-
Notifications
You must be signed in to change notification settings - Fork 9
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-3863: E2E tests for user onboarding tutorials #23
base: main
Are you sure you want to change the base?
(test) O3-3863: E2E tests for user onboarding tutorials #23
Conversation
|
||
await test.step('And I click the `Appointments` button', async () => { | ||
await page.evaluate(() => { | ||
document.querySelector('.react-joyride__overlay')?.setAttribute('style', 'z-index: 1 !important'); |
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.
I had to use this at multiple instances (mostly for a button click) because Playwright was unable to interact with the button as it was covered by a tooltip overlay.
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.
Hi @harshthakkr, Could you please send a screenshot of this scenario?
@jayasanka-sack, @denniskigen Could you please review this PR? |
This is awesome @harshthakkr! 😍 @Vijaykv5 @Piumal1999 Could you please review this PR? |
@harshthakkr I made a commit to the main branch, could you please take a pull? |
Sure @jayasanka-sack ! |
Can you please re-trigger the E2E tests @jayasanka-sack? |
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.
Good job! @harshthakkr
I have requested some minor changes.
Btw, the build is failing due to a playwright issue. Let's bump the Playwright version to ^1.50.1
, which is used in other esm repos.
"react": "18.x", | ||
"react-i18next": "11.x", | ||
"react-router-dom": "6.x", | ||
"rxjs": "6.x" | ||
}, | ||
"devDependencies": { | ||
"@openmrs/esm-framework": "next", | ||
"@openmrs/esm-framework": "^6.2.1-pre.2752", |
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.
Keep the openmrs
and @openmrs/esm-framework
versions as next
@@ -0,0 +1,97 @@ | |||
import { type APIRequestContext, expect } from '@playwright/test'; | |||
|
|||
export interface Patient { |
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.
Let's reuse the interfaces defined in e2e/types/index.ts
here as well, to avoid redundancy.
|
||
await test.step('And I click the `Help` button', async () => { | ||
await page | ||
.locator('[id="single-spa-application\\:\\@openmrs\\/esm-help-menu-app-page-0"]') |
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.
Are there any other selectors we can use for this? It would be better if we could query using a visual property.
|
||
await test.step('And I click the `Appointments` button', async () => { | ||
await page.evaluate(() => { | ||
document.querySelector('.react-joyride__overlay')?.setAttribute('style', 'z-index: 1 !important'); |
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.
Hi @harshthakkr, Could you please send a screenshot of this scenario?
await test.step('When I fill `37` as the temperature', async () => { | ||
await page.getByRole('spinbutton', { name: /temperature/i }).fill('37'); | ||
}); | ||
|
||
await test.step('And I fill `120` as the systolic', async () => { | ||
await page.getByRole('spinbutton', { name: /systolic/i }).fill('120'); | ||
}); | ||
|
||
await test.step('And I fill `100` as the diastolic', async () => { | ||
await page.getByRole('spinbutton', { name: /diastolic/i }).fill('100'); | ||
}); | ||
|
||
await test.step('And I fill `65` as the pulse', async () => { | ||
await page.getByRole('spinbutton', { name: /pulse/i }).fill('65'); | ||
}); | ||
|
||
await test.step('And I fill `16` as the respiration rate', async () => { | ||
await page.getByRole('spinbutton', { name: /respiration rate/i }).fill('16'); | ||
}); | ||
|
||
await test.step('And I fill `98` as the oxygen saturation', async () => { | ||
await page.getByRole('spinbutton', { name: /oxygen saturation/i }).fill('98'); | ||
}); | ||
|
||
await test.step('And I add additional notes', async () => { | ||
await page.getByPlaceholder(/type any additional notes here/i).fill('Test notes'); | ||
}); |
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.
Merge these kinds of steps into a single step.
Requirements
For changes to apps
If applicable
Summary
This PR adds E2E tests for the following tutorials:
Related Issue
O3-3863
Other
The related JIRA ticket also suggests adding E2E tests for the Patient Lists tutorial. However, since the functionality is not working at the moment, I have excluded it from this PR.