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

"Cookies are disabled" issue with Epic Hyperspace in Cypress 10.3.0 #22670

Closed
ganeshac123 opened this issue Jul 4, 2022 · 69 comments · Fixed by #23872
Closed

"Cookies are disabled" issue with Epic Hyperspace in Cypress 10.3.0 #22670

ganeshac123 opened this issue Jul 4, 2022 · 69 comments · Fixed by #23872
Assignees
Labels
E2E Issue related to end-to-end testing topic: auth type: bug

Comments

@ganeshac123
Copy link

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.

Screenshot 2022-07-04 at 9 58 43 AM

Screenshot 2022-07-04 at 9 58 56 AM

Cypress Version
10.3.0

Desired behavior

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

Test code to reproduce

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

10.3.0

Other

In recent version of cypress that is 10.3.0, cypress team members informed us that this cookie issue will be solved but it is not solved yet, reference of old bug: #20685

@ganeshac123
Copy link
Author

@cypress-app-bot @cypress-github-team-services-sa Anyone is looking into issue, please take this as priority we are waiting for this from last 5 months.

@ganeshac123
Copy link
Author

@chrisbreiding chrisbreiding self-assigned this Jul 11, 2022
@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jul 11, 2022
@chrisbreiding chrisbreiding changed the title Multi domain support issue "Cookies are disabled" issue with Epic Hyperspace in Cypress 10.3.0 Jul 11, 2022
@chrisbreiding
Copy link
Contributor

It doesn't look like there's enough information to reproduce this, but my hunch is that it will be fixed by #22594. Sites often use document.cookie to check if cookies are enabled or not and #22594 fixes how document.cookie is handled in a cross-origin context. That fix will be out in the next release of Cypress, which should be this week or next week at the latest.

If you'd like to check out if this fixes your issue before the release, you can install a pre-release version:

  • Linux (x64): npm install https://cdn.cypress.io/beta/npm/10.3.1/linux-x64/develop-a9476ecb3d43f628b689e060294a1952937cb1a7/cypress.tgz
  • Linux (arm64): npm install https://cdn.cypress.io/beta/npm/10.3.1/linux-arm64/develop-a9476ecb3d43f628b689e060294a1952937cb1a7/cypress.tgz
  • MacOS (M1/M2): npm install https://cdn.cypress.io/beta/npm/10.3.1/darwin-arm64/develop-a9476ecb3d43f628b689e060294a1952937cb1a7/cypress.tgz
  • MacOS (Intel): npm install https://cdn.cypress.io/beta/npm/10.3.1/darwin-x64/develop-a9476ecb3d43f628b689e060294a1952937cb1a7/cypress.tgz
  • Windows: npm install https://cdn.cypress.io/beta/npm/10.3.1/win32-x64/develop-a9476ecb3d43f628b689e060294a1952937cb1a7/cypress.tgz

If you confirm the issue is fixed, please let us know.

p.s. Please don't spam mention users/teams. We regularly check issues and have a process for responding to them. Adding mentions won't speed up that process.

@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 Jul 11, 2022
@ganeshac123
Copy link
Author

ganeshac123 commented Jul 12, 2022 via email

@chrisbreiding
Copy link
Contributor

It might be easiest to install it globally:

npm install -g https://cdn.cypress.io/beta/npm/10.3.1/darwin-x64/develop-a9476ecb3d43f628b689e060294a1952937cb1a7/cypress.tgz

Then the cypress cli will be available globally and you can run:

cypress open --e2e --project <path to your project>

@ganeshac123
Copy link
Author

ganeshac123 commented Jul 12, 2022 via email

@chrisbreiding
Copy link
Contributor

How do you currently have Cypress installed, using npm or yarn or do you directly download it?

@ganeshac123
Copy link
Author

ganeshac123 commented Jul 12, 2022 via email

@chrisbreiding
Copy link
Contributor

In that case, install it non-globally (no -g) within your project's directory (where the package.json is):

npm install https://cdn.cypress.io/beta/npm/10.3.1/darwin-x64/develop-a9476ecb3d43f628b689e060294a1952937cb1a7/cypress.tgz

It will replace the local copy of cypress and you can run npm run cypress:open to open it. If it's working correctly, it will say It looks like this is your first time using Cypress: 10.3.1 in the terminal and then you'll see 10.3.1 in the top-right of Cypress's UI. That way you'll know it's running the pre-release version.

@ganeshac123
Copy link
Author

ganeshac123 commented Jul 12, 2022 via email

@chrisbreiding
Copy link
Contributor

By same error, do you mean the Cookies are disabled error?

Are you able to share the original url you visit in your test, before it navigates to epic.com? Right now, I'm not able to reproduce the issue, so any test code or information you can provide will be useful for debugging this.

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

ganeshac123 commented Jul 12, 2022 via email

@chrisbreiding
Copy link
Contributor

Can you share the code for your cy.login() custom command implementation?

@ganeshac123
Copy link
Author

ganeshac123 commented Jul 13, 2022 via email

@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 Jul 13, 2022
@chrisbreiding
Copy link
Contributor

Are you able to provide the username and password for that initial login used in the cy.login() command?

@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 Jul 13, 2022
@ganeshac123
Copy link
Author

ganeshac123 commented Jul 13, 2022 via email

@ganeshac123
Copy link
Author

ganeshac123 commented Jul 13, 2022 via email

@mschile
Copy link
Contributor

mschile commented Oct 6, 2022

@ganeshac123, clicking the link above for the PR will show you the status. It was merged 3 days ago. You can install any of the pre-releases since then. Here is the latest one 3e01474#comments

linux (x64): npm install https://cdn.cypress.io/beta/npm/10.10.0/linux-x64/develop-3e014743909b35f54b697d2a759e4a2c5b67b5b7/cypress.tgz

linux (arm64): npm install https://cdn.cypress.io/beta/npm/10.10.0/linux-arm64/develop-3e014743909b35f54b697d2a759e4a2c5b67b5b7/cypress.tgz

MacOS (M1/M2): npm install https://cdn.cypress.io/beta/npm/10.10.0/darwin-arm64/develop-3e014743909b35f54b697d2a759e4a2c5b67b5b7/cypress.tgz

MacOS (Intel): npm install https://cdn.cypress.io/beta/npm/10.10.0/darwin-x64/develop-3e014743909b35f54b697d2a759e4a2c5b67b5b7/cypress.tgz

Windows: npm install https://cdn.cypress.io/beta/npm/10.10.0/win32-x64/develop-3e014743909b35f54b697d2a759e4a2c5b67b5b7/cypress.tgz

@AtofStryker
Copy link
Contributor

Closing as complete with #23872. @ganeshac123 this should be release 10.10.0 this afternoon EST. Can you confirm once the release is available that this issue is fixed?

@ganeshac123
Copy link
Author

ganeshac123 commented Oct 11, 2022 via email

@ganeshac123
Copy link
Author

ganeshac123 commented Oct 12, 2022 via email

@AtofStryker
Copy link
Contributor

Hey @ganeshac123 . I'm sorry to hear this didn't fix your issue. Just to clarify, you tested with 10.10.0? I cannot see an attached screenshot which could be very useful here.

@AtofStryker AtofStryker reopened this Oct 12, 2022
@ganeshac123
Copy link
Author

ganeshac123 commented Oct 12, 2022 via email

@AtofStryker
Copy link
Contributor

@ganeshac123 OK Thank you for confirming. We thought the issue was fixed because it happens intermittently for us, but we think we have an idea what is going on with the initial cookies set by hyperspace. We are working on a solution and will keep you updated.

@AtofStryker
Copy link
Contributor

@ganeshac123 With the implementation of #23531 & #23643 this should unblock the epic login issues to the point where it gets passed "cookies are disabled" and should be in the release next week for Cypress 10.11.0

@ganeshac123
Copy link
Author

ganeshac123 commented Oct 19, 2022 via email

@AtofStryker
Copy link
Contributor

@ganeshac123 it should be resolved with Tuesday's release. I am hoping you can download Cypress 10.11.0 at that time and confirm the issue is resolved for you.

@chrisbreiding
Copy link
Contributor

@ganeshac123, thanks for your patience as we've worked through this. Cypress 10.11.0 is now out, which should resolve your issue. Please let us know if you can confirm that you no longer encounter the Browser cookies were cleared alert.

@ganeshac123
Copy link
Author

ganeshac123 commented Nov 8, 2022

Hi @chrisbreiding @AtofStryker downloaded Cypress 10.11.0 from cypress website, tested browser cookies issue. Looks like issue is not resolved yet.

Screenshot 2022-11-08 at 10 25 44 AM

@nagash77 nagash77 added E2E Issue related to end-to-end testing topic: auth and removed E2E-auth labels Nov 8, 2022
@ganeshac123
Copy link
Author

Hi @chrisbreiding @AtofStryker downloaded Cypress 10.11.0 from cypress website, tested browser cookies issue. i

hi Guys any updates on this, waiting for this issue to solved from one year? Let us know if @cypress-github-team-services-sa is not able to solve it, we can do something from our end?

@AtofStryker
Copy link
Contributor

AtofStryker commented Nov 16, 2022

Hi @ganeshac123 are you running the binary directly? I am running the following test in 11.1.0 installed from npm:

  cy.visit('https://app.suki-test.com')
  .clearLocalStorage()
  .get('[data-cy=textfield-username]', { timeout: 90000 }).type('****')
  .get('[data-cy=textfield-password]').type('****')
  .get('[data-cy=btn-login]').click()

  cy.wait(2000)
  .get('.ant-btn-primary').click()

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

I have run this multiple times and am unable to reproduce the issue. Is there something about our test set up that is different? It doesn't like like a cy.origin block is declared in the screenshot above, which is needed to patch the cookie context correctly. Is that the case?
epic-working

@ganeshac123
Copy link
Author

Where did you enable "experimentalSessionAndOrigin" flag? If I don't enable this flag I am getting error asking for enabling this, If I enable this flag in cypress config, I am not able to any files

@AtofStryker
Copy link
Contributor

Where did you enable "experimentalSessionAndOrigin" flag? If I don't enable this flag I am getting error asking for enabling this,

@ganeshac123 I have experimentalSessionAndOrigin enabled in my cypress.config.js since it needs to be enabled at launch of the server to handle cy.origin. To get cookies to work in this scenario, the experimentalSessionAndOrigin flag needs to be enabled.

If I enable this flag in cypress config, I am not able to any files

What do you mean by this? I am not sure I understand completely.

@ganeshac123
Copy link
Author

I have enabled experimentalSessionAndOrigin flag in cypress.config.js file, after enabling this I am not able to run any files in cypress application(web app downloaded from cypress.io)

@AtofStryker
Copy link
Contributor

@ganeshac123 I'm sorry but I'm still not entirely sure what that means. Is there an error being thrown? Could you share a screenshot?

@ganeshac123
Copy link
Author

ganeshac123 commented Nov 21, 2022

Check the screenshot for error is displayed when trying to run file.
Screenshot 2022-11-21 at 10 54 41 AM

@AtofStryker
Copy link
Contributor

@ganeshac123 this just means you need to change this:

const { defineConfig } = require("cypress");

module.exports = defineConfig({
  experimentalSessionAndOrigin: true,
  e2e: {
    setupNodeEvents(on, config) {
      // implement node event listeners here
    },
  },
});

to this:

const { defineConfig } = require("cypress");

module.exports = defineConfig({
  e2e: {
    experimentalSessionAndOrigin: true,
    setupNodeEvents(on, config) {
      // implement node event listeners here
    },
  },
});

can you try that and report back to let us know if it fixed your issue?

@ganeshac123
Copy link
Author

Now it's working. This issue is resolved now, it was pending from long long time.. Thanks for fixing this @AtofStryker 👍

@AtofStryker
Copy link
Contributor

That's great to hear! Thank you for patience and helping us get this working. Let us know if you run into other trouble!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E Issue related to end-to-end testing topic: auth type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants