question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress tests loads page on browser then goes blank immediately after when running against Forge url

See original GitHub issue

Current behavior

I am trying to run Cypress in GitHub actions against an app that is deployed using Forge. It is a Laravel Vue app. The remote url is https://ppt2.nomorecph.com and I have the following test that fails

 it('logs in with correct credentials', () => {
        cy.visit("/login").debug()
        cy.wait(3000);
        cy.get('input[data-cy=email]').type("email@test.com");
        cy.get('input[data-cy=password]').type("password");
        cy.get('[data-cy=login-btn]').click();
})

When developing on localhost, the tests pass, but when I try when the app is deployed on forge on this link, cypress visits the site then abruptly shows a blank page and therefore the tests fail since they can’t find the input fields. These are some screenshots to add context:

Screen Shot 2021-01-28 at 2 59 14 PM Screen Shot 2021-01-28 at 2 59 40 PM

Desired behavior

I expect the tests to pass as they do when I run them against the app when it’s on localhost. I don’t understand why the page initially loads then goes blank on cypress browser

Test code to reproduce


context('Login', () => {

    it('logs in with correct credentials', () => {
        const email = "email@test.com"),
            password = "password";
        cy.visit("/login").debug()
        cy.wait(3000);
        cy.get('input[data-cy=email]').type(email);
        cy.get('input[data-cy=password]').type(password);
        cy.get('[data-cy=login-btn]').click()
        cy.wait(1000);
    })

})

Versions

“cypress”: “^6.2.1”

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Justinohallocommented, Jan 28, 2021

Unfortunately there are multiple threads describing this same issue and they are typically closed by the moderator without a proper resolution.

I switched back to selenium.

On Thu, Jan 28, 2021 at 8:02 AM Tony notifications@github.com wrote:

hey @Justinohallo https://github.com/Justinohallo , thanks for the quick response, had been banging my head on this for quite a while, could you maybe have an idea if there is a fix in the pipeline for this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cypress-io/cypress/issues/14798#issuecomment-769187648, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4EAOD22J77A6JQKX44H2DS4GDBZANCNFSM4WW7LJ7Q .

– Justin O’Halloran Events, Travel & Logistics 1-604-338-2312

0reactions
Justinohallocommented, Jan 29, 2021

Yah, it is a very weird bug. There are numerous threads where that Cypress devs essentially close the thread without addressing anything.

You can hit numerous sites with the same blank page error.

I think one example was www.abercrombie.com

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress loads blank page on attempt to open test app url
On attempt to open simple app url in primitive Cypress (10.11) test (via Chrome browser) - blank page is loaded. cypress.config.js
Read more >
Troubleshooting | Cypress Documentation
If you're having an issue during installation of Cypress, try removing the contents of the Cypress cache. This will clear out all installed...
Read more >
Visit The Blank Page Between Cypress Tests - Gleb Bahmutov
When a Cypress test finishes, the web application stays in the browser's window. ... tests by visiting the blank about page after each...
Read more >
How to Fix The ERR_TOO_MANY_REDIRECTS Error - Kinsta
Essentially the site is stuck (such as URL 1 points to URL 2 and URL 2 points back ... variations of this error...
Read more >
Too Many Redirects: What This Error Means & How to Fix It
Clear cookies on the redirecting website. Clear your browser cache. Ensure your SSL certificate is installed correctly. Evaluate your third- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found