-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
8.2.0 and later still rerun before hooks when visiting multiple superdomains #17940
Comments
Cypress 9.2.0 encountered the same problem, can it be solved? @jennifer-shehane |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
Hmmm, not sure I care for this bot. Bugs don't have a habit of just fixing themselves, and it's frustrating that the Cypress team never engaged or acknowledged the issue, despite the time and effort I put into creating a reproducible example. I can certainly try the MWE in my original description against the latest version of Cypress, but that doesn't feel worth my time unless a human from the Cypress team is willing to look at the issue. |
Hi @c32hedge , Cypress has been evolving our support process in the last year. We are trying to do a better job of staying on top of issues both old and new. While we wish we had the resources and time to address every single issue that is raised by the community that is not realistic at this moment in time. The stalebot helps us make sure issues are still relevant, and in spite of what you might think, many bugs do get addressed either inadvertently or are missed when a developer is closing out related bugs. The work Cypress did on cy.origin affected many areas of visit and how we handle domains in general. I would ask that you please verify that this issue is still happening. If you can confirm you are still seeing the issue, our team will be happy to pick this ticket back up and investigate. |
Hi @nagash77 , I can verify this issue is still happening in 12.13.0 (Ubuntu). before(() => {
// Read-only tests so reset once
cy.visit(Cypress.env('DT_DATABASE_RESET'));
cy.wait(5000);
});
beforeEach(() => {
cy.visit(Cypress.env('DT_EDITOR_URL') + '/examples/extensions/searchPanes.html');
});
describe('Editor tests - SearchPanes', () => {
it('Single string in one pane', () => {
cy.contains('Pandora').click();
});
it('Single string in two panes', () => {
cy.contains('Singapore').click();
});
}); In this code, the However, if I remove the |
I was able to reproduce in with https://github.com/AtofStryker/cypress-issue-17940. The visit in the |
When will this be fixed? We just received email from a support engineer and they confirmed our issue even with the latest version. This is costing us 75K unneeded tests per year because of this. Thanks, Steve |
@steve-schreiner Cypress does not charge per 'hook' run, we only charge per 'it' block that is run. This should not cost you any extra in terms of extra tests run within Cypress. Could you explain how you calculated this costing 75K tests per year? |
The work-around does indeed run in an 'it' block. We have added the duplicated 'it' blocks (91) times to resolve the problem in our test suite. Our test suite runs about 4 times a day which equates to an additional 95k unneeded tests per year. |
@steve-schreiner Thanks for describing the issue. I've added this as consideration for discussion for Cypress 14 since the change in this behavior, while more correct, would likely require some code changes from users. We'll be discussing scope of Cypress 14 soon and what should be included. |
Our team discussed this issue and made some implementation decisions. We will not make this a part of Cypress 14, since changing the behavior for all users might result in some unexpected behavior that users would not want. To summarize:
So we need a switch to allow users to determine what behavior they want. We would introduce a new configuration, something like Since this is no longer a part of Cypress 14 scope, we're prioritizing some 14 work first ahead of this. |
Current behavior
Previously mentioned in #14179, which was closed as a duplicate of #9026 but seems to have lost this distinction when that one was marked fixed by #17498. The behavior described below was not fixed by #17884.
I can confirm that #17498 fixed the issue with tests being skipped. However, as I described in #14179, the top-level
before
blocks still get run multiple times, once for each innerdescribe
:Note the extra
log
statements in the second and third tests--thebefore 1
andbefore 2
logs should only happen once, not three times.Desired behavior
Before blocks shouldn't be rerun.
Test code to reproduce
Cypress Version
8.3.1
Other
Reproduced on both 8.2.0 and 8.3.1
If I replace the second and third
cy.visit
calls with the same superdomain as the first test, the tests behave as I would expect.The text was updated successfully, but these errors were encountered: