Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.91 KB

CONTRIBUTING.md

File metadata and controls

39 lines (28 loc) · 1.91 KB

Contributing

Code style

The Go code is linted with golangci-lint and formatted with gofumpt. Please configure your editor to run the tools while developing and make sure to run the tools before committing any code.

Tests

Test coverage

For every Pull Request on GitHub and on the main branch the coverage data will get sent over to Coveralls, this is helpful for finding functions that aren't covered by tests.

Running tests

You can use the BROWSER environment variable to use a different browser than Chromium for the tests and use the HEADLESS environment variable which is useful for debugging.

BROWSER=chromium HEADLESS=1 go test -v --race ./...

Roll

  1. Find out to which upstream version you want to roll, and change the value of playwrightCliVersion in the run.go to the new version.
  2. Download current version of Playwright driver go run scripts/install-browsers/main.go
  3. Apply patch bash scripts/apply-patch.sh
  4. Fix merge conflicts if any, otherwise ignore this step. Once you are happy you can commit the changes cd playwright; git commit -am "apply patch" && cd ..
  5. Regenerate a new patch bash scripts/update-patch.sh
  6. Generate go code go generate ./...

To adapt to the new version of Playwright's protocol and feature updates, you may need to modify the patch. Refer to the following steps:

  1. Apply patch bash scripts/apply-patch.sh
  2. cd playwright
  3. Revert the patchgit reset HEAD~1
  4. Modify the files under docs/src/api, etc. as needed. Available references:
  5. Commit the changes git commit -am "apply patch"
  6. Regenerate a new patch bash scripts/update-patch.sh
  7. Generate go code go generate ./....