-
Notifications
You must be signed in to change notification settings - Fork 14
(test) O3-3863: E2E tests for user onboarding tutorials #23
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
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?
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.
Screen.Recording.2025-03-13.at.10.37.51.AM.mov
Playwright Error
Error: locator.click: Test timeout of 180000ms exceeded.
Call log:
- waiting for
getByRole('button', { name: 'Search patient' }) - locator resolved to
<button type="button" name="SearchPatientIcon" aria-labe…>…</button> - attempting click action
- waiting for element to be visible, enabled and stable
- element is visible, enabled and stable
- scrolling into view if needed
- done scrolling
<div role="presentation" data-test-id="overlay" class…>…</div> from <div id="react-joyride-portal">…</div>
|
@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? |
Piumal1999
left a comment
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.
package.json
Outdated
| }, | ||
| "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
e2e/commands/patient-operations.ts
Outdated
| @@ -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.
e2e/specs/basic-overview.spec.ts
Outdated
|
|
||
| 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?
e2e/specs/record-vitals.spec.ts
Outdated
| 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.
|
@Piumal1999 could you please review it? |
|
Could you please review it @Piumal1999? |
ed9047b to
1b8ccc7
Compare
1b8ccc7 to
fb3333f
Compare
Jest was failing to parse ES modules from @carbon/feature-flags, causing test suite failures with "Unexpected token 'export'" errors. Added the specific package to `transformIgnorePatterns` to allow proper transformation while following OpenMRS Jest configuration patterns.
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.