Skip to content

Commit

Permalink
Merge branch 'develop' into rename-blacklisthosts
Browse files Browse the repository at this point in the history
# Conflicts:
#
packages/server/test/support/fixtures/projects/e2e/cypress/integration/r
equest_spec.coffee
  • Loading branch information
brian-mann committed Jul 11, 2020
2 parents d7af362 + c72538d commit f098cd8
Show file tree
Hide file tree
Showing 91 changed files with 3,592 additions and 2,210 deletions.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -40,5 +40,5 @@ Delete tasks if they are not applicable.
- [ ] Have tests been added/updated?
- [ ] Has the original issue been tagged with a release in ZenHub? <!-- (internal team only)-->
- [ ] Has a PR for user-facing changes been opened in [`cypress-documentation`](https://github.com/cypress-io/cypress-documentation)? <!-- Link to PR here -->
- [ ] Have API changes been updated in the [`type definitions`](../cli/types/cypress.d.ts)?
- [ ] Have new configuration options been added to the [`cypress.schema.json`](../cli/schema/cypress.schema.json)?
- [ ] Have API changes been updated in the [`type definitions`](https://github.com/cypress-io/cypress/blob/develop/cli/types/cypress.d.ts)?
- [ ] Have new configuration options been added to the [`cypress.schema.json`](https://github.com/cypress-io/cypress/blob/develop/cli/schema/cypress.schema.json)?
2 changes: 1 addition & 1 deletion cli/package.json
Expand Up @@ -44,7 +44,7 @@
"is-installed-globally": "0.3.2",
"lazy-ass": "1.6.0",
"listr": "0.14.3",
"lodash": "4.17.15",
"lodash": "4.17.19",
"log-symbols": "4.0.0",
"minimist": "1.2.5",
"moment": "2.26.0",
Expand Down
10 changes: 5 additions & 5 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "cypress",
"version": "4.9.0",
"version": "4.10.0",
"description": "Cypress.io end to end testing tool",
"private": true,
"scripts": {
Expand Down Expand Up @@ -95,11 +95,11 @@
"@types/lodash": "4.14.149",
"@types/markdown-it": "0.0.9",
"@types/mini-css-extract-plugin": "0.8.0",
"@types/node": "12.12.21",
"@types/node": "12.12.50",
"@types/prismjs": "1.16.0",
"@types/ramda": "0.25.47",
"@types/react": "16.9.35",
"@types/react-dom": "16.9.4",
"@types/react": "16.9.42",
"@types/react-dom": "16.9.8",
"@types/request-promise": "4.1.45",
"@types/sinon-chai": "3.2.3",
"@typescript-eslint/eslint-plugin": "2.14.0",
Expand Down Expand Up @@ -155,7 +155,7 @@
"lerna": "3.20.2",
"lint-staged": "9.4.1",
"listr": "0.14.3",
"lodash": "4.17.15",
"lodash": "4.17.19",
"make-empty-github-commit": "1.2.0",
"mocha": "3.5.3",
"mocha-banner": "1.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-gui/package.json
Expand Up @@ -30,7 +30,7 @@
"fira": "cypress-io/fira#fb63362742eea8cdce0d90825ab9264d77719e3d",
"gravatar": "1.8.0",
"human-interval": "0.1.6",
"lodash": "4.17.15",
"lodash": "4.17.19",
"markdown-it": "8.4.2",
"mobx": "5.15.4",
"mobx-react": "6.1.8",
Expand Down
19 changes: 19 additions & 0 deletions packages/driver/cypress/fixtures/global_parent_definition.html
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>

<head>
<title>Global Parent Fixture</title>
</head>

<body>
<span class="foo">Foo</span>
</body>
<script>
// This is defined to create a global parent which
// can cause issues when calling win.parent later
// since the win.parent is now this element
// https://github.com/cypress-io/cypress/issues/6412
var parent = document.querySelector(".foo")
</script>

</html>
30 changes: 30 additions & 0 deletions packages/driver/cypress/fixtures/issue-7794.html
@@ -0,0 +1,30 @@
<html>
<head>
<style>
.full {
bottom: 0;
left: 0;
right: 0;
top: 0;
}
.container-1 {
position: fixed;
}
.container-2,
.host {
position: absolute;
}
</style>
</head>
<body>
<div class="container-1 full">
<div class="container-2 full">
<div class="host full"></div>
</div>
</div>

<script>
document.querySelector('.host').attachShadow({ mode: 'open' })
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion packages/driver/cypress/fixtures/shadow-dom.html
Expand Up @@ -31,7 +31,7 @@
const content = this.getAttribute('content')
const className = this.hasAttribute('innerClass') ? this.getAttribute('innerClass') : 'shadow-content'

root.innerHTML = `<p class="${className}">${content}</p><slot></slot>`
root.innerHTML = `<p class="${className}">${content}</p><input /><slot></slot>`
}
})
}
Expand Down
Expand Up @@ -4456,6 +4456,8 @@ describe('mouse state', () => {

expect(targetRect.top).gt(iframeRect.top)
expect(targetRect.bottom).lt(iframeRect.bottom)
expect(targetRect.left).gt(iframeRect.left)
expect(targetRect.right).lt(iframeRect.right)
})
})
})
Expand Down
Expand Up @@ -13,7 +13,8 @@ const {

const expectTextEndsWith = (expected) => {
return ($el) => {
const text = $el.text().trim()
// only want to compare the body text, not text in <script> tag
const text = $el[0].innerText.trim()

const passed = text.endsWith(expected)

Expand Down Expand Up @@ -3066,4 +3067,18 @@ describe('src/cy/commands/actions/type - #type', () => {
})
})
})

describe('shadow dom', () => {
beforeEach(() => {
cy.visit('/fixtures/shadow-dom.html')
})

// https://github.com/cypress-io/cypress/issues/7741
it('types into input', () => {
cy
.get('#shadow-element-1')
.find('input', { includeShadowDom: true })
.type('foo')
})
})
})
20 changes: 9 additions & 11 deletions packages/driver/cypress/integration/commands/querying_spec.js
Expand Up @@ -502,20 +502,18 @@ describe('src/cy/commands/querying', () => {
})

describe('.log', () => {
beforeEach(() => {
beforeEach(function () {
this.logs = []

cy.on('log:added', (attrs, log) => {
if (attrs.name === 'root') {
this.lastLog = log
beforeEach(function () {
this.logs = []

this.logs.push(log)
}
})
cy.on('log:added', (attrs, log) => {
if (attrs.name === 'root') {
this.lastLog = log

return null
this.logs.push(log)
}
})

return null
})

it('can turn off logging', () => {
Expand Down
28 changes: 10 additions & 18 deletions packages/driver/cypress/integration/commands/traversals_spec.js
Expand Up @@ -371,10 +371,9 @@ describe('src/cy/commands/traversals', () => {
describe('find', () => {
it('retrieves a matching element beyond shadow boundaries', () => {
const el = cy.$$('#shadow-element-3')[0].shadowRoot.querySelector('p')
const parent = cy.$$('#parent-of-shadow-container-0')

cy
.get(parent)
.get('#parent-of-shadow-container-0')
.find('p', { includeShadowDom: true })
.then(($element) => {
expect($element.length).to.eq(1)
Expand All @@ -384,10 +383,9 @@ describe('src/cy/commands/traversals', () => {

it('retrieves a matching element when no shadow roots', () => {
const el = cy.$$('#shadow-element-3')[0]
const parent = cy.$$('#parent-of-shadow-container-0')

cy
.get(parent)
.get('#parent-of-shadow-container-0')
.find('#shadow-element-3', { includeShadowDom: true })
.then(($element) => {
expect($element.length).to.eq(1)
Expand All @@ -396,11 +394,11 @@ describe('src/cy/commands/traversals', () => {
})

it('allows traversal when already within a shadow root', () => {
const parent = cy.$$('#shadow-element-3')[0].shadowRoot
const el = cy.$$('#shadow-element-3')[0].shadowRoot.querySelector('p')

cy
.get(parent)
.get('#shadow-element-3')
.shadow()
.find('p')
.then(($element) => {
expect($element.length).to.eq(1)
Expand All @@ -417,10 +415,9 @@ describe('src/cy/commands/traversals', () => {

describe('closest', () => {
it('retrieves the closest element beyond shadow boundaries', () => {
const el = cy.$$('#shadow-element-3')[0].shadowRoot.querySelector('p')

cy
.get(el)
.get('#shadow-element-3')
.find('p', { includeShadowDom: true })
.closest('#parent-of-shadow-container-0')
.then(($parent) => {
expect($parent.length).to.eq(1)
Expand All @@ -429,10 +426,8 @@ describe('src/cy/commands/traversals', () => {
})

it('retrieves closest elements normally when no shadow roots', () => {
const el = cy.$$('#shadow-element-3')

cy
.get(el)
.get('#shadow-element-3')
.closest('#parent-of-shadow-container-0')
.then(($parent) => {
expect($parent.length).to.eq(1)
Expand All @@ -443,10 +438,9 @@ describe('src/cy/commands/traversals', () => {

describe('parents', () => {
it('retrieves all parents, including those beyond shadow boundaries', () => {
const el = cy.$$('#shadow-element-3')[0].shadowRoot.querySelector('p')

cy
.get(el)
.get('#shadow-element-3')
.find('p', { includeShadowDom: true })
.parents()
.then(($parents) => {
expect($parents.length).to.eq(5)
Expand All @@ -459,10 +453,8 @@ describe('src/cy/commands/traversals', () => {
})

it('retrieves parents normally when no shadow roots exist', () => {
const el = cy.$$('#shadow-element-3')

cy
.get(el)
.get('#shadow-element-3')
.parents()
.then(($parents) => {
expect($parents.length).to.eq(4)
Expand Down
10 changes: 0 additions & 10 deletions packages/driver/cypress/integration/cypress/runner_spec.js
Expand Up @@ -11,16 +11,6 @@ Cypress.on('test:after:run', (test) => {
})

describe('src/cypress/runner', () => {
it('handles "double quotes" in test name', (done) => {
cy.once('log:added', (log) => {
expect(log.hookName).to.equal('test')

return done()
})

return cy.wrap({})
})

context('pending tests', () => {
it('is not pending', () => {})

Expand Down

0 comments on commit f098cd8

Please sign in to comment.