Skip to content
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(multi-domain): adding websocket support for backend and automation requests #19843

Conversation

mschile
Copy link
Contributor

@mschile mschile commented Jan 24, 2022

User facing changelog

n/a

Additional details

  • Connected a websocket from the secondary domain to the server to allow backend and automation requests
  • Removed the skip for the following tests:
    • getCookie(), getCookies(), setCookie, clearCookie(), clearCookies()
    • fixture(), readFile()
    • exec(), task()
  • The writeFile() test is failing due to an issue stubbing Cypress.backend. This will need to be investigated further outside of this PR so the skip can be removed.

How has the user experience changed?

User is not able to perform tasks that interact with the server.

PR Tasks

  • Have tests been added/updated?
  • [n/a] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [n/a] Has a PR for user-facing changes been opened in cypress-documentation?
  • [n/a] Have API changes been updated in the type definitions?
  • [n/a] Have new configuration options been added to the cypress.schema.json?

@mschile mschile requested a review from a team as a code owner January 24, 2022 15:41
@mschile mschile requested review from jennifer-shehane and removed request for a team January 24, 2022 15:41
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 24, 2022

Thanks for taking the time to open a PR!

@mschile mschile requested review from chrisbreiding, AtofStryker and mjhenkes and removed request for jennifer-shehane January 24, 2022 15:41
@cypress
Copy link

cypress bot commented Jan 24, 2022



Test summary

19553 0 278 4Flakiness 1


Run details

Project cypress
Status Passed
Commit 8c0f963
Started Jan 25, 2022 11:38 PM
Ended Jan 25, 2022 11:50 PM
Duration 12:15 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/commands/net_stubbing_spec.ts Flakiness
1 network stubbing > intercepting response > can 'delay' a proxy response using Promise.delay

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Contributor

@chrisbreiding chrisbreiding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see the writeFile test fixed and uncommented if possible, but otherwise, looks great.

@@ -28,10 +23,10 @@ context('multi-domain files', { experimentalSessionSupport: true, experimentalMu
})
})

// FIXME: Cypress.backend.resolves is not a function
// Works when not using switchToDomain
// FIXME: stub on Cypress.backend is causing an infinite loop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The primary driver writeFile tests call through to the real implementation of Cypress.backend, so I guess they actually write the file. I think that's fine because we do intend the driver tests to often be e2e or integration tests.

It might not necessary to stub Cypress.backend here at all. I think we do it in the other tests primarily to test out when it fails and rejects, but just testing the happy path here is fine for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does call through in the beforeEach but in the actual it block, it calls .resolves() to mock the writeFile(). I doubt we want to actually write a file unless it was to a temp directory or maybe write to an existing file and check the modified date?

packages/driver/src/multi-domain/index.ts Outdated Show resolved Hide resolved
packages/driver/src/multi-domain/index.ts Outdated Show resolved Hide resolved
// at eval(webpack:///../driver/src/cy/commands/task.ts?:72:78)
// From previous event: at task(webpack:///../driver/src/cy/commands/task.ts?:71:15)
it.skip('.task()', () => {
it('.task()', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its nice to see all these tests getting enabled 🎉

@chrisbreiding chrisbreiding changed the title chore (multi-domain): adding websocket support for backend and automation requests chore(multi-domain): adding websocket support for backend and automation requests Jan 25, 2022
@mschile mschile merged commit b50fe56 into feature-multidomain Jan 26, 2022
@mschile mschile deleted the issue-19767-multi-domain-backend-automation-request branch January 26, 2022 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants