Skip to content
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

Playwright webserver command should run build before preview? #263

Open
vincerubinetti opened this issue May 4, 2023 · 1 comment
Open

Comments

@vincerubinetti
Copy link

vincerubinetti commented May 4, 2023

Currently, create-vue generates a playwright config that has something like this in it:

{
  webServer: {
    /**
     * use the dev server by default for faster feedback loop. Use the preview
     * server on CI for more realistic testing
     */
    command: process.env.CI
      ? "vite preview --port 5173"
      : "vite dev",
    port: 5173,
    reuseExistingServer: !process.env.CI,
  }
}

Shouldn't we need to run build before preview so that the app actually exists?

I ran into problems running my tests on GitHub Actions, and it took me a while to figure out that this was the cause. See:
vitejs/vite#4572

@jonalexander
Copy link

jonalexander commented Feb 18, 2025

yes you need to run build first.

in the snippet above vite preview is being run in a CI env. you can add a step to run build and then trigger a CI job to run the PW tests.

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

No branches or pull requests

2 participants