Repository navigation
docs(readme): show the locator API in the quickstart instead of getDriver() - #40
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:That is indistinguishable from the in-house
BaseTestmost Java teams already have, so the quickstart gave an evaluator no reason to keep reading. The API is real, tested, and reachable directly fromBaseTest— it just wasn't on the front page.The change
getByRoleandassertThat(...).isVisible().WebDriverWaitand CSS/XPath, next to five lines with none of it.Verification
Run against published 3.3.0 from Maven Central, not the working tree.
pom.xmlandselenium-boot.yml, then run against real Chrome underxvfb— green.One thing worth knowing
example.comhas 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.