Skip to content

Commit

Permalink
(BSR)[PRO] test: be sure to have homepage loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
scolson-pass committed Sep 5, 2024
1 parent 3a72bc4 commit 5fe8f9c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pro/cypress/e2e/step-definitions/commonSteps.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import {
When,
} from '@badeball/cypress-cucumber-preprocessor'

function homePageLoaded(): void {
cy.findByText('Bienvenue dans l’espace acteurs culturels')
cy.findByText('Vos adresses')
cy.findByText('Ajouter un lieu')
cy.findAllByTestId('spinner').should('not.exist')
}

Given('I open the {string} page', (page: string) => {
cy.visit('/' + page)
})
Expand All @@ -18,23 +25,22 @@ When('I go to the {string} page', (page: string) => {
cy.findAllByText(page).first().click()
cy.url().should('not.equal', urlSource)
})
cy.findAllByTestId('spinner').should('not.exist')
})

Given('I am logged in with account 1', () => {
cy.login({
email: '[email protected]',
password: 'user@AZERTY123',
})
cy.findAllByTestId('spinner').should('not.exist')
homePageLoaded()
})

Given('I am logged in with account 2', () => {
cy.login({
email: '[email protected]',
password: 'user@AZERTY123',
})
cy.findAllByTestId('spinner').should('not.exist')
homePageLoaded()
})

Given('I am logged in with account 2 and no cookie selection', () => {
Expand All @@ -43,7 +49,6 @@ Given('I am logged in with account 2 and no cookie selection', () => {
password: 'user@AZERTY123',
refusePopupCookies: false,
})
cy.findAllByTestId('spinner').should('not.exist')
})

// créer un seul scénario createOffers avec son step-def
Expand Down

0 comments on commit 5fe8f9c

Please sign in to comment.