Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

O3-1457: Create E2E automated workflow to test medications feature in o3 #16

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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("Your basket is empty");
cy.contains("There are no active medications to display for this patient");
});

//TODO: Place drug orders (Still on development)
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