-
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: Fix rerunning multidomain tests (#18090)
- Loading branch information
1 parent
cc66129
commit 416aabe
Showing
4 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
packages/driver/cypress/integration/e2e/multidomain_rerun_spec.ts
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 @@ | ||
describe('multidomain - rerun', () => { | ||
beforeEach(() => { | ||
cy.visit('/fixtures/multidomain.html') | ||
// @ts-ignore | ||
cy.anticipateMultidomain() | ||
cy.get('a').click() | ||
}) | ||
|
||
// this test will hang without the fix for multidomain rerun | ||
// https://github.com/cypress-io/cypress/issues/18043 | ||
it('successfully reruns tests', () => { | ||
// @ts-ignore | ||
cy.switchToDomain('127.0.0.1:3501', () => { | ||
cy.get('[data-cy="dom-check"]') | ||
}) | ||
.then(() => { | ||
const top = window.top! | ||
const { hash } = top.location | ||
|
||
// @ts-ignore | ||
if (!top.hasRunOnce) { | ||
// @ts-ignore | ||
top.hasRunOnce = true | ||
|
||
// hashchange causes the test to rerun | ||
top.location.hash = `${hash}?rerun` | ||
|
||
return | ||
} | ||
|
||
// this only executes after the test has been rerun | ||
expect(true).to.be.true | ||
}) | ||
}) | ||
}) |
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