- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.6k
 
Add ExpectedConditions.urlFulfills #16285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ExpectedConditions.urlFulfills #16285
Conversation
| 
           Thank you, @UncleOwen for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks.  | 
    
          PR Reviewer Guide 🔍Here are some key observations to aid the review process: 
  | 
    
          PR Code Suggestions ✨Explore these optional code suggestions: 
  | 
    |||||||||||||||
| 
           Thanks, but I am closing this for the reasons described in: #16285 (comment) Also, pretty much every conceivable expected condition for a URL can already be handled with   | 
    
User description
💥 What does this PR do?
This PR adds a new method
ExpectedConditions.urlFulfills(). This allows code likewhich is more specific than
and more readable than whatever you'd do with
ExpectedContitions.urlMatches()🔧 Implementation Notes
Predicates usually don't have a good.toString(), that's why I left it out from.toString()💡 Additional Considerations
I'm bad at coming up with good names. Feed free to suggest a better name.
🔄 Types of changes
PR Type
Enhancement
Description
Add
urlFulfills()method toExpectedConditionsclassAccept
Predicate<URI>for flexible URL validationInclude comprehensive test coverage for new functionality
Handle malformed URLs gracefully with exception handling
Diagram Walkthrough
File Walkthrough
ExpectedConditions.java
Add urlFulfills method with predicate supportjava/src/org/openqa/selenium/support/ui/ExpectedConditions.java
urlFulfills()method acceptingPredicateURI,URISyntaxException, andPredicateclassesExpectedConditionsTest.java
Add comprehensive tests for urlFulfills methodjava/test/org/openqa/selenium/support/ui/ExpectedConditionsTest.java
urlFulfillsmethodURIclass for test implementationsscenarios
handling