Skip to content
Mutesasira Moses edited this page Jul 6, 2021 · 26 revisions

OpenELIS-Global-2 Automated Testing Framework

Overview

openelis-qaframework is the OpenELIS-Global2 behaviour driven development (BDD) quality assurance framework.

BDD brings technical(developers, QA) together with business(non-technical, Business analysts) people to foster collaboration and ease problem-solving.

The Framework uses cucumber for its BDD test case descriptions and Selenium for Functional Testing

  1. E2E Test Process

proces

  1. Setup

    • Intall Java

    • Install Maven

    • Install git

    • Clone the openelis-qaframework and install the dependencies

          git clone https://github.com/I-TECH-UW/openelis-qaframework.git
          mvn clean install -Dcucumber.filter.tags='@null'
      
    • In order to test within a real desktop browser, you will need a webdriver to connect to your browser (either firefox or chrome). Download the webdriver version that matches your system and browser version.

      Chrome
      Firefox
      Others

      Note: The framework comes with the version of ChromeDriver that only supports Chrome version 89 which is supported by the CI server

    • Move your downloaded browser webdriver into the right locations as follows

           Chrome:  
                   Linux   : src/test/resources/chromedriver/linux/chromedriver 
                   Mac     : src/test/resources/chromedriver/mac/chromedriver 
                   Windows : src/test/resources/chromedriver/windows/chromedriver.exe
           Firefox: 
                   Linux   : src/test/resources/firefoxdriver/linux/geckodriver  
                   Mac     : src/test/resources/firefoxdriver/mac/geckodriver 
                   Windows : src/test/resources/firefoxdriver/windows/geckodriver.exe
      
    • Edit src/test/resources/test.properties

          Set  webdriver=chrome or  webdriver=firefox
          Set headless=false to allow the web browser UI to appear during the test
      
    • Properties explanation:

       webapp.url=https://testing.openelisci.org:8443/OpenELIS-Global [OpenELIS instance URL]
       login.username=itect [Above OpenELIS instance username]
       login.password=adminADMIN! [Above OpenELIS instance password]
       webdriver=chrome [Browser instance; chrome/firefox]
       headless=true [Launch browser in the background without UI; true/false]
      
    • Running the Tests
      The tests are categorised in different groups and can be ran all at once or in the different categories
      To run all tests

                mvn test
      

      To run a specific test category

                mvn test -Dcucumber.filter.tags='@<category>'
      

      see all the test projects

  2. OpenELIS Automated Testing Infrastructure

qa-labed

  • Collaboratively, business analysts translate requirements into test cases and define from them features, scenarios, steps written in a Behavior Driven Development (BDD) approach through a human readable language, Gherkin.

  • The feature files are added to the Automation framework and an automation layer (with step descriptions) is written by a test engineer using Selenium selenium automation framework .

  • Running the QA framework locally or in Bamboo CI runs the automated test suite;

    • This reads the test.properties and launch RunTest.java(junit with cucumber runner) with the loaded configurations which reads all feature files and locates each respective step description from mapped automation package,
    • The Automation steps launch the Selenium automation framework by scenario and each scenarios by step order, steps loads the pages and return results to the build through its web driver
    • The build posts test results to reports.cucumber.io
    • The build aslo posts results into Cucumber studio and a result green/red label (build status) is displayed on qaframework basing on CI build result.
Clone this wiki locally