-
Notifications
You must be signed in to change notification settings - Fork 597
Create SelenideElement from Suppliers #544
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
Conversation
|
@Icok It's an interesting idea. Yes, probably we should do it. But can you describe a real case? How could your |
|
@asolntsev To answering to your question: -- How could your getDiv() method be implemented? |
|
@Icok The build is failing. There are some checkstyle issues. Please execute |
asolntsev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but please make the build green.
Codecov Report
@@ Coverage Diff @@
## master #544 +/- ##
============================================
- Coverage 60.53% 60.02% -0.52%
+ Complexity 772 768 -4
============================================
Files 148 149 +1
Lines 2752 2764 +12
Branches 272 272
============================================
- Hits 1666 1659 -7
- Misses 981 992 +11
- Partials 105 113 +8
Continue to review full report at Codecov.
|
|
@asolntsev Done |
|
I am closing it due inactivity. Feel free to start conversation again if you would mind to add such changes. |
I suggest an idea of getting element from Supplier<? extends WebElement>.
It can be helpful in different situations:
WebElement el = getDiv();
But in this case we have a problem if something goes wrong with first element 'el', I mean if that element updates, we will get StaleElementReferenceException and Selenide cannot re-init that element.
But have a look at that example:
$(this::getDiv).$ (input).setValue("text").
In that case, if something goes wrong, Selenide will invoke the given supplier and can re-init first element and others elements as well.
@asolntsev What do you think?