Skip to content

Commit

Permalink
Change test names add legend test init lines test
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotrk39 committed Nov 11, 2024
1 parent 702a1fd commit dee0b79
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
11 changes: 11 additions & 0 deletions tests/e2e/Pages/MapComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
},
);

0 comments on commit dee0b79

Please sign in to comment.