Skip to content
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

Revert "Revert "Update selenium-webdriver gem to 4.2.0"" #51960

Merged
merged 3 commits into from May 23, 2023

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented May 17, 2023

Reverts #51958, reapplying #51635. The original attempt consistently failed UI tests on iPhone and iPad when trying to interact with dropdowns, because we were trying to apply a desktop-Safari-specific workaround when executing in mobile Safari.

In Selenium 3, @browser.browser is :Safari on desktop Safari and :safari on mobile. In Selenium 4, it's :safari on both, so in addition to browser detection I explicitly inspect browser capabilities (as we do here) to determine whether or not to apply the workaround.

Testing Story

Verified locally that the tests pass with the new modifications; also ran with [test all browsers] and verified that the only tests which failed in that run did not fail during the actual DTT.

@Hamms Hamms marked this pull request as ready for review May 18, 2023 02:35
@Hamms Hamms requested review from snickell and a team May 18, 2023 02:35
@Hamms Hamms added the Ruby Update Everything related to work to update the version of Ruby our codebase runs on label May 18, 2023
Copy link
Contributor

@cat5inthecradle cat5inthecradle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing story looks good!

@@ -41,7 +41,7 @@ def create_response(code, body, content_type)
if (msg = exception.message.match(/unexpected response, code=(?<code>\d+).*\n(?<error>.*)/))
error = msg[:error]
error = JSON.parse(error)['value']['error'] rescue error
exception.message.replace("Error #{msg[:code]}: #{error}")
raise exception, "Error #{msg[:code]}: #{error}", exception.backtrace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely like this approach better than mutating the exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise! Shout out to @snickell, who actually came up with this before I copied it out of his WIP PR. I assume it was in response to the fact that the message string is now frozen internally by Selenium and throws an error when we try to modify it, but I agree that overall it's much cleaner this way. Also, I learned that you can pass the backtrace manually as an optional third argument to Kernel#raise!

Copy link
Contributor

@snickell snickell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Wish [test all browsers] passed on drone :-P, good workaround. For my future ref, here's the drone run for test all browsers: https://drone.cdn-code.org/code-dot-org/code-dot-org/29313/2/5

@Hamms Hamms merged commit a03a2ae into staging May 23, 2023
2 checks passed
@Hamms Hamms deleted the revert-51958-revert-51635-update-selenium branch May 23, 2023 23:32
@Hamms Hamms mentioned this pull request May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ruby Update Everything related to work to update the version of Ruby our codebase runs on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants