Add Until.elementTextDoesNotMatch
See original GitHub issueIs your feature request related to a problem? Please describe. I want to check for an element to not match a specific text. That way I know it has changed after ie. button click. Writing an inverted regex pattern is not easy.
Describe the solution you’d like Add Until.~DoesNotMatch as counterparts for Until.~Matches
- elementTextMatches(selectorOrLocator, regex) >> elementTextDoesNotMatch(selectorOrLocator, regex)
- titleMatches(title) >> titleDoesNotMatch(title)
- urlMatches(title) >> urlDoesNotMatch(title)
Describe alternatives you’ve considered Inverted regex is something you’ll need to look up, exposing a friendly alternative is nicer.
Additional context I was able to figure out how to check for change with the following:
const regex = new RegExp("^(?!" + amountBefore + "$)");
await browser.wait(Until.elementTextMatches(amountLocator, regex));
Adding ~DoesNotMatch would allow this much simpler code:
const regex = new RegExp(amountBefore);
await browser.wait(Until.elementTextDoesNotMatch(amountLocator, regex));
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Wait Till Text Present In Text Field - java - Stack Overflow
This is wrong, it looks for text nodes within the given WebElement , i.e., other element's texts, text between elements, and so on....
Read more >RPA.Browser library | Robocorp documentation
Use Element Text Should Be if you want to match the exact text, not a substring. Element Should Not Be Visible. Verifies that...
Read more >not() - CSS: Cascading Style Sheets - MDN Web Docs
The :not() CSS pseudo-class represents elements that do not match a list of selectors. Since it prevents specific items from being selected, ...
Read more >AppiumLibrary - GitHub Pages
AppiumLibrary is a Mobile App testing library for Robot Framework. Locating or specifying elements. All keywords in AppiumLibrary that need ...
Read more >Retry-ability - Cypress Documentation
We need to retry getting the element, invoking the text() method, calling the parseFloat function and running the gte and lte assertions. We...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good for me!
Interested in this ticket, I’m taking this if nobody is working on it.