-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C2C-341: E2E test for patient registration form (#21)
- Loading branch information
Showing
4 changed files
with
52 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
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,38 @@ | ||
|
||
import { test, expect } from '@playwright/test'; | ||
import { Bahmni, patientName } from '../utils/functions/bahmni'; | ||
import { BAHMNI_URL } from '../utils/configs/globalSetup'; | ||
|
||
let bahmni: Bahmni; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
bahmni = new Bahmni(page); | ||
}); | ||
|
||
test('Register and edit a patient.', async ({ page }) => { | ||
// setup | ||
await bahmni.login(); | ||
await expect(page.getByText(/registration/i)).toBeVisible(); | ||
await expect(page.getByText(/clinical/i)).toBeVisible(); | ||
await expect(page.getByText(/admin/i)).toBeVisible(); | ||
await expect(page.getByText(/patient documents/i)).toBeVisible(); | ||
|
||
// replay | ||
await bahmni.registerPatient(); | ||
|
||
// verify creation | ||
await bahmni.navigateToPatientDashboard(); | ||
await expect(page.locator('#patientContext span:nth-child(2)')).toContainText(`${patientName.givenName + ' ' + patientName.familyName}`) | ||
|
||
// verify revision | ||
await page.goto(`${BAHMNI_URL}`); | ||
await bahmni.navigateToPatientRegistationForm(); | ||
await bahmni.updatePatientDetails(); | ||
await bahmni.navigateToPatientDashboard(); | ||
await expect(page.locator('#patientContext span:nth-child(2)')).toContainText(`${patientName.updatedGivenName}` + ' ' + `${patientName.familyName}`) | ||
}); | ||
|
||
test.afterEach(async ({ page }) => { | ||
await bahmni.voidPatient(); | ||
await page.close(); | ||
}); |
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