agentleFS
MicrosoftKnown publishermicrosoft/playwright-java/AGENTS.md

playwright-java

AGENTS.md1.6k starsChanged 25 days agoApache-2.0View on GitHub

The Java client is a port of the JavaScript client in ../playwright/packages/playwright-core/src/client/. When implementing or changing a method, read the corresponding JS file first and mirror its logic. Project checkouts (including the upstream playwright repo) live in the parent directory (../). Use the gh cli to interact with GitHub. The tests are in playwright/src/test/java/com/microsoft/playwright/. A test is a @PlaywrightTest method that takes the fixtures it needs as parameters, resolved by type: Page page, BrowserContext context, Browser browser, BrowserType browserType, Playwright…

  • Commits and pushes

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about microsoft/playwright-java

The biggest 5 of 56 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 56

Talked about on GitHub and Stack Overflow (56 times).

On GitHub · 50

45 more on GitHub
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository4 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Never add Co-Authored-By agents in commit message.

    line 62
  2. Very specific:

    Never add "Generated with" in commit message.

    line 63
  3. Very specific:

    Never add test plan to PR description.

    line 64
  4. Distinctive:

    Never amend commits: Always create a new commit for follow-up changes, even when iterating on an open PR.

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Playwright Java

The Java client is a port of the JavaScript client in ../playwright/packages/playwright-core/src/client/. When implementing or changing a method, read the corresponding JS file first and mirror its logic.

Project checkouts (including the upstream playwright repo) live in the parent directory (../). Use the gh cli to interact with GitHub.

Build and test

scripts/download_driver.sh                           # the driver, once per DRIVER_VERSION
mvn -B install -D skipTests --no-transfer-progress   # build and install every module
mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --with-deps" -f playwright/pom.xml --no-transfer-progress
BROWSER=chromium mvn test -f playwright/pom.xml -D test=TestPageScreenshot --no-transfer-progress
  • mvn test -f playwright/pom.xml compiles the playwright module and its tests, so a change in playwright/src/main/ needs no separate build step. After a change in driver/ or driver-bundle/, run mvn -B install -D skipTests --no-transfer-progress -f <module>/pom.xml first: the playwright module takes those modules from the local Maven repository.
  • The project targets Java 8. CI builds with JDK 8 (Zulu) and JDK 25. Do not use a newer language feature or library API.
  • There is no lint or format check. The style is the Google Java Style with a two-space indent, and without comments. When you change a file under playwright/src/test/java/com/microsoft/playwright/tests/, run python3 scripts/check_test_registry.py.
  • -D test=<Class> runs one class, -D test=<Class>#<method> one method. BROWSER is a comma-separated list of chromium, firefox and webkit; unset, it runs all three. HEADED=1 runs headed. A filter that matches no test passes with Tests run: 0, so check the count. Each test method has a 120 second timeout, set in the root pom.xml. Do not set PW_MAX_RETRIES, which reruns a failed test; CI sets it to 3. The reports are in playwright/target/surefire-reports/.

Tests

The tests are in playwright/src/test/java/com/microsoft/playwright/. A test is a @PlaywrightTest method that takes the fixtures it needs as parameters, resolved by type: Page page, BrowserContext context, Browser browser, BrowserType browserType, Playwright playwright, BrowserName browserName, Server server, HttpsServer httpsServer and @TempDir Path. The method runs once per selected browser, with a context and a page of its own; the browser and the servers are shared. A class overrides options with @Fixture methods, and skips a browser with @DisabledOnBrowser or @EnabledOnBrowser. Drive the page with page.setContent(...) or page.navigate(server.PREFIX + "/..."), and the server with server.setRoute(...), server.setRedirect(...), server.futureRequest(...) and server.EMPTY_PAGE.

DirectoryUse for
com/microsoft/playwright/the Java-only tests, one class per feature (TestPageScreenshot, TestBrowserContextHar). A regression test for a bug of the Java client goes here, in the class that owns the feature, as one added case.
com/microsoft/playwright/tests/page/, tests/library/line-by-line ports of upstream tests/page and tests/library, one class per spec file (TestPageCheck for page-check.spec.ts), each test titled @DisplayName("CH-001 ...") with the upstream identifier. Do not add a test or an assertion that upstream does not have. When the port that covers a bug carries @Fixme("java: ..."), the fix removes the mark, and that port is the regression test. playwright/src/test/AGENTS.md has the rules.
com/microsoft/playwright/junit/the public JUnit extension, @UsePlaywright

Tag a regression test with the issue as the Java-only tests do: a comment with the full URL on the first line of the test body, // https://github.com/microsoft/playwright-java/issues/<n>. Good models: TestBrowserContextExposeFunction, shouldNotDispatchBindingOnAClosedPage (a binding, a popup and a context of its own in a try-with-resources block); TestTracing, shouldRecoverTracingAfterAFailedStop (a tagged test with @TempDir on context.tracing()).

Commit Convention

Semantic commit messages: label(scope): description

Labels: fix, feat, chore, docs, test, devops

git checkout -b fix-39562
# ... make changes ...
git add <changed-files>
git commit -m "$(cat <<'EOF'
fix(proxy): handle SOCKS proxy authentication

Fixes: https://github.com/microsoft/playwright-java/issues/39562
EOF
)"
# **Never `git push` without an explicit instruction to push.**
git push origin fix-39562
gh pr create --repo microsoft/playwright-java --head <user>:fix-39562 \
  --title "fix(proxy): handle SOCKS proxy authentication" \
  --body "$(cat <<'EOF'
## Summary
- <describe the change very! briefly>

Fixes https://github.com/microsoft/playwright-java/issues/39562
EOF
)"

Never add Co-Authored-By agents in commit message. Never add "Generated with" in commit message. Never add test plan to PR description. Keep PR description short — a few bullet points at most. Branch naming for issue fixes: fix-<issue-number>.

Never amend commits. Always create a new commit for follow-up changes, even when iterating on an open PR. Amending rewrites history and forces a force-push, losing the incremental review trail. Only amend if the user explicitly says so.

Never git push without an explicit instruction to push. Applies even when a PR is already open for the branch — additional commits are immediately visible to reviewers. Commit locally, report what was committed, and wait. Only push when the user's message contains "push", "upload", "create PR", "ship it", or equivalent.

Skills

  • playwright-roll (.claude/skills/playwright-roll/SKILL.md) — roll Playwright Java to a new upstream version: bump the driver, regenerate the API, and port relevant upstream changes.
  • playwright-java-release (.claude/skills/playwright-java-release/SKILL.md) — prepare a release after the rolling PR merges: cut the release branch, mark the Maven version, and draft the GitHub release.
  • playwright-cherry-pick (upstream, ../playwright/.claude/skills/playwright-cherry-pick/SKILL.md) — cherry-pick a merged PR into a release-1.X branch as cherry-pick(#<pr>): <original title>. Use the same rules for this repo's release branches.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.