Skip to content

refactor!: use prod bundle & preview server for playwright testing on CI #182

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

Merged
merged 8 commits into from
Oct 21, 2022

Conversation

haoqunjiang
Copy link
Member

@haoqunjiang haoqunjiang commented Oct 19, 2022

To make it consistent with the Cypress configurations.

Background: https://twitter.com/haoqunjiang/status/1582692547188920322

Alternative: use npm run dev in Cypress configuration, as suggested in #39

@haoqunjiang haoqunjiang changed the title refactor!: use preview server for playwright testing refactor!: use prod bundle & preview server for playwright testing Oct 19, 2022
@haoqunjiang
Copy link
Member Author

Cc @mxschmitt @lmiller1990
Do you have any preferences on this configuration?

Copy link
Contributor

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me, but it requires an additional step for running e2e tests.

I feel like customers would run into issues, e.g. that they run tests against outdated build directory, or are not easily able to run tests against a dev server (not easily means they would need to change playwright config file baseURL and webServer run command).

Was also thinking about something like this: only run the webserver when it's on CI, for the other cases rely on the user to use npm run dev / npm run build+preview

@haoqunjiang haoqunjiang force-pushed the refactor-use-preview-for-playwright branch from 977882c to 4c399f6 Compare October 20, 2022 10:52
@haoqunjiang haoqunjiang changed the title refactor!: use prod bundle & preview server for playwright testing refactor!: use prod bundle & preview server for playwright testing on CI Oct 20, 2022
As `npm` and `npx` add `./node_modules/.bin` to `$PATH`,
the `vite` command should be available when playwright is running.

(Not sure if this works on Windows, let's wait and see the CI results.)
@haoqunjiang
Copy link
Member Author

haoqunjiang commented Oct 20, 2022

And I also opened a PR to apply the similar changes to the Cypress templates: #183

@haoqunjiang
Copy link
Member Author

Was also thinking about something like this: only run the webserver when it's on CI, for the other cases rely on the user to use npm run dev / npm run build+preview

I feel this is a better option.
But to make the configuration simpler, I think we can still reuse the CI environment variable to switch between different servers, they can share the same port though.
I've updated the PR accordingly. What do you think?

Co-authored-by: Max Schmitt <max@schmitt.mx>
@haoqunjiang haoqunjiang merged commit 11fc2a1 into main Oct 21, 2022
@haoqunjiang haoqunjiang deleted the refactor-use-preview-for-playwright branch October 21, 2022 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy