-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create medications e2e automated test workflow
- Loading branch information
pasindur2
committed
Nov 25, 2022
1 parent
1d07633
commit c4dcb51
Showing
5 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: RefApp 3.x Medications | ||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
repository_dispatch: | ||
types: [ qa ] | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout qaframework | ||
uses: actions/checkout@main | ||
with: | ||
repository: ${{github.repository}} | ||
- name: Run db and web containers | ||
run: docker-compose -f docker/docker-compose-refqa-3x.yml up -d | ||
- name: Wait for Openmrs instance to start | ||
run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/openmrs/login.htm)" != "200" ]]; do sleep 10; done | ||
- name: Using Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16.x' | ||
- name: Installing dependencies | ||
run: yarn install | ||
- name: Run medications workflow tests | ||
run: cd packages/cypress && yarn refapp3Medications | ||
- name: Upload screen recordings of failed tests | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Screen recordings of failed tests | ||
path: packages/cypress/cypress/videos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...ss/cypress/integration/cucumber/step_definitions/refapp-3.x/11-medications/medications.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Given, Before, When } from "cypress-cucumber-preprocessor/steps"; | ||
|
||
let identifier = null; | ||
let patient = null; | ||
|
||
Before({ tags: "@patient-medications" }, () => { | ||
cy.generateIdentifier().then((generatedIdentifier) => { | ||
identifier = generatedIdentifier; | ||
cy.createPatient(identifier).then((generatedPatient) => { | ||
patient = generatedPatient; | ||
}); | ||
}); | ||
}); | ||
|
||
Given("the user is logged in", () => { | ||
cy.login(); | ||
}); | ||
|
||
Given("the user arrives on a patient’s summary page", () => { | ||
cy.visit(`patient/${patient.uuid}/chart`); | ||
}); | ||
|
||
When("the user clicks on Orders tab", () => { | ||
cy.contains("Orders").click({ force: true }); | ||
}); | ||
|
||
Then("the empty Orders page should display", () => { | ||
cy.contains("There are no active medications to display for this patient"); | ||
cy.contains("There are no past medications to display for this patient"); | ||
}); | ||
|
||
//TODO: Place drug orders |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/cypress/resources/features/refapp-3.x/11-medications/medications.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Feature: Medications | ||
|
||
Background: | ||
Given the user is logged in | ||
And the user arrives on a patient’s summary page | ||
|
||
@patient-medications | ||
Scenario: The user should be able view active and past medications | ||
When the user clicks on Orders tab | ||
Then the empty Orders page should display |