-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add Playwright tests for mapper flow #1766
Add Playwright tests for mapper flow #1766
Conversation
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.
This is great!
A few other things to check could be:
- Adding a comment works
- Reading the comment on the tab
In future I am wondering if it's possible to make a mock form submission too, so we can do the next round of tests (check the submission download, validator workflow, etc) - a future PR
(Update: to do the above we can replicate something like this https://forum.getodk.org/t/creating-fake-odk-data/26144/3
using JavaScript instead of Python. We simply need to POST some pre-generated XML data to the ODK Central submission API)
src/frontend/e2e/entityPopup.spec.ts
Outdated
@@ -0,0 +1,68 @@ | |||
import { test, expect } from '@playwright/test'; |
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 was checking the test ordering for Playwright
https://playwright.dev/docs/next/test-parallel#control-test-order
It seems they simply run in alphabetical order of the files, so with that in mind I think we should append numbers to some tests like:
- 0-project-create.spec.ts
- 1-mapper-workflow.spec.ts
This should mean that the project is created first, then the project page can be viewed and tests carried out there
src/frontend/e2e/entityPopup.spec.ts
Outdated
}); | ||
await expect(page.getByRole('heading', { name: 'Feature:' })).toBeVisible(); | ||
await expect(page.getByRole('button', { name: 'MAP FEATURE IN ODK' })).toBeEnabled(); | ||
await page.getByRole('button', { name: 'MAP FEATURE IN ODK' }).click(); |
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.
After this click I think we should expect a console warning that the redirect to protocol odkcollect://
failed (it attempts to open the link via mobile intent).
We could set a console listener via playwright and check this warning is displayed (it's not a user facing thing, but it helps check the button works as intended)
What type of PR is this? (check all applicable)
Related Issue
Describe this PR
This PR contains the following works:
Screenshots