Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Every change is looked at by the maintainer. GitHub asks this person for a review automatically.
* @leonkrix
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

Thank you for looking at this. Bug reports, false positives and ideas are as welcome as code.

## How a change gets in

1. **Issue first, for anything bigger than a small fix.** A bug with a reproduction, an idea for an option or a rule: open an [issue](https://github.com/leonkrix/playwright-layout-guard/issues) and say what you test. It saves you from writing code that does not fit.
2. **Small fixes and documentation: straight to a pull request.** A typo, a wrong sentence in the README, a clear bug with a test.
3. **Fork, branch, pull request.** Fork the repository, make a branch, and open a pull request against `main`. You do not need write access, and nobody has to add you.
4. **The CI runs.** The first time you contribute, a maintainer has to approve the run (GitHub asks for that for every new contributor, because workflows run code). The check `CI passed` has to be green.
5. **The maintainer reviews and merges.** Only a maintainer can merge. Pull requests are squash-merged, so the title of the pull request becomes the commit message: write it as a Conventional Commit.
6. **The change is released** with the next version. A pull request that users can see carries a changeset (see below); the maintainer collects them into a release.

Nobody merges their own pull request without the CI. While there is one maintainer, the maintainer's own pull requests need no second approval; that changes as soon as there is a second maintainer.

## Reporting a false positive

The most useful report is a page where the guard fails a test but nothing visibly jumps (or the other way round). Please include:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/leonkrix/playwright-layout-guard/badge)](https://scorecard.dev/viewer/?uri=github.com/leonkrix/playwright-layout-guard)

**A Playwright fixture that fails a test when something on the page moves.** Any element that changes its place or size after the page has loaded — a banner that pushes the content down, an image without a size, a button that jumps when it is pressed — fails the test, and the message names the element and says how far it moved. It works in Chromium, Firefox and WebKit.
**A Playwright fixture that fails a test when something on the page moves.** Any element that changes its place or size after the page has loaded (a banner that pushes the content down, an image without a size, a button that jumps when it is pressed) fails the test, and the message names the element and says how far it moved. It works in Chromium, Firefox and WebKit.

```text
Error: Something on the page moved or changed its size (1 shift):
Expand Down
Loading