diff --git a/tests/e2e/Pages/MapComponent.ts b/tests/e2e/Pages/MapComponent.ts index bfaf33330..e7263b635 100644 --- a/tests/e2e/Pages/MapComponent.ts +++ b/tests/e2e/Pages/MapComponent.ts @@ -24,6 +24,7 @@ class MapComponent extends DashboardPage { readonly alerThresholdLines: Locator; readonly closeButtonIcon: Locator; readonly layerInfoContent: Locator; + readonly ibfAggregatePane: Locator; constructor(page: Page) { super(page); @@ -56,6 +57,9 @@ class MapComponent extends DashboardPage { ); this.closeButtonIcon = this.page.getByTestId('close-matrix-icon'); this.layerInfoContent = this.page.getByTestId('layer-info-content'); + this.ibfAggregatePane = this.page.locator( + '.leaflet-pane.leaflet-ibf-aggregate-pane', + ); } async mapComponentIsVisible() { @@ -377,5 +381,16 @@ class MapComponent extends DashboardPage { expect(await glofasMarker.count()).toBe(0); } } + + // This method checks that when radio button is checked then the layer is visible in leaflet-ibf-aggregate-pane + // Only one radio button can be checked at a time + // It valdates the functionality not data displayed + async validateAggregatePaneIsNotEmpty() { + const aggregatePaneContent = this.ibfAggregatePane.locator( + '.leaflet-interactive', + ); + const aggregatePaneContentCount = await aggregatePaneContent.count(); + expect(aggregatePaneContentCount).toBeGreaterThan(0); + } } export default MapComponent; diff --git a/tests/e2e/tests/Map/ExposedPopulationVisibleInTrigger.spec.ts b/tests/e2e/tests/Map/ExposedPopulationVisibleInTrigger.spec.ts index 53f8b8091..d03a60671 100644 --- a/tests/e2e/tests/Map/ExposedPopulationVisibleInTrigger.spec.ts +++ b/tests/e2e/tests/Map/ExposedPopulationVisibleInTrigger.spec.ts @@ -55,14 +55,15 @@ test( await map.isLegendOpen({ legendOpen: true }); await map.isLayerMenuOpen({ layerMenuOpen: false }); await map.clickLayerMenu(); + await map.isLayerMenuOpen({ layerMenuOpen: true }); await map.verifyLayerRadioButtonCheckedByName({ layerName: 'Exposed population', }); await map.assertLegendElementIsVisible({ legendComponentName: 'Exposed population', }); - // Exposed population layer should be visible by default in trigger mode - console.log('Exposed population layer is visible'); + // Validate that the aggregate pane is not empty after the layer is checked and loaded + await map.validateAggregatePaneIsNotEmpty(); }, );