Fix cypress landing flaky test

pull/2409/head
Jérémy Rialland 2022-12-05 15:10:00 +01:00 committed by Jérémy Rialland
parent cae23d2b20
commit 0804e1d452
1 changed files with 7 additions and 7 deletions

View File

@ -33,19 +33,19 @@ describe('Landing page', function () {
FIXTURES_FOLDER
)
cy.intercept({
method: 'GET',
hostname: 'api.recherche-entreprises.fabrique.social.gouv.fr',
url: '/api/v1/search*',
}).as('entreprises')
cy.visit('/')
cy.get(currentCompanyPath).should('not.exist')
cy.get(searchInputPath).should('have.attr', 'placeholder')
cy.get(searchInputPath).invoke('attr', 'type').should('equal', 'search')
cy.get(searchInputPath).focus().type('noima').wait('@entreprises')
cy.get(searchInputPath).focus().type('noima')
cy.intercept({
method: 'GET',
hostname: 'api.recherche-entreprises.fabrique.social.gouv.fr',
url: '/api/v1/search?*',
})
cy.get(searchResultsPath).children().should('have.length', 6)
cy.get(searchResultsPath).children().first().click()