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

Optimize for local playwright tests #14

Open
TroyWitthoeft opened this issue Aug 21, 2022 · 1 comment
Open

Optimize for local playwright tests #14

TroyWitthoeft opened this issue Aug 21, 2022 · 1 comment

Comments

@TroyWitthoeft
Copy link

TroyWitthoeft commented Aug 21, 2022

It's really cool to see this project updated with playwright tests.
However, like most folks I like to test locally first, and then automate it.

After cloning this project, I struggled to get local testing setup.
The Test.README.md states to run npm run playwright_test
If we just naively run this we'll get an error ...

image

[WebServer] 'sirv' is not recognized as an internal or external command,
operable program or batch file.
Error: Process from config.webServer was not able to start. Exit code: 1

Luckily, we've got the playwright-onDemand.yml that hints at what is needed for local testing. Specifically, we need to install the dependencies.
npx playwright install --with-deps
npm install --g sirv-cli

After getting those dependencies installed locally, I was up and running tests locally! 🎉
However, the test results made a bit of a mess inside the project.

image

We've now got new files in root, new folders, and none of them were part of the .gitignore so, they are set to get committed. Proposal, we're already ignoring the test-results folder. In order to optimize the experience for local testing, would it make sense to do two things ...

  • Update that Test.README.md with the explicit steps to get local testing working.
  • Re-arrange our testing config to drop all of the results into the test-results` folder so we don't have to update the gitignore file? Something like this?
    image

Alternatively, it might be that using a GitHub Codespace or using VS Code with the remote containers extension, resolves this?
Didn't try that. But, would prefer to NOT have those local environment dependencies if possible.

I know we'd have to touch a few files to make this happen. The workflows, playwright.config.ts, etc ...
However, I am happy to take a swing PR'ing this! I really just want the local playwright experience to be optimized.
Thanks!

@MaxWilson
Copy link

Your explanation of the error saved me time and confusion during my Hello World journey for SWA. Thank you!

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