-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1865 from rodekruis/feat.add-e2e-test-for-aggrega…
…tes-in-trigger-mode Add E2E for Triggered agregates
- Loading branch information
Showing
23 changed files
with
78 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
tests/e2e/tests/AggregatesSection/AggregatesShouldNotBeZeroInTriggerState.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters