From 8ad07ef6056c95eed402bc90f48772997086cc61 Mon Sep 17 00:00:00 2001 From: piotrk39 Date: Wed, 22 Jan 2025 16:49:42 +0100 Subject: [PATCH] Add implicit awaits and timeout for for map legend & aggregates elements --- tests/e2e/Pages/MapComponent.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/e2e/Pages/MapComponent.ts b/tests/e2e/Pages/MapComponent.ts index fbb9c8547..ce88753ee 100644 --- a/tests/e2e/Pages/MapComponent.ts +++ b/tests/e2e/Pages/MapComponent.ts @@ -143,7 +143,12 @@ class MapComponent extends DashboardPage { async clickLayerCheckbox({ layerName }: { layerName: string }) { // Remove Glofas station from the map (in case the mock is for floods) + await this.page.waitForLoadState('networkidle'); + await this.page.waitForLoadState('domcontentloaded'); + await this.layerMenuToggle.click(); + await this.page.waitForSelector('data-testid=matrix-layer-name'); + const getLayerRow = this.page .getByTestId('matrix-layer-name') .filter({ hasText: layerName }); @@ -273,6 +278,7 @@ class MapComponent extends DashboardPage { await this.page.waitForLoadState('networkidle'); await this.page.waitForLoadState('domcontentloaded'); await this.page.waitForSelector('.leaflet-interactive'); + await this.page.waitForTimeout(200); // Assert that Aggregates title is visible and does not contain the text 'National View'