Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
QAFramework is an OpenMRS’ 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.
QAFramework uses cucumber for its BDD test case descriptions;
BDD largely uses a simple domain-specific natural language (DSL) to represent the test cases cucumber specifically uses Gherkin for this.
In addition to the clear guidance below, you can see this recording for a tutorial we hosted on setting up Selenium tests for the Reference Application:
https://iu.mediaspace.kaltura.com/media/Design+Meeting/1_dh12nkr0?st=321
GitHub repo from example in Tutorial: https://github.com/openmrs/openmrs-contrib-qaframework/pull/9
Install java8, git and maven
QAFramework depends on UITestFramework and Reference application distro to support Reference application distribution out of the box quality assurance.
This is the default OpenMRS community-supported distribution, it should be pulled by default while compiling the QAFramework, but in-case this doesn’t happen, please clone and compile it separately.
git clone git@github.com:openmrs/openmrs-distro-referenceapplication.git git checkout 2.10.0 mvn clean install |
This is the Reference application distribution’s user interface test framework, it uses selenium for its webdriver.
Clone and compile its bdd branch
git clone git@github.com:openmrs/openmrs-contrib-uitestframework.git git checkout bdd mvn clean install |
git clone git@github.com:openmrs/openmrs-contrib-qaframework.git |
To change the default runtime settings. Please edit src/test/resources/org/openmrs/uitestframework/test.properties
Properties explanation;
webapp.url=https://qa-refapp.openmrs.org/openmrs [openmrs instance URL] login.username=admin [Above OpenMRS instance username] login.password=Admin123 [Above OpenMRS instance password] login.location=Pharmacy [Above OpenMRS instance login location] webdriver=chrome [Browser instance; chrome/firefox] login.auto=false [Auto login or not on each scenario; true/false] headless=true [Launch browser in the background without UI; true/false] webdriver.gecko.driver=firefoxdriver/mac/geckodriver |
To Run UI tests
mvn clean test |
In order to test within a physical web browser, you will need a webdriver to connect to your browser either firefox or chrome, the webdriver.
webdriver.gecko.driver=firefoxdriver/mac/geckodriver
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, this is made easier graphically through cucumber studio.
Exporting the project from cucumber studio for automation avails a feature file with the human readable test case which file can be written from any texteditor and which is imported into the automation library (qaframework) and an automation layer (with step descriptions) is written by a test engineer or developer through a preferred automation framework such as selenium (for the reference application), cypress (OCL) etc.
Running the QA framework locally or in Bamboo CI runs the automated test suite;
- this will read test.properties and launch RunTest.java(junit with cucumber runner) with the loaded configurations which reads all feature files tagged @run and locates each respective step description from mapped (glued) automation package,
- automation steps launch the automation framework (e.g selenium/cypress) by scenario and each scenarios by step order, steps load pages (some are from uitestframework/distribution/qaframework) and return results to the build through its web driver
- the build posts test results to reports.cucumber.io if configured to in cucumber.properties which happens by default within bamboo CI
- Bamboo CI is also configured to post results back into cucumber studio and a result green/red label (build status) is displayed on qaframework basing on CI build result.