Repository navigation
feat(locator): waitFor, allTextContents, element screenshot (#135) - #150
Conversation
|
Thanks again, Pushpak: this is a solid, well-tested contribution. I checked it out and ran the suite: 658 run, 0 failures (638 on master + your 20), and the Javadoc, docs and changelog entries are all there. Before merging I found two places where the behaviour doesn't match the "re-resolve from scratch and retry stale elements" contract from #67/#68. I reproduced both with a throwaway unit test against this branch:
Smaller things, not blockers:
Happy to merge once 1 and 2 are in. Ping me if you want to talk any of it through. |
|
@shossain786 ok i am working on this |
…r-alltext-screenshot # Conflicts: # CHANGELOG.md # docs-site/docs/changelog.md
|
@shossain786 i have made the necessary changes. |
What & why
Adds three new capabilities to
Locatorinspired by Playwright's locator API:waitFor(State)andwaitFor(): waits for an element to reach a target lifecycle state (VISIBLE,HIDDEN,ATTACHED,DETACHED) with auto-wait retrying up totimeouts.explicit.allTextContents(): retrieves the text of all matching elements in a single pass, returning immediately without waiting when no matches are found.screenshot()andscreenshot(Path): captures an element's PNG screenshot bytes and writes them to a file path, auto-waiting for visibility and re-resolving on every poll.All terminal actions re-resolve elements from scratch on each poll, surviving stale element reference exceptions and late-appearing elements (#67/#68).
Closes #135
Type of change
Checklist
mvn clean verify)@SeleniumBootApipublic APIs (or a major version bump is justified below)docs-site/)Notes for reviewers
Stateis exposed as@SeleniumBootApi(since = "3.9.0")incom.seleniumboot.locator.waitFor()defaults toState.VISIBLE.