forked from rodekruis/IBF-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpload_mock_data.feature
83 lines (72 loc) · 4.59 KB
/
Upload_mock_data.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
@api-admin-user
Feature: Upload mock data
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 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 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 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