From dee0b79f165c2848156b5deee049f5c1a37141f9 Mon Sep 17 00:00:00 2001 From: piotrk39 Date: Mon, 11 Nov 2024 12:05:30 +0100 Subject: [PATCH] Change test names add legend test init lines test --- tests/e2e/Pages/MapComponent.ts | 11 +++++++++++ ...tThresholdLinesAreNotVisibleNoTrigger.spec.ts} | 15 +++------------ ...=> NoAlertThresholdIsVisibleNoTrigger.spec.ts} | 15 +++------------ 3 files changed, 17 insertions(+), 24 deletions(-) rename tests/e2e/tests/Map/{AlertThresholdLinesAreNotVisibleTrigger.spec.ts => AlertThresholdLinesAreNotVisibleNoTrigger.spec.ts} (78%) rename tests/e2e/tests/Map/{AlertThresholdLinesAreVisibleNoTrigger.spec.ts => NoAlertThresholdIsVisibleNoTrigger.spec.ts} (78%) diff --git a/tests/e2e/Pages/MapComponent.ts b/tests/e2e/Pages/MapComponent.ts index 646c4f079..e4e3acf27 100644 --- a/tests/e2e/Pages/MapComponent.ts +++ b/tests/e2e/Pages/MapComponent.ts @@ -188,6 +188,17 @@ class MapComponent extends DashboardPage { await expect(legendComponent).toBeVisible(); } + async assertLegendElementIsNotVisible({ + legendComponentName, + }: { + legendComponentName: string; + }) { + const legendComponent = this.legend.filter({ + hasText: legendComponentName, + }); + await expect(legendComponent).toBeHidden(); + } + async redCrossMarkersAreVisible() { // Wait for the page to load await this.page.waitForSelector('[alt="red-cross-branch-marker"]'); diff --git a/tests/e2e/tests/Map/AlertThresholdLinesAreNotVisibleTrigger.spec.ts b/tests/e2e/tests/Map/AlertThresholdLinesAreNotVisibleNoTrigger.spec.ts similarity index 78% rename from tests/e2e/tests/Map/AlertThresholdLinesAreNotVisibleTrigger.spec.ts rename to tests/e2e/tests/Map/AlertThresholdLinesAreNotVisibleNoTrigger.spec.ts index f8005d0e6..1745922d8 100644 --- a/tests/e2e/tests/Map/AlertThresholdLinesAreNotVisibleTrigger.spec.ts +++ b/tests/e2e/tests/Map/AlertThresholdLinesAreNotVisibleNoTrigger.spec.ts @@ -36,10 +36,7 @@ test.beforeEach(async ({ page }) => { }); test( - qase( - 28, - '[No-trigger] GloFAS stations markers should be visible on "Legend", "Layer" and "Map"', - ), + qase(30, '[No-trigger] No "Alert Threshold Reached" lines are visible'), async ({ page }) => { const dashboard = new DashboardPage(page); const userState = new UserStateComponent(page); @@ -56,14 +53,8 @@ test( await map.mapComponentIsVisible(); await map.isLegendOpen({ legendOpen: true }); - await map.isLayerMenuOpen({ layerMenuOpen: false }); - await map.clickLayerMenu(); - await map.validateCheckboxIsChekced({ layerName: 'Glofas stations' }); - await map.assertLegendElementIsVisible({ - legendComponentName: 'GloFAS No action', + await map.assertLegendElementIsNotVisible({ + legendComponentName: 'Alert Threshold Reached', }); - - // GloFAS layer should be visible by default - await map.gloFASMarkersAreVisible(); }, ); diff --git a/tests/e2e/tests/Map/AlertThresholdLinesAreVisibleNoTrigger.spec.ts b/tests/e2e/tests/Map/NoAlertThresholdIsVisibleNoTrigger.spec.ts similarity index 78% rename from tests/e2e/tests/Map/AlertThresholdLinesAreVisibleNoTrigger.spec.ts rename to tests/e2e/tests/Map/NoAlertThresholdIsVisibleNoTrigger.spec.ts index f8005d0e6..eeff59c36 100644 --- a/tests/e2e/tests/Map/AlertThresholdLinesAreVisibleNoTrigger.spec.ts +++ b/tests/e2e/tests/Map/NoAlertThresholdIsVisibleNoTrigger.spec.ts @@ -36,10 +36,7 @@ test.beforeEach(async ({ page }) => { }); test( - qase( - 28, - '[No-trigger] GloFAS stations markers should be visible on "Legend", "Layer" and "Map"', - ), + qase(29, '[No-trigger] No alert Threshold Reached is visible on the legend'), async ({ page }) => { const dashboard = new DashboardPage(page); const userState = new UserStateComponent(page); @@ -56,14 +53,8 @@ test( await map.mapComponentIsVisible(); await map.isLegendOpen({ legendOpen: true }); - await map.isLayerMenuOpen({ layerMenuOpen: false }); - await map.clickLayerMenu(); - await map.validateCheckboxIsChekced({ layerName: 'Glofas stations' }); - await map.assertLegendElementIsVisible({ - legendComponentName: 'GloFAS No action', + await map.assertLegendElementIsNotVisible({ + legendComponentName: 'Alert Threshold Reached', }); - - // GloFAS layer should be visible by default - await map.gloFASMarkersAreVisible(); }, );