-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: prevent serialization issues with retries using multi-domain #20628
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1c6cc20
fix: prevent serialization issues with retries using multi-domain by …
AtofStryker 536d2e9
Merge branch 'feature-multidomain' of github.com:cypress-io/cypress i…
AtofStryker 8b7b999
recursively map Objects/Arrays to literallys if keys inside Object ma…
AtofStryker 4c5e8da
update chromium based tests to now expect error objects to be literal…
AtofStryker 4a4272c
avoid sanitizing primary to secondary user defined data
AtofStryker 51de416
update new system test name to not be the copy pasta alternate :)
AtofStryker 57297db
Merge branch 'feature-multidomain' into fix_multi_domain_retries
mjhenkes 9486f78
uncomment firefox tests to attempt run in CI
AtofStryker cc0a4bd
Merge branch 'feature-multidomain' into fix_multi_domain_retries
mjhenkes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
84 changes: 84 additions & 0 deletions
84
system-tests/__snapshots__/multi_domain_retries_spec.ts.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,84 @@ | ||
exports['e2e multi domain retries / Appropriately displays test retry errors without other side effects'] = ` | ||
|
||
==================================================================================================== | ||
|
||
(Run Starting) | ||
|
||
┌────────────────────────────────────────────────────────────────────────────────────────────────┐ | ||
│ Cypress: 1.2.3 │ | ||
│ Browser: FooBrowser 88 │ | ||
│ Specs: 1 found (multi_domain_retries_spec.ts) │ | ||
│ Searched: cypress/integration/multi_domain_retries_spec.ts │ | ||
└────────────────────────────────────────────────────────────────────────────────────────────────┘ | ||
|
||
|
||
──────────────────────────────────────────────────────────────────────────────────────────────────── | ||
|
||
Running: multi_domain_retries_spec.ts (1 of 1) | ||
|
||
|
||
multi-domain test retries | ||
(Attempt 1 of 3) appropriately retries test within "switchToDomain" without propagating other errors errors | ||
(Attempt 2 of 3) appropriately retries test within "switchToDomain" without propagating other errors errors | ||
1) appropriately retries test within "switchToDomain" without propagating other errors errors | ||
|
||
|
||
0 passing | ||
1 failing | ||
|
||
1) multi-domain test retries | ||
appropriately retries test within "switchToDomain" without propagating other errors errors: | ||
AssertionError: expected true to be false | ||
[stack trace lines] | ||
|
||
|
||
|
||
|
||
(Results) | ||
|
||
┌────────────────────────────────────────────────────────────────────────────────────────────────┐ | ||
│ Tests: 1 │ | ||
│ Passing: 0 │ | ||
│ Failing: 1 │ | ||
│ Pending: 0 │ | ||
│ Skipped: 0 │ | ||
│ Screenshots: 3 │ | ||
│ Video: true │ | ||
│ Duration: X seconds │ | ||
│ Spec Ran: multi_domain_retries_spec.ts │ | ||
└────────────────────────────────────────────────────────────────────────────────────────────────┘ | ||
|
||
|
||
(Screenshots) | ||
|
||
- /XXX/XXX/XXX/cypress/screenshots/multi_domain_retries_spec.ts/multi-domain test (1280x720) | ||
retries -- appropriately retries test within switchToDomain without propagating | ||
other errors errors (failed).png | ||
- /XXX/XXX/XXX/cypress/screenshots/multi_domain_retries_spec.ts/multi-domain test (1280x720) | ||
retries -- appropriately retries test within switchToDomain without propagating | ||
other errors errors (failed) (attempt 2).png | ||
- /XXX/XXX/XXX/cypress/screenshots/multi_domain_retries_spec.ts/multi-domain test (1280x720) | ||
retries -- appropriately retries test within switchToDomain without propagating | ||
other errors errors (failed) (attempt 3).png | ||
|
||
|
||
(Video) | ||
|
||
- Started processing: Compressing to 32 CRF | ||
- Finished processing: /XXX/XXX/XXX/cypress/videos/multi_domain_retries_spec.ts.mp (X second) | ||
4 | ||
|
||
|
||
==================================================================================================== | ||
|
||
(Run Finished) | ||
|
||
|
||
Spec Tests Passing Failing Pending Skipped | ||
┌────────────────────────────────────────────────────────────────────────────────────────────────┐ | ||
│ ✖ multi_domain_retries_spec.ts XX:XX 1 - 1 - - │ | ||
└────────────────────────────────────────────────────────────────────────────────────────────────┘ | ||
✖ 1 of 1 failed (100%) XX:XX 1 - 1 - - | ||
|
||
|
||
` |
15 changes: 15 additions & 0 deletions
15
system-tests/projects/e2e/cypress/integration/multi_domain_retries_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,15 @@ | ||
// @ts-ignore / session support is needed for visiting about:blank between tests | ||
describe('multi-domain test retries', { experimentalSessionSupport: true }, () => { | ||
beforeEach(() => { | ||
cy.visit('/multi_domain.html') | ||
cy.get('a[data-cy="multi_domain_secondary_link"]').click() | ||
}) | ||
|
||
it('appropriately retries test within "switchToDomain" without propagating other errors errors', function () { | ||
cy.switchToDomain('http://foobar.com:4466', () => { | ||
cy.then(() => { | ||
expect(true).to.be.false | ||
}) | ||
}) | ||
}) | ||
}) |
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,49 @@ | ||
import path from 'path' | ||
import systemTests, { expect } from '../lib/system-tests' | ||
import Fixtures from '../lib/fixtures' | ||
|
||
const e2ePath = Fixtures.projectPath('e2e') | ||
|
||
const PORT = 3500 | ||
const onServer = function (app) { | ||
app.get('/multi_domain_secondary.html', (_, res) => { | ||
res.sendFile(path.join(e2ePath, `multi_domain_secondary.html`)) | ||
}) | ||
} | ||
|
||
describe('e2e multi domain retries', () => { | ||
systemTests.setup({ | ||
servers: [{ | ||
port: 4466, | ||
onServer, | ||
}], | ||
settings: { | ||
hosts: { | ||
'*.foobar.com': '127.0.0.1', | ||
}, | ||
}, | ||
}) | ||
|
||
systemTests.it('Appropriately displays test retry errors without other side effects', { | ||
// keep the port the same to prevent issues with the snapshot | ||
port: PORT, | ||
spec: 'multi_domain_retries_spec.ts', | ||
snapshot: true, | ||
expectedExitCode: 1, | ||
config: { | ||
experimentalMultiDomain: true, | ||
experimentalSessionSupport: true, | ||
retries: 2, | ||
}, | ||
async onRun (exec) { | ||
const res = await exec() | ||
|
||
// verify that retrying tests with multi domain doesn't cause serialization problems to spec bridges on test:before:run:async | ||
expect(res.stdout).to.not.contain('TypeError') | ||
expect(res.stdout).to.not.contain('Cannot set property message of which has only a getter') | ||
|
||
expect(res.stdout).to.contain('AssertionError') | ||
expect(res.stdout).to.contain('expected true to be false') | ||
}, | ||
}) | ||
}) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
we technically only have to do this for Objects/Arrays, but figured this is easier to maintain to do full recursion in which the property is just returned. This can be optimized a bit more if we find this highly important