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

Upgrade Selenium to 4.1.1 #2995

Merged
merged 5 commits into from
Mar 22, 2022
Merged

Upgrade Selenium to 4.1.1 #2995

merged 5 commits into from
Mar 22, 2022

Conversation

AutomatedTester
Copy link
Member

checkResponse was deprecated in Selenium and has been removed. This PR moves to the method that was suggested.

Thanks in advance for your contribution. Please follow the below steps in submitting a pull request, as it will help us with reviewing it quicker.

  • Create a new branch from master (e.g. features/my-new-feature or issue/123-my-bugfix);
  • If you're fixing a bug also create an issue if one doesn't exist yet;
  • If it's a new feature explain why do you think it's necessary. Please check with the maintainers beforehand to make sure it is something that we will accept. Usually we only accept new features if we feel that they will benefit the entire community;
  • Please avoid sending PRs which contain drastic or low level changes. If you are certain that the changes are needed, please discuss them beforehand and indicate what the impact will be;
  • If your change is based on existing functionality please consider refactoring first. Pull requests that duplicate code will most likely be ignored;
  • Do not include changes that are not related to the issue at hand;
  • Follow the same coding style with regards to spaces, semicolons, variable naming etc.;
  • Always add unit tests - PRs without tests are most of the times ignored.

@CLAassistant
Copy link

CLAassistant commented Jan 11, 2022

CLA assistant check
All committers have signed the CLA.

@AutomatedTester AutomatedTester marked this pull request as draft January 18, 2022 10:59
@vaibhavsingh97 vaibhavsingh97 linked an issue Jan 19, 2022 that may be closed by this pull request
@AutomatedTester AutomatedTester force-pushed the checkresponse_deprecation branch 3 times, most recently from 33be871 to 12e544d Compare January 26, 2022 10:09
@AutomatedTester AutomatedTester force-pushed the checkresponse_deprecation branch 2 times, most recently from 2207784 to 0e71955 Compare February 21, 2022 15:02
@AutomatedTester AutomatedTester marked this pull request as ready for review February 21, 2022 15:03
@AutomatedTester AutomatedTester changed the title Move to throwDecodedError as checkResponse deprecated Upgrade Selenium to 4.1.1 Feb 21, 2022
Copy link
Member

@beatfactor beatfactor left a comment

Choose a reason for hiding this comment

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

A few remarks. Due to the high volume of refactoring and style changes, this PR makes it very difficult to review.

Is it possible to leave out the changes to spaces?
Is it entirely necessary to use the w3c endpoints? in terms of tests, I don't think it makes any difference if we use jwp or w3c, but it makes it very difficult to review the actual meaningful changes.

lib/api/expect/cookie.js Show resolved Hide resolved
this.resultValue = result ? result.value : {};
if (result && result.value) {
if (Array.isArray(result.value)) {
this.resultValue = result.value[0].value;
Copy link
Member

Choose a reason for hiding this comment

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

If result.value is an empty array, this will throw an error.

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch!

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added a ternary here. Looking at the spec, the likelihood of it being empty for named cookies is low because it should error if it can't return anything.

I'm not sure how to add a test as it seems to kick the retry code in so any guidance would be appreciated.

@AutomatedTester
Copy link
Member Author

A few remarks. Due to the high volume of refactoring and style changes, this PR makes it very difficult to review.

I can revert these but most where put in when running npm run eslint -- --fix

Is it possible to leave out the changes to spaces? Is it entirely necessary to use the w3c endpoints? in terms of tests, I don't think it makes any difference if we use jwp or w3c, but it makes it very difficult to review the actual meaningful changes.

It makes a big difference. The Mocks are only looking for JWP but Selenium is no longer calling those so we were getting test failures. The necessary changes to get tests passing where done without changing the results of the tests.

@@ -233,7 +233,7 @@ mocks:
sessionId: *sessionId
status: 0

- url: '/wd/hub/session/1352110219202/log'
- url: '/wd/hub/session/1352110219202/se/log'
Copy link
Member

Choose a reason for hiding this comment

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

is this a valid endpoint?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, the /se/ is namespacing it purely for Selenium and showing that it is not in the standard.

@beatfactor beatfactor merged commit e64584e into main Mar 22, 2022
@beatfactor beatfactor deleted the checkresponse_deprecation branch March 22, 2022 21:05
gravityvi pushed a commit to gravityvi/nightwatch that referenced this pull request Mar 24, 2022
* Upgrade to Selenium 4.1.1

This handles the deprecations and updates to endpoints that selenium only supports now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

after you updated selenium webdriver, now everything is failing
5 participants