Skip to content

Commit

Permalink
Clean up e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kajambiya committed Aug 21, 2024
1 parent 7333026 commit 03c5738
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
16 changes: 12 additions & 4 deletions e2e/specs/clinical-forms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ test('Fill a clinical form', async ({ page }) => {
});

await test.step('Then I should see a success notification', async () => {
await expect(page.getByText(/record created/i, { exact: true })).toBeVisible();
await expect(page.getByText(/a new encounter was created/i, { exact: true })).toBeVisible();
await expect(
page.locator('.cds--actionable-notification__title').getByText('Form submitted', { exact: true }),
).toBeVisible();
await expect(
page.locator('.cds--actionable-notification__subtitle').getByText('Form submitted successfully', { exact: true }),
).toBeVisible();
});

await test.step('And if I navigate to the visits dashboard', async () => {
Expand Down Expand Up @@ -219,8 +223,12 @@ test('Form state is retained when minimizing a form in the workspace', async ({
});

await test.step('Then I should see a success notification', async () => {
await expect(page.getByText(/record created/i)).toBeVisible();
await expect(page.getByText(/a new encounter was created/i)).toBeVisible();
await expect(
page.locator('.cds--actionable-notification__title').getByText('Form submitted', { exact: true }),
).toBeVisible();
await expect(
page.locator('.cds--actionable-notification__subtitle').getByText('Form submitted successfully', { exact: true }),
).toBeVisible();
});
});

Expand Down
16 changes: 12 additions & 4 deletions e2e/specs/results-viewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,12 @@ test('Record and edit test results', async ({ page }) => {
});

await test.step('Then I should see a success notification', async () => {
await expect(page.getByText(/record created/i, { exact: true })).toBeVisible();
await expect(page.getByText(/a new encounter was created/i, { exact: true })).toBeVisible();
await expect(
page.locator('.cds--actionable-notification__title').getByText('Form submitted', { exact: true }),
).toBeVisible();
await expect(
page.locator('.cds--actionable-notification__subtitle').getByText('Form submitted successfully', { exact: true }),
).toBeVisible();
});

await test.step('When I go to the results viewer page', async () => {
Expand Down Expand Up @@ -332,8 +336,12 @@ test('Record and edit test results', async ({ page }) => {
});

await test.step('Then I should see a success notification', async () => {
await expect(page.getByText(/record updated/i, { exact: true })).toBeVisible();
await expect(page.getByText(/the patient encounter was updated/i, { exact: true })).toBeVisible();
await expect(
page.locator('.cds--actionable-notification__title').getByText('Form submitted', { exact: true }),
).toBeVisible();
await expect(
page.locator('.cds--actionable-notification__subtitle').getByText('Form submitted successfully', { exact: true }),
).toBeVisible();
});

await test.step('When I revisit the `Results Viewer` page', async () => {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4233,8 +4233,8 @@ __metadata:
linkType: soft

"@openmrs/esm-form-engine-lib@npm:next":
version: 2.1.0-pre.1373
resolution: "@openmrs/esm-form-engine-lib@npm:2.1.0-pre.1373"
version: 2.1.0-pre.1376
resolution: "@openmrs/esm-form-engine-lib@npm:2.1.0-pre.1376"
dependencies:
"@carbon/react": "npm:>1.47.0 <1.50.0"
classnames: "npm:^2.5.1"
Expand All @@ -4252,7 +4252,7 @@ __metadata:
react: 18.x
react-i18next: 11.x
swr: 2.x
checksum: 10/fca2352c0b81d189a4c9733d31f7073b5da59b21c6504f914d6999a6a43f0694357b4b0351978bfada16fa1b05323bb4d3e56b26d7c2f67c2371d3010f0827cf
checksum: 10/022ec391964912dd496cd20093d44517b7c7ea0f56a6da1d43133333af12e7178c3958ffb92947414896719baf6311fd20289c049097a50efa9d42e1921bb4c9
languageName: node
linkType: hard

Expand Down

0 comments on commit 03c5738

Please sign in to comment.