Try now Demo en
  • en
  • fr
  • de
  • Solutions
    • Use cases
      • Modern IntranetBuild strong internal culture & sense of belonging
      • Collaboration PlatformEfficient project management & teamwork
      • Social NetworkEngage users & recognize contributions
      • Knowledge managementCentralize & share your company knowledge
      • Employee PortalEngage your community
    • Industries
      • Public Sector
      • Networks
      • Education
      • Enterprises
  • Product
    • Overview
      • Digital workplaceFeatures & capabilities
      • Why eXoKey differentiators
      • InternationalisationMultilingual environments
      • MobileBranded mobile applications
    • Platform
      • No CodeTailor to your needs without code
      • IntegrationsAvailable connectors & extension capabilities
    • Technology
      • ArchitectureAn overview of eXo Platform technology
      • SecurityeXo Platform security measures
      • Open sourceComponents & licensing
  • Offers
    • EnterpriseMore than 250 users
    • ProfessionalLess than 250 users
    • OEM EditionFor software vendors & service providers
    • ServicesDiscover eXo professional services
  • Resources
    • Resource center
      • Case studies
      • White Papers
      • Datasheets
      • Videos
    • Migration guide
      • Alternative to Microsoft 365
      • Alternative to Sharepoint
      • Alternative to Workplace from Meta
    • From The Blog
      • eXo Platform 7.0 is released
      • eXo Platform Community Edition 7.0 is released
      • Cloud Vs On-premise Digital Workplace: Which one is right for your business?
  • Community
    • CommunityJoin our online community platform
    • DownloadLaunch eXo platform in your infrastructure
    • Source codeSource code on github
    • FAQsAbout the software, the community and our offers
    • REST APIs & DocumentationAll REST APIs available in eXo Platform
  • Company
    • About us
    • Customers
    • Partners
    • Contact us
    • Newsroom
  • Menu mobile
    • Pricing
    • About us
    • Careers
    • Resource center
    • Blog
    • Contact us
    • Try eXo
Use cases
  • Modern Intranet Build strong internal culture & sense of belonging
  • Collaboration Platform Efficient project management & teamwork
  • Social Network Engage users & recognize contributions
  • Knowledge management Centralize & share your company knowledge
  • Employee Portal Engage your community
Industries
  • Public Sector
  • Networks
  • Education
  • Enterprises
Overview
  • Digital workplace Features & capabilities
  • Why eXo Key differentiators
  • Internationalisation Multilingual environments
  • Mobile Branded mobile applications
Platform
  • No Code Tailor to your needs without code
  • Integrations Available connectors & extension capabilities
Technology
  • Architecture An overview of eXo Platform technology
  • Security eXo Platform security measures
  • Open source Components & licensing
Enterprise More than 250 users
Professional Less than 250 users
OEM Edition For software vendors & service providers
Services Discover eXo professional services
Resource center
  • Case studies
  • White Papers
  • Datasheets
  • Videos
Migration guide
  • Alternative to Microsoft 365
  • Alternative to Sharepoint
  • Alternative to Workplace from Meta
From The Blog
  • eXo Platform 7.0 is released
  • eXo Platform Community Edition 7.0 is released
  • Cloud Vs On-premise Digital Workplace: Which one is right for your business?
Community Join our online community platform
Download Launch eXo platform in your infrastructure
Source code Source code on github
FAQs About the software, the community and our offers
REST APIs & Documentation All REST APIs available in eXo Platform
About us
Customers
Partners
Contact us
Newsroom
Pricing
About us
Careers
Resource center
Blog
Contact us
Try eXo
  1. Accueil
  2. Tutorial
  3. How to Set Up Your Test Automation at eXo Platform

How to Set Up Your Test Automation at eXo Platform

1. What is an automated test ?

An automated test doesn’t require human intervention. Automated test execution requires computer solutions that perform actions, either in a web browser or at the operating system level.

Test automation can reduce testing efforts and increase the amount of testing performed in a limited time. Some tests can be done in minutes that would take several hours if they had been run manually.

  2. How do we automate tests in eXo ?

2.1 Development languages and tools

We need the following environment to develop and run test cases:

  • Maven 3
  • JDK 8
  • Docker

Our automation test tool framework is Selenide.

Why Selenide?

To choose the best tool, we selected criteria that we consider essential (see the table below).

SeleniumCodeceptionWindmillSahiCucumberSelenide
Open sourceyesyesyesyes with Pro versionyesyes
Cross-browseryesyesyesyesyesyes
Development languageJavaPHPPythonPHPPHPJava
Script languageJavaScript PHP Python

C#

Java

Ruby

PHPJavaScript Python

Ruby

JavaScriptGherkin

+

Java

JavaScript PHP Python

C#

Java

Regular updatehighhighlowlowmediumhigh
Record playbackyesyesyesyesnoyes
Intelligent identification of objectsnononoyesnono
Waiting for events (Ajax)yesyesnoyesnoyes
ReportingyesyesyesOnly Pro versionPluginyes

 

The criteria for choosing the best automation tool are the same for Selenium and Selenide. We chose Selenide because it offers simplicity in creating test cases, as explained in this link:  selenide vs selenium.

2.2 Automatic test development

The choice of test cases to be automated is based on several criteria, such as execution frequency, the development and maintenance time for the test case, and the test case execution time.

The diagram below shows the different criteria for selecting cases that will be automated.

Les différents critères pour un test automatiséTo automate a test case, we have to go through three steps.

1. Locator declaration

“Locators” are variables defined in the “Xlocators” classes to select the HTML elements used in the test cases.

We find these classes in the“Selenium” module.

Classes sous le module SeleniumHere are some examples of locators:

By “id”

public static final SelenideElement ELEMENT_ABOUT_ME_PORTLET=$(byId(“UIExperienceProfilePortlet“));

By “className”

public static final SelenideElement ELEMENT_BUTTON_ADD_GADGET=$(byClassName(“AddIcon“));

By “Xpath”

public static final SelenideElement ELEMENT_TAB_ACCESS_AND =  $(byXpath(“//*[@id=\”UITabPane\”]/ul/li[2]/a“));

There are several ways to define the locator. We should prioritize selection by “id” or “className” if it is unique. Also,  we can use by “Xpath”, “value”, “type”, “name”, and so on.

2. Function development

Functions are specific actions that will be used in test cases. All the functions used in our test cases are in the “pageobject” package of each module. For example, the functions used for wiki test cases are under the “pageobject” package in the wiki module.

Les fonctions utilisées pour les cas de tests wiki

We must use locators that have already been declared in our functions. Below you can see the “add a user” function used extensively in our test cases.

Locators déclarés dans un cas de test3. Test case development

Smoke test cases are under the module associated with these tests. For example, smoke forum tests are under the forum module.

Tests Smoke sous le module Forum

Sniff and functional test cases are under the platform module because they require dependencies to the other modules.

The test type is specified using the @Tag annotation in test classes. For example, this class contains sniff tests of the Answer function:

We use pre-defined functions in our test cases to execute the desired scenario.

3) How do we run automated tests?

3.1. Run with IDE and local browser

We can run the test case through the IDE (Intellij) by adding the necessary parameters in “VM_options(-ea -Dwebdriver.chrome.driver=<path-to-chrome-driver> -Dselenide.baseUrl=<exoplatform-instance-url>)”. The test will be run on your local browser.

3.2. Run with Maven and local browser

We can run tests using this Maven command:

mvn  clean verify -Prun-its,chrome \
-Dselenide.baseUrl=<exoplatform-instance-url> \

-Dselenium.webdriver.chrome.driver.path=<path-to-chrome-driver>

3.3. Run with Docker, Maven and Selenium Grid

Tests can be run on Docker images of Selenium Grid and Chrome.

First, we must start containers using this command:

docker-compose -f core/src/main/resources/stack/docker-compose-50-hsqldb.yml -p qa_ui up

Then, we run tests on the chrome node of the Selenium Grid.

We can use this parameter to select tests to run; for example, if you want to run smoke tests, you add -Dselenide.test.tags.include=smoke \ to the above command.

3.4. Run with Jenkins

We can also run automated tests through our private pipeline: platform-qa-ui-with-params.

Conclusion

Test automation at eXo has allowed increased coverage of test cases, early detection of anomalies (i.e. we have scheduled an automatic weekly Jenkins pipeline run for early bug detection) and time savings in execution (e.g. 1000 cases require 10 d/h to execute on one instance manually, while automatic tests are run in four hours on multiple instances in parallel).

 


Join The eXo Tribe

Join The eXo Tribe


Register for our Community to Get updates, tutorials, support, and access to the Platform and add-on downloads. Sign in Now!

Brahim Jaouane

I am a Digital Marketing specialist specialized in SEO at eXo Platform. Passionate about new technologies and Digital Marketing. With 10 years' experience, I support companies in their digital communication strategies and implement the tools necessary for their success. My approach combines the use of different traffic acquisition levers and an optimization of the user experience to convert visitors into customers. After various digital experiences in communication agencies as well as in B2B company, I have a wide range of skills and I am able to manage the digital marketing strategy of small and medium-sized companies.

Full-featured digital workplace with everything your employees need to work efficiently, smartly integrated for a compelling employee experience

  • Product
    • Software tour
    • Communication
    • Collaboration
    • Knowledge
    • Productivity
    • Open Source
    • Integrations
    • Security
  • Uses cases
    • Digital Workplace
    • Intranet software
    • Collaboration software
    • Knowledge management software
    • Entreprise Social Network
    • Employee Engagement platform
  • Roles
    • Internal Communications
    • Human Resources
    • Information Technology
  • Company
    • Product offer
    • Services Offer
    • Customers
    • Partners
    • About us
  • Resources
    • FAQs
    • Resource Center
    • Collaboration guide
    • What is a Digital workplace?
    • What is an intranet?
    • Employee engagement
  • Terms and Conditions
  • Legal
  • Privacy Policy
  • Accessibility
  • Contact us
  • Sitemap
  • Facebook
  • Twitter
  • LinkedIn
wpDiscuz