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

Page goes into infinite refresh loop(Phoenix Liveview websites) #29690

Open
bynasrivastav99 opened this issue Jun 17, 2024 · 7 comments
Open
Labels

Comments

@bynasrivastav99
Copy link

bynasrivastav99 commented Jun 17, 2024

Current behavior

When navigating from any page to another page which uses Phoenix Liveview, the page goes into infinite refresh loop.
In the below code I first visit a website(could be any website) and from that website I try redirecting to another webpage(website made using Phoenix Liveview) and try and click on 'Get-Started' button. But as soon as cypress redirects to the concerned page it starts to refresh and keeps on refreshing and the execution of test lines does not move forward.
Note: If we navigate directly to page using Phoenix Liveview, the refresh issue does not seem to happen.

Test.page.refresh.issue.mp4

Desired behavior

The test should first visit the given webpage, then navigate to another given webpage and click on 'Get-Started' button thus opening sign-in pop-up.

Test code to reproduce

/// <reference types="Cypress" />

describe("Visit", () => {
  it("visit testcase", () => {
    cy.visit("https://elixirstream.dev/regex");//Can visit any webpage
    cy.visit('https://rocketvalidator.com/');//Website made by elixir+Phoenix LV
    cy.contains('Get Started').click();
    //Below are a list of few website which produce same behaviour.
     //cy.visit('https://www.intelidoc.io/');
    // cy.visit('https://2024.elixirconf.com/');
    //cy.visit("https://websocketstest.com/ ");
  });
});

Cypress Version

13.11.0

Node version

v21.4.0

Operating System

Windows 11 Pro

Debug Logs

No response

Other

No response

@jennifer-shehane jennifer-shehane added type: bug stage: needs investigating Someone from Cypress needs to look at this labels Jun 18, 2024
@srivastav99
Copy link

Hi @jennifer-shehane , any update on this.

@jennifer-shehane
Copy link
Member

I'm no seeing this exact issue with the information provided. I get this error:

Screenshot 2024-08-05 at 11 22 56 AM

@jennifer-shehane jennifer-shehane added stage: needs information Not enough info to reproduce the issue and removed stage: needs investigating Someone from Cypress needs to look at this labels Aug 5, 2024
@srivastav99
Copy link

srivastav99 commented Aug 7, 2024

Hi @jennifer-shehane , for that particular code, i too am getting the same issue.
Please try with following below code:

describe("Visit", () => {
  it("visit testcase", () => {
    
    cy.visit("https://elixirstream.dev/regex");//Can visit any webpage
    cy.visit('https://2024.elixirconf.com/');
   
    //Below are a list of few website which produce same behaviour.
    //cy.visit('https://www.arta.io/contact-us');
    //cy.visit('https://arta-us.sothebys.com/');
    //cy.visit('https://www.intelidoc.io/');
    //cy.visit('https://rocketvalidator.com/');//Website made by elixir+Phoenix LV
    //cy.contains('Get Started').click();
  });
});

@srivastav99
Copy link

This is the screencast of results for the above code:

cypress.reloading.issue.mp4

@srivastav99
Copy link

Hi @jennifer-shehane , any further update on this.

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Aug 26, 2024

I am able to see this behavior of infinite reloading of the AUT website with no resolution in the tests while running the below code in 13.13.3.

  it("visit testcase", () => {
    cy.visit("https://elixirstream.dev/regex");//Can visit any webpage
    cy.visit('https://2024.elixirconf.com/');
})

This used to accurately show an error about how you should use cy.origin in this case of visiting two different superdomains. But in 12.0.0 this just started looping through trying to resolve the new visit.

@srivastav99 Call cy.origin for this second visit instead of cy.visit to get around this.

Screenshot 2024-08-26 at 2 52 14 PM

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Aug 26, 2024

Ok, actually this shouldn't error - the origin error will actually only display if you run commands against the new origin in v12. I'm not sure why this is infinitely reloading, it certainly shouldn't

@jennifer-shehane jennifer-shehane added stage: needs investigating Someone from Cypress needs to look at this Reproducible Can be reproduced and removed stage: needs information Not enough info to reproduce the issue labels Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants