Skip to content

docs(readme): show the locator API in the quickstart instead of getDriver() - #40

Merged
shossain786 merged 1 commit into
masterfrom
docs/quickstart-shows-locator-api
Aug 27, 2026
Merged

shossain786 merged 1 commit into
masterfrom
docs/quickstart-shows-locator-api

Conversation

@shossain786

Copy link
Copy Markdown
Contributor

The problem

The README promises Playwright ergonomics in prose — "accessibility-first locators (getByRole / getByLabel / getByText), auto-waiting, web-first assertions" — and then never demonstrates them.

Across 44 code blocks in the README, not one contained a getBy* call. The only code a reader saw in the first 60 seconds was:

assertTrue(getDriver().getTitle().contains("Example Domain"));

That is indistinguishable from the in-house BaseTest most Java teams already have, so the quickstart gave an evaluator no reason to keep reading. The API is real, tested, and reachable directly from BaseTest — it just wasn't on the front page.

The change

  • The quickstart test now uses getByRole and assertThat(...).isVisible().
  • Adds a before/after against plain Selenium: the same sign-in flow with driver lifecycle, WebDriverWait and CSS/XPath, next to five lines with none of it.

Verification

Run against published 3.3.0 from Maven Central, not the working tree.

  • The quickstart was extracted verbatim from the README into a clean three-file project matching the README's own pom.xml and selenium-boot.yml, then run against real Chrome under xvfb — green.
  • The before/after snippet was wrapped in a class and compiled against the same artifact — compiles.

One thing worth knowing

example.com has been redesigned; its link now reads "Learn more", not "More information...". The new quickstart asserts on the heading and on the presence of a link, so it does not depend on their copy. The old quickstart still passed only because it asserted on the page title, which didn't change.

…iver()

The README promises "the productivity features people love in Playwright —
accessibility-first locators, auto-waiting, web-first assertions" in prose, then
never demonstrates them: across 44 code blocks, not one contained a getBy* call.
The only code a reader saw in the first 60 seconds was getDriver().getTitle() —
which is indistinguishable from the in-house BaseTest they already have.

The API is real, tested and reachable directly from BaseTest. It just wasn't on
the front page.

- Quickstart now uses getByRole + assertThat(...).isVisible() instead of
  assertTrue(getDriver().getTitle().contains(...)).
- Adds a before/after against plain Selenium: the same sign-in flow with driver
  lifecycle, WebDriverWait and CSS/XPath, next to five lines with none of it.

Verified against PUBLISHED 3.3.0, not the working tree. The quickstart was
extracted verbatim from the README into a clean three-file project matching the
README's own pom and yml, and run against real Chrome via xvfb: green. The
before/after snippet was wrapped and compiled against the same artifact.

Note for anyone re-running it: example.com was redesigned and its link now reads
"Learn more", not "More information...". The new quickstart asserts on the heading
and on the presence of a link, so it does not depend on their copy.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@shossain786
shossain786 merged commit 0e3e88e into master Aug 27, 2026
2 checks passed
@shossain786
shossain786 deleted the docs/quickstart-shows-locator-api branch August 27, 2026 02:04
@shossain786 shossain786 mentioned this pull request Sep 19, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant