-
Notifications
You must be signed in to change notification settings - Fork 3.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
bump jquery to 3.1.1 #1229
bump jquery to 3.1.1 #1229
Conversation
jennifer-shehane
commented
Jan 25, 2018
- close Upgade jQuery dependency to 3.x #1215
Definitely going to need to reference the upgrade guide for this: https://jquery.com/upgrade-guide/3.0/ |
First issue: jQuery Example where via jQuery
|
Please update your branch to latest develop branch from upstream. I've tested all examples with JQuery 3.0.0 and only one test didn't pass: |
|
some tests are failing with undefined
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
You can recreate failing tests locally using for example
|
with jQuery 2 if an element is not found we have selector property which we use to form error message with jQuery 3 change we do not have this property (and we don't have context property) Tested the returned result using jquery v3 and v2 fiddle So we need to either change the jQuery behavior or "remember" the context and selector ourselves and just add them immediately after calling jQuery Looking at jQuery v3 migration guide https://jquery.com/upgrade-guide/3.0/:
|
jQuery v3 has removed the selector property from the returned element, this commit adds it back, making sure the error messages thrown include the selector string. See [jQuery v3 upgrade](https://jquery.com/upgrade-guide/3.0/#breaking-change-deprecated-context-and-selector-properties-removed)
Next missing test:
Seems v3 always runs in strict mode https://jquery.com/upgrade-guide/3.0/#breaking-change-jquery-3-0-runs-in-strict-mode, which throws when trying to set attribute on the primitive type // elem = 1
// name = 'data-cypress-el'
return ( elem[ name ] = value ) 'use strict'
1['foo'] = 2
console.log('ended')
// silently runs just fine without "use strict" But with "use strict" fails
|
Snapshots CSS test failing because
Changing to the recommended solution |
Since snapshot test remains - the screenshot height is different from the snapshot value. See https://circleci.com/gh/cypress-io/cypress/150034 |
|
||
iframesSizeNode.style.width = `${Math.min($window.width(), $iframesSizeNode.width())}px` | ||
iframesSizeNode.style.height = `${Math.min($window.height(), $iframesSizeNode.height())}px` | ||
iframesSizeNode.style.width = `${Math.min(window.innerWidth, iframesSizeNode.offsetWidth)}px` |
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.
jQuery 3 changes how it does width and height calculations (it now uses getBoundingClientRect
), which takes into account the scaling. We want the absolute value without scaling, so we're better off directly using the DOM properties.
@chrisbreiding I'm in favor of bumping it back down to 3.0.0 and pushing that out. |
jQuery 3 changed how it does width and height calculations (it now uses getBoundingClientRect), which takes into account the scaling and returns non-integers. We want the absolute integer value without scaling, so we're better off directly using the DOM properties.
This reverts commit 91fdbde.
Was able to get 3.1.1 passing. |
Good team effort. Almost 2 years coming. @chrisbreiding I guess open a new PR for jQuery latest. Merging this one in. |
Yes! 🙌 Is a release imminent? |
* bump jquery to 3.0 * add selector property to the element returned by jQuery query jQuery v3 has removed the selector property from the returned element, this commit adds it back, making sure the error messages thrown include the selector string. See [jQuery v3 upgrade](https://jquery.com/upgrade-guide/3.0/#breaking-change-deprecated-context-and-selector-properties-removed) * do not try setting highlight attribute on non-elements * use jquery v3 on load callback * another instance of jquery load * better element check before setting an attribute * use dom APIs instead of jQuery when unscaling AUT for screenshot * bump jquery to 3.4.1 * replace instances of $.fn.width/height with respective dom APIs jQuery 3 changed how it does width and height calculations (it now uses getBoundingClientRect), which takes into account the scaling and returns non-integers. We want the absolute integer value without scaling, so we're better off directly using the DOM properties. * try should instead of then * Revert "try should instead of then" This reverts commit 91fdbde. * try getting rid of borders * try jquery 3.3.1 * try jquery 3.2.1 * try jquery 3.1.1