Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

revise timeline e2e tests to reduce test suite, move date selector to separate file

Ed Plato623cf23173f9
diff --git a/e2e/features/timeline/date-selector-test.js b/e2e/features/timeline/date-selector-test.js
new file mode 100644
index 000000000..97e8d855e
--- /dev/null
+++ b/e2e/features/timeline/date-selector-test.js
@@ -0,0 +1,121 @@
+const reuseables = require('../../reuseables/skip-tour.js');
+const localSelectors = require('../../reuseables/selectors.js');
+const localQuerystrings = require('../../reuseables/querystrings.js');
+const dateSelectorMinuteInput = '#date-selector-main .input-wrapper-minute input';
+const dateSelectorHourInput = '#date-selector-main .input-wrapper-hour input';
+const dateSelectorDayInput = '#date-selector-main .input-wrapper-day input';
+const dateSelectorMonthInput = '#date-selector-main .input-wrapper-month input';
+const dateSelectorYearInput = '#date-selector-main .input-wrapper-year input';
+const TIME_LIMIT = 20000;
+
+module.exports = {
+ beforeEach: client => {
+ reuseables.loadAndSkipTour(client, TIME_LIMIT);
+ client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
+ },
+
+ // verify subdaily default year, month, day, hour, minute date selector inputs
+ 'Verify subdaily default year, month, day, hour, minute date selector inputs': client => {
+ client.url(client.globals.url + localQuerystrings.subdailyLayerIntervalTimescale);
+ client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
+ client.expect.element(dateSelectorMinuteInput).to.be.visible;
+ client.expect.element(dateSelectorHourInput).to.be.visible;
+ client.expect.element(dateSelectorDayInput).to.be.visible;
+ client.expect.element(dateSelectorMonthInput).to.be.visible;
+ client.expect.element(dateSelectorYearInput).to.be.visible;
+ client.end();
+ },
+
+ // verify change date using left/right date arrows
+ 'Change date using left/right arrows': client => {
+ client.url(client.globals.url + localQuerystrings.knownDate);
+ client.assert.attributeContains(dateSelectorDayInput, 'value', '22');
+ client.click('#left-arrow-group');
+ client.assert.attributeContains(dateSelectorDayInput, 'value', '21');
+ client.click('#right-arrow-group');
+ client.assert.attributeContains(dateSelectorDayInput, 'value', '22');
+ },
+
+ // verify default left arrow enabled since loaded on current day
+ 'Left timeline arrow will not be disabled by default': client => {
+ client.assert.cssClassNotPresent('#left-arrow-group', 'button-disabled');
+ },
+
+ // verify default right arrow disabled since loaded on current day
+ 'Right timeline arrow will be disabled by default': client => {
+ client.assert.cssClassPresent('#right-arrow-group', 'button-disabled');
+ },
+
+ // verify valid right arrow enabled since NOT loaded on current day
+ 'Right timeline arrow will not be disabled': client => {
+ client.url(client.globals.url + localQuerystrings.knownDate);
+ client.assert.cssClassNotPresent('#right-arrow-group', 'button-disabled');
+ },
+
+ // verify date selector is populated with date YYYY-MON-DD
+ 'Verify date selector is populated with date YYYY-MON-DD': client => {
+ client.url(client.globals.url + '?t=2019-02-22');
+ client.assert.attributeContains(dateSelectorDayInput, 'value', '22');
+ client.assert.attributeContains(dateSelectorMonthInput, 'value', 'FEB');
+ client.assert.attributeContains(dateSelectorYearInput, 'value', '2019');
+ },
+
+ // verify subdaily date selector is populated with date YYYY-MON-DD-HH-MM
+ 'Verify subdaily date selector is populated with date YYYY-MON-DD-HH-MM': client => {
+ client.url(client.globals.url + localQuerystrings.subdailyLayerIntervalTimescale);
+
+ client.assert.attributeContains(dateSelectorMinuteInput, 'value', '46');
+ client.assert.attributeContains(dateSelectorHourInput, 'value', '09');
+ client.assert.attributeContains(dateSelectorDayInput, 'value', '04');
+ client.assert.attributeContains(dateSelectorMonthInput, 'value', 'OCT');
+ client.assert.attributeContains(dateSelectorYearInput, 'value', '2019');
+ },
+
+ // verify user can temporarily input incorrect day values in date selector
+ 'Allow invalid day values in date selector': client => {
+ client.url(client.globals.url + '?t=2019-02-22');
+ client
+ .click(dateSelectorDayInput)
+ .setValue(dateSelectorDayInput, [31, client.Keys.ENTER]);
+ client.assert.cssClassPresent(dateSelectorDayInput, 'invalid-input');
+ },
+
+ // verify user can change year on invalid date to a valid one and remove invalid-input class
+ 'Allow invalid year to valid year values in date selector': client => {
+ client.url(client.globals.url + '?t=2019-02-22');
+ client
+ .click(dateSelectorYearInput)
+ .setValue(dateSelectorYearInput, [2020, client.Keys.ENTER]);
+ client.setValue(dateSelectorMonthInput, ['MAR', client.Keys.ENTER]);
+ client.setValue(dateSelectorDayInput, [31, client.Keys.ENTER]);
+ client.setValue(dateSelectorYearInput, [2019, client.Keys.ENTER]);
+ client.assert.cssClassNotPresent(dateSelectorDayInput, 'invalid-input');
+ client.assert.cssClassNotPresent(dateSelectorMonthInput, 'invalid-input');
+ client.assert.cssClassNotPresent(dateSelectorYearInput, 'invalid-input');
+ },
+
+ // date selector up arrow rolls over from Feb 28 to 1 (non leap year) and the inverse
+ 'Date selector up arrow rolls over from Feb 28 to 1 (non leap year) and the inverse': client => {
+ client.url(client.globals.url + '?t=2013-02-28');
+ client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
+ client
+ .click('div.input-wrapper.input-wrapper-day > div.date-arrows.date-arrow-up')
+ .pause(500);
+
+ client.assert.attributeContains(dateSelectorDayInput, 'value', '01');
+ client.assert.attributeContains(dateSelectorMonthInput, 'value', 'FEB');
+ client.assert.attributeContains(dateSelectorYearInput, 'value', '2013');
+
+ client
+ .click('div.input-wrapper.input-wrapper-day > div.date-arrows.date-arrow-down')
+ .pause(500);
+
+ client.assert.attributeContains(dateSelectorDayInput, 'value', '28');
+ client.assert.attributeContains(dateSelectorMonthInput, 'value', 'FEB');
+ client.assert.attributeContains(dateSelectorYearInput, 'value', '2013');
+ },
+
+ after: client => {
+ client.end();
+ }
+};
diff --git a/e2e/features/timeline/timeline-test.js b/e2e/features/timeline/timeline-test.js
index 4256c927f..5d02a88cd 100644
--- a/e2e/features/timeline/timeline-test.js
+++ b/e2e/features/timeline/timeline-test.js
@@ -1,24 +1,23 @@
const reuseables = require('../../reuseables/skip-tour.js');
const localSelectors = require('../../reuseables/selectors.js');
const localQuerystrings = require('../../reuseables/querystrings.js');
+const draggerA = '.timeline-dragger.draggerA ';
const dateSelectorDayInput = '#date-selector-main .input-wrapper-day input';
-const dateSelectorMonthInput = '#date-selector-main .input-wrapper-month input';
-const dateSelectorYearInput = '#date-selector-main .input-wrapper-year input';
const TIME_LIMIT = 20000;
module.exports = {
beforeEach: client => {
reuseables.loadAndSkipTour(client, TIME_LIMIT);
+ client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
},
// verify timescale dragger is visible
'Dragger is visible': client => {
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
+ client.expect.element(localSelectors.dragger).to.be.visible;
},
// verify timescale is expanded by default and can be opened/closed
'Timeline is expanded by default and closes/reopen on clicking timeline chevrons': client => {
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client.expect.element('#timeline-footer').to.be.visible;
// hide timeline
client
@@ -35,20 +34,17 @@ module.exports = {
// verify default MMM YYYY format is displayed on axis
'verify default MMM YYYY format is displayed on axis': client => {
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client.assert.elementPresent('.axis-grid-text-day');
client.assert.elementPresent('.axis-grid-text-year');
},
// verify default 1 day interval
'Interval defaults to 1 DAY': client => {
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client.assert.containsText('#current-interval', '1 DAY');
},
// change to month zoom level
'Change to month zoom level and axis changes': client => {
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client
.click('.zoom-level-change div.date-arrows.date-arrow-up')
.pause(500);
@@ -59,7 +55,6 @@ module.exports = {
// change to year zoom level
'Change to year zoom level and axis changes': client => {
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client
.click('.zoom-level-change div.date-arrows.date-arrow-up')
.pause(500);
@@ -74,7 +69,6 @@ module.exports = {
// verify subdaily default year, month, day, hour, minute, and custom intervals
'Interval subdaily default year, month, day, hour, minute, and custom available': client => {
client.url(client.globals.url + localQuerystrings.subdailyLayerIntervalTimescale);
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client
.useCss()
.moveToElement('#timeline-interval-btn-container', 0, 0)
@@ -92,7 +86,6 @@ module.exports = {
// verify interval state restored from permalink
'Interval state of HOUR restored from permalink': client => {
client.url(client.globals.url + localQuerystrings.subdailyLayerIntervalTimescale);
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client
.useCss()
.moveToElement('#timeline-interval-btn-container', 0, 0)
@@ -116,7 +109,6 @@ module.exports = {
// verify changing custom interval changes current interval and how many time units change with date arrows
'Select custom interval changes current interval and changes date by current interval': client => {
client.url(client.globals.url + localQuerystrings.knownDate);
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client.assert.attributeContains(dateSelectorDayInput, 'value', '22');
client
.useCss()
@@ -135,14 +127,12 @@ module.exports = {
// verify default day timescale zoom level
'Timescale zoom level defaults to DAY': client => {
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client.assert.containsText('#current-zoom', 'DAY');
},
// verify subdaily default year, month, day, hour, minute, and custom intervals
'Timescale zoom subdaily default year, month, day, hour, minute, and custom intervals': client => {
client.url(client.globals.url + localQuerystrings.subdailyLayerIntervalTimescale);
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client
.useCss()
.moveToElement('#current-zoom', 0, 0)
@@ -159,7 +149,6 @@ module.exports = {
// verify timescale zoom state restored from permalink
'Timescale zoom HOUR restored from permalink': client => {
client.url(client.globals.url + localQuerystrings.subdailyLayerIntervalTimescale);
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
client
.useCss()
.waitForElementVisible('#current-zoom', TIME_LIMIT);
@@ -167,57 +156,34 @@ module.exports = {
client.end();
},
- // verify change date using left/right date arrows
- 'Change date using left/right arrows': client => {
- client.url(client.globals.url + localQuerystrings.knownDate);
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
- client.assert.attributeContains(dateSelectorDayInput, 'value', '22');
- client.click('#left-arrow-group');
- client.assert.attributeContains(dateSelectorDayInput, 'value', '21');
- client.click('#right-arrow-group');
- client.assert.attributeContains(dateSelectorDayInput, 'value', '22');
- },
-
- // verify default left arrow enabled since loaded on current day
- 'Left timeline arrow will not be disabled by default': client => {
+ // blue hover line and valid date tooltip date are present on hovering over timeline axis
+ 'Blue hover line is present on hovering over timeline axis': client => {
+ client.url(client.globals.url + '?t=2019-02-22');
client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
- client.assert.cssClassNotPresent('#left-arrow-group', 'button-disabled');
- },
+ client
+ .useCss()
+ .moveToElement(draggerA, 15, 15)
+ .mouseButtonDown(0)
+ .waitForElementVisible('.date-tooltip', TIME_LIMIT)
+ .assert.containsText('.date-tooltip', '2019-02-22 (53)')
+ .mouseButtonUp(0)
+ .moveTo(null, -200, 0);
- // verify default right arrow disabled since loaded on current day
- 'Right timeline arrow will be disabled by default': client => {
- client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
- client.assert.cssClassPresent('#right-arrow-group', 'button-disabled');
+ client.waitForElementVisible('.axis-hover-line-container', TIME_LIMIT);
+ client.expect.element('.axis-hover-line-container').to.be.visible;
+ client.expect.element('.date-tooltip').to.be.visible;
},
- // verify valid right arrow enabled since NOT loaded on current day
- 'Right timeline arrow will not be disabled': client => {
- client.url(client.globals.url + localQuerystrings.knownDate);
+ // subdaily valid date tooltip date is present on hovering over timeline axis
+ 'Subdaily date tooltip date is present on hovering over timeline axis': client => {
+ client.url(client.globals.url + localQuerystrings.subdailyLayerIntervalTimescale);
client.waitForElementVisible(localSelectors.dragger, TIME_LIMIT);
- client.assert.cssClassNotPresent('#right-arrow-group', 'button-disabled');
- },
-
- // verify user can temporarily input incorrect day values in date selector
- 'Allow invalid day values in date selector': client => {
- client.url(client.globals.url + '?t=2019-02-22');
- client
- .click(dateSelectorDayInput)
- .setValue(dateSelectorDayInput, [31, client.Keys.ENTER]);
- client.assert.cssClassPresent(dateSelectorDayInput, 'invalid-input');
- },
-
- // verify user can change year on invalid date to a valid one and remove invalid-input class
- 'Allow invalid year to valid year values in date selector': client => {
- client.url(client.globals.url + '?t=2019-02-22');
client
- .click(dateSelectorYearInput)
- .setValue(dateSelectorYearInput, [2020, client.Keys.ENTER]);
- client.setValue(dateSelectorMonthInput, ['MAR', client.Keys.ENTER]);
- client.setValue(dateSelectorDayInput, [31, client.Keys.ENTER]);
- client.setValue(dateSelectorYearInput, [2019, client.Keys.ENTER]);
- client.assert.cssClassNotPresent(dateSelectorDayInput, 'invalid-input');
- client.assert.cssClassNotPresent(dateSelectorMonthInput, 'invalid-input');
- client.assert.cssClassNotPresent(dateSelectorYearInput, 'invalid-input');
+ .useCss()
+ .moveToElement(draggerA, 15, 15)
+ .mouseButtonDown(0)
+ .waitForElementVisible('.date-tooltip', TIME_LIMIT)
+ .assert.containsText('.date-tooltip', '2019-10-04 09:46Z (277)');
},
after: client => {