-
-
Notifications
You must be signed in to change notification settings - Fork 175
chore: build project before playwright test #777
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
| "test": "vite test", | ||
| "test:browser": "playwright test", | ||
| "test:browser:ui": "playwright test --ui", | ||
| "test:browser:ui": "pnpm build:playwright && playwright test --ui", |
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.
Can also move it to a separate step in the CI workflow - that could give us more visibility into if/how the build time changes over time. But kept it here now so the local browser tests run would be the same DX, just run the same command.
| "scripts": { | ||
| "build": "nuxt build", | ||
| "build:lunaria": "node ./lunaria/lunaria.ts", | ||
| "build:playwright": "NODE_ENV=test pnpm build", |
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 where the NODE_ENV matters, kept it for both for now
danielroe
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.
this shouldn't make any difference in CI but it does enable writing tests more easily locally - e.g you build server, then iterate on it with playwright.... so I think it's a good thing
thank you!: ❤️
|
From what I understood is that the main issue currently is that playwright has to wait for the build to complete before running browser tests - this should affect CI positively in that regard, i.e. it doesn't matter if the build takes 1-2 minutes longer (depending on flakyness in CPU/memory availability for example), playwright only starts after the build completes, and only has to wait for the local webserver to start. |
|
playwright has to wait for the build to finish one way or another - either before playwright starts, or as part of the playwright process - so this is the same as simply adding a very high timeout for that start command |
Effectively does the same thing, but builds for playwright browser tests as a pre-step, so playwright won't have to wait for the build to succeed, rather just the webserver starting, which should be fast.
Lowered the timeout to the default value, but left it in the config, as it might still be useful to see/change later on.