Closed Josehower closed 3 years ago
I have a very similar issue right now that's been affecting several tests at our company. Locally it's working, even using the electron browser but on circle ci it fails.
cy.get('[aria-expanded=true]').should('exist');
We are running "cypress": "^6.8.0",
All I can think of is that on CI it's headless. I'm not sure why this would make selectors randomly fail though.
We found this 👇🏻 helps and seperating out the test but I believe this should be working
cy.get('[data-cy=selector]').then(($el) => {
Cypress.dom.isVisible($el) // true
})
I think the longer timing due to performance regression is affecting the tests. For now I suggest sticking with the last known Cypress version or trying increasing the default command timeout setting in the cypress.json file.
I was attempting to reproduce (https://github.com/Hypercubed/cypress-issue) an issue we were seeing in our app that looks related this ticket. I am hesitant to post this as a bug since I think, for the most part, it's a flaky test on our end. However, it does show that there is some sort of performance regression in v7.x vs v6. Increasing command timeout doesn't help in our case since it boils down to how long takes takes cypress to run the next command when other things are going on in the app. There has been nothing I can find that can force Cypress to execute the commands fast enough to capture the DOM. Hope this info helps.
Can you all try updating to Cypress 8.0 and report if this issue is still happening? We've addressed some performance issues that were introduced with the screen size changes.
It seems like it's working now. We will test for a couple more days.
But the cy.stub() does not work and neither do the recipes from here: https://glebbahmutov.com/blog/stub-window-open/ It worked well with the older version.
Closing as I believe this is resolved in 8.0.
In 7.0 the screen size was increased when running headlessly. This will slow down runtime and in some cases with low resourced machines (as GitHub Actions may be depending on the background process) it can cause hanging. In 8.0 we reverted this change back to pre-7.0 screen size.
Current behavior
On Cypress 7.0 Test is failing on GitHub Actions due Timeout, Locally the test is working good This test never failed before on older cypress versions
Local Test
Github Actions
Desired behavior
This test should be working as good as always
Test code to reproduce
Test Code
Versions
Last working version
Unexpected behavior version
additional comments
I can confirm that the test duration is significantly longer than the previous version