Skip to content

Commit

Permalink
Merge branch 'develop' into TR-667-remove-preprocessor-error-stack-tr…
Browse files Browse the repository at this point in the history
…uncation
  • Loading branch information
chrisbreiding authored Feb 24, 2021
2 parents 6638fb4 + c3af3dc commit 800c809
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 9 deletions.
4 changes: 4 additions & 0 deletions npm/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"peerDependencies": {
"@babel/core": "^=7.x",
"@babel/preset-env": "^=7.x",
"@cypress/webpack-dev-server": "*",
"@types/react": "^16.9.16 || ^17.0.0",
"babel-loader": "^=8.x",
"cypress": "*",
Expand Down Expand Up @@ -141,6 +142,9 @@
"@babel/preset-env": {
"optional": true
},
"@cypress/webpack-dev-server": {
"optional": true
},
"@types/react": {
"optional": true
},
Expand Down
8 changes: 7 additions & 1 deletion npm/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"watch": "tsc -w"
},
"dependencies": {
"@cypress/webpack-dev-server": "0.0.0-development",
"@vue/test-utils": "1.0.3",
"unfetch": "4.1.0"
},
Expand All @@ -21,6 +20,7 @@
"@babel/plugin-transform-modules-commonjs": "7.10.4",
"@babel/preset-env": "7.9.5",
"@cypress/code-coverage": "3.8.1",
"@cypress/webpack-dev-server": "0.0.0-development",
"@intlify/vue-i18n-loader": "1.0.0",
"@vue/cli-plugin-babel": "~4.4.0",
"@vue/cli-service": "~4.4.0",
Expand All @@ -45,6 +45,7 @@
"webpack": "4.42.0"
},
"peerDependencies": {
"@cypress/webpack-dev-server": "*",
"babel-loader": "8",
"cypress": ">=4.5.0",
"vue": "2.x"
Expand All @@ -68,6 +69,11 @@
"cypress",
"vue"
],
"peerDependenciesMeta": {
"@cypress/webpack-dev-server": {
"optional": true
}
},
"publishConfig": {
"access": "public",
"registry": "http://registry.npmjs.org/"
Expand Down
24 changes: 24 additions & 0 deletions packages/driver/cypress/fixtures/issue-8279.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<body>
<form tabindex="0">
<div style="height: 2000px"></div>
<div id="clickme">click me</div>
</form>
<script>
const button = document.getElementById('clickme')

let yPos
button.addEventListener('mousedown', e => {
yPos = e.currentTarget.getBoundingClientRect().y
})
button.addEventListener('click', (e) => {
let yPos2 = e.currentTarget.getBoundingClientRect().y

if (yPos !== yPos2) {
throw new Error('element was scrolled during mousedown')
}
})
</script>
</body>
</html>
12 changes: 12 additions & 0 deletions packages/driver/cypress/integration/dom/jquery_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,16 @@ describe('src/dom/jquery', () => {
})
})
})

// https://github.com/cypress-io/cypress/issues/14279
it('empty jQuery object is shown properly in "DOM required" error message', (done) => {
cy.on('fail', (err) => {
expect(err.message).to.include('jQuery{0}')

done()
})

cy.visit('fixtures/dom.html')
cy.noop(cy.$$('#should-not-exist')).scrollTo('250px', '250px')
})
})
7 changes: 7 additions & 0 deletions packages/driver/cypress/integration/issues/8279_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// https://github.com/cypress-io/cypress/issues/8279
describe('issue 8279', () => {
it('can click button inside large div with tabindex=0 without scrolling', () => {
cy.visit('/fixtures/issue-8279.html')
cy.get('#clickme').click()
})
})
4 changes: 2 additions & 2 deletions packages/driver/src/cy/focused.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const create = (state) => {
return el.dispatchEvent(focusoutEvt)
}

const fireFocus = (el) => {
const fireFocus = (el, opts) => {
// body will never emit focus events (unless it's contenteditable)
// so we avoid simulating this
if ($elements.isBody(el) && !$elements.isContentEditable(el)) {
Expand Down Expand Up @@ -112,7 +112,7 @@ const create = (state) => {

$elements.callNativeMethod(el, 'addEventListener', 'focus', onFocus)

$elements.callNativeMethod(el, 'focus')
$elements.callNativeMethod(el, 'focus', opts)

cleanup()

Expand Down
2 changes: 1 addition & 1 deletion packages/driver/src/cy/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ const create = (state, keyboard, focused, Cypress) => {
}
} else {
// the user clicked inside a focusable element
focused.fireFocus($elToFocus.get(0))
focused.fireFocus($elToFocus.get(0), { preventScroll: true })
}
}

Expand Down
6 changes: 6 additions & 0 deletions packages/driver/src/cypress/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const _ = require('lodash')
const capitalize = require('underscore.string/capitalize')
const methods = require('methods')
const moment = require('moment')
const $ = require('jquery')

const $jquery = require('../dom/jquery')
const $Location = require('./location')
Expand Down Expand Up @@ -182,6 +183,11 @@ module.exports = {
}

if (_.isObject(value)) {
// Cannot use $dom.isJquery here because it causes infinite recursion.
if (value instanceof $) {
return `jQuery{${value.length}}`
}

const len = _.keys(value).length

if (len > 2) {
Expand Down
2 changes: 1 addition & 1 deletion packages/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"minimist": "1.2.5"
},
"devDependencies": {
"electron": "11.2.3",
"electron": "11.3.0",
"execa": "4.1.0",
"mocha": "3.5.3"
},
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14174,10 +14174,10 @@ electron-to-chromium@^1.3.247, electron-to-chromium@^1.3.378, electron-to-chromi
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.636.tgz#6980bd90813a9fb744e43f5e848f16cea4930058"
integrity sha512-Adcvng33sd3gTjNIDNXGD1G4H6qCImIy2euUJAQHtLNplEKU5WEz5KRJxupRNIIT8sD5oFZLTKBWAf12Bsz24A==

electron@11.2.3:
version "11.2.3"
resolved "https://registry.yarnpkg.com/electron/-/electron-11.2.3.tgz#8ad1d9858436cfca0e2e5ea7fea326794ae58ebb"
integrity sha512-6yxOc42nDAptHKNlUG/vcOh2GI9x2fqp2nQbZO0/3sz2CrwsJkwR3i3oMN9XhVJaqI7GK1vSCJz0verOkWlXcQ==
electron@11.3.0:
version "11.3.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-11.3.0.tgz#87e8528fd23ae53b0eeb3a738f1fe0a3ad27c2db"
integrity sha512-MhdS0gok3wZBTscLBbYrOhLaQybCSAfkupazbK1dMP5c+84eVMxJE/QGohiWQkzs0tVFIJsAHyN19YKPbelNrQ==
dependencies:
"@electron/get" "^1.0.1"
"@types/node" "^12.0.12"
Expand Down

0 comments on commit 800c809

Please sign in to comment.