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

feat: (multi-domain) adding support for cy.visit in multi-domain #20467

Merged
merged 10 commits into from
Mar 8, 2022

Conversation

mschile
Copy link
Contributor

@mschile mschile commented Mar 3, 2022

User facing changelog

n/a

Additional details

This change supports the following:

  • Using cy.visit() within switchToDomain both as the first navigation to a new domain or navigating within the domain
    • Note: relative urls are NOT currently supported
  • Using cy.go() within switchToDomain

Details:

  • Stability is sync'd in from primary domain to allow the command queue to proceed
  • When requesting a change to the iframe src prop in the secondary, a message is sent to the primary to perform that actual change since the secondary does not have access to the $autIframe
  • When resolving the url on the backend, the isMultiDomain value is passed along to:
    • prevent the server from updating the remote state with the new origin
    • inject fullMultiDomain for buffered multi-domain responses
  • hasVisitedAboutBlank is sync'd between primary and secondary to ensure about:blank is only visited once for the spec

How has the user experience changed?

Users are now able to use cy.visit() within switchToDomain

    it('supports visiting primary first', () => {
      // visit primary that doesn't redirect to secondary
      cy.visit('/fixtures/multi-domain.html')

      cy.switchToDomain('foobar.com', () => {
        // visit secondary
        cy.visit('http://www.foobar.com:3500/fixtures/multi-domain-secondary.html')

        cy.get('[data-cy="dom-check"]').should('have.text', 'From a secondary domain')
      })
    })

Screen Shot 2022-03-03 at 10 33 54 AM

PR Tasks

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

@mschile mschile requested a review from a team as a code owner March 3, 2022 17:35
@mschile mschile requested review from jennifer-shehane and removed request for a team March 3, 2022 17:35
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 3, 2022

Thanks for taking the time to open a PR!

@jennifer-shehane jennifer-shehane removed their request for review March 3, 2022 17:44
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.

Very nice! Besides the few nitpicks, it looks there are some legitimately failing tests that need to be looked into.

packages/driver/src/cy/commands/navigation.ts Outdated Show resolved Hide resolved
packages/driver/src/cy/commands/navigation.ts Outdated Show resolved Hide resolved
packages/driver/src/cy/commands/navigation.ts Outdated Show resolved Hide resolved
@cypress
Copy link

cypress bot commented Mar 3, 2022



Test summary

20258 0 326 4Flakiness 5


Run details

Project cypress
Status Passed
Commit c5c867d
Started Mar 7, 2022 6:56 PM
Ended Mar 7, 2022 7:10 PM
Duration 13:29 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/commands/net_stubbing_spec.ts Flakiness
1 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"
2 network stubbing > intercepting response > can 'delay' a proxy response using Promise.delay
3 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"
4 network stubbing > intercepting response > can 'delay' a proxy response using Promise.delay
5 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"

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
Member

@mjhenkes mjhenkes left a comment

Choose a reason for hiding this comment

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

You've made this look easy :)

@AtofStryker AtofStryker self-requested a review March 4, 2022 14:37
@chrisbreiding chrisbreiding self-requested a review March 4, 2022 16:22
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