diff --git a/site/cypress/integration/mon-entreprise/demande-mobilité.ts b/site/cypress/integration/mon-entreprise/demande-mobilité.ts index b846f27a1..a137ae13d 100644 --- a/site/cypress/integration/mon-entreprise/demande-mobilité.ts +++ b/site/cypress/integration/mon-entreprise/demande-mobilité.ts @@ -67,7 +67,7 @@ describe( cy.contains('Non').click() cy.focused().tab().type('Pouts') cy.wait('@communes') - cy.focused().contains('65100').type('{enter}') + cy.contains('65100', { timeout: 10000 }).type('{enter}') cy.focused().tab().type('{downarrow}') cy.focused().tab().type('Brest') diff --git a/site/cypress/integration/mon-entreprise/english/navigation.ts b/site/cypress/integration/mon-entreprise/english/navigation.ts index 56f1a39bd..d4e5313e8 100644 --- a/site/cypress/integration/mon-entreprise/english/navigation.ts +++ b/site/cypress/integration/mon-entreprise/english/navigation.ts @@ -80,7 +80,15 @@ describe(`Navigation to income simulator using company name (${ .parentsUntil('li') .find('button') .click() + + cy.location().should((loc) => { + expect(loc.pathname).to.match(/834364291$/) + }) + + cy.contains(fr ? 'Lancer le simulateur' : 'Launch the simulator') + cy.contains('SAS(U)').siblings('a').click() + cy.location().should((loc) => { expect(loc.pathname).to.match(/sasu$/) }) @@ -105,6 +113,16 @@ describe(`Navigation to income simulator using company name (${ .parentsUntil('li') .find('button') .click() + + cy.location().should((loc) => { + expect(loc.pathname).to.match(/493096580$/) + }) + cy.contains( + fr + ? 'Simulateurs pour votre entreprise' + : 'Simulateurs pour votre entreprise' + ) + // ask if auto-entrepreneur cy.contains(fr ? 'auto-entrepreneur' : 'auto-entrepreneur') cy.contains(fr ? 'Oui' : 'Yes').click() diff --git a/site/cypress/integration/mon-entreprise/english/status.ts b/site/cypress/integration/mon-entreprise/english/status.ts index 6da1140a2..4408a31b8 100644 --- a/site/cypress/integration/mon-entreprise/english/status.ts +++ b/site/cypress/integration/mon-entreprise/english/status.ts @@ -5,7 +5,9 @@ describe.skip('Status guide', function () { beforeEach(function () { cy.visit(fr ? encodeURI('/créer') : '/create') - cy.contains(fr ? 'Trouver le bon statut' : 'Find the right status').click() + cy.contains(fr ? 'Trouver le bon statut' : 'Find the right status').click({ + waitForAnimations: true, + }) }) it('should allow to go back clicking on the previous answers', function () { diff --git a/site/cypress/integration/mon-entreprise/landing.ts b/site/cypress/integration/mon-entreprise/landing.ts index 534a63d5a..0536324b9 100644 --- a/site/cypress/integration/mon-entreprise/landing.ts +++ b/site/cypress/integration/mon-entreprise/landing.ts @@ -41,8 +41,7 @@ describe('Landing page', function () { cy.get(searchInputPath).should('have.attr', 'placeholder') cy.get(searchInputPath).invoke('attr', 'type').should('equal', 'search') - cy.get(searchInputPath).focus() - cy.type('noima') + cy.get(searchInputPath).first().type('noima') cy.intercept( { diff --git a/site/cypress/support/simulateur.js b/site/cypress/support/simulateur.ts similarity index 92% rename from site/cypress/support/simulateur.js rename to site/cypress/support/simulateur.ts index 6c5e04181..e3a5b200b 100644 --- a/site/cypress/support/simulateur.js +++ b/site/cypress/support/simulateur.ts @@ -19,19 +19,21 @@ export const runSimulateurTest = (simulateur) => { it('should display a result when entering a value in any of the currency input', function () { cy.contains(fr ? 'Montant annuel' : 'Annual amount').click() if (['indépendant', 'profession-liberale'].includes(simulateur)) { - cy.get(chargeInputSelector).type(1000) + cy.get(chargeInputSelector).type('1000') } cy.get(inputSelector).each(($testedInput) => { // eslint-disable-next-line cypress/unsafe-to-chain-command cy.wrap($testedInput) .type('{selectall}60111') .and(($i) => - expect($i.val().replace(/[\s,.€]/g, '')).to.match(/[1-9][\d]{3,6}$/) + expect(($i.val() as string).replace(/[\s,.€]/g, '')).to.match( + /[1-9][\d]{3,6}$/ + ) ) cy.get(inputSelector).each(($input) => { if ($testedInput.get(0) === $input.get(0)) return cy.wrap($input).and(($i) => { - const val = $i.val().replace(/[\s,.€]/g, '') + const val = ($i.val() as string).replace(/[\s,.€]/g, '') expect(val).not.to.be.eq('60111') expect(val).to.match(/[1-9][\d]{3,6}$/) })