-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-O3-4312
- Loading branch information
Showing
308 changed files
with
8,349 additions
and
1,077 deletions.
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
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
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
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 @@ | ||
import { type Page } from '@playwright/test'; | ||
|
||
export class MarkPatientDeceasedPage { | ||
constructor(readonly page: Page) {} | ||
|
||
async goTo(patientUuid: string) { | ||
await this.page.goto('/openmrs/spa/patient/' + patientUuid + '/chart/Patient%20Summary'); | ||
} | ||
|
||
} |
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
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
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
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
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,60 @@ | ||
import { expect } from '@playwright/test'; | ||
import { generateRandomPatient, deletePatient, type Patient } from '../commands'; | ||
import { test } from '../core'; | ||
import { MarkPatientDeceasedPage } from '../pages/mark-patient-deceased-page'; | ||
|
||
let patient: Patient; | ||
|
||
test.beforeEach(async ({ api }) => { | ||
patient = await generateRandomPatient(api); | ||
}); | ||
|
||
test('Mark a patient as deceased', async ({ page }) => { | ||
const markPatientDeceasedPage = new MarkPatientDeceasedPage(page); | ||
const todayDate = new Date().toLocaleDateString('en-GB').replace(/\//g, '-'); | ||
const causeOfDeath = 'Neoplasm'; | ||
const actionsButton = () => page.getByRole('button', { name: /actions/i }); | ||
const markDeceasedMenuItem = () => page.getByRole('menuitem', { name: /mark patient deceased/i }); | ||
const deathDetailsForm = () => page.locator('form'); | ||
const dateOfDeathInput = () => page.getByPlaceholder(/dd\/mm\/yyyy/i); | ||
const saveAndCloseButton = () => page.getByRole('button', { name: /save and close/i }); | ||
|
||
await test.step('Given that I have a patient and I am on the Patient’s chart page', async () => { | ||
await markPatientDeceasedPage.goTo(patient.uuid); | ||
}); | ||
|
||
await test.step('When I click on the "Actions" button and select "Mark patient deceased"', async () => { | ||
await actionsButton().click(); | ||
await markDeceasedMenuItem().click(); | ||
}); | ||
|
||
await test.step('Then I should see a form to enter the patient\'s death details', async () => { | ||
await expect(deathDetailsForm()).toBeVisible(); | ||
await expect(dateOfDeathInput()).toBeVisible(); | ||
await expect(page.getByRole('radio', { name: causeOfDeath })).toBeVisible(); | ||
}); | ||
|
||
await test.step('When I enter the "Date of death" to today’s date', async () => { | ||
await dateOfDeathInput().fill(todayDate); | ||
await page.keyboard.press('Enter'); | ||
}); | ||
|
||
await test.step('And the "Cause of death" to Neoplasm', async () => { | ||
await page.locator('text=Neoplasm').click(); | ||
}); | ||
|
||
await test.step('And I click "Save and close"', async () => { | ||
await page.getByRole('button', { name: /save and close/i }).click(); | ||
}); | ||
|
||
await test.step('Then I should see a “deceased” patient tag in the patient banner', async () => { | ||
const deceasedTagLocator = page.locator( | ||
'[data-extension-id="deceased-patient-tag"] span[title="Deceased"]' | ||
); | ||
await expect(deceasedTagLocator).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.afterEach(async ({ api }) => { | ||
await deletePatient(api, patient.uuid); | ||
}); |
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
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
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
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
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
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
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,15 @@ | ||
{ | ||
"cancel": "Cancel", | ||
"closeThisPanel": "Close this panel", | ||
"collapseAll": "Collapse all", | ||
"deleteQuestion": "Delete question", | ||
"deleteQuestionConfirmation": "Are you sure you want to delete this question?", | ||
"deleteQuestionExplainerText": "This action cannot be undone.", | ||
"errorTitle": "There was an error with this form", | ||
"expandAll": "Expand all", | ||
"loading": "Loading", | ||
"or": "or", | ||
"thisList": "this list", | ||
"toggleCollapseOrExpand": "Toggle collapse or expand", | ||
"tryAgainMessage": "Try opening another form from" | ||
} |
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,15 @@ | ||
{ | ||
"cancel": "Cancel", | ||
"closeThisPanel": "Close this panel", | ||
"collapseAll": "Collapse all", | ||
"deleteQuestion": "Delete question", | ||
"deleteQuestionConfirmation": "Are you sure you want to delete this question?", | ||
"deleteQuestionExplainerText": "This action cannot be undone.", | ||
"errorTitle": "There was an error with this form", | ||
"expandAll": "Expand all", | ||
"loading": "Loading", | ||
"or": "or", | ||
"thisList": "this list", | ||
"toggleCollapseOrExpand": "Toggle collapse or expand", | ||
"tryAgainMessage": "Try opening another form from" | ||
} |
Oops, something went wrong.