mirror of
https://github.com/cypress-io/cypress.git
synced 2026-03-13 12:59:07 -05:00
chore: rename multi-domain to origin paradigm (#21231)
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<div>
|
||||
Go to different origin:
|
||||
<a data-cy="cross-origin-secondary-link"
|
||||
href="http://www.foobar.com:3500/fixtures/multi-domain-secondary.html">http://www.foobar.com:3500/fixtures/multi-domain-secondary.html</a>
|
||||
href="http://www.foobar.com:3500/fixtures/secondary-origin.html">http://www.foobar.com:3500/fixtures/secondary-origin.html</a>
|
||||
<a data-cy="dom-link" href="http://www.foobar.com:3500/fixtures/dom.html">http://www.foobar.com:3500/fixtures/dom.html</a>
|
||||
<a data-cy="scrolling-link" href="http://www.foobar.com:3500/fixtures/scrolling.html">http://www.foobar.com:3500/fixtures/scrolling.html</a>
|
||||
<a data-cy="request-link" href="http://www.foobar.com:3500/fixtures/request.html">http://www.foobar.com:3500/fixtures/request.html</a>
|
||||
@@ -14,7 +14,7 @@
|
||||
<button data-cy="reload">reload</button>
|
||||
<a data-cy="hashChange" href='#hashChange'>hashChange</a>
|
||||
<a data-cy="cross-origin-page"
|
||||
href="/fixtures/multi-domain.html">/fixtures/multi-domain.html</a>
|
||||
href="/fixtures/primary-origin.html">/fixtures/primary-origin.html</a>
|
||||
|
||||
<script>
|
||||
if (window.Cypress) {
|
||||
@@ -2158,7 +2158,7 @@ describe('src/cy/commands/navigation', () => {
|
||||
expect(err.message).to.equal(stripIndent`\
|
||||
Timed out after waiting \`3000ms\` for your remote page to load on origin(s):\n
|
||||
- \`http://localhost:3500\`\n
|
||||
A cross-origin request for \`http://www.foobar.com:3500/fixtures/multi-domain-secondary.html\` was detected.\n
|
||||
A cross-origin request for \`http://www.foobar.com:3500/fixtures/secondary-origin.html\` was detected.\n
|
||||
A command that triggers cross-origin navigation must be immediately followed by a \`cy.origin()\` command:\n
|
||||
\`cy.origin(\'http://foobar.com:3500\', () => {\`
|
||||
\` <commands targeting http://www.foobar.com:3500 go here>\`
|
||||
@@ -2192,7 +2192,7 @@ describe('src/cy/commands/navigation', () => {
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin actions', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
})
|
||||
|
||||
it('.type()', () => {
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin aliasing', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin assertions', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin connectors', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin cookies', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin files', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin local storage', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin location', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@ context('cy.origin location', () => {
|
||||
it('.location()', () => {
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.location().should((location) => {
|
||||
expect(location.href).to.equal('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
expect(location.href).to.equal('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
expect(location.origin).to.equal('http://www.foobar.com:3500')
|
||||
})
|
||||
})
|
||||
@@ -23,7 +23,7 @@ context('cy.origin location', () => {
|
||||
|
||||
it('.url()', () => {
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.url().should('equal', 'http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.url().should('equal', 'http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -86,7 +86,7 @@ context('cy.origin location', () => {
|
||||
|
||||
expect(consoleProps.Command).to.equal('url')
|
||||
|
||||
expect(consoleProps.Yielded).to.equal('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
expect(consoleProps.Yielded).to.equal('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -11,7 +11,7 @@ context('cy.origin log', () => {
|
||||
logs.push(log)
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin misc', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
})
|
||||
|
||||
@@ -3,14 +3,14 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin navigation', () => {
|
||||
it('.go()', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/dom.html')
|
||||
|
||||
cy.go('back')
|
||||
cy.location('pathname').should('include', 'multi-domain-secondary.html')
|
||||
cy.location('pathname').should('include', 'secondary-origin.html')
|
||||
|
||||
cy.go('forward')
|
||||
cy.location('pathname').should('include', 'dom.html')
|
||||
@@ -18,7 +18,7 @@ context('cy.origin navigation', () => {
|
||||
})
|
||||
|
||||
it('.reload()', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -38,7 +38,7 @@ context('cy.origin navigation', () => {
|
||||
cy.on('window:before:load', primaryCyBeforeLoadSpy)
|
||||
cy.on('window:load', primaryCyLoadSpy)
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html', {
|
||||
cy.visit('/fixtures/primary-origin.html', {
|
||||
onBeforeLoad: primaryVisitBeforeLoadSpy,
|
||||
onLoad: primaryVisitLoadSpy,
|
||||
}).then(() => {
|
||||
@@ -75,10 +75,10 @@ context('cy.origin navigation', () => {
|
||||
})
|
||||
|
||||
it('supports visiting primary first', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
|
||||
cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary origin')
|
||||
})
|
||||
@@ -86,7 +86,7 @@ context('cy.origin navigation', () => {
|
||||
|
||||
it('supports skipping visiting primary first', () => {
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
|
||||
cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary origin')
|
||||
})
|
||||
@@ -94,10 +94,10 @@ context('cy.origin navigation', () => {
|
||||
|
||||
// TODO: we don't support nested cy.origin yet...
|
||||
it.skip('supports nesting a third origin', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
|
||||
cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary origin')
|
||||
|
||||
@@ -108,7 +108,7 @@ context('cy.origin navigation', () => {
|
||||
})
|
||||
|
||||
it('supports navigating to secondary through button and then visiting', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
@@ -149,12 +149,12 @@ context('cy.origin navigation', () => {
|
||||
})
|
||||
|
||||
it('supports hash change within secondary', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html#hashchange')
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html#hashchange')
|
||||
|
||||
cy.location('hash').should('equal', '#hashchange')
|
||||
})
|
||||
@@ -162,14 +162,14 @@ context('cy.origin navigation', () => {
|
||||
|
||||
it('navigates back to primary', () => {
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary origin')
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').should('have.text', 'http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.location('href').should('equal', 'http://localhost:3500/fixtures/multi-domain.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').should('have.text', 'http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
cy.location('href').should('equal', 'http://localhost:3500/fixtures/primary-origin.html')
|
||||
})
|
||||
|
||||
it('errors when visiting a new origin within origin', (done) => {
|
||||
@@ -178,7 +178,7 @@ context('cy.origin navigation', () => {
|
||||
\`cy.visit()\` failed because you are attempting to visit a URL that is of a different origin.\n
|
||||
You likely forgot to use \`cy.origin()\`:\n
|
||||
\`cy.origin('http://foobar.com:3500', () => {\`
|
||||
\` cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')\`
|
||||
\` cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html')\`
|
||||
\` <commands targeting http://www.foobar.com:3500 go here>\`
|
||||
\`})\`\n
|
||||
\`cy.origin('http://idp.com:3500', () => {\`
|
||||
@@ -196,7 +196,7 @@ context('cy.origin navigation', () => {
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -211,7 +211,7 @@ context('cy.origin navigation', () => {
|
||||
expect(e.message).to.equal(stripIndent`\
|
||||
\`cy.visit()\` failed because you are attempting to visit a URL that is of a different origin.\n
|
||||
In order to visit a different origin, you can enable the \`experimentalSessionAndOrigin\` flag and use \`cy.origin()\`:\n
|
||||
\`cy.visit('http://localhost:3500/fixtures/multi-domain.html')\`
|
||||
\`cy.visit('http://localhost:3500/fixtures/primary-origin.html')\`
|
||||
\`<commands targeting http://localhost:3500 go here>\`\n
|
||||
\`cy.origin('http://foobar.com:3500', () => {\`
|
||||
\` cy.visit('http://www.foobar.com:3500/fixtures/dom.html')\`
|
||||
@@ -228,17 +228,17 @@ context('cy.origin navigation', () => {
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
// this call should error since we can't visit a cross-origin
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/dom.html')
|
||||
})
|
||||
|
||||
it('supports the query string option', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html', { qs: { foo: 'bar' } })
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html', { qs: { foo: 'bar' } })
|
||||
|
||||
cy.location('search').should('equal', '?foo=bar')
|
||||
})
|
||||
@@ -264,10 +264,10 @@ context('cy.origin navigation', () => {
|
||||
// manually remove the spec bridge iframe to ensure Cypress.state('window') is not already set
|
||||
window.top?.document.getElementById('Spec\ Bridge:\ foobar.com')?.remove()
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
|
||||
cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary origin')
|
||||
})
|
||||
@@ -276,17 +276,17 @@ context('cy.origin navigation', () => {
|
||||
it('succeeds when the secondary is already defined but the AUT is still on the primary', () => {
|
||||
// setup the secondary to be on the secondary origin
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
|
||||
cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary origin')
|
||||
})
|
||||
|
||||
// update the AUT to be on the primary origin
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
// verify there aren't any issues when the AUT is on primary but the spec bridge is on secondary (cross-origin)
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
|
||||
cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary origin')
|
||||
})
|
||||
@@ -302,9 +302,9 @@ context('cy.origin navigation', () => {
|
||||
|
||||
cy.on('window:load', secondaryCyLoadSpy)
|
||||
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html').then(() => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html').then(() => {
|
||||
expect(secondaryCyLoadSpy).to.have.been.calledOnce
|
||||
expect(secondaryCyLoadSpy.args[0][0].location.href).to.equal('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
expect(secondaryCyLoadSpy.args[0][0].location.href).to.equal('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -314,16 +314,16 @@ context('cy.origin navigation', () => {
|
||||
})
|
||||
|
||||
it('supports redirecting from primary to secondary in cy.origin', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.origin('http://www.foobar.com:3500', () => {
|
||||
cy.visit('http://localhost:3500/redirect?href=http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.visit('http://localhost:3500/redirect?href=http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary origin')
|
||||
})
|
||||
})
|
||||
|
||||
it('supports redirecting from secondary to primary outside of cy.origin', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.visit('http://www.foobar.com:3500/redirect?href=http://localhost:3500/fixtures/generic.html')
|
||||
})
|
||||
|
||||
@@ -341,7 +341,7 @@ context('cy.origin navigation', () => {
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('http://localhost:3500/fixtures/multi-domain.html')
|
||||
cy.visit('http://localhost:3500/fixtures/primary-origin.html')
|
||||
|
||||
cy.origin('http://www.foobar.com:3500', () => {
|
||||
cy.visit('/redirect?href=http://localhost:3500/fixtures/generic.html')
|
||||
@@ -362,7 +362,7 @@ context('cy.origin navigation', () => {
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('http://localhost:3500/fixtures/multi-domain.html')
|
||||
cy.visit('http://localhost:3500/fixtures/primary-origin.html')
|
||||
|
||||
cy.origin('http://www.foobar.com:3500', () => {
|
||||
cy.visit('http://localhost:3500/fixtures/generic.html')
|
||||
@@ -374,7 +374,7 @@ context('cy.origin navigation', () => {
|
||||
expect(e.message).to.equal(stripIndent`\
|
||||
\`cy.visit()\` failed because you are attempting to visit a URL that is of a different origin.\n
|
||||
You likely forgot to use \`cy.origin()\`:\n
|
||||
\`cy.visit('http://localhost:3500/fixtures/multi-domain.html')\`
|
||||
\`cy.visit('http://localhost:3500/fixtures/primary-origin.html')\`
|
||||
\`<commands targeting http://localhost:3500 go here>\`\n
|
||||
\`cy.origin('http://foobar.com:3500', () => {\`
|
||||
\` cy.visit('http://localhost:3500/redirect?href=http://www.foobar.com:3500/fixtures/generic.html')\`
|
||||
@@ -391,7 +391,7 @@ context('cy.origin navigation', () => {
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.visit('http://localhost:3500/redirect?href=http://www.foobar.com:3500/fixtures/generic.html')
|
||||
})
|
||||
|
||||
@@ -415,7 +415,7 @@ context('cy.origin navigation', () => {
|
||||
|
||||
// attaches the auth options for the foobar origin even from another origin
|
||||
cy.origin('http://www.idp.com:3500', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.window().then((win) => {
|
||||
win.location.href = 'http://www.foobar.com:3500/basic_auth'
|
||||
@@ -426,7 +426,7 @@ context('cy.origin navigation', () => {
|
||||
cy.get('body').should('have.text', 'basic auth worked')
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
// attaches the auth options for the foobar origin from the top-level
|
||||
cy.window().then((win) => {
|
||||
@@ -449,7 +449,7 @@ context('cy.origin navigation', () => {
|
||||
})
|
||||
|
||||
cy.window().then((win) => {
|
||||
win.location.href = 'http://www.foobar.com:3500/fixtures/multi-domain.html'
|
||||
win.location.href = 'http://www.foobar.com:3500/fixtures/primary-origin.html'
|
||||
})
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -460,33 +460,33 @@ context('cy.origin navigation', () => {
|
||||
})
|
||||
|
||||
it('succeeds when visiting local file server first', { baseUrl: undefined }, () => {
|
||||
cy.visit('cypress/fixtures/multi-domain.html')
|
||||
cy.visit('cypress/fixtures/primary-origin.html')
|
||||
|
||||
cy.origin('http://www.foobar.com:3500', () => {
|
||||
cy.visit('/fixtures/multi-domain-secondary.html')
|
||||
cy.visit('/fixtures/secondary-origin.html')
|
||||
cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary origin')
|
||||
})
|
||||
})
|
||||
|
||||
it('handles visit failures', { baseUrl: undefined }, (done) => {
|
||||
cy.on('fail', (e) => {
|
||||
expect(e.message).to.include('failed trying to load:\n\nhttp://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
expect(e.message).to.include('failed trying to load:\n\nhttp://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
expect(e.message).to.include('500: Internal Server Error')
|
||||
|
||||
done()
|
||||
})
|
||||
|
||||
cy.intercept('*/multi-domain-secondary.html', { statusCode: 500 })
|
||||
cy.intercept('*/secondary-origin.html', { statusCode: 500 })
|
||||
|
||||
cy.visit('cypress/fixtures/multi-domain.html')
|
||||
cy.visit('cypress/fixtures/primary-origin.html')
|
||||
cy.origin('http://www.foobar.com:3500', () => {
|
||||
cy.visit('fixtures/multi-domain-secondary.html')
|
||||
cy.visit('fixtures/secondary-origin.html')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('supports navigating through changing the window.location.href', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -510,7 +510,7 @@ context('cy.origin navigation', () => {
|
||||
})
|
||||
|
||||
it('.go()', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -531,7 +531,7 @@ context('cy.origin navigation', () => {
|
||||
})
|
||||
|
||||
it('.reload()', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -550,10 +550,10 @@ context('cy.origin navigation', () => {
|
||||
})
|
||||
|
||||
it('visit()', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.visit('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
|
||||
cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary origin')
|
||||
})
|
||||
@@ -562,12 +562,12 @@ context('cy.origin navigation', () => {
|
||||
const { consoleProps, ...attrs } = findCrossOriginLogs('visit', logs, 'foobar.com')
|
||||
|
||||
expect(attrs.name).to.equal('visit')
|
||||
expect(attrs.message).to.equal('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
expect(attrs.message).to.equal('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
|
||||
expect(consoleProps.Command).to.equal('visit')
|
||||
expect(consoleProps).to.have.property('Cookies Set').that.is.an('object')
|
||||
expect(consoleProps).to.have.property('Redirects').that.is.an('object')
|
||||
expect(consoleProps).to.have.property('Resolved Url').that.equals('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
expect(consoleProps).to.have.property('Resolved Url').that.equals('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin network requests', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="request-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin querying', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin shadow dom', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="shadow-dom-link"]').click()
|
||||
})
|
||||
|
||||
@@ -16,7 +16,7 @@ context('cy.origin screenshot', () => {
|
||||
|
||||
cy.viewport(600, 200)
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="screenshots-link"]').click()
|
||||
})
|
||||
|
||||
@@ -74,7 +74,7 @@ context('cy.origin screenshot', () => {
|
||||
duration: 100,
|
||||
}
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="screenshots-link"]').click()
|
||||
})
|
||||
|
||||
@@ -287,7 +287,7 @@ context('cy.origin screenshot', () => {
|
||||
logs.set(attrs.id, log)
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="screenshots-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin spies, stubs, and clock', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin traversal', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
context('cy.origin unsupported commands', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@ context('cy.origin viewport', () => {
|
||||
// change the viewport in the primary first
|
||||
cy.viewport(320, 480)
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -27,7 +27,7 @@ context('cy.origin viewport', () => {
|
||||
|
||||
context('with out pre-set viewport', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -135,7 +135,7 @@ context('cy.origin viewport', () => {
|
||||
cy.viewport(320, 480)
|
||||
|
||||
cy.window().then((win) => {
|
||||
win.location.href = 'http://localhost:3500/fixtures/multi-domain.html'
|
||||
win.location.href = 'http://localhost:3500/fixtures/primary-origin.html'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -160,7 +160,7 @@ context('cy.origin viewport', () => {
|
||||
})
|
||||
|
||||
cy.window().then((win) => {
|
||||
win.location.href = 'http://www.idp.com:3500/fixtures/multi-domain.html'
|
||||
win.location.href = 'http://www.idp.com:3500/fixtures/primary-origin.html'
|
||||
})
|
||||
|
||||
cy.origin('http://idp.com:3500', () => {
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin waiting', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { findCrossOriginLogs } from '../../../../support/utils'
|
||||
|
||||
context('cy.origin window', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -7,7 +7,7 @@ describe('cy.origin - cookie login', () => {
|
||||
|
||||
it('works in a session', () => {
|
||||
cy.session('ZJohnson', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('[data-cy="cookie-login"]').click()
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.get('[data-cy="username"]').type('ZJohnson')
|
||||
@@ -25,7 +25,7 @@ describe('cy.origin - cookie login', () => {
|
||||
|
||||
describe('SameSite handling', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('[data-cy="cookie-login"]').click()
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ const { assertLogLength } = require('../../../support/utils')
|
||||
|
||||
describe('cy.origin Cypress API', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -229,7 +229,7 @@ describe('cy.origin Cypress API', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('throws an error when a user attempts to call Cypress.session.clearAllSavedSessions() inside of multi-domain', (done) => {
|
||||
it('throws an error when a user attempts to call Cypress.session.clearAllSavedSessions() inside of cy.origin', (done) => {
|
||||
cy.on('fail', (err) => {
|
||||
expect(err.message).to.equal('`Cypress.session.*` methods are not supported in the `cy.switchToDomain()` callback. Consider using them outside of the callback instead.')
|
||||
expect(err.docsUrl).to.equal('https://on.cypress.io/session-api')
|
||||
@@ -1,6 +1,6 @@
|
||||
describe('cy.origin', () => {
|
||||
it('window:before:load event', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.on('window:before:load', (win: {testPrimaryOriginBeforeLoad: boolean}) => {
|
||||
win.testPrimaryOriginBeforeLoad = true
|
||||
})
|
||||
@@ -20,7 +20,7 @@ describe('cy.origin', () => {
|
||||
.should('equal', 'Window Before Load Called')
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.window().its('testPrimaryOriginBeforeLoad').should('be.true')
|
||||
cy.window().its('testSecondaryWindowBeforeLoad').should('be.undefined')
|
||||
@@ -28,7 +28,7 @@ describe('cy.origin', () => {
|
||||
|
||||
describe('post window load events', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -57,7 +57,7 @@ describe('cy.origin', () => {
|
||||
})
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.wrap(afterWindowBeforeUnload)
|
||||
})
|
||||
@@ -72,7 +72,7 @@ describe('cy.origin', () => {
|
||||
})
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
cy.wrap(afterWindowUnload)
|
||||
})
|
||||
@@ -8,7 +8,7 @@ describe('cy.origin logging', () => {
|
||||
logs.push(attrs)
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -45,7 +45,7 @@ describe('cy.origin logging', () => {
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
// @ts-ignore
|
||||
@@ -67,7 +67,7 @@ describe('cy.origin logging', () => {
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
const options = { args: { div: Cypress.$('div') } }
|
||||
@@ -98,7 +98,7 @@ describe('cy.origin logging', () => {
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -130,7 +130,7 @@ describe('cy.origin logging', () => {
|
||||
done()
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -21,7 +21,7 @@ describe('navigation events', () => {
|
||||
logs.push(log)
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -32,7 +32,7 @@ describe('navigation events', () => {
|
||||
const listener = () => {
|
||||
cy.location().should((loc) => {
|
||||
expect(loc.host).to.equal('www.foobar.com:3500')
|
||||
expect(loc.pathname).to.equal('/fixtures/multi-domain-secondary.html')
|
||||
expect(loc.pathname).to.equal('/fixtures/secondary-origin.html')
|
||||
expect(loc.hash).to.equal('#hashChange')
|
||||
})
|
||||
|
||||
@@ -92,7 +92,7 @@ describe('navigation events', () => {
|
||||
const listener = (win) => {
|
||||
times++
|
||||
expect(win.location.host).to.equal('www.foobar.com:3500')
|
||||
expect(win.location.pathname).to.equal('/fixtures/multi-domain-secondary.html')
|
||||
expect(win.location.pathname).to.equal('/fixtures/secondary-origin.html')
|
||||
|
||||
if (times === 2) {
|
||||
cy.removeListener('window:load', listener)
|
||||
@@ -129,13 +129,13 @@ describe('navigation events', () => {
|
||||
times++
|
||||
if (times === 1) {
|
||||
expect(win.location.host).to.equal('www.foobar.com:3500')
|
||||
expect(win.location.pathname).to.equal('/fixtures/multi-domain-secondary.html')
|
||||
expect(win.location.pathname).to.equal('/fixtures/secondary-origin.html')
|
||||
}
|
||||
|
||||
if (times === 2) {
|
||||
cy.removeListener('window:load', listener)
|
||||
expect(win.location.host).to.equal('www.foobar.com:3500')
|
||||
expect(win.location.pathname).to.equal('/fixtures/multi-domain.html')
|
||||
expect(win.location.pathname).to.equal('/fixtures/primary-origin.html')
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ describe('navigation events', () => {
|
||||
})
|
||||
|
||||
cy.get('a[data-cy="cross-origin-page"]').click()
|
||||
cy.get('a[data-cy="cross-origin-secondary-link').invoke('text').should('equal', 'http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link').invoke('text').should('equal', 'http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
cy.wrap(afterWindowLoad).then(() => {
|
||||
return logs.map((log) => ({ name: log.get('name'), message: log.get('message') }))
|
||||
})
|
||||
@@ -154,7 +154,7 @@ describe('navigation events', () => {
|
||||
assertLogLength(secondaryLogs, 13)
|
||||
expect(secondaryLogs[5].get('name')).to.eq('page load')
|
||||
expect(secondaryLogs[6].get('name')).to.eq('new url')
|
||||
expect(secondaryLogs[6].get('message')).to.eq('http://www.foobar.com:3500/fixtures/multi-domain.html')
|
||||
expect(secondaryLogs[6].get('message')).to.eq('http://www.foobar.com:3500/fixtures/primary-origin.html')
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -164,7 +164,7 @@ describe('navigation events', () => {
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
const afterUrlChanged = new Promise<void>((resolve) => {
|
||||
cy.once('url:changed', (url) => {
|
||||
expect(url).to.equal('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
expect(url).to.equal('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
@@ -181,12 +181,12 @@ describe('navigation events', () => {
|
||||
const listener = (url) => {
|
||||
times++
|
||||
if (times === 1) {
|
||||
expect(url).to.equal('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')
|
||||
expect(url).to.equal('http://www.foobar.com:3500/fixtures/secondary-origin.html')
|
||||
}
|
||||
|
||||
if (times === 2) {
|
||||
cy.removeListener('url:changed', listener)
|
||||
expect(url).to.equal('http://www.foobar.com:3500/fixtures/multi-domain.html')
|
||||
expect(url).to.equal('http://www.foobar.com:3500/fixtures/primary-origin.html')
|
||||
resolve()
|
||||
}
|
||||
}
|
||||
@@ -212,7 +212,7 @@ describe('navigation events', () => {
|
||||
// @ts-ignore / session support is needed for visiting about:blank between tests
|
||||
describe('event timing', () => {
|
||||
it('does not timeout when receiving a delaying:html event after cy.origin has started, but before the spec bridge is ready', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
@@ -221,7 +221,7 @@ describe('event timing', () => {
|
||||
|
||||
// This command is run from localhost against the cross-origin aut. Updating href is one of the few allowed commands. See https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#location
|
||||
cy.window().then((win) => {
|
||||
win.location.href = 'http://www.idp.com:3500/fixtures/multi-domain.html'
|
||||
win.location.href = 'http://www.idp.com:3500/fixtures/primary-origin.html'
|
||||
})
|
||||
|
||||
cy.origin('http://idp.com:3500', () => {
|
||||
@@ -8,7 +8,7 @@ describe('cy.origin', () => {
|
||||
expect(primaryViewport).to.deep.equal(expectedViewport)
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', { args: expectedViewport }, (expectedViewport) => {
|
||||
@@ -20,7 +20,7 @@ describe('cy.origin', () => {
|
||||
|
||||
context('withBeforeEach', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-ignore
|
||||
describe('cy.origin - rerun', { }, () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
describe('cy.origin - uncaught errors', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="errors-link"]').click()
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a localhost domain name', () => {
|
||||
cy.origin('localhost', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://localhost/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://localhost/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://localhost') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -13,7 +13,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on an ip address', () => {
|
||||
cy.origin('127.0.0.1', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://127.0.0.1/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://127.0.0.1/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://127.0.0.1') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -25,7 +25,7 @@ describe('cy.origin', () => {
|
||||
it.skip('succeeds on an ipv6 address', () => {
|
||||
cy.origin('0000:0000:0000:0000:0000:0000:0000:0001', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://[::1]/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://[::1]/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://[::1]') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -35,7 +35,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a unicode domain', () => {
|
||||
cy.origin('はじめよう.みんな', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://xn--p8j9a0d9c9a.xn--q9jyb4c/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://xn--p8j9a0d9c9a.xn--q9jyb4c/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://xn--p8j9a0d9c9a.xn--q9jyb4c') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -45,7 +45,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a complete origin', () => {
|
||||
cy.origin('http://foobar1.com:3500', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `http://foobar1.com:3500/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `http://foobar1.com:3500/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ http://foobar1.com:3500') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -55,7 +55,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a complete origin using https', () => {
|
||||
cy.origin('https://foobar2.com:3500', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://foobar2.com:3500/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://foobar2.com:3500/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://foobar2.com:3500') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -65,7 +65,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a hostname and port', () => {
|
||||
cy.origin('foobar3.com:3500', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://foobar3.com:3500/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://foobar3.com:3500/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://foobar3.com:3500') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -75,7 +75,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a protocol and hostname', () => {
|
||||
cy.origin('http://foobar4.com', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `http://foobar4.com/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `http://foobar4.com/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ http://foobar4.com') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -85,7 +85,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a subdomain', () => {
|
||||
cy.origin('app.foobar5.com', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://foobar5.com/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://foobar5.com/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://foobar5.com') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -95,7 +95,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds when only domain is passed', () => {
|
||||
cy.origin('foobar6.com', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://foobar6.com/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://foobar6.com/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://foobar6.com') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -105,7 +105,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a url with path', () => {
|
||||
cy.origin('http://www.foobar7.com/login', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `http://foobar7.com/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `http://foobar7.com/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ http://foobar7.com') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -115,7 +115,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a url with a hash', () => {
|
||||
cy.origin('http://www.foobar8.com/#hash', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `http://foobar8.com/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `http://foobar8.com/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ http://foobar8.com') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -125,7 +125,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a url with a path and hash', () => {
|
||||
cy.origin('http://www.foobar9.com/login/#hash', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `http://foobar9.com/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `http://foobar9.com/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ http://foobar9.com') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -135,7 +135,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a domain with path', () => {
|
||||
cy.origin('foobar10.com/login', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://foobar10.com/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://foobar10.com/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://foobar10.com') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -145,7 +145,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a domain with a hash', () => {
|
||||
cy.origin('foobar11.com/#hash', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://foobar11.com/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://foobar11.com/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://foobar11.com') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -155,7 +155,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a domain with a path and hash', () => {
|
||||
cy.origin('foobar12.com/login/#hash', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://foobar12.com/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://foobar12.com/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://foobar12.com') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -165,7 +165,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a public suffix with a subdomain', () => {
|
||||
cy.origin('app.foobar.herokuapp.com', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://foobar.herokuapp.com/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://foobar.herokuapp.com/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://foobar.herokuapp.com') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -175,7 +175,7 @@ describe('cy.origin', () => {
|
||||
it('succeeds on a machine name', () => {
|
||||
cy.origin('machine-name', () => undefined)
|
||||
cy.then(() => {
|
||||
const expectedSrc = `https://machine-name/__cypress/multi-domain-iframes`
|
||||
const expectedSrc = `https://machine-name/__cypress/spec-bridge-iframes`
|
||||
const iframe = window.top?.document.getElementById('Spec\ Bridge:\ https://machine-name') as HTMLIFrameElement
|
||||
|
||||
expect(iframe.src).to.equal(expectedSrc)
|
||||
@@ -203,7 +203,7 @@ describe('cy.origin', () => {
|
||||
cy.origin('http://www.bar.com:3500', () => undefined)
|
||||
|
||||
cy.origin('http://www.app.foobar.com:3500', () => {
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('cy.origin yields', () => {
|
||||
logs.push(log)
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/multi-domain.html')
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
@@ -408,7 +408,7 @@ describe('Log Serialization', () => {
|
||||
expect($el[0].id).to.equal('button-inside-a')
|
||||
expect($el[0].textContent).to.equal('click button')
|
||||
|
||||
// most of the consoleProps logic is tested in the e2e/multi-domain folder. focus in this test will be mostly snapshot serialization
|
||||
// most of the consoleProps logic is tested in the e2e/commands/origin folder. focus in this test will be mostly snapshot serialization
|
||||
expect(consoleProps['Applied To']).to.be.instanceOf(HTMLFormElement)
|
||||
expect(consoleProps['Applied To']).to.have.property('id').that.equals('button-inside-a')
|
||||
expect(consoleProps['Applied To']).to.have.property('textContent').that.equals('click button')
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"scripts": {
|
||||
"clean-deps": "rm -rf node_modules",
|
||||
"cypress:open": "node ../../scripts/cypress open",
|
||||
"cypress:run": "node ../../scripts/cypress run --spec \"cypress/integration/*/*\",\"cypress/integration/*/!(multi-domain)/**/*\"",
|
||||
"cypress:run": "node ../../scripts/cypress run --spec \"cypress/integration/*/*\",\"cypress/integration/*/!(origin)/**/*\"",
|
||||
"cypress:open-experimentalSessionAndOrigin": "node ../../scripts/cypress open --config experimentalSessionAndOrigin=true",
|
||||
"cypress:run-experimentalSessionAndOrigin": "node ../../scripts/cypress run --config experimentalSessionAndOrigin=true",
|
||||
"postinstall": "patch-package",
|
||||
|
||||
@@ -30,6 +30,8 @@ import * as Location from './location'
|
||||
|
||||
import * as Misc from './misc'
|
||||
|
||||
import * as Origin from './origin'
|
||||
|
||||
import * as Popups from './popups'
|
||||
|
||||
import * as Navigation from './navigation'
|
||||
@@ -69,6 +71,7 @@ export const allCommands = {
|
||||
LocalStorage,
|
||||
Location,
|
||||
Misc,
|
||||
Origin,
|
||||
Popups,
|
||||
Navigation,
|
||||
...Querying,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import Bluebird from 'bluebird'
|
||||
import $errUtils from '../../cypress/error_utils'
|
||||
import $stackUtils from '../../cypress/stack_utils'
|
||||
import $errUtils from '../../../cypress/error_utils'
|
||||
import $stackUtils from '../../../cypress/stack_utils'
|
||||
import { Validator } from './validator'
|
||||
import { createUnserializableSubjectProxy } from './unserializable_subject_proxy'
|
||||
import { serializeRunnable } from './util'
|
||||
import { preprocessConfig, preprocessEnv, syncConfigToCurrentOrigin, syncEnvToCurrentOrigin } from '../../util/config'
|
||||
import { $Location } from '../../cypress/location'
|
||||
import { LogUtils } from '../../cypress/log'
|
||||
import logGroup from '../logGroup'
|
||||
import { preprocessConfig, preprocessEnv, syncConfigToCurrentOrigin, syncEnvToCurrentOrigin } from '../../../util/config'
|
||||
import { $Location } from '../../../cypress/location'
|
||||
import { LogUtils } from '../../../cypress/log'
|
||||
import logGroup from '../../logGroup'
|
||||
|
||||
const reHttp = /^https?:\/\//
|
||||
|
||||
@@ -22,7 +22,7 @@ const normalizeOrigin = (urlOrDomain) => {
|
||||
return $Location.normalize(origin)
|
||||
}
|
||||
|
||||
export function addCommands (Commands, Cypress: Cypress.Cypress, cy: Cypress.cy, state: Cypress.State, config: Cypress.InternalConfig) {
|
||||
export default (Commands, Cypress: Cypress.Cypress, cy: Cypress.cy, state: Cypress.State, config: Cypress.InternalConfig) => {
|
||||
let timeoutId
|
||||
|
||||
const communicator = Cypress.primaryOriginCommunicator
|
||||
@@ -1,4 +1,4 @@
|
||||
import $errUtils from '../../cypress/error_utils'
|
||||
import $errUtils from '../../../cypress/error_utils'
|
||||
|
||||
// These properties are required to avoid failing prior to attempting to use the subject.
|
||||
// If Symbol.toStringTag is passed through to the target we will not properly fail the 'cy.invoke' command.
|
||||
@@ -1,5 +1,5 @@
|
||||
import $utils from '../../cypress/utils'
|
||||
import $errUtils from '../../cypress/error_utils'
|
||||
import $utils from '../../../cypress/utils'
|
||||
import $errUtils from '../../../cypress/error_utils'
|
||||
import { difference, isPlainObject, isString } from 'lodash'
|
||||
|
||||
const validOptionKeys = Object.freeze(['args'])
|
||||
@@ -37,7 +37,7 @@ import ProxyLogging from './cypress/proxy-logging'
|
||||
import * as $Events from './cypress/events'
|
||||
import $Keyboard from './cy/keyboard'
|
||||
import * as resolvers from './cypress/resolvers'
|
||||
import { PrimaryOriginCommunicator, SpecBridgeCommunicator } from './multi-domain/communicator'
|
||||
import { PrimaryOriginCommunicator, SpecBridgeCommunicator } from './cross-origin/communicator'
|
||||
|
||||
const debug = debugFn('cypress:driver:cypress')
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import _ from 'lodash'
|
||||
import { allCommands } from '../cy/commands'
|
||||
import { addCommand as addNetstubbingCommand } from '../cy/net-stubbing'
|
||||
import { addCommands as addCrossOriginCommands } from '../cy/multi-domain'
|
||||
import $errUtils from './error_utils'
|
||||
import $stackUtils from './stack_utils'
|
||||
|
||||
@@ -10,7 +9,6 @@ const builtInCommands = [
|
||||
// @ts-ignore
|
||||
..._.toArray(allCommands).map((c) => c.default || c),
|
||||
addNetstubbingCommand,
|
||||
addCrossOriginCommands,
|
||||
]
|
||||
|
||||
const getTypeByPrevSubject = (prevSubject) => {
|
||||
|
||||
4
packages/driver/types/internal-types.d.ts
vendored
4
packages/driver/types/internal-types.d.ts
vendored
@@ -66,8 +66,8 @@ declare namespace Cypress {
|
||||
state: State
|
||||
events: Events
|
||||
emit: (event: string, payload?: any) => void
|
||||
primaryOriginCommunicator: import('../src/multi-domain/communicator').PrimaryOriginCommunicator
|
||||
specBridgeCommunicator: import('../src/multi-domain/communicator').SpecBridgeCommunicator
|
||||
primaryOriginCommunicator: import('../src/cross-origin/communicator').PrimaryOriginCommunicator
|
||||
specBridgeCommunicator: import('../src/cross-origin/communicator').SpecBridgeCommunicator
|
||||
mocha: $Mocha
|
||||
configure: (config: Cypress.ObjectLike) => void
|
||||
isCrossOriginSpecBridge: boolean
|
||||
|
||||
@@ -296,7 +296,7 @@ describe('http/response-middleware', function () {
|
||||
...props.res,
|
||||
},
|
||||
req: {
|
||||
proxiedUrl: 'http://127.0.0.1:3501/multi-domain.html',
|
||||
proxiedUrl: 'http://127.0.0.1:3501/primary-origin.html',
|
||||
headers: {},
|
||||
...props.req,
|
||||
},
|
||||
@@ -580,7 +580,7 @@ describe('http/response-middleware', function () {
|
||||
...props.res,
|
||||
},
|
||||
req: {
|
||||
proxiedUrl: 'http://127.0.0.1:3501/multi-domain.html',
|
||||
proxiedUrl: 'http://127.0.0.1:3501/primary-origin.html',
|
||||
headers: {},
|
||||
cookies: {
|
||||
'__cypress.initial': true,
|
||||
@@ -735,7 +735,7 @@ describe('http/response-middleware', function () {
|
||||
},
|
||||
req: {
|
||||
isAUTFrame: true,
|
||||
proxiedUrl: 'http://www.foobar.com/multi-domain.html',
|
||||
proxiedUrl: 'http://www.foobar.com/primary-origin.html',
|
||||
},
|
||||
res: {
|
||||
append: appendStub,
|
||||
@@ -758,7 +758,7 @@ describe('http/response-middleware', function () {
|
||||
},
|
||||
req: {
|
||||
isAUTFrame: true,
|
||||
proxiedUrl: 'http://www.foobar.com/multi-domain.html',
|
||||
proxiedUrl: 'http://www.foobar.com/primary-origin.html',
|
||||
},
|
||||
res: {
|
||||
append: appendStub,
|
||||
@@ -903,7 +903,7 @@ describe('http/response-middleware', function () {
|
||||
...props.res,
|
||||
},
|
||||
req: {
|
||||
proxiedUrl: 'http://127.0.0.1:3501/multi-domain.html',
|
||||
proxiedUrl: 'http://127.0.0.1:3501/primary-origin.html',
|
||||
headers: {},
|
||||
...props.req,
|
||||
},
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// this is the entry point for the cross-origin version of the driver
|
||||
import '@packages/driver/src/multi-domain/cypress'
|
||||
import '@packages/driver/src/cross-origin/cypress'
|
||||
@@ -188,7 +188,7 @@ export default class Iframes extends Component {
|
||||
// container since it needs to match the size of the top window for screenshots
|
||||
$container: $(document.body),
|
||||
className: 'spec-bridge-iframe',
|
||||
src: `${location.originPolicy}/${this.props.config.namespace}/multi-domain-iframes`,
|
||||
src: `${location.originPolicy}/${this.props.config.namespace}/spec-bridge-iframes`,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ const crossOriginConfig: webpack.Configuration = {
|
||||
mode: 'production',
|
||||
...getSimpleConfig(),
|
||||
entry: {
|
||||
cypress_cross_origin_runner: [path.resolve(__dirname, 'src/multi-domain.js')],
|
||||
cypress_cross_origin_runner: [path.resolve(__dirname, 'src/cross-origin.js')],
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
@@ -114,7 +114,7 @@ const crossOriginInjectionConfig: webpack.Configuration = {
|
||||
...getSimpleConfig(),
|
||||
mode: 'production',
|
||||
entry: {
|
||||
injection_cross_origin: [path.resolve(__dirname, 'injection/multi-domain.js')],
|
||||
injection_cross_origin: [path.resolve(__dirname, 'injection/cross-origin.js')],
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
|
||||
@@ -51,7 +51,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
handleCrossOriginIframe (req, res) {
|
||||
const iframePath = cwd('lib', 'html', 'multi-domain-iframe.html')
|
||||
const iframePath = cwd('lib', 'html', 'spec-bridge-iframe.html')
|
||||
const domain = req.hostname
|
||||
|
||||
const iframeOptions = {
|
||||
|
||||
@@ -129,7 +129,7 @@ export const createRoutesE2E = ({
|
||||
res.sendFile(file, { etag: false })
|
||||
})
|
||||
|
||||
routesE2E.get('/__cypress/multi-domain-iframes', (req, res) => {
|
||||
routesE2E.get('/__cypress/spec-bridge-iframes', (req, res) => {
|
||||
debug('handling cross-origin iframe for domain: %s', req.hostname)
|
||||
|
||||
files.handleCrossOriginIframe(req, res)
|
||||
|
||||
@@ -7,15 +7,15 @@ exports['e2e cy.origin errors / captures the stack trace correctly for errors in
|
||||
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ Cypress: 1.2.3 │
|
||||
│ Browser: FooBrowser 88 │
|
||||
│ Specs: 1 found (multi_domain_error_spec.ts) │
|
||||
│ Searched: cypress/integration/multi_domain_error_spec.ts │
|
||||
│ Specs: 1 found (cy_origin_error_spec.ts) │
|
||||
│ Searched: cypress/integration/cy_origin_error_spec.ts │
|
||||
│ Experiments: experimentalSessionAndOrigin=true │
|
||||
└────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
Running: multi_domain_error_spec.ts (1 of 1)
|
||||
Running: cy_origin_error_spec.ts (1 of 1)
|
||||
|
||||
|
||||
cy.origin
|
||||
@@ -44,20 +44,20 @@ exports['e2e cy.origin errors / captures the stack trace correctly for errors in
|
||||
│ Screenshots: 1 │
|
||||
│ Video: true │
|
||||
│ Duration: X seconds │
|
||||
│ Spec Ran: multi_domain_error_spec.ts │
|
||||
│ Spec Ran: cy_origin_error_spec.ts │
|
||||
└────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
|
||||
(Screenshots)
|
||||
|
||||
- /XXX/XXX/XXX/cypress/screenshots/multi_domain_error_spec.ts/cy.origin -- tries t (1280x720)
|
||||
o find an element that doesn't exist and fails (failed).png
|
||||
- /XXX/XXX/XXX/cypress/screenshots/cy_origin_error_spec.ts/cy.origin -- tries to f (1280x720)
|
||||
ind an element that doesn't exist and fails (failed).png
|
||||
|
||||
|
||||
(Video)
|
||||
|
||||
- Started processing: Compressing to 32 CRF
|
||||
- Finished processing: /XXX/XXX/XXX/cypress/videos/multi_domain_error_spec.ts.mp4 (X second)
|
||||
- Finished processing: /XXX/XXX/XXX/cypress/videos/cy_origin_error_spec.ts.mp4 (X second)
|
||||
|
||||
|
||||
====================================================================================================
|
||||
@@ -67,7 +67,7 @@ exports['e2e cy.origin errors / captures the stack trace correctly for errors in
|
||||
|
||||
Spec Tests Passing Failing Pending Skipped
|
||||
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ ✖ multi_domain_error_spec.ts XX:XX 1 - 1 - - │
|
||||
│ ✖ cy_origin_error_spec.ts XX:XX 1 - 1 - - │
|
||||
└────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
✖ 1 of 1 failed (100%) XX:XX 1 - 1 - -
|
||||
|
||||
@@ -7,15 +7,15 @@ exports['e2e cy.origin retries / Appropriately displays test retry errors withou
|
||||
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ Cypress: 1.2.3 │
|
||||
│ Browser: FooBrowser 88 │
|
||||
│ Specs: 1 found (multi_domain_retries_spec.ts) │
|
||||
│ Searched: cypress/integration/multi_domain_retries_spec.ts │
|
||||
│ Specs: 1 found (cy_origin_retries_spec.ts) │
|
||||
│ Searched: cypress/integration/cy_origin_retries_spec.ts │
|
||||
│ Experiments: experimentalSessionAndOrigin=true │
|
||||
└────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
Running: multi_domain_retries_spec.ts (1 of 1)
|
||||
Running: cy_origin_retries_spec.ts (1 of 1)
|
||||
|
||||
|
||||
cy.origin test retries
|
||||
@@ -46,28 +46,27 @@ exports['e2e cy.origin retries / Appropriately displays test retry errors withou
|
||||
│ Screenshots: 3 │
|
||||
│ Video: true │
|
||||
│ Duration: X seconds │
|
||||
│ Spec Ran: multi_domain_retries_spec.ts │
|
||||
│ Spec Ran: cy_origin_retries_spec.ts │
|
||||
└────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
|
||||
(Screenshots)
|
||||
|
||||
- /XXX/XXX/XXX/cypress/screenshots/multi_domain_retries_spec.ts/cy.origin test ret (1280x720)
|
||||
ries -- appropriately retries test within cy.origin without propagating other er
|
||||
rors errors (failed).png
|
||||
- /XXX/XXX/XXX/cypress/screenshots/multi_domain_retries_spec.ts/cy.origin test ret (1280x720)
|
||||
ries -- appropriately retries test within cy.origin without propagating other er
|
||||
rors errors (failed) (attempt 2).png
|
||||
- /XXX/XXX/XXX/cypress/screenshots/multi_domain_retries_spec.ts/cy.origin test ret (1280x720)
|
||||
ries -- appropriately retries test within cy.origin without propagating other er
|
||||
rors errors (failed) (attempt 3).png
|
||||
- /XXX/XXX/XXX/cypress/screenshots/cy_origin_retries_spec.ts/cy.origin test retrie (1280x720)
|
||||
s -- appropriately retries test within cy.origin without propagating other error
|
||||
s errors (failed).png
|
||||
- /XXX/XXX/XXX/cypress/screenshots/cy_origin_retries_spec.ts/cy.origin test retrie (1280x720)
|
||||
s -- appropriately retries test within cy.origin without propagating other error
|
||||
s errors (failed) (attempt 2).png
|
||||
- /XXX/XXX/XXX/cypress/screenshots/cy_origin_retries_spec.ts/cy.origin test retrie (1280x720)
|
||||
s -- appropriately retries test within cy.origin without propagating other error
|
||||
s errors (failed) (attempt 3).png
|
||||
|
||||
|
||||
(Video)
|
||||
|
||||
- Started processing: Compressing to 32 CRF
|
||||
- Finished processing: /XXX/XXX/XXX/cypress/videos/multi_domain_retries_spec.ts.mp (X second)
|
||||
4
|
||||
- Finished processing: /XXX/XXX/XXX/cypress/videos/cy_origin_retries_spec.ts.mp4 (X second)
|
||||
|
||||
|
||||
====================================================================================================
|
||||
@@ -77,7 +76,7 @@ exports['e2e cy.origin retries / Appropriately displays test retry errors withou
|
||||
|
||||
Spec Tests Passing Failing Pending Skipped
|
||||
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ ✖ multi_domain_retries_spec.ts XX:XX 1 - 1 - - │
|
||||
│ ✖ cy_origin_retries_spec.ts XX:XX 1 - 1 - - │
|
||||
└────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
✖ 1 of 1 failed (100%) XX:XX 1 - 1 - -
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
describe('cy.origin', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/multi_domain.html')
|
||||
cy.visit('/primary_origin.html')
|
||||
cy.get('a[data-cy="cross_origin_secondary_link"]').click()
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
describe('cy.origin test retries', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/multi_domain.html')
|
||||
cy.visit('/primary_origin.html')
|
||||
cy.get('a[data-cy="cross_origin_secondary_link"]').click()
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div>
|
||||
Go to different origin:
|
||||
<a data-cy="cross_origin_secondary_link"
|
||||
href="http://www.foobar.com:4466/multi_domain_secondary.html">http://www.foobar.com:4466/multi_domain_secondary.html</a>
|
||||
href="http://www.foobar.com:4466/secondary-origin.html">http://www.foobar.com:4466/secondary-origin.html</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -14,7 +14,7 @@
|
||||
<button data-cy="reload">reload</button>
|
||||
<a data-cy="hashChange" href='#hashChange'>hashChange</a>
|
||||
<a data-cy="cross-origin-page"
|
||||
href="/fixtures/multi_domain.html">/fixtures/multi_domain.html</a>
|
||||
href="/fixtures/primary_origin.html">/fixtures/primary_origin.html</a>
|
||||
|
||||
<script>
|
||||
if (window.Cypress) {
|
||||
@@ -6,8 +6,8 @@ const e2ePath = Fixtures.projectPath('e2e')
|
||||
|
||||
const PORT = 3500
|
||||
const onServer = function (app) {
|
||||
app.get('/multi_domain_secondary.html', (_, res) => {
|
||||
res.sendFile(path.join(e2ePath, `multi_domain_secondary.html`))
|
||||
app.get('/secondary_origin.html', (_, res) => {
|
||||
res.sendFile(path.join(e2ePath, `secondary_origin.html`))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('e2e cy.origin errors', () => {
|
||||
systemTests.it('captures the stack trace correctly for errors in cross origins to point users to their "cy.origin" callback', {
|
||||
// keep the port the same to prevent issues with the snapshot
|
||||
port: PORT,
|
||||
spec: 'multi_domain_error_spec.ts',
|
||||
spec: 'cy_origin_error_spec.ts',
|
||||
snapshot: true,
|
||||
expectedExitCode: 1,
|
||||
config: {
|
||||
@@ -42,7 +42,7 @@ describe('e2e cy.origin errors', () => {
|
||||
expect(res.stdout).to.contain('Timed out retrying after 1000ms: Expected to find element: `#doesnotexist`, but never found it.')
|
||||
|
||||
// check to make sure the snapshot contains the 'cy.origin' sourcemap
|
||||
expect(res.stdout).to.contain('http://localhost:3500/__cypress/tests?p=cypress/integration/multi_domain_error_spec.ts:102:12')
|
||||
expect(res.stdout).to.contain('http://localhost:3500/__cypress/tests?p=cypress/integration/cy_origin_error_spec.ts:102:12')
|
||||
},
|
||||
})
|
||||
})
|
||||
@@ -6,8 +6,8 @@ const e2ePath = Fixtures.projectPath('e2e')
|
||||
|
||||
const PORT = 3500
|
||||
const onServer = function (app) {
|
||||
app.get('/multi_domain_secondary.html', (_, res) => {
|
||||
res.sendFile(path.join(e2ePath, `multi_domain_secondary.html`))
|
||||
app.get('/secondary_origin.html', (_, res) => {
|
||||
res.sendFile(path.join(e2ePath, `secondary_origin.html`))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('e2e cy.origin retries', () => {
|
||||
systemTests.it('Appropriately displays test retry errors without other side effects', {
|
||||
// keep the port the same to prevent issues with the snapshot
|
||||
port: PORT,
|
||||
spec: 'multi_domain_retries_spec.ts',
|
||||
spec: 'cy_origin_retries_spec.ts',
|
||||
snapshot: true,
|
||||
expectedExitCode: 1,
|
||||
config: {
|
||||
38
yarn.lock
38
yarn.lock
@@ -6121,16 +6121,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@percy/env/-/env-1.1.0.tgz#b04e769db0b6b71136b3112555727920302b2f77"
|
||||
integrity sha512-Y2lSuiP+zyLSYf7IV/95MgNqiL6nRDYk9Ji8CMZPKuvPIrnCDExZ7nqszCli3hJ4qi6U4m1NykJWPDei4GjZNw==
|
||||
|
||||
"@percy/logger@1.1.0":
|
||||
"@percy/logger@1.1.0", "@percy/logger@^1.0.0-beta.48":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@percy/logger/-/logger-1.1.0.tgz#6bb5df0563d3566071f8b718e61f11a04c5a2722"
|
||||
integrity sha512-bAlxBcdnViTpGQZtjs361vXSlaxEj6Zt4Wt1Mo7EdPwv/zya2cBpLFNNcRycWto4mdb5Qnpht+IPXf7RFXJ/nw==
|
||||
|
||||
"@percy/logger@^1.0.0-beta.48":
|
||||
version "1.0.0-beta.48"
|
||||
resolved "https://registry.yarnpkg.com/@percy/logger/-/logger-1.0.0-beta.48.tgz#c8323536038d0ac5f05080a36f7dbc3319b139c9"
|
||||
integrity sha512-vO70hgMuRssqFAcI3x3zyRLHqXYNtaaBKoaoXMpt4XF0W7At7AxFPOttvkzAI1gP7mqNwUZtc2K8VPkcguR7Aw==
|
||||
|
||||
"@percy/sdk-utils@^1.0.0-beta.44":
|
||||
version "1.0.0-beta.48"
|
||||
resolved "https://registry.yarnpkg.com/@percy/sdk-utils/-/sdk-utils-1.0.0-beta.48.tgz#47e59d92c7df19fe13faf5458702fd2b9a0e0b76"
|
||||
@@ -10646,7 +10641,7 @@ ajv@6.5.3:
|
||||
json-schema-traverse "^0.4.1"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
ajv@8.6.2, ajv@^8.0.0:
|
||||
ajv@8.6.2:
|
||||
version "8.6.2"
|
||||
resolved "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz#2fb45e0e5fcbc0813326c1c3da535d1881bb0571"
|
||||
integrity sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==
|
||||
@@ -10676,7 +10671,7 @@ ajv@^7.0.2:
|
||||
require-from-string "^2.0.2"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
ajv@^8.6.2:
|
||||
ajv@^8.0.0, ajv@^8.6.2:
|
||||
version "8.11.0"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f"
|
||||
integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==
|
||||
@@ -14534,14 +14529,14 @@ content-disposition@0.5.2:
|
||||
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4"
|
||||
integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ=
|
||||
|
||||
content-disposition@0.5.3, content-disposition@~0.5.2:
|
||||
content-disposition@0.5.3:
|
||||
version "0.5.3"
|
||||
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd"
|
||||
integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==
|
||||
dependencies:
|
||||
safe-buffer "5.1.2"
|
||||
|
||||
content-disposition@^0.5.4:
|
||||
content-disposition@^0.5.4, content-disposition@~0.5.2:
|
||||
version "0.5.4"
|
||||
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe"
|
||||
integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==
|
||||
@@ -26490,12 +26485,7 @@ mime-db@1.45.0:
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea"
|
||||
integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==
|
||||
|
||||
mime-db@1.49.0, "mime-db@>= 1.43.0 < 2", mime-db@^1.28.0:
|
||||
version "1.49.0"
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed"
|
||||
integrity sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==
|
||||
|
||||
mime-db@1.52.0:
|
||||
mime-db@1.52.0, "mime-db@>= 1.43.0 < 2", mime-db@^1.28.0:
|
||||
version "1.52.0"
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
|
||||
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==
|
||||
@@ -26519,14 +26509,7 @@ mime-types@2.1.27:
|
||||
dependencies:
|
||||
mime-db "1.44.0"
|
||||
|
||||
mime-types@^2.1.12, mime-types@^2.1.18, mime-types@^2.1.21, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24:
|
||||
version "2.1.32"
|
||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5"
|
||||
integrity sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==
|
||||
dependencies:
|
||||
mime-db "1.49.0"
|
||||
|
||||
mime-types@^2.1.34:
|
||||
mime-types@^2.1.12, mime-types@^2.1.18, mime-types@^2.1.21, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@^2.1.34, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24:
|
||||
version "2.1.35"
|
||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
|
||||
integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==
|
||||
@@ -40727,16 +40710,11 @@ ws@^7.2.0, ws@~7.4.2:
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.4.tgz#383bc9742cb202292c9077ceab6f6047b17f2d59"
|
||||
integrity sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==
|
||||
|
||||
ws@^8.0.0:
|
||||
ws@^8.0.0, ws@^8.1.0:
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f"
|
||||
integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==
|
||||
|
||||
ws@^8.1.0:
|
||||
version "8.2.0"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.0.tgz#0b738cd484bfc9303421914b11bb4011e07615bb"
|
||||
integrity sha512-uYhVJ/m9oXwEI04iIVmgLmugh2qrZihkywG9y5FfZV2ATeLIzHf93qs+tUNqlttbQK957/VX3mtwAS+UfIwA4g==
|
||||
|
||||
xdg-basedir@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz#edbc903cc385fc04523d966a335504b5504d1bd2"
|
||||
|
||||
Reference in New Issue
Block a user