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

Many Cypress tests are hanging at the first Visit command during full runs (Electron only) #3662

Closed
funatronics opened this issue Mar 6, 2019 · 5 comments
Labels
type: duplicate This issue or pull request already exists

Comments

@funatronics
Copy link

funatronics commented Mar 6, 2019

Current behavior:

In Electron, about one third of my tests are failing during a full run because it's hanging at the first Visit command (both headless and headed). Usually it's the same tests, but not always. When running alone, I do not experience this issue

Works correctly in Chrome 72.

Steps to reproduce: (app code and test code)

Running all tests. When it hangs, I get this error:

Your page did not fire its 'load' event within '60000ms'.

However, it looks like everything had loaded:

screen shot 2019-03-06 at 2 39 48 pm

Let me know if there is any other debug information I can provide.

Versions

3.1.5
Electron 59

@funatronics funatronics changed the title Many Cypress tests are hanging at the first Visit command during full runs Many Cypress tests are hanging at the first Visit command during full runs (Electron only) Mar 7, 2019
@jennifer-shehane
Copy link
Member

Could you provide the test code you are running? Also, are you sure that your application is indeed firing it's load event within this time?

So, can you see if this is console.logging from your code?

<script>
  window.addEventListener("load", function(event) {
    console.log("load event fired!");
  });
</script>

@funatronics
Copy link
Author

funatronics commented Mar 7, 2019

@jennifer-shehane : Test looks like this:

var loadEvent = "not fired"

window.addEventListener("load", function(event) {
  console.log("load event fired!");
  loadEvent = "fired";
});

describe('Blah Blah Blah', function() {
  it('More Blah Blah', function(){
    var user = this.user; //User object
    var pageInformation = this.pages.addressBook; //Page object
    
    cy.log(loadEvent)

    cy.visit(this.pages.home.url)
    
   //There are more Cypress commands, but it gets stuck at the Visit above
    })
  })

I edited the post above, but it's worth noting that this hanging does not occur in when running in Chrome 72.

And the loadEvent is coming back "fired" (I hope I inserted your script correctly).

@jbpallingayan
Copy link

same experience for me. #2265
we experience this even chrome and electron.

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Mar 8, 2019

This looks to be a duplicate of #2938

I'm curious if blacklisting some hosts as laid out in this comment may help the load event fire. #1608 (comment)

@jennifer-shehane jennifer-shehane added the type: duplicate This issue or pull request already exists label Mar 8, 2019
@funatronics
Copy link
Author

funatronics commented Mar 9, 2019

FYI: I was able to fix this problem by blacklisting Google ad and tracking hosts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants