Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add E2E for Triggered agregates #1865

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ test.beforeEach(async ({ page }) => {
// The bug is that the marker of glofas stations cannot be disabled with the first chebox click (needs several) and it is failing on flood disaster type
// https://github.com/rodekruis/IBF-system/issues/1657
// When the bug is fixed, the test should be unskipped
// https://app.qase.io/project/IBF?case=12&previewMode=side&suite=7
test.skip(
qase(
12,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { expect, test } from '@playwright/test';
import AggregatesComponent from 'Pages/AggregatesComponent';
import DashboardPage from 'Pages/DashboardPage';
import UserStateComponent from 'Pages/UserStateComponent';
import { qase } from 'playwright-qase-reporter';
import { TriggerDataSet } from 'testData/testData.enum';

import {
getAccessToken,
mockFloods,
resetDB,
} from '../../helpers/utility.helper';
import LoginPage from '../../Pages/LoginPage';

let accessToken: string;

test.beforeEach(async ({ page }) => {
// Login
const loginPage = new LoginPage(page);

accessToken = await getAccessToken();
await resetDB(accessToken);
// We should maybe create one mock for all different disaster types for now we can just use floods
await mockFloods(
TriggerDataSet.TriggerScenario,
TriggerDataSet.CountryCode,
accessToken,
);

await page.goto('/');
await loginPage.login(TriggerDataSet.UserMail, TriggerDataSet.UserPassword);
});

// https://app.qase.io/project/IBF?case=39&previewMode=side&suite=7
test(
qase(39, '[Trigger] Aggregated number of events should be non-zero'),
async ({ page }) => {
const aggregates = new AggregatesComponent(page);
const dashboard = new DashboardPage(page);
const userState = new UserStateComponent(page);

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

// get the number of warning events and aggregated events
const aggregatesEventCount = await aggregates.getNumberOfPredictedEvents();

// check if the number of warning events is equal to the number of aggregated events
expect(aggregatesEventCount).toBeGreaterThan(0);
jannisvisser marked this conversation as resolved.
Show resolved Hide resolved
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=6&previewMode=side&suite=7
test(
qase(6, 'All Aggregate elements are present in no-trigger mode'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=13&previewMode=side&suite=7
test(
qase(13, 'All Aggregate info buttons show on click information'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=11&previewMode=side&suite=6
test(
qase(
11,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=5&previewMode=side&suite=6
test(
qase(5, 'All Chat section elements are present in no-trigger mode'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test.beforeEach(async ({ page }) => {
await page.goto('/');
await loginPage.login(TriggerDataSet.UserMail, TriggerDataSet.UserPassword);
});

// https://app.qase.io/project/IBF?case=44&previewMode=side&suite=6
test(
qase(44, '[Trigger] Show prediction button is clickable'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.beforeEach(async ({ page }) => {
await page.goto('/');
await loginPage.login(TriggerDataSet.UserMail, TriggerDataSet.UserPassword);
});

// https://app.qase.io/project/IBF?case=43&previewMode=side&suite=6
test(
qase(43, '[Trigger] Amount of events should equal the aggregate number'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=1&previewMode=side&suite=2
test(
qase(1, 'All Dashboard elements are present in no-trigger mode'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=4&previewMode=side&suite=5
test(
qase(4, 'All Disaster Type elements are present in no-trigger mode'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ test.beforeEach(async ({ page }) => {
});
// Test is skipped because it was flaky and more invastigation is needed to fix it
// Logged in PBI: https://dev.azure.com/redcrossnl/IBF/_workitems/edit/32127/
// https://app.qase.io/project/IBF?case=4&previewMode=side&suite=5
test.skip(
qase(10, 'All Disaster Types can be selected in no-trigger mode'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=29&previewMode=side&suite=3
test(
qase(29, '[No-trigger] Alert Threshold Reached is visible on the legend'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=30&previewMode=side&suite=3
test(
qase(30, '[No-trigger] No "Alert Threshold Reached" lines are visible'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=2&previewMode=side&suite=3
test(
qase(2, 'All Map elements are present in no-trigger mode'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=32&previewMode=side&suite=3
test(
qase(32, 'Check if (default) checked checkbox-layers show in map'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=7&previewMode=side&suite=3
test(
qase(7, 'Verify Map functionality for no-triggered mode'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=31&previewMode=side&suite=3
test(
qase(
31,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.beforeEach(async ({ page }) => {
await page.goto('/');
await loginPage.login(TriggerDataSet.UserMail, TriggerDataSet.UserPassword);
});

// https://app.qase.io/project/IBF?case=38&previewMode=side&suite=3
test(
qase(
38,
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/Map/GlofasStationsVisibleNoTrigger.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=28&previewMode=side&suite=3
test(
qase(
28,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=15&previewMode=side&suite=9
test(qase(15, 'Timeline present in no trigger mode'), async ({ page }) => {
const dashboard = new DashboardPage(page);
const userState = new UserStateComponent(page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=14&previewMode=side&suite=9
test(
qase(14, 'Timeline is deactivated in no-trigger mode'),
async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

// https://app.qase.io/project/IBF?case=3&previewMode=side&suite=4
test(
qase(3, 'All User State elements are present in no-trigger mode'),
async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tests/UserState/SuccessfullyLogOut.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ test.beforeEach(async ({ page }) => {
NoTriggerDataSet.UserPassword,
);
});

test(qase(8, 'Log out from IBF-system'), async ({ page }) => {
// https://app.qase.io/project/IBF?case=8&previewMode=side&suite=4
test(qase(4, 'Log out from IBF-system'), async ({ page }) => {
const loginPage = new LoginPage(page);
const dashboard = new DashboardPage(page);
const userState = new UserStateComponent(page);
Expand Down
Loading