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

MF-900: Create a separate workflow for search E2E tests #200

Merged
merged 4 commits into from Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,4 +1,4 @@
name: RefApp 3.x Search & Registration
name: RefApp 3.x Patient Registration
on:
push:
branches: [master]
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Installing dependencies
run: npm install
- name: Run patient registration workflow tests
run: npm run refapp3SearchAndRegistration
run: npm run refapp3PatientRegistration
- name: Upload screen recordings of failed tests
if: ${{ failure() }}
uses: actions/upload-artifact@v2
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/refapp-3x-patient-search.yml
@@ -0,0 +1,28 @@
name: RefApp 3.x Patient Search
on:
push:
branches: [master]
pull_request:
branches: [master]
repository_dispatch:
types: [qa]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Using Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Installing dependencies
run: npm install
- name: Run patient search workflow tests
run: npm run refapp3PatientSearch
- name: Upload screen recordings of failed tests
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: Screen recordings of failed tests
path: cypress/videos/refapp-3.x
2 changes: 1 addition & 1 deletion cypress.json
Expand Up @@ -5,7 +5,7 @@
"**/*.feature"
],
"video": true,
"defaultCommandTimeout": 5000,
"defaultCommandTimeout": 20000,
"baseUrl": "https://openmrs-spa.org/openmrs/spa",
"env": {
"API_BASE_URL": "https://openmrs-spa.org/openmrs/ws/rest/v1",
Expand Down
Expand Up @@ -9,19 +9,6 @@ Given('the user login to the Registration Desk', () => {
cy.visit('home');
})

When('the user search for {string}', patientName => {
cy.get('button[name=SearchPatientIcon]').click();
cy.getByPlaceholder('Search for a patient by name or identifier number').type(patientName);
// Adding an artificial wait because it takes time to get typed text updates
cy.wait(500);
cy.contains('Search').click({force:true});
})

Then('the result should be {string}', result => {
cy.contains(result);
});


When('the user clicks on the add patient icon', () => {
cy.get('button[name=SearchPatientIcon]');
cy.get('button[name=AddPatientIcon]').click();
Expand Down
@@ -0,0 +1,22 @@
import {Given} from 'cypress-cucumber-preprocessor/steps';

Given('the user login to the Registration Desk', () => {
cy.on('uncaught:exception', (err, runnable) => {
console.log(err);
return false;
});
cy.login();
cy.visit('home');
})

When('the user search for {string}', patientName => {
cy.get('button[name=SearchPatientIcon]').click();
cy.getByPlaceholder('Search for a patient by name or identifier number').type(patientName);
// Adding an artificial wait because typed texts takes some time to get updated
cy.wait(1000);
cy.getByPlaceholder('Search for a patient by name or identifier number').type('{enter}');
})

Then('the result should be {string}', result => {
cy.contains(result);
});
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -24,7 +24,8 @@
"ocl": "./node_modules/.bin/cypress-tags run -eTAGS='@cypress and @ocl'",
"microfrontend": "cypress-tags run -eTAGS='@cypress and @microfrontend'",
"refapp3Login": "cypress run --spec src/test/resources/features/refapp-3.x/01-login/login.feature",
"refapp3SearchAndRegistration": "cypress run --spec src/test/resources/features/refapp-3.x/02-search-and-registration/search-and-registration.feature",
"refapp3PatientRegistration": "cypress run --spec src/test/resources/features/refapp-3.x/02-patient-registration/patient-registration.feature",
"refapp3PatientSearch": "cypress run --spec src/test/resources/features/refapp-3.x/06-patient-search/patient-search.feature",
"refapp3Settings": "cypress run --spec src/test/resources/features/refapp-3.x/03-settings/settings.feature",
"refapp3ClinicalVisit": "cypress run --spec src/test/resources/features/refapp-3.x/04-clinical-visit/clinical-visit.feature",
"refapp3VitalsAndTriage": "cypress run --spec src/test/resources/features/refapp-3.x/05-vitals-and-triage/vitals-and-triage.feature"
Expand Down
@@ -1,16 +1,8 @@
Feature: Search & Registration
Feature: Patient Registration

Background:
Given the user login to the Registration Desk

Scenario Outline: Search for a patient
When the user search for "<patientName>"
Then the result should be "<result>"
Examples:
| patientName | result |
| Kevin Jones | Found 1 patient |
| 100MQ | No results found |

Scenario Outline: Register a patient
When the user clicks on the add patient icon
And the user enters "<validity>" details for Andria Faiza
Expand Down
@@ -0,0 +1,12 @@
Feature: Patient Search

Background:
Given the user login to the Registration Desk

Scenario Outline: Search for a patient
When the user search for "<patientName>"
Then the result should be "<result>"
Examples:
| patientName | result |
| Kevin Jones | Found 1 patient |
| 100MQ | No results found |