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

Multi domain support issue #21642

Closed
ganeshac123 opened this issue May 26, 2022 · 9 comments
Closed

Multi domain support issue #21642

ganeshac123 opened this issue May 26, 2022 · 9 comments
Assignees
Labels
stage: investigating Someone from Cypress is looking into this

Comments

@ganeshac123
Copy link

ganeshac123 commented May 26, 2022

Current behavior

Cookies are disabled. Please enable cookies to log in to Hyperspace with a browser.

Note: take a look at the screenshot for reference.

Desired behavior

Cypress should allow cross origin as I am using recent version of cypress(9.7.0) this issue reportedly solved.

Test code to reproduce

describe('Note creation flow for Epic user tests', function () {
  it('cy.get() - Login to Suki as a Physician', function () {

    cy.login(USER_PERSONA.EPICUSER)
      .wait(2000)
      .xpath('(//button[@type="button"])[2]').click()
      .wait(6000)

    cy.origin("https://apporchard.epic.com/HSWeb_aocurprd/", ()=>{
      cy.get('#txtUserID').should('be.visible').type('****')
      .get('#txtPassword').should('be.visible').type('******')
      .get('#btnLogin').click()
    })
})

Cypress Version

9.7.0

Other

Uploading Screenshot 2022-05-26 at 12.19.29 PM.png…

@cypress-bot cypress-bot bot added stage: internal stage: investigating Someone from Cypress is looking into this and removed stage: internal labels May 26, 2022
@mschile
Copy link
Contributor

mschile commented May 27, 2022

@ganeshac123, it looks like you may have submitted the issue before the screenshot was completely uploaded as it didn't get correctly attached to the issue.

Are you able to visit the login page outside of cy.origin? Something like:

it("visit login page", () => {
  cy.visit("https://apporchard.epic.com/HSWeb_aocurprd/")
  cy.get('#txtUserID').should('be.visible').type('SUKIAIR')
})

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels May 27, 2022
@ganeshac123
Copy link
Author

@mschile I waited till complete page loading after that only I submitted this issue.

I am not able to login outisde of cy.origin for given link

it("visit login page", () => {
cy.visit("https://apporchard.epic.com/HSWeb_aocurprd/")
cy.get('#txtUserID').should('be.visible').type('SUKIAIR')
})

Screenshot attached for reference.
Screenshot 2022-05-27 at 6 52 55 PM
Screenshot 2022-05-27 at 6 53 07 PM
Uploading Screenshot 2022-05-27 at 6.55.36 PM.png…

@mschile
Copy link
Contributor

mschile commented May 27, 2022

Are you expecting the https://apporchard.epic.com/HSWeb_aocurprd/ link to work? When I tried to visit the link (outside of Cypress) in Chrome it also failed with the same message.
Screen Shot 2022-05-27 at 8 57 24 AM
What does your custom cy.login command do? Does it log you in somewhere else and then you log into apporchard.epic.com? Do you have a reproducible test that I could try?

@denke8
Copy link

denke8 commented May 30, 2022

I think I'm experiencing the same issue:

I opted in to "experimentalSessionAndOrigin"

I created two tests, that are the exact same except
-One matches the baseUrl
-One does not, and is wrapped by cy.origin

Both WP sites are configured correctly, if I manually visit the site, I can log in to both

Both tests try to log into a WordPress admin interface, aside from the above difference they are exactly the same (copy paste)
They do not use external commands, and all information (user, pass) is available and are correctly filled into the form

The test with no cy.origin() does pass
The test with cy.origin(), and the alternate domain does fail, Wp complains about cookies being disabled

Did a tcpdump, cookies are requested to be set by the server:

Set-Cookie: wordpress_test_cookie=WP%20Cookie%20check; path=/

But are never sent back to the server on subsequent navigations/form posts
Tried to dump all cookies fron Cpress and log them to the console, I get back an empty array (please see screenshot below)

image
[pwd is auto-generated for each test execution, so it's not a problem that it shows on the screenshot, no security concern]

It is possible that I'm missing something, if you have any further advice how to debug the issue, please let me know

Cypress: 9.7.0
Chrome: 101
experimentalSessionAndOrigin: true
chromeWebSecurity: false

@ganeshac123
Copy link
Author

Are you expecting the https://apporchard.epic.com/HSWeb_aocurprd/ link to work? When I tried to visit the link (outside of Cypress) in Chrome it also failed with the same message. Screen Shot 2022-05-27 at 8 57 24 AM What does your custom cy.login command do? Does it log you in somewhere else and then you log into apporchard.epic.com? Do you have a reproducible test that I could try?

@mschile
Cy.Login using this we logging into our suki application, after logging there we are navigated to the https://apporchard.epic.com/HSWeb_aocurprd/

@cypress-bot cypress-bot bot added stage: investigating Someone from Cypress is looking into this and removed stage: awaiting response Potential fix was proposed; awaiting response labels May 31, 2022
@mschile
Copy link
Contributor

mschile commented May 31, 2022

@denke8, since you are able to login outside of cy.origin, I'm inclined to believe that you are impacted by our cookie handling within cy.origin. We are currently working on #20685 to hopefully resolve these type of issues.

@ganeshac123, my initial guess is you are being impacted by the same issue.

@denke8
Copy link

denke8 commented May 31, 2022

@mschile Thank you for the info, I'll track that issue for updates!

@ganeshac123
Copy link
Author

@mschile Yes, When this issue will be solved?

@mjhenkes
Copy link
Member

mjhenkes commented Jun 2, 2022

Closing as a duplicate of #20685

@mjhenkes mjhenkes closed this as completed Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: investigating Someone from Cypress is looking into this
Projects
None yet
Development

No branches or pull requests

4 participants