-
Notifications
You must be signed in to change notification settings - Fork 3
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
Test suite initialization #41
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
See that the github workflow is failing for tests and prettier (I'm not sure if you installed prettier in this repo, if you haven't grab it from devs.near too, remember to get the fmt commands)
Then run fmt and push the result with this
@@ -54,6 +54,7 @@ | |||
"prod:analyze": "npm run prod -- --env presets=analyze", | |||
"build": "npm run prod", | |||
"start": "npm run dev", | |||
"test": "npx playwright test", |
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 you add these scripts too please
"test": "npx playwright test",
"test:ui": "npx playwright test --ui",
"test:ui:codespaces": "npx playwright test --ui-host=0.0.0.0",
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.
Add add the following to the README:
Running Playwright tests
To be able to run the playwright tests, you first need to install the dependencies. You can see how this is done in .devcontainer/post-create.sh which is automatically executed when opening this repository in a github codespace.
When the dependencies are set up, you can run the test suite in your terminal:
yarn test
To run tests visually in the playwright UI, you can use the following command:
yarn test:ui
This will open the playwright UI in a browser, where you can run single tests, and also inspect visually.
If you want to use the playwright UI from a github codespace, you can use this command:
yarn test:ui:codespaces
In general it is a good practice, and very helpful for reviewers and users of this project, that all use cases are covered in Playwright tests. Also, when contributing, try to make your tests as simple and clear as possible, so that they serve as examples on how to use the functionality.
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.
And just drag over .devcontainer from here
https://github.com/NEARBuilders/near-bos-webcomponent/tree/main/.devcontainer
/* Run your local dev server before starting the tests */ | ||
webServer: { | ||
command: "npm run dev", | ||
port: 4040, |
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 think this port needs to match the dev server, which is 8000. Change all 4040 to 8000
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.
Resolves #40