-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into v5.0-release
- Loading branch information
Showing
42 changed files
with
1,417 additions
and
2,562 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
packages/driver/cypress/fixtures/isolated-runner-inner.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Isolated Runner Fixture</title> | ||
</head> | ||
<body> | ||
<div> | ||
<button class="trigger-sync-error">Trigger Sync Error</button> | ||
<button class="trigger-async-error">Trigger Async Error</button> | ||
</div> | ||
|
||
<script> | ||
document.querySelector(".trigger-sync-error").addEventListener('click', function () { | ||
syncReference.error() | ||
}) | ||
|
||
document.querySelector(".trigger-async-error").addEventListener('click', function () { | ||
setTimeout(function () { | ||
asyncReference.error() | ||
}) | ||
}) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/runner/cypress/fixtures/errors/assertions_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import './setup' | ||
|
||
describe('assertion failures', () => { | ||
it('with expect().<foo>', () => { | ||
expect('actual').to.equal('expected') | ||
}) | ||
|
||
it('with assert()', () => { | ||
assert(false, 'should be true') | ||
}) | ||
|
||
it('with assert.<foo>()', () => { | ||
assert.equal('actual', 'expected') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import './setup' | ||
|
||
describe('commands', { defaultCommandTimeout: 0 }, () => { | ||
it('failure', () => { | ||
cy.get('#does-not-exist') | ||
}) | ||
|
||
it('chained failure', () => { | ||
cy.get('body').find('#does-not-exist') | ||
}) | ||
}) |
27 changes: 27 additions & 0 deletions
27
packages/runner/cypress/fixtures/errors/custom_commands_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import './setup' | ||
|
||
Cypress.Commands.add('failAssertion', () => { | ||
expect('actual').to.equal('expected') | ||
}) | ||
|
||
Cypress.Commands.add('failException', () => { | ||
({}).bar() | ||
}) | ||
|
||
Cypress.Commands.add('failCommand', () => { | ||
cy.get('#does-not-exist') | ||
}) | ||
|
||
describe('custom commands', { defaultCommandTimeout: 0 }, () => { | ||
it('assertion failure', () => { | ||
cy.failAssertion() | ||
}) | ||
|
||
it('exception', () => { | ||
cy.failException() | ||
}) | ||
|
||
it('command failure', () => { | ||
cy.failCommand() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import './setup' | ||
|
||
describe('docs url', () => { | ||
it('displays as button in interactive mode', () => { | ||
Cypress.config('isInteractive', true) | ||
cy.viewport() | ||
}) | ||
|
||
it('is text in error message in run mode', () => { | ||
Cypress.config('isInteractive', false) | ||
cy.viewport() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import './setup' | ||
|
||
describe('cy.each', { defaultCommandTimeout: 0 }, () => { | ||
it('assertion failure', () => { | ||
cy.wrap([1]).each(() => { | ||
expect('actual').to.equal('expected') | ||
}) | ||
}) | ||
|
||
it('exception', () => { | ||
cy.wrap([1]).each(() => { | ||
({}).bar() | ||
}) | ||
}) | ||
|
||
it('command failure', () => { | ||
cy.wrap([1]).each(() => { | ||
cy.get('#does-not-exist') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import './setup' | ||
|
||
describe('event handlers', { defaultCommandTimeout: 0 }, () => { | ||
it('event assertion failure', () => { | ||
cy.on('window:load', () => { | ||
expect('actual').to.equal('expected') | ||
}) | ||
|
||
cy.visit('http://localhost:1919') | ||
}) | ||
|
||
it('event exception', () => { | ||
cy.on('window:load', () => { | ||
({}).bar() | ||
}) | ||
|
||
cy.visit('http://localhost:1919') | ||
}) | ||
|
||
it('fail handler assertion failure', () => { | ||
cy.on('fail', () => { | ||
expect('actual').to.equal('expected') | ||
}) | ||
|
||
cy.get('#does-not-exist') | ||
}) | ||
|
||
it('fail handler exception', () => { | ||
cy.on('fail', () => { | ||
({}).bar() | ||
}) | ||
|
||
cy.get('#does-not-exist') | ||
}) | ||
}) |
13 changes: 13 additions & 0 deletions
13
packages/runner/cypress/fixtures/errors/exceptions_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import './setup' | ||
|
||
const outsideError = require('../../../../server/test/support/fixtures/projects/todos/throws-error') | ||
|
||
describe('exception failures', () => { | ||
it('in spec file', () => { | ||
({}).bar() | ||
}) | ||
|
||
it('in file outside project', () => { | ||
outsideError() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import './setup' | ||
|
||
describe('cy.readFile', () => { | ||
it('existence failure', () => { | ||
cy.readFile('does-not-exist', { timeout: 0 }) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { abortXhr, sendXhr } from './setup' | ||
|
||
describe('cy.route', { defaultCommandTimeout: 0 }, () => { | ||
it('callback assertion failure', () => { | ||
cy.server().route(() => { | ||
expect('actual').to.equal('expected') | ||
}) | ||
}) | ||
|
||
it('callback exception', () => { | ||
cy.server().route(() => { | ||
({}).bar() | ||
}) | ||
}) | ||
|
||
it('command failure', () => { | ||
cy.server().route(() => { | ||
cy.get('#does-not-exist') | ||
|
||
return '/foo' | ||
}) | ||
}) | ||
|
||
it('onAbort assertion failure', () => { | ||
cy.server().route({ | ||
url: '/foo', | ||
onAbort () { | ||
expect('actual').to.equal('expected') | ||
}, | ||
}) | ||
.window().then(abortXhr('/foo')) | ||
}) | ||
|
||
it('onAbort exception', () => { | ||
cy.server().route({ | ||
url: '/foo', | ||
onAbort () { | ||
({}).bar() | ||
}, | ||
}) | ||
.window().then(abortXhr('/foo')) | ||
}) | ||
|
||
it('onRequest assertion failure', () => { | ||
cy.server().route({ | ||
url: '/foo', | ||
onRequest () { | ||
expect('actual').to.equal('expected') | ||
}, | ||
}) | ||
.window().then(sendXhr('/foo')) | ||
}) | ||
|
||
it('onRequest exception', () => { | ||
cy.server().route({ | ||
url: '/foo', | ||
onRequest () { | ||
({}).bar() | ||
}, | ||
}) | ||
.window().then(sendXhr('/foo')) | ||
}) | ||
|
||
it('onResponse assertion failure', () => { | ||
cy.server().route({ | ||
url: '/json-content-type', | ||
onResponse () { | ||
expect('actual').to.equal('expected') | ||
}, | ||
}) | ||
.window().then(sendXhr('/json-content-type')) | ||
.wait(10000) | ||
}) | ||
|
||
it('onResponse exception', () => { | ||
cy.server().route({ | ||
url: '/json-content-type', | ||
onResponse () { | ||
({}).bar() | ||
}, | ||
}) | ||
.window().then(sendXhr('/json-content-type')) | ||
.wait(10000) | ||
}) | ||
}) |
Oops, something went wrong.