build: remove old cypress retry hack (#4413)
This commit is contained in:
Родитель
67abad7c8b
Коммит
532ce97e01
|
@ -2,8 +2,5 @@
|
|||
"projectId": "4j4z3k",
|
||||
"requestTimeout": 10000,
|
||||
"record": false,
|
||||
"defaultCommandTimeout": 10000,
|
||||
"env": {
|
||||
"RETRY_FAILED_TESTS": true
|
||||
}
|
||||
"defaultCommandTimeout": 10000
|
||||
}
|
||||
|
|
|
@ -18,57 +18,3 @@ import './commands'
|
|||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
|
||||
// https://github.com/cypress-io/cypress/issues/1313#issuecomment-449456550
|
||||
// eslint-disable-next-line
|
||||
if (Cypress.env('RETRY_FAILED_TESTS')) {
|
||||
let skip = false
|
||||
const _it = window.it
|
||||
const _beforeEach = window.beforeEach
|
||||
|
||||
window.beforeEach = (...args) => {
|
||||
const beforeEachFn = args.pop()
|
||||
args.push(() => {
|
||||
if (!skip) beforeEachFn()
|
||||
})
|
||||
_beforeEach(...args)
|
||||
}
|
||||
|
||||
window.it = (testName, testFn) => {
|
||||
if (!testFn) {
|
||||
_it(testName)
|
||||
return
|
||||
}
|
||||
|
||||
_it(`${testName} 🔄 1 of 3`, function () {
|
||||
skip = true
|
||||
// eslint-disable-next-line
|
||||
cy.on('fail', () => {
|
||||
skip = false
|
||||
this.skip()
|
||||
})
|
||||
testFn()
|
||||
})
|
||||
|
||||
_it(`${testName} 🔄 2 of 3`, function () {
|
||||
if (skip) this.skip()
|
||||
skip = true
|
||||
// eslint-disable-next-line
|
||||
cy.on('fail', () => {
|
||||
skip = false
|
||||
this.skip()
|
||||
})
|
||||
testFn()
|
||||
})
|
||||
|
||||
_it(`${testName} 🔄 3 of 3`, function () {
|
||||
const _skip = skip
|
||||
skip = false
|
||||
if (_skip) this.skip()
|
||||
testFn()
|
||||
})
|
||||
}
|
||||
|
||||
window.it.skip = _it.skip
|
||||
window.it.only = _it.only
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче