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

fix(sessions): correct when page is cleared in cy.session() #24563

Merged
merged 7 commits into from Nov 15, 2022
11 changes: 3 additions & 8 deletions packages/app/cypress/e2e/runner/sessions.ui.cy.ts
Expand Up @@ -19,10 +19,7 @@ const validateSetupSessionGroup = (isNewSession = true) => {
cy.get('@setupSession').find('.command-expander').click()
cy.get('@setupSession').find('.command-alias').contains('runSetup')

return cy.contains(groupText)
.closest('.command')
.find('.command-name-Clear-page')
.should('have.length', 1)
return cy.get('@setupSession')
}

describe('runner/cypress sessions.ui.spec', {
Expand Down Expand Up @@ -200,7 +197,7 @@ describe('runner/cypress sessions.ui.spec', {
cy.contains('user1')
cy.contains('restored')

cy.get('.command-name-Clear-page').should('have.length', 1)
cy.get('.command-name-Clear-page').should('have.length', 2)

cy.contains('Restore saved session')

Expand Down Expand Up @@ -258,7 +255,7 @@ describe('runner/cypress sessions.ui.spec', {
.find('.command-expander')
.should('have.class', 'command-expander-is-open')

cy.get('.command-name-Clear-page').should('have.length', 2)
cy.get('.command-name-Clear-page').should('have.length', 3)

validateSetupSessionGroup(false)

Expand Down Expand Up @@ -321,8 +318,6 @@ describe('runner/cypress sessions.ui.spec', {
cy.get('.command-name-Clear-page').should('have.length', 2)

validateSetupSessionGroup(false)
.parent()
.closest('.command')
.next()
.contains('Validate session')
.closest('.command').as('secondValidateSession')
Expand Down