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

Feat.drop old event #1486

Merged
merged 10 commits into from
Mar 18, 2024
1 change: 1 addition & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
environment:
- NODE_ENV=development
- LOCAL_PORT_IBF_SERVICE=${LOCAL_PORT_IBF_SERVICE}
- GEOSERVER_ADMIN_PASSWORD=${GEOSERVER_ADMIN_PASSWORD}
ports:
- ${LOCAL_PORT_IBF_SERVICE}:3000
depends_on:
Expand Down
127 changes: 56 additions & 71 deletions features/API-admin-user/Upload_mock_data.feature
Original file line number Diff line number Diff line change
@@ -1,82 +1,67 @@
@api-admin-user
Feature: Upload mock data

Background:
Given a logged-in user on the Swagger UI page
Background:
Given a logged-in user on the Swagger UI page

Scenario: Upload mock data for all countries & disaster-types at once
Given the user is using the `/api/scripts/mock-all` endpoint
Given the user has filled in the right `secret` (depends on server/environment)
Given the user has filled in 'true' or 'false' for 'triggered'
When the user clicks 'Execute'
Then mock data is uploaded for all countries and all disaster-types
And all are triggered if 'triggered=true' is chosen
And all are non-triggered if 'triggered=false' is chosen
And it includes data for all dynamic admin-area layers defined for that country & disaster-type
And it includes data for dynamic point layers ('Glofas stations' / 'Typhoon track')
And it includes dynamic raster data ('flood extent' / 'rainfall extent')
And only 1 event is uploaded per country and disaster-type (relevant for `typhoon` only)
And the dashboard should be opened/refreshed to check all of this
Scenario: Upload mock data for all countries & disaster-types at once
Given the user is using the `/api/scripts/mock-all` endpoint
Given the user has filled in the right `secret` (depends on server/environment)
Given the user has filled in 'true' or 'false' for 'triggered'
When the user clicks 'Execute'
Then mock data is uploaded for all countries and all disaster-types
And all are triggered if 'triggered=true' is chosen
And all are non-triggered if 'triggered=false' is chosen
And it includes data for all dynamic admin-area layers defined for that country & disaster-type
And it includes data for dynamic point layers ('Glofas stations' / 'Typhoon track')
And it includes dynamic raster data ('flood extent' / 'rainfall extent')
And only 1 event is uploaded per country and disaster-type (relevant for `typhoon` only)
And the dashboard should be opened/refreshed to check all of this

Scenario: Upload mock data for TRIGGERED state (active event) for specific country & disaster-types
Given the user is using the `/api/scripts/mock-dynamic-data` endpoint
Given the user has filled in the right `secret` (depends on server/environment)
Given the user has filled in 'triggered = true'
Given the user has filled in 'removeEvents = true'
Given the user has filled in 'country' and 'disaster-type' (exact right formats)
When the user clicks 'Execute'
Then mock data is uploaded for the chosen 'country' and 'disaster-type'
And it is in triggered state
And all the data as described in previous scenario is uploaded
And the dashboard should be opened/refreshed to check all of this
Scenario: Upload mock data for TRIGGERED state (active event) for specific country & disaster-types
Given the user is using the `/api/scripts/mock-dynamic-data` endpoint
Given the user has filled in the right `secret` (depends on server/environment)
Given the user has filled in 'triggered = true'
Given the user has filled in 'removeEvents = true'
Given the user has filled in 'country' and 'disaster-type' (exact right formats)
When the user clicks 'Execute'
Then mock data is uploaded for the chosen 'country' and 'disaster-type'
And it is in triggered state
And all the data as described in previous scenario is uploaded
And the dashboard should be opened/refreshed to check all of this

Scenario: Upload mock data for NON-TRIGGERED state (no event) for specific country & disaster-types
Given everything the same as previous scenario
Given the user has filled in 'triggered = false'
When the user clicks 'Execute'
Then mock data is uploaded for the chosen 'country' and 'disaster-type'
And it is in non-triggered state
And all the data as described in previous scenario is uploaded
And the dashboard should be opened/refreshed to check all of this
Scenario: Upload mock data for NON-TRIGGERED state (no event) for specific country & disaster-types
Given everything the same as previous scenario
Given the user has filled in 'triggered = false'
When the user clicks 'Execute'
Then mock data is uploaded for the chosen 'country' and 'disaster-type'
And it is in non-triggered state
And all the data as described in previous scenario is uploaded
And the dashboard should be opened/refreshed to check all of this

Scenario: Upload mock data for OLD-EVENT state for specific country & disaster-types
Given user has first created an active event (see scenario TRIGGERE state)
Given the user is subsquently using the `/api/scripts/mock-dynamic-data` endpoint a 2nd time
Given the user changes 'triggered' to 'false'
Given the user changes 'removeEvents' to 'false'
Given the user leaves all other input the same
When the user clicks 'Execute'
Then mock data is uploaded for the chosen 'country' and 'disaster-type'
And it is updating the existing event to become inactive, and thus an 'old event'
And the dashboard should be opened/refreshed to check all of this
And the dashboard is in NON-TRIGGERED state
And the map is showing no triggered areas
And the chat section is showing EAP-actions for all old triggered areas
And see other feature files to look for correct behaviour of old event, by Ctrl+F on 'OLD-EVENT'
Scenario: Upload Typhoon-specific events
Given the disaster-type is 'Typhoon'
Given the user uses the '/api/scripts/mock-typhoon-scenario' endpoint
Given the user fills in one of the available 'scenario' options
Given the user fills in 'eventNr = 1'
When the user clicks 'Execute'
Then the mock data is uploaded for the given 'scenario'
- eventTrigger: exact same result as using '/api/scripts/mock-dynamic-data' endpoint with 'triggered = true'
- noEvent: exact same result as using '/api/scripts/mock-dynamic-data' endpoint with 'triggered = false'
- eventNoTrigger: produces event that does not reach trigger threshold
- eventAfterLandfall: produces (triggered) event that has already made landfall (i.e. leadTime = '0-hour')
- eventNoLandafall: produces (triggered) event with a track that does not make landfall

Scenario: Upload Typhoon-specific events
Given the disaster-type is 'Typhoon'
Given the user uses the '/api/scripts/mock-typhoon-scenario' endpoint
Given the user fills in one of the available 'scenario' options
Given the user fills in 'eventNr = 1'
When the user clicks 'Execute'
Then the mock data is uploaded for the given 'scenario'
- eventTrigger: exact same result as using '/api/scripts/mock-dynamic-data' endpoint with 'triggered = true'
- noEvent: exact same result as using '/api/scripts/mock-dynamic-data' endpoint with 'triggered = false'
- eventNoTrigger: produces event that does not reach trigger threshold
- eventAfterLandfall: produces (triggered) event that has already made landfall (i.e. leadTime = '0-hour')
- eventNoLandafall: produces (triggered) event with a track that does not make landfall

Scenario: Upload 2nd/3rd/etc. Typhoon event
Given the disaster-type is 'Typhoon'
Given user has already created an event (see above)
Given the user is subsquently using the `/api/scripts/mock-typhoon-scenario`
Given the user fills in 'eventNr' as 2/3/etc
When the user clicks 'Execute'
Then mock data is uploaded for a 2nd/3rd/etc event
And the dashboard should be opened/refreshed to check all of this
And the chat-section should show 2/3/etc event buttons in the 2nd speech-bubble
And the timeline-section should show 2/3/etc active lead-time buttons
Scenario: Upload 2nd/3rd/etc. Typhoon event
Given the disaster-type is 'Typhoon'
Given user has already created an event (see above)
Given the user is subsquently using the `/api/scripts/mock-typhoon-scenario`
Given the user fills in 'eventNr' as 2/3/etc
When the user clicks 'Execute'
Then mock data is uploaded for a 2nd/3rd/etc event
And the dashboard should be opened/refreshed to check all of this
And the chat-section should show 2/3/etc event buttons in the 2nd speech-bubble
And the timeline-section should show 2/3/etc active lead-time buttons



Expand Down
72 changes: 36 additions & 36 deletions features/IBF-portal-admin-user/Use_dev_menu.feature
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
@ibf-portal-admin-user
Feature: Use dev menu section

Background:
Given a logged-in "admin" user on the dashboard page
Background:
Given a logged-in "admin" user on the dashboard page

Scenario: Open and view Dev Menu
When the user clicks on menu-icon in the top left of Dashboard page
Then the menu section open up
And it contains a menu list
And the menu list contains 'Version', 'Country', 'Load Mock Scenario', 'Activation Report'
Scenario: Open and view Dev Menu
When the user clicks on menu-icon in the top left of Dashboard page
Then the menu section open up
And it contains a menu list
And the menu list contains 'Version', 'Country', 'Load Mock Scenario', 'Activation Report'

Scenario: Click on Version
When the user clicks "Version"
Then a new tab opens on the IBF Github repository, specifically to the version tag
Scenario: Click on Version
When the user clicks "Version"
Then a new tab opens on the IBF Github repository, specifically to the version tag

Scenario: Switch Country
When the user clicks "country" dropdown of menu section
Then the Country's dropdown section open up
And it contains list of different countries with radio button
And the user select any of the country from the list
When the user selects a country
Then the Dashboard page switches to that country
Scenario: Switch Country
When the user clicks "country" dropdown of menu section
Then the Country's dropdown section open up
And it contains list of different countries with radio button
And the user select any of the country from the list
When the user selects a country
Then the Dashboard page switches to that country

Scenario: View Load Mock Data popup
When the user clicks on "Load Mock Scenario" from menu
Then the 'Load Mock Scenario' popup open up
And it generates a question whether the user wants to mock the situation for selected country
And it contains 3 buttons "cancel", "Old event", "No Trigger", "Trigger" buttons
And it ask user to 'enter the secret' to switch to mock mode
Scenario: View Load Mock Data popup
When the user clicks on "Load Mock Scenario" from menu
Then the 'Load Mock Scenario' popup open up
And it generates a question whether the user wants to mock the situation for selected country
And it contains 3 buttons "cancel", "No Trigger", "Trigger" buttons
And it ask user to 'enter the secret' to switch to mock mode

Scenario: Load mock data successfully
Given the user has opened the mock data popup
And the user has filled in the correct secret
And clicks "Old event" or "No Trigger" or "Trigger"
Then the mock data is loaded in the back-end
And it appears also in the dashboard
And the mock data popup closes
Scenario: Load mock data unsuccessfully
Given the user has opened the mock data popup
And the user has filled in an incorrect secret
And clicks "Old event" or "No Trigger" or "Trigger"
Then a message appears that says 'Failed to set mock scenario'
Scenario: Load mock data successfully
Given the user has opened the mock data popup
And the user has filled in the correct secret
And clicks "No Trigger" or "Trigger"
Then the mock data is loaded in the back-end
And it appears also in the dashboard
And the mock data popup closes

Scenario: Load mock data unsuccessfully
Given the user has opened the mock data popup
And the user has filled in an incorrect secret
And clicks "No Trigger" or "Trigger"
Then a message appears that says 'Failed to set mock scenario'
Loading