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
Feature idea: should() for JavaScript executions #1750
Comments
@flange-ipb Yes, probably it's a great idea. I like the power of JavaScript - it allows to do many things that are not possible with pure webdriver. Can you please bring some example of jsCode? |
Hi @asolntsev! The concrete use case: Back to Selenide! API ideas:
where
Selenide could offer a few basic conditions for the relevant types, e.g.
Coping with the situation when executeScript() returns a WebElement (e.g. via returning a jQuery selection) might also be interesting, because you could go back to the existing Condition API, maybe by wrapping a Notes:
|
@flange-ipb Thank you for sharing idea! It's a valuable contribution. :) The question arises, how is the first option better than the second?
Usually Selenide
But is it needed to wait and take screenshot in case of JS checks? |
Hi again!
Well, I fell in love with should() and Conditions in combination with soft assertions and almost got rid of all asserts in my project. The only situation in which I still need a JUnit assert is when I need to check results of a JavaScript execution, so my idea would be something like this:
where condition could be something like equals(otherObject) (invoke Object.equals()) or even the text-related conditions like Condition.text("something").
What do you think?
The text was updated successfully, but these errors were encountered: