This adds the dependency to Playwright (https://playwright.dev/) and configures it to run locally.
There are two scripts added to the package.json file:
test-playwright - This script will execute all playwright tests in the package using an already running webpack dev server.
test-playwright:webpack - This script will also start a webpack dev server before running the tests.
Playwright is configured to scan the /packages/fast-tooling/src folder looking for files with a "*.spec.pw.ts" naming convention and execute the tests. This does not conflict with the existing karma/chia tests and both may exists side by side.
To create a new test add a new file with the named .spec.pw.ts in any folder under src and import "expect" and "test" from @playwright/test.
Encapsulate your tests inside of a "test.describe()" call. Use the color-picker.spec.pw.ts as an example.
Start an instance of the webpack dev server (npm start).
In a separate terminal window execute playwright (npm run test-playwright).
To start the playwright test generator execute this command "npx playwright codegen http://localhost:7776" replacing the port number with the correct number for the package that you are testing (tooling=7776, react=7002, wasm=7003).
This only configures Playwright to be run manually on the local dev environment. GitHub build gate integration will be done in a separately.
🎫 Issues
closes: #147
👩💻 Reviewer Notes
✅ Checklist
General
[x] I have added tests for my changes.
[x] I have tested my changes.
[ ] I have updated the project documentation to reflect my changes.
Pull Request
📖 Description
This adds the dependency to Playwright (https://playwright.dev/) and configures it to run locally. There are two scripts added to the package.json file:
Playwright is configured to scan the /packages/fast-tooling/src folder looking for files with a "*.spec.pw.ts" naming convention and execute the tests. This does not conflict with the existing karma/chia tests and both may exists side by side.
To create a new test add a new file with the named.spec.pw.ts in any folder under src and import "expect" and "test" from @playwright/test.
Encapsulate your tests inside of a "test.describe()" call. Use the color-picker.spec.pw.ts as an example.
Start an instance of the webpack dev server (npm start).
In a separate terminal window execute playwright (npm run test-playwright).
To start the playwright test generator execute this command "npx playwright codegen http://localhost:7776" replacing the port number with the correct number for the package that you are testing (tooling=7776, react=7002, wasm=7003).
This only configures Playwright to be run manually on the local dev environment. GitHub build gate integration will be done in a separately.
🎫 Issues
closes: #147
👩💻 Reviewer Notes
✅ Checklist
General
⏭ Next Steps