-
Notifications
You must be signed in to change notification settings - Fork 242
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
(test) O3-2943: E2E test for Immunizations workflow #2148
Open
Muta-Jonathan
wants to merge
10
commits into
openmrs:main
Choose a base branch
from
Muta-Jonathan:O3-2943-e2e-update-immunizations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1b950d7
O3-2943: Add e2e test for editing immunization recording workflow
Muta-Jonathan 94a193a
debugging why step fails on CI but passes locally
Muta-Jonathan e3dfb34
merge:main into branch
Muta-Jonathan 4a2c7e4
adding a step to collapse all rows
Muta-Jonathan c1bfd96
Merge branch 'main' into O3-2943-e2e-update-immunizations
Muta-Jonathan 321280f
refactored step should see updated immunization ...
Muta-Jonathan 80034ac
refactored step to see measles vaccination ...
Muta-Jonathan bda3281
removed the collapse and expand functionality steps ...
Muta-Jonathan 6063cd0
removed button's visibility assertion
Muta-Jonathan 0e6518b
Merge branch 'main' into O3-2943-e2e-update-immunizations
Muta-Jonathan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ test.beforeEach(async ({ api }) => { | |
visit = await startVisit(api, patient.uuid); | ||
}); | ||
|
||
test('Add an immunization', async ({ page }) => { | ||
test('Add and edit an immunization', async ({ page }) => { | ||
const immunizationsPage = new ImmunizationsPage(page); | ||
const headerRow = immunizationsPage.immunizationsTable().locator('thead > tr'); | ||
const immunizationType = immunizationsPage.immunizationsTable().locator('tbody td:nth-child(2)'); | ||
|
@@ -55,6 +55,48 @@ test('Add an immunization', async ({ page }) => { | |
await expect(immunizationType).toContainText(/hepatitis b vaccination/i); | ||
await expect(vaccinationDate).toContainText(/mar 8, 2024/i); | ||
}); | ||
|
||
await test.step('When I click the expand All rows in the table header with the newly recorded immunization', async () => { | ||
await page.getByRole('button', { name: /expand all rows/i }).click(); | ||
}); | ||
|
||
await test.step('Then I should see the immunization saved row in the table', async () => { | ||
await expect(page.getByText(/dose number within series/i)).toBeVisible(); | ||
await expect(page.getByText(/vaccination date/i)).toBeVisible(); | ||
}); | ||
|
||
await test.step('And I click on the `Edit` button', async () => { | ||
await page.getByRole('button', { name: /edit/i }).click(); | ||
}); | ||
|
||
await test.step('Then I should see the immunization form launch in the workspace in edit mode`', async () => { | ||
await expect(page.getByText(/immunization form/i)).toBeVisible(); | ||
await expect(page.getByRole('cell', { name: /hepatitis b vaccination/i })).toBeVisible(); | ||
}); | ||
|
||
await test.step('When I change the immunization type to `measles vaccination`', async () => { | ||
await page.getByRole('combobox', { name: /immunization/i }).click(); | ||
await page.getByText(/measles vaccination/i).click(); | ||
}); | ||
|
||
await test.step('And I change the immunization Dose number within series to `2`', async () => { | ||
await page.getByRole('spinbutton', { name: /dose number within series/i }).clear(); | ||
await page.getByRole('spinbutton', { name: /dose number within series/i }).fill('2'); | ||
}); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also modify the vaccination date? |
||
await test.step('And I click on the `Save` button', async () => { | ||
await page.getByRole('button', { name: /save/i }).click(); | ||
}); | ||
|
||
await test.step('Then I should see a success notification', async () => { | ||
await expect(page.getByText(/vaccination saved successfully/i)).toBeVisible(); | ||
}); | ||
|
||
await test.step('And I should see the updated immunization in the list', async () => { | ||
await expect(page.getByRole('columnheader', { name: /vaccine/i })).toContainText(/vaccine/i); | ||
await expect(page.getByText(/recent vaccination/i)).toBeVisible(); | ||
await expect(page.getByRole('cell', { name: /measles vaccination/i })).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.afterEach(async ({ api }) => { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the corresponding test in the validation step.