-
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.
chore: ensure legacy retry overrides work; reject exp. retries overrides
- Loading branch information
1 parent
1b15b2a
commit 4a3dd4b
Showing
6 changed files
with
116 additions
and
0 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
23 changes: 23 additions & 0 deletions
23
system-tests/projects/experimental-retries/cypress-experimental-retries.config.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,23 @@ | ||
module.exports = { | ||
e2e: { | ||
supportFile: false, | ||
setupNodeEvents (on, config) { | ||
// in the case the tests needed to be debugged: | ||
|
||
// on('before:browser:launch', (browser, launchOptions) => { | ||
// launchOptions.args.push('--auto-open-devtools-for-tabs') | ||
|
||
// return launchOptions | ||
// }) | ||
}, | ||
}, | ||
retries: { | ||
experimentalStrategy: 'detect-flake-and-pass-on-threshold', | ||
runMode: true, | ||
openMode: true, | ||
experimentalOptions: { | ||
maxRetries: 3, | ||
passesRequired: 1, | ||
}, | ||
}, | ||
} |
18 changes: 18 additions & 0 deletions
18
system-tests/projects/experimental-retries/cypress-legacy-retries.config.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,18 @@ | ||
module.exports = { | ||
e2e: { | ||
supportFile: false, | ||
setupNodeEvents (on, config) { | ||
// in the case the tests needed to be debugged: | ||
|
||
// on('before:browser:launch', (browser, launchOptions) => { | ||
// launchOptions.args.push('--auto-open-devtools-for-tabs') | ||
|
||
// return launchOptions | ||
// }) | ||
}, | ||
}, | ||
retries: { | ||
runMode: 0, | ||
openMode: 0, | ||
}, | ||
} |
29 changes: 29 additions & 0 deletions
29
...-tests/projects/experimental-retries/cypress/e2e/override-with-experimental-retries.cy.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,29 @@ | ||
describe('overriding legacy retries with experimental retries', () => { | ||
const experimentalStrategy = 'detect-flake-and-pass-on-threshold' | ||
const openMode = false | ||
const runMode = true | ||
const maxRetries = 3 | ||
const passesRequired = 1 | ||
|
||
describe('at the describe level', { | ||
retries: { | ||
experimentalStrategy, | ||
openMode, | ||
runMode, | ||
experimentalOptions: { | ||
maxRetries, | ||
passesRequired, | ||
}, | ||
}, | ||
}, () => { | ||
it('sets the config', () => { | ||
const retries = Cypress.config('retries') | ||
|
||
expect(retries.experimentalStrategy).to.eq(experimentalStrategy) | ||
expect(retries.experimentalOptions?.maxRetries).to.eq(maxRetries) | ||
expect(retries.experimentalOptions?.passesRequired).to.eq(passesRequired) | ||
expect(retries.runMode).to.eq(runMode) | ||
expect(retries.openMode).to.eq(openMode) | ||
}) | ||
}) | ||
}) |
16 changes: 16 additions & 0 deletions
16
system-tests/projects/experimental-retries/cypress/e2e/override-with-legacy-retries.cy.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,16 @@ | ||
describe('overriding experimental retries with legacy retries', () => { | ||
const openMode = 1 | ||
const runMode = 3 | ||
|
||
it('sets the config', { | ||
retries: { | ||
openMode, | ||
runMode, | ||
}, | ||
}, () => { | ||
const retries = Cypress.config('retries') | ||
|
||
expect(retries.runMode).to.eq(runMode) | ||
expect(retries.openMode).to.eq(openMode) | ||
}) | ||
}) |
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