Skip to content

Commit

Permalink
Create medications e2e automated test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pasindur2 committed Nov 25, 2022
1 parent 1d07633 commit c4dcb51
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/refapp-3x-medications.yml
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ___
[![RefApp 3.x Appointments](https://github.com/openmrs/openmrs-test-3refapp/actions/workflows/refapp-3x-appointments.yml/badge.svg)](https://github.com/openmrs/openmrs-test-3refapp/actions/workflows/refapp-3x-appointments.yml)
[![RefApp 3.x Care Programs](https://github.com/openmrs/openmrs-test-3refapp/actions/workflows/refapp-3x-care-programs.yml/badge.svg)](https://github.com/openmrs/openmrs-test-3refapp/actions/workflows/refapp-3x-care-programs.yml)
[![RefApp 3.x Clinical Visit](https://github.com/openmrs/openmrs-test-3refapp/actions/workflows/refapp-3x-clinical-visit.yml/badge.svg)](https://github.com/openmrs/openmrs-test-3refapp/actions/workflows/refapp-3x-clinical-visit.yml)
[![RefApp 3.x Medications](https://github.com/openmrs/openmrs-test-3refapp/actions/workflows/refapp-3x-medications.yml/badge.svg)](https://github.com/openmrs/openmrs-test-3refapp/actions/workflows/refapp-3x-medications.yml)
___


Expand Down
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
3 changes: 2 additions & 1 deletion packages/cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"refapp3PatientConditions": "cypress run --spec resources/features/refapp-3.x/12-patient-conditions/patient-conditions.feature",
"refapp3PatientAllergies": "cypress run --spec resources/features/refapp-3.x/13-patient-allergies/patient-allergies.feature",
"refapp3Appointments": "cypress run --spec resources/features/refapp-3.x/14-appointments/appointments.feature",
"refapp3CarePrograms": "cypress run --spec resources/features/refapp-3.x/10-care-programs/care-programs.feature"
"refapp3CarePrograms": "cypress run --spec resources/features/refapp-3.x/10-care-programs/care-programs.feature",
"refapp3Medications": "cypress run --spec resources/features/refapp-3.x/11-medications/medications.feature"
},
"devDependencies": {
"@badeball/cypress-cucumber-preprocessor": "^12.2.0",
Expand Down
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

0 comments on commit c4dcb51

Please sign in to comment.