Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add test for event visibility notification

Josiah Spraguebc38a339f374
diff --git a/e2e/features/events/events.feature b/e2e/features/events/events.feature
index d6586d8c7..cbcf2001a 100644
--- a/e2e/features/events/events.feature
+++ b/e2e/features/events/events.feature
@@ -21,3 +21,12 @@ Scenario: Selecting an Event from the List
When I click the "first event"
Then I see the "selected marker"
And I see the "selected first event"
+ And I see "Events may not be visible at all times" within 4 seconds
+ When I click "Events may not be visible at all times"
+ Then I see "Why can’t I see an event?"
+ When I click the "modal close button"
+ And I wait 2 seconds
+ Then I don't see "Why can’t I see an event?"
+ When I click the "notification dismiss button"
+ And I wait 2 seconds
+ And I don't see "Events may not be visible at all times"
diff --git a/e2e/globals.js b/e2e/globals.js
index 0a8321870..a72af0a0c 100644
--- a/e2e/globals.js
+++ b/e2e/globals.js
@@ -28,7 +28,9 @@ module.exports = {
'first event': '#wv-events ul.map-item-list .item:first-child',
'selected first event': '#wv-events ul.map-item-list .item-selected:first-child',
'selected marker': '.marker-selected',
- 'map marker': '.ol-viewport .marker'
+ 'map marker': '.ol-viewport .marker',
+ 'modal close button': '.ui-dialog.ui-draggable.ui-resizable .ui-dialog-titlebar-close',
+ 'notification dismiss button': '.ui-dialog.notify-alert .fa-times'
},
delay: 3000 // Acceptable delay in ms between performing actions and seeing results
};
diff --git a/e2e/step_definitions/utility.js b/e2e/step_definitions/utility.js
index e03a4a73e..4e836f4c2 100644
--- a/e2e/step_definitions/utility.js
+++ b/e2e/step_definitions/utility.js
@@ -54,6 +54,11 @@ defineSupportCode(({Given, Then, When}) => {
return client.useCss().assert.containsText('body', text);
});
+ // Wait for an element to be visible
+ Then('I see {string} within {int} seconds', (text, seconds) => {
+ return client.useCss().expect.element('body').text.to.contain(text).before(seconds*1000);
+ });
+
// Check for a string
Then('I don\'t see {string}', (text) => {
return client.useCss().expect.element('body').text.not.contains(text);