generated from mmisty/cypress-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[minor] mark parent step as broken when children have errors and unca…
…ught exception support (#157)
- Loading branch information
Showing
8 changed files
with
332 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { visitHtml } from '../../common/helper'; | ||
|
||
describe('uncaught error', () => { | ||
it('#1 test pass', function () { | ||
cy.on('uncaught:exception', () => { | ||
// returning false here prevents Cypress from | ||
// failing the test | ||
return false; | ||
}); | ||
|
||
visitHtml({ | ||
script: ` | ||
throw new Error('UNCAUGHT 1'); | ||
`, | ||
}); | ||
|
||
cy.get('div').should('exist'); | ||
}); | ||
|
||
it('#1 test pass with parent', function () { | ||
cy.on('uncaught:exception', () => { | ||
// returning false here prevents Cypress from | ||
// failing the test | ||
return false; | ||
}); | ||
|
||
cy.allure().startStep('VISITING'); | ||
visitHtml({ | ||
script: ` | ||
throw new Error('UNCAUGHT 1'); | ||
`, | ||
}); | ||
|
||
cy.allure().endStep(); | ||
cy.get('div').should('exist'); | ||
}); | ||
|
||
it('#2 test fail', function () { | ||
cy.on('uncaught:exception', () => { | ||
// returning false here prevents Cypress from | ||
// failing the test | ||
return false; | ||
}); | ||
cy.allure().startStep('VISITING'); | ||
visitHtml({ | ||
script: ` | ||
throw new Error('UNCAUGHT 1'); | ||
`, | ||
}); | ||
cy.get('div').should('not.exist'); | ||
cy.allure().endStep(); | ||
}); | ||
|
||
it('#3 test fail', function () { | ||
cy.allure().startStep('VISITING'); | ||
visitHtml({ | ||
script: ` | ||
throw new Error('UNCAUGHT 1'); | ||
`, | ||
}); | ||
cy.get('div').should('not.exist'); | ||
cy.allure().endStep(); | ||
}); | ||
|
||
it('#5 test fail', function () { | ||
cy.allure().startStep('VISITING'); | ||
|
||
cy.allure().endStep(); | ||
cy.allure().startStep('VISITING2'); | ||
cy.allure().startStep('CHILD'); | ||
cy.allure().endStep('failed'); | ||
|
||
cy.allure().endStep(); | ||
}); | ||
}); |
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
Oops, something went wrong.