-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(driver): fix integration test retry configuration #18643
Changes from 6 commits
d243a15
973f354
f24ec80
66c2fd8
2eb8ef1
e1cdde4
891567a
15ffd2f
f741ecb
55e70e1
f987fac
14cc8a6
f6bb5df
358b844
717c8dc
5edf0ee
e89ab54
a9d0d81
37b8892
952dda3
c1f9ae1
6c25eb5
e19d176
11f5c14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,13 @@ const helpers = require('../../support/helpers') | |
const { _, Promise, $ } = Cypress | ||
|
||
describe('src/cy/commands/navigation', () => { | ||
before(() => { | ||
expect(Cypress.config('retries')).to.deep.eq({ | ||
runMode: 2, | ||
openMode: 0, | ||
}) | ||
}) | ||
|
||
context('#reload', () => { | ||
before(() => { | ||
cy | ||
|
@@ -163,6 +170,8 @@ describe('src/cy/commands/navigation', () => { | |
}) | ||
|
||
it('throws passing 2 invalid arguments', { defaultCommandTimeout: 200, retries: 1 }, (done) => { | ||
expect(Cypress.config('retries')).to.eq(1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. testing the value of |
||
|
||
cy.on('fail', (err) => { | ||
expect(err.message).to.eq('`cy.reload()` can only accept a boolean or `options` as its arguments.') | ||
expect(err.docsUrl).to.eq('https://on.cypress.io/reload') | ||
|
@@ -174,6 +183,7 @@ describe('src/cy/commands/navigation', () => { | |
}) | ||
|
||
it('throws passing 1 invalid argument', (done) => { | ||
expect(Cypress.config('retries')).to.deep.eq({ runMode: 2, openMode: 0 }) | ||
cy.on('fail', (err) => { | ||
expect(err.message).to.eq('`cy.reload()` can only accept a boolean or `options` as its arguments.') | ||
expect(err.docsUrl).to.eq('https://on.cypress.io/reload') | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,17 +1,11 @@ | ||||||||||||||||||||||||||||
const { $ } = Cypress | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
let isActuallyInteractive | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
isActuallyInteractive = Cypress.config('isInteractive') | ||||||||||||||||||||||||||||
if (!isActuallyInteractive) { | ||||||||||||||||||||||||||||
// we want to only enable retries in runMode | ||||||||||||||||||||||||||||
// and because we set `isInteractive` above | ||||||||||||||||||||||||||||
// we have to set retries here | ||||||||||||||||||||||||||||
Cypress.config('retries', 2) | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was here as a workaround to the fact that we set Cypress's cypress/packages/driver/src/cypress.ts Lines 147 to 159 in 2eb8ef1
Locally, it was returning 0 for me in this PR, which makes sense since this workaround was removed. |
||||||||||||||||||||||||||||
before(() => { | ||||||||||||||||||||||||||||
expect(Cypress.config('retries')).to.deep.eq({ runMode: 2, openMode: 0 }) | ||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
beforeEach(() => { | ||||||||||||||||||||||||||||
isActuallyInteractive = Cypress.config('isInteractive') | ||||||||||||||||||||||||||||
const isActuallyInteractive = Cypress.config('isInteractive') | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// always set that we're interactive so we | ||||||||||||||||||||||||||||
// get consistent passes and failures when running | ||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work because of
isInteractive
being forced to true