-
Notifications
You must be signed in to change notification settings - Fork 2
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[e2e]: Add PlanX input components to create-flow test #3617
Conversation
Removed vultr server and associated DNS entries |
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.
Minor toast improvements cherry-picked from the react-toastify PR so it's not forgotten :)
import { Browser, Page, Request } from "@playwright/test"; | ||
import { createAuthenticatedSession } from "../globalHelpers"; | ||
|
||
export const isGetUserRequest = (req: Request) => | ||
req.url().includes("/user/me"); |
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.
Renamed the file to be more specific to 'getPage' helpers, and moved this to another file
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.
Just moved this file into a helpers folder and moved a couple of the functions into another file with a better name
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.
Sorry there's a lot of changes like this where it's just the imports that have changed!
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.
Super exciting first additions here and meaningful refactors, thanks !
1. Navigate to `/tests/ui-driven` | ||
2. Run `pnpm install` to install the Playwright package. | ||
3. Run `pnpm exec playwright install` to install the Playwright test browsers. | ||
4. Run the tests with `pnpm 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.
🌟
noBranchNoticeText, | ||
); | ||
|
||
// TODO: find a nicer way to find the next node |
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.
When you're in a real browser, a handy trick for doing this is running window.api.getState().upcomingCardIds()
in the console - where the next node ID will be the first item in the returned array. From there, you can do flow[nodeId]
for the full node data like its' type
etc.
Just flagging in case it jogs any future ideas ! setFeatureFlag
& getSessionId
helper functions already hook into similar window
calls, so might be a pattern we can follow here too!
await page.getByRole("dialog").waitFor(); | ||
await page.locator("select").selectOption({ label: type }); | ||
|
||
switch (type) { |
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.
Nice & clear !
Trello ticket: https://trello.com/c/dBmTyu9F/3017-test-each-planx-component-via-an-e2e-test
So far I've just focused on adding in the relatively easy 'input' components. The next PR will start to tackle the more complicated ones.
In this PR:
useToast
hook improvement cherry-picked from my closed react-toastify PR 🍒