-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
adding the EpectedCondition invisibility_of_element #6163
adding the EpectedCondition invisibility_of_element #6163
Conversation
I personally am not in favor of adding any additional Expected Conditions, but I will leave this open for a while to gauge interest. |
Right now the list of Expected Conditions looks a bit scatter-shot to me. But I was a bit annoyed that there was a Long term I would personally be in favor of cutting it down to just |
I think |
@shs96c This is Python, there is no And if you really want less methods, then my approach of being generous with input seem to provide a clear method forward to consolidating a few of the Expected Conditions, without losing any functionality. And seriously, are you going to remove the |
@shs96c, @innokenty I have to say that this was a pretty bad interaction with a first time commiter. I hope that this is not representative of the general culture in the project. Since I have some experience in well-run projects I will give you some notes:
My employer is paying me to improve our use of Selenium, so I have a whole framework of updates that could be pushed back upstream. There seems little point to do so now. |
@larkost This is totally my bad. First of all, an apology: I didn't pay enough attention when I closed this PR --- for some reason I thought this was java --- and there's no excuse for that. Sorry. You're also totally justified to want thanking. It wasn't polite not to thank you, especially since we normally make an effort to show some appreciation. Again, I apologise. I'm glad that your employer is paying you to support Selenium. That's a fortunate and happy place to be in. I'm happy for you. However, of the 6 people who have made more than 10 commits this year, none of us are paid to work on Selenium. We fit our Open Source work in around our work and personal commitments. There are one or two people who can review Python patches properly. The fact that it took two days isn't rude: it's a sign that people are stressed and over-committed. I'm not singling you out here, since there are many, many people who believe the same, but it's a crying shame that people mistake a labour of love by deeply committed individuals for a corporate effort backed by plenty of dollars and hordes of engineers. When we get the core committers together, we can sit round a single table, and buying a round of drinks for them isn't expensive. We're exhausted. |
@shs96c Thanks for re-looking at this. I completely understand the realities of open-source development. The only reason I focused on the 2 days thing is because the rest of the conversation was so fast. That difference caused it to look like "case closed". I am not in any hurry to get this approved (locally I already have workarounds), and to be clear I am happy to re-work it if should go in another direction. And as I said... I am not a touchy-feely person in general. I care more that a process be based on good arguments. But I did witness first-hand that just a little bit of the soft-touch approach goes a long way, especially with new contributors. It felt that might be a lesson unlearned in this community. I am happy to hear that that is not the case. I do notice that this was not un-closed. Do you want me to re-submit? |
Something that's been on my to-do list for a long time is to write a Python package that provides a library of expected conditions for use with Selenium. I'm not a fan of the inconsistencies in the support package, and would prefer that we had a decent third-party package to recommend. That said, there's no reason why a rewrite couldn't exist in the Selenium project if we had someone with the time to contribute to and maintain it. We could even deprecate the existing package, and just have it call through to the new code. |
@davehunt Could you list out the conditions that you would like to see in such a package? My own needs have been mostly centred around visibility/invisibility, but I might take up that challenge if I could get a good idea of what it looked like. |
@larkost I'd start with the conditions that are provided by the existing support module, but taking a more Pythonic approach (I honestly haven't thought about this too much, so don't know what it would look like). I would focus on a consistent approach to naming, arguments, and return values. Good test coverage, and thorough documentation with plenty of examples. After taking a look at this patch, I'd b personally be okay with landing it as it's consistent with the existing conditions. I'll reopen, and add my review. |
|
||
def __call__(self, driver): | ||
try: | ||
return _element_if_visible(_find_element(driver, self.locator), False) | ||
target = self.target | ||
if not isinstance(self.locator, WebElement): |
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.
This is causing the tests to fail with AttributeError: 'invisibility_of_element' object has no attribute 'locator'
I made fixes, but at least some of the CI failures are not related. I am having trouble getting the tests to run locally, and am not sure if it is my setup, or something I am missing. |
Failures are not related to your change. You should be able to run tests if you follow the steps here: https://github.com/SeleniumHQ/selenium/wiki/Python-Bindings#development You can also run them with pytest outside of tox if you supply the |
ping @davehunt it looks like your review has been addressed |
Merged as 7842db3 |
X
in the preceding checkbox, I verify that I have signed the Contributor License AgreementThis adds a
invisibility_of_element
to compliment the existinginvisibility_of_element_located
ExpectedCondition. It also makes both methods use the same logic where either a locator or aWebElement
can be given to them to evaluate.If people are happy with this approach I am happy to follow up giving other similar pairs the same treatment. I also did not see the documentation in this repository, so don't know where to add that. Pointers in that direction would be appreciated.