Bug 1308322: Upgrade to selenium 3.x#4195
Conversation
b52e5aa to
31f670e
Compare
Codecov Report
@@ Coverage Diff @@
## master #4195 +/- ##
=========================================
Coverage ? 95.14%
=========================================
Files ? 262
Lines ? 23169
Branches ? 1674
=========================================
Hits ? 22043
Misses ? 907
Partials ? 219Continue to review full report at Codecov.
|
|
I got the same results in Jenkins that I did locally: Bedrock appears to be using Selenium 3 - I'll see if there are configuration changes needed for our environment. |
|
I am wrong. There is an PR for updating to Selenium 3 (mozilla/bedrock#4472) but it isn't merged, and appears stale. I'll try to get this to a test case for an upstream issue. |
|
@jwhitlock Selenium Python client 3.4.1 was released today, which should solve your issue. https://pypi.python.org/pypi/selenium/3.4.1 |
|
Still fails with selenium 3.4.1. |
|
Opened SeleniumHQ/selenium#3927 |
b4deb93 to
f44d9de
Compare
7fa8701 to
eb7bb19
Compare
|
The upstream bug is marked as fixed, but is not integrated in a new release, so we're still blocked. I'm watching the hub and node-firefox Docker images, and will test with the next release. |
53e8931 to
46e2288
Compare
|
There's a new release, and I've upgraded the packages and docker images. However, it is still not working. It appears there is a problem with settings |
c1fd4c0 to
acccb39
Compare
|
Selenium team believes the issue is fixed in master, waiting for Selenium 3.5 release to test again. |
acccb39 to
60e9602
Compare
60e9602 to
2920fbd
Compare
|
Selenium 3.5 is released, with a new Python selenium library and pytest plugin. The tracking issue SeleniumHQ/selenium#3808 is closed. However, there are no 3.5.x images for hub or node-firefox yet. I've rebased and installed today's libraries, and the tests immediately fail in Full output in https://gist.github.com/jwhitlock/167dc3ed2d0f8f654a9fe3f05cc4c924. |
2920fbd to
d384417
Compare
|
New 3.5.0 images are released for hub or node-firefox. I've rebased on master and updated the script to use the new tags. I'm also preparing the script to be used in the future, because I think it will be useful. The nodes no longer fail with an exception, but instead run the tests. Progress! Unfortunately, our functional tests are broken (bug 1394480), so I can't see if they pass yet. Working on that next. |
d384417 to
0c9cbb5
Compare
0c9cbb5 to
9105040
Compare
|
Sorry, I'm having trouble getting that branch installed in my Docker image. Here's the current state: With pytest-dev/pytest-selenium#137
With pytest-selenium 1.11.1 (current release):
I think the differences are due to server weather rather than pytest-dev/pytest-selenium#136. With
In Jenkins (just Firefox): 30 pass, same 6 failed tests as I'm considering:
|
|
@jwhitlock pytest-selenium 1.11.2 is available now, which should help with the "Unable to find a matching set of capabilities" issue. |
|
The problem went away with me with Selenium 3.7.1 Docker images. I've updated to pytest-selenium 1.11.2, and I'm having some trouble with Chrome in Jenkins. It may just be server weather, or maybe I need to adjust those tests. There's lots of moving parts, and none of them are particularly reliable. |
d524c5d to
a08f4ff
Compare
a08f4ff to
f799f89
Compare
|
First bit of progress in a while. I updated to the 3.8.1 Docker images, and had the same results as 3.7.1. I tried some interactive testing in pdb, and the This was the hover code: hover = ActionChains(self.selenium).move_to_element(submenu_trigger)
hover.perform()If I first move the mouse to just left of the submenu, and then onto the submenu, I can get the hover action to occur: hover = (ActionChains(self.selenium)
.move_to_element_with_offset(submenu_trigger, -5, 0)
.move_to_element(submenu_trigger))
hover.perform()My guess is that, for the remote Firefox, there's no current mouse position. The first move teleports the cursor to the element, and doesn't give the browser a chance to register it as a hover. Moving to a outside point, and then onto the element, allows Firefox to register the element getting focus and activates the hover. This trick isn't needed when running against Chrome or local Firefox, just when running against dockerized Firefox with the Remote driver. I'll continue tomorrow and see if I can get the remaining tests working locally with similar tricks, and then take next steps toward working in Jenkins and a mergeable PR. |
dbc79eb to
c38f858
Compare
|
I've gotten the integration tests running successfully with Selenium Grid (hub + chrome node + firefox node). I've opened a few PRs:
I'll rebase when / if those are merged, and clean up. That would leave:
I think I will try to get the scripts into a seperate PR as well, so that this becomes just the tool update. |
c4482e4 to
ad4bd52
Compare
|
I merged the two scripts I rearranged this PR to build on top of the other PRs. I'll wait for those to be merged, and then I should be able to reduce this to a one-commit PR. |
ad4bd52 to
ea9ecb6
Compare
ea9ecb6 to
f16354b
Compare
If combined into one test, it fails on Selenium 3.8 and Firefox 57. If broken up into multiple tests, it passes.
* selenium 2.53.6 → 3.8.1: Support for GeckoDriver 0.15.0+, Firefox 52+, headless. Many fixes. * pytest-base-url 1.1.0 → 1.4.1: specify by env, add to metadata * pytest-html 1.10.1 → 1.16.1: add metadata to report * pytest-selenium 1.4.0 → 1.11.4: Move cloud testing credentials from default config files to new files or environment. Re-write Firefox options method. Work with metadata. Work with W3C capabilities, and don't send Firefox profile by default. * pytest-metadata 1.5.1: New dependency of pytest-selenium * pytest-variables 1.4 → 1.7.1: Make vars available in config Use 3.8.1 docker images
f16354b to
2acee52
Compare
|
This pull request is ready! 🎉 The functional test There's an extra commit to allow the tests to run in Jenkins, and if I remove it, it will delete the test run in Jenkins. I can remove the commit before merging, or I can delete |
escattone
left a comment
There was a problem hiding this comment.
Wow, I feel like this deserves fanfare! 🎉 Thanks so much @jwhitlock! You get a 🥇 and a 🍭
Builds on py.test updates in #4210 with Selenium updates:
Django tests and coverage worked for me. I was able to run the functional tests locally with Chrome and Firefox. I tried running the Selenium hub and remote locally, but wasn't able to get it working (
KeyError: 'moz:firefoxOptions'issue), and Jenkins has the same issue.Update Sep 19, 2017: The tests now run, and pass in Chrome, but they fail when run with
node-firefox(timeouts) and when run locally (2 tests that open new URLS, maybe in a tab)Update Oct 6, 2017: Selenium 3.6.0. The tests pass locally in Chrome and Firefox. They pass with
node-chrome, but now do not run withnode-firefox.Update Nov 7, 2017: Selenium 3.7.1. The tests pass in Chrome (with one flaky test for a recently changed feature), and 5 test failures in Firefox.
Update Dec 6, 2017: Selenium 3.8.1. The tests pass in Chrome and local Firefox. I've found a way to make hover tests pass in Remote, and might be able to fix the failures.
Update Jan 16, 2017: Selenium 3.8.1-erbium. After breaking up
test-dashboard, tests pass in Chrome and Firefox. There are selectivexfailsfor Firefox breakage around hover tests. The base functionality has been merged in other PRs, now we're down to just the Selenium 3.x update.