cypress: After upgrading to cypress 13, all test fail with blank page after the first IT
Current behavior
After I upgrade to Cypress 13, my test start failing, due to the testIsolation concept introduced.
I really believe the testIsolation is fine as far as the isolation is applied between test runs (ex, a full spec file) but I really not understand how this helps inside the same test file, for each IT.
While I like and I understand the test isolation concept, I really do not understand
testIsolation should be applied at spec level not at IT level, all my tests now are broken due to this change, and also becomes harder now to chunk a single test in steps.
Desired behavior
No response
Test code to reproduce
Run this test
For example how would this test look now in Cypress 13 to pass?
describe('Test home page', () => {
before(() => {
cy.visit('http://localhost:4200');
});
it('shows nav menu on top', () => {
cy.get('.desktop-only .main-nav.nav li').should('have.length', 8);
cy.get('.desktop-only .main-nav.nav li').eq(1).should('have.text', 'Shitje');
cy.get('.desktop-only .main-nav.nav li').eq(6).should('have.text', 'Hyr');
});
it('can search cities in the input select with autosuggest', () => {
const newItem = 'Tiran';
cy.get('.xselect-input-wrapper input').focus();
cy.get('.xselect-input-wrapper input').type(`${newItem}`, { scrollBehavior: false });
cy.get('.xselect-option').should('length.gte', 1).first().contains(newItem);
});
it('loads the featured properties', () => {
cy.get('.featured-properties').scrollIntoView();
cy.get('.featured-properties a').should('have.length', 3);
});
it('loads the recent property card', () => {
cy.get('[data-testid="recent-props"]').scrollIntoView();
cy.get('.homepage-recent-properties .property-card').should('have.length', 7);
});
it('loads the most searched locations', () => {
cy.get('.home-popular').scrollIntoView();
cy.get('.popular-area').should('have.length', 10);
});
});
Cypress Version
13
Node version
v18.15.0
Operating System
Window12
Debug Logs
No response
Other
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 18 (6 by maintainers)
@albanx - Over the past few months, we’ve transitioned our test suite to Playwright, as we no longer feel that Cypress aligns with our evolving needs. They have great test isolation 🙌