diff --git a/front/tests/002-project-management.spec.ts b/front/tests/002-project-management.spec.ts index cef8290b888..be50334e994 100644 --- a/front/tests/002-project-management.spec.ts +++ b/front/tests/002-project-management.spec.ts @@ -70,7 +70,7 @@ test.describe('Validate the Operational Study Project workflow', () => { }); // Navigate back to the Operational Studies page via the home page - await projectPage.goToHomePage(); + await projectPage.backToHomePage(); await projectPage.goToOperationalStudiesPage(); // Reopen the updated project and validate the updated data diff --git a/front/tests/pages/home-page-model.ts b/front/tests/pages/home-page-model.ts index aaf28f6d0a4..d010bf0e5a3 100644 --- a/front/tests/pages/home-page-model.ts +++ b/front/tests/pages/home-page-model.ts @@ -46,6 +46,7 @@ class HomePage extends CommonPage { // Click on the logo to navigate back to the home page async backToHomePage() { await this.backHomeLogo.click(); + await this.page.waitForLoadState(); } async goToOperationalStudiesPage() { diff --git a/front/tests/pages/stdcm-page-model.ts b/front/tests/pages/stdcm-page-model.ts index 4adff4cbdef..4c52a852c27 100644 --- a/front/tests/pages/stdcm-page-model.ts +++ b/front/tests/pages/stdcm-page-model.ts @@ -490,6 +490,7 @@ class STDCMPage extends HomePage { // Fill and verify origin CI suggestions await this.dynamicOriginCi.fill(input); await this.verifyOriginNorthSuggestions(); + await expect(this.suggestionNWS).toBeVisible(); await this.suggestionNWS.click(); const originCiValue = await this.dynamicOriginCi.getAttribute('value'); expect(originCiValue).toContain(suggestion); @@ -529,6 +530,7 @@ class STDCMPage extends HomePage { // Fill destination input and verify suggestions await this.dynamicDestinationCi.fill(input); await this.verifyDestinationSouthSuggestions(); + await expect(this.suggestionSS).toBeVisible(); await this.suggestionSS.click(); const destinationCiValue = await this.dynamicDestinationCi.getAttribute('value'); expect(destinationCiValue).toContain(suggestion); @@ -569,6 +571,7 @@ class STDCMPage extends HomePage { const { input, chValue, arrivalDate, arrivalTime, tolerance, arrivalType } = LIGHT_ORIGIN_DETAILS; await this.dynamicOriginCi.fill(input); + await expect(this.suggestionNWS).toBeVisible(); await this.suggestionNWS.click(); if (isPrecise && arrivalTypeOverride) { await this.originArrival.selectOption(arrivalTypeOverride); @@ -585,6 +588,7 @@ class STDCMPage extends HomePage { async fillDestinationDetailsLight() { const { input, chValue, arrivalType } = LIGHT_DESTINATION_DETAILS; await this.dynamicDestinationCi.fill(input); + await expect(this.suggestionSS).toBeVisible(); await this.suggestionSS.click(); await expect(this.dynamicDestinationCh).toHaveValue(chValue); await expect(this.destinationArrival).toHaveValue(arrivalType); @@ -622,6 +626,7 @@ class STDCMPage extends HomePage { expect(await this.addViaButton.count()).toBe(viaNumber + 1); await expect(this.getViaCI(viaNumber)).toBeVisible(); await this.getViaCI(viaNumber).fill(ciSearchText); + await expect(selectedSuggestion).toBeVisible(); await selectedSuggestion.click(); await expect(this.getViaCH(viaNumber)).toHaveValue(DEFAULT_DETAILS.chValue); await expect(this.getViaType(viaNumber)).toHaveValue(PASSAGE_TIME);