How to Run Playwright Tests Locally - jidone7061/mywebclass-simulation GitHub Wiki
Overview
Playwright will run automatically during a pull request. However, you should test it locally before submitting the pull request to make the pull request process easier and likely to pass.
How How to Run Playwright Tests Locally
-
Open up the project in Pycharm. In the bottom of the screen open Terminal. Run the command npm start to start webpack.
It is not strictly necessary to start webpack manually as Playwright will start it itself. However this is useful if running subsequent tests as there is less startup time if webpack is already running.
-
Open a second Terminal tab in Pycharm. Run the following commands as necessary:
- npx playwright test - run all the tests
- npx playwright test --headed - run all the tests but open a window so you can watch
- npx playwright test --debug - run playwright in debug mode allowing you to go through step by step. Use page.pause() to insert a manual pause.
- npx playwright test test/mytest.spec.js - run only a single playwright test file