-
Notifications
You must be signed in to change notification settings - Fork 9
Write some initial e2e tests #429
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?
Conversation
| @impl true | ||
| def mount(socket) do | ||
| programs = for p <- Delivery.list_programs(), do: {p.name, p.id} | ||
| programs = for p <- Delivery.list_programs(), do: [key: p.name, value: p.id, label: p.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.
This was required in order to add "label" attributes to options in the <select> tag; these labels are used to traget dropdowns in tests.
| "assets.deploy": ["esbuild default --minify", "tailwind default --minify", "phx.digest"] | ||
| "assets.deploy": ["esbuild default --minify", "tailwind default --minify", "phx.digest"], | ||
| # REVIEW: Sometimes this hangs on a query - `INSERT INTO "tasks_items"...` | ||
| "test.e2e": ["ecto.drop", "phx.server"] |
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.
Not sure what's going on here—but it just seems to hang. Maybe just remove it?
| name: 'firefox', | ||
| use: { ...devices['Desktop Firefox'] }, | ||
| }, | ||
|
|
||
| { | ||
| name: 'webkit', | ||
| use: { ...devices['Desktop Safari'] }, | ||
| }, |
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.
It might be worth removing testing for Firefox and Safari?
| // once the program is created, we need to find it on the program page and EDIT it, | ||
| // because at this time there is no "add items" for part when creating a new program | ||
| // (only when editing it) |
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 wonder if this is an intentional part of the New Program form, or if the ability to add items should be possible in that form.
|
Hmm is it possible to get this to at least run in the test database instead of dev in order to not wipe it? |
Describe your changes
This PR adds Playwright e2e testing and a handful of example tests. A few notes:
I'd like to write more tests, but I also wanted to check in to see if this is going in the right direction first.
NOTE: At this time, running e2e tests just pollutes your local dev. So, I've been dropping the DB and resetting it before fresh runs. The tests have been written in a way to allow continuously running them, but it clutters your db. It may be possible to use the Ecto Sandbox to resolve this (here's a blog post going over that) but I didn't have any luck trying to set that up.
Checklist before requesting a review
about this update in the description above.
CleanShot.2025-03-27.at.15.23.00.mp4