playwright.dev
This website is built using Docusaurus v2. Content is pulled from the microsoft/playwright repo.
Development
Setup the repo
npm installRoll docs
SRC_DIR=../playwright npm run rollRemove old release
node src/versions.js --delete 1.16Run dev server
npm run start-nodejsSee package.json for other languages (java, python, .NET).
Run prod build and serve
npm run build
npm run serveRunning this on Windows
If you don't already, you might need to set the default shell to bash.
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"You can revert it later, if you have issues, by doing:
npm config delete script-shellIn some cases, the postinstall script doesn't auto-run after npm install, in which case, you can run that manually:
npm run postinstallThat should bring your environment to a state ready for testing.
To roll the docs in PowerShell, make sure you set the env variable correctly, i.e.:
$env:SRC_DIR="C:\Users\user\src\playwright"; npm run rollRun end-to-end tests
Run on local machine
Run this on one terminal:
npm run start-nodejsand this on another, it will automatically use the local docusaurus server:
npx playwright test nodejsRun on different environment
You can set the BASE_URL=https://playwright.dev env var, otherwise http://localhost:3000 gets used by default.
Publishing Doc Changes After a Release
-
Open PR against
mainbranch so the change is inlcuded in all future releases of Playwright. -
Cherry pick the landed commit on
maininto the release branch:$ git fetch --all $ git checkout -b cp/name-your-change-branch upstream/release-1.XY # (e.g. 1.24 instead of 1.XY) $ git cherry-pick <commit from main> -
Open PR against the
release-1.XYbranch with your cherry-picked commit
- Manually run https://github.com/microsoft/playwright.dev/actions/workflows/create_release.yml
- Run Workflow dropdown
- Leave branch as
main - Enter release version number (e.g. 1.24, NO
vprefix) - Run Workflow
- Wait for action to finish. A PR will appear in https://github.com/microsoft/playwright.dev/pulls.
- Review PR and land!