-
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-355: E2E tests for the observation forms
- Loading branch information
Showing
9 changed files
with
174 additions
and
113 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,70 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { Bahmni } from '../utils/functions/bahmni'; | ||
|
||
let bahmni: Bahmni; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
bahmni = new Bahmni(page); | ||
|
||
await bahmni.login(); | ||
await expect(page.getByText(/registration/i)).toBeVisible(); | ||
await expect(page.getByText(/linical/i)).toBeVisible(); | ||
await expect(page.getByText(/admin/i)).toBeVisible(); | ||
await expect(page.getByText(/appointment scheduling/i)).toBeVisible(); | ||
await expect(page.getByText(/patient documents/i)).toBeVisible(); | ||
}); | ||
|
||
test('Anthropometry form should save observations.', async ({ page }) => { | ||
// setup | ||
await bahmni.registerPatient(); | ||
|
||
// replay | ||
await bahmni.navigateToPatientDashboard(); | ||
await bahmni.navigateToForms(); | ||
await page.getByRole('button', { name: 'Anthropométrie' }).click(); | ||
await expect(page.getByText('Anthropométrie added successfully')).toBeVisible(); | ||
await bahmni.fillAnthropometryForm(); | ||
|
||
// verify | ||
await page.locator('#dashboard-link span.patient-name').click(); | ||
await expect(page.locator('a.visit')).toBeVisible(); | ||
await page.locator('a.visit').click(); | ||
await expect(page.locator('#observationSection h2')).toHaveText('Observations'); | ||
await expect(page.locator('#observationSection').getByText('BMI Data')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('22.49')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('BMI Status Data')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('Normal')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('Height')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('170')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('Weight')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('65')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('Head Circumference')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('23')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('Abdominal Diameter')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('25.5')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('Mid-Upper Arm Circumference')).toBeVisible(); | ||
await expect(page.locator('#observationSection').getByText('24', {exact: true})).toBeVisible(); | ||
}); | ||
|
||
test('Gynecological ultrasound form should save observations.', async ({ page }) => { | ||
// setup | ||
await bahmni.registerPatient(); | ||
|
||
// replay | ||
await bahmni.navigateToPatientDashboard(); | ||
await bahmni.navigateToForms(); | ||
await page.getByRole('button', { name: 'Echographie gynécologique' }).click(); | ||
await expect(page.getByText('Echographie gynécologique added successfully')).toBeVisible(); | ||
await bahmni.fillGynecologicalUltrasoundForm(); | ||
|
||
// verify | ||
await page.locator('#dashboard-link span.patient-name').click(); | ||
await expect(page.locator('a.visit')).toBeVisible(); | ||
await page.locator('a.visit').click(); | ||
await expect(page.locator('div:nth-child(2) span.value-text-only').getByText('Normal left ovary. The right ovary contains a complex mass. No free fluid in the pelvis.')).toBeVisible(); | ||
}); | ||
|
||
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
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