question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Until.elementTextDoesNotMatch

See original GitHub issue

Is 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidDeSlooverecommented, Apr 16, 2020

Good for me!

1reaction
huyennblcommented, Apr 15, 2020

Interested in this ticket, I’m taking this if nobody is working on it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found