Skip to content

Commit

Permalink
Add test case and update trigger scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotrk39 committed Feb 5, 2025
1 parent 6466472 commit 2f7ac3e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/e2e/tests/ScenarioTrigger.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import ChatComponentInfoPopover from './ChatComponent/ChatComponentInfoPopover';
import MapComponentFloodExtent from './MapComponent/MapComponentFloodExtent';
import MapComponentGloFASStationsTrigger from './MapComponent/MapComponentGloFASStationsTrigger';
import MapComponentLayersDefault from './MapComponent/MapComponentLayersDefault';
import TimelineComponentNotClickable from './TimelineComponent/TimelineComponentNotClickable';

let accessToken: string;
let page: Page;
Expand Down Expand Up @@ -83,6 +84,10 @@ test.describe('Scenario: Trigger', () => {
ChatComponentInfoPopover(pages, components, disasterType, date);
});

test.describe('TimelineComponent', () => {
TimelineComponentNotClickable(pages, components, disasterType);
});

test.describe('ActionsSummaryComponent', () => {
ActionSummaryTooltipTest(pages, components, disasterType);
});
Expand Down
31 changes: 31 additions & 0 deletions tests/e2e/tests/TimelineComponent/TimelineComponentNotClickable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import test from '@playwright/test';
import { TriggerDataSet } from 'testData/testData.enum';

import { Components, Pages } from '../../helpers/interfaces';

export default (
pages: Partial<Pages>,
components: Partial<Components>,
disasterType: string,
) => {
test('[33066] Timeline Buttons are not clickable in floods', async () => {
const { dashboard } = pages;
const { userState, timeline } = components;

if (!dashboard || !userState || !timeline) {
throw new Error('pages and components not found');
}

// Navigate to disaster type the data was mocked for
await dashboard.navigateToDisasterType(disasterType);
// Assertions
await userState.headerComponentIsVisible({
countryName: TriggerDataSet.CountryName,
});
await timeline.timelineIsInactive();

// Reload the page to prepare for next test
await dashboard.page.goto('/');
await dashboard.page.waitForTimeout(1000);
});
};

0 comments on commit 2f7ac3e

Please sign in to comment.