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
Checks for disabled select/option when using selectOption* methods #1553
Conversation
@bereg2k The implementation looks good.
NB! Probably we should just implement the whole |
|
Regarding JS implementation. |
@bereg2k After a long delay, I returned back to this PR. But I realised that the check for Anyway, I am going to merge your PR - at least to have these tests in our test suite. |
@asolntsev I think it was a great idea to implement these checks on the Selenium side.
|
@bereg2k No problems in both cases. :)
Yes, I will try to continue my work with JS implementation. We'll see how easy it is. |
@asolntsev Ok, if you mean to make changes to this PR so it would work somehow, then yes, it's totally reasonable. And if you need me to make any specific changes to this feature, let me know. |
+ check that neither select nor option is disabled
# Conflicts: # statics/src/test/java/integration/SelectsTest.java
@bereg2k FYI The check for Though the implementation is a bit different from yours (it throws Let's leave this PR open because the discussion continues... |
@asolntsev Thanks for the heads-up. Would it be reasonable to catch such exceptions, and handle them a bit more gracefully to provide the ability for negative checks and readable assertion error messages? |
@bereg2k Let's for wait the discussion result. |
now select is implemented with JS code, and this functionality is covered by integration tests.
+ check that neither select nor option is disabled
now select is implemented with JS code, and this functionality is covered by integration tests.
+ check that neither select nor option is disabled
now select is implemented with JS code, and this functionality is covered by integration tests.
Overseeded by #1876 |
Changes
Before:
SelenideElement.selectOption*
methods used underlying Selenium'sSelect.setSelected()
method that simply clicked on the option. If<select>
element was disabled or the selected<option>
was disabled , no exceptions were raised, and the test continued.Now:
All
SelenideElement.selectOption*
methods will throwInvalidStateException
if the test selects an option either from disabled<select>
element or the<option>
itself is disabled.