Repository navigation
feat(wait): add attributeToBe, urlMatches, textMatches wait conditions - #21
Merged
Merged
Conversation
Closes #12 Adds three commonly-requested explicit-wait conditions behind the existing static WaitEngine API, consistent with the current waitFor* naming: - waitForAttribute(By, attr, value) -> ExpectedConditions.attributeToBe (exact) - waitForUrlMatches(String regex) -> ExpectedConditions.urlMatches - waitForTextMatches(By, String regex)-> ExpectedConditions.textMatches The other issue candidate, attributeContains, already exists (waitForAttributeContains), as does waitForUrlContains — so those are covered and left as-is. Purely additive to the @SeleniumBootApi surface — no breaking changes. New WaitEngineTest covers all three via a mocked WebDriver (no real browser). Docs updated in guides/wait-engine.md. Full suite: 473 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 of 6 tasks
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.
Closes #12
What
Adds three commonly-requested explicit-wait conditions behind the existing static
WaitEngineAPI, consistent with the currentwaitFor*naming:waitForAttribute(By, attr, value)ExpectedConditions.attributeToBe(exact match)waitForUrlMatches(String regex)ExpectedConditions.urlMatcheswaitForTextMatches(By, String regex)ExpectedConditions.textMatchesScope note
The issue also listed
attributeContains, but that already exists aswaitForAttributeContains— as doeswaitForUrlContains. So the candidate list is fully covered; those two are left unchanged and cross-referenced in the docs (substring vs exact / regex).Safety
@SeleniumBootApisurface — this is purely additive (new public static methods on an existing API class).WaitEngineTestcovers all three via a mockedWebDriverwhose state satisfies each condition on the first poll — no real browser required.Verification
mvn -Dtest=WaitEngineTest test→ 3 passingmvn test(full suite) → 473 passing, 0 failures (confirms themockStaticsetup doesn't leak into other tests)npm run build(docs) → passes;guides/wait-engine.mdupdated with the new conditionsFollow-up (not in this PR)
While documenting, I noticed the wait-engine guide uses a
getWait().waitForX()call style, butgetWait()actually returns a raw SeleniumWebDriverWait(thewaitForXmethods arestaticonWaitEngine). That's a pre-existing doc inconsistency across the guide — worth a separate cleanup pass rather than widening this PR.🤖 Generated with Claude Code