Interactive interface for browsing global, full-resolution satellite imagery
Rewrite animation tests #930
Benjamin King97b45646f04d
diff --git a/e2e/features/animations/animation-test.js b/e2e/features/animations/animation-test.jsnew file mode 100644index 000000000..ab144eb3d--- /dev/null+++ b/e2e/features/animations/animation-test.js@@ -0,0 +1,59 @@+const reuseables = require('../../reuseables/skip-tour.js');+const localSelectors = require('./selectors.js');+const localQuerystrings = require('./querystrings.js');+const TIME_LIMIT = 10000;+module.exports = {+ before: function (client) {+ reuseables.loadAndSkipTour(client, TIME_LIMIT);+ },+ /**+ * Clicking the animation widget button+ * Opens the widget+ */+ 'Toggling Animation Mode': function(client) {+ client.expect.element(localSelectors.animationWidget).to.not.be.visible;+ client.useCss().click(localSelectors.animationButton);+ client.waitForElementVisible(localSelectors.animationWidget, TIME_LIMIT);+ },+ /**+ * Moving the range selector updates the selected range+ * in the animation widget date selector+ */+ 'Changing date range of animation': function(client) {+ client.url(client.globals.url + localQuerystrings.activeAnimationWidget);+ // Test Permalink opens widget+ client.waitForElementVisible('#day-animation-widget-start', TIME_LIMIT, function(el) {+ client.getValue('#day-animation-widget-start', function(result) {+ startDay = result.value;+ client.useCss()+ .moveToElement('#wv-timeline-range-selector > g:nth-child(2) > rect', 1, 1)+ .mouseButtonDown(0)+ .moveToElement('#guitarpick', 0, 0)+ .mouseButtonUp(0)+ .pause(2000);+ client.getValue('#day-animation-widget-start', function(result) {+ newDay = result.value;+ this.assert.notEqual(startDay, newDay);+ });+ });+ });+ },+ /**+ * Changing the resolution to a selection with too high of a resolution+ * disables downloading the GIF+ */+ 'Changing animation time resolution': function(client) {+ const globalSelectors = client.globals.selectors;+ client.url(client.globals.url + localQuerystrings.activeAnimationWidget);+ client.waitForElementVisible(localSelectors.animationButton, TIME_LIMIT, function(el) {+ client.useCss()+ .moveToElement(globalSelectors.resolutionTooltip, 1, 1)+ .click(globalSelectors.yearlyResolutionTooltip);+ client.pause(1000);+ client.expect.element(globalSelectors.timelineSetToYears).to.be.present;+ });+ },+ after: function(client) {+ client.end();+ }+};diff --git a/e2e/features/animations/animations.feature b/e2e/features/animations/animations.featuredeleted file mode 100644index 6fcf9d624..000000000--- a/e2e/features/animations/animations.feature+++ /dev/null@@ -1,22 +0,0 @@-Feature: Animation Widget- The widget that controls animation mode--Background:- Given Worldview is in "initial" state- And I click "Skip Tour"--Scenario: Toggling animation mode- Then I don't see the "animation widget"- When I click the "animation button"- Then I see the "animation widget"--Scenario: Changing date range of animation- When I click the "animation button"- Then the animation range selector works--Scenario: Changing animation time resolution- When I click the "animation button"- And I scroll to the "animation resolution tooltip"- And I click the "yearly resolution tooltip"- And I wait 1 seconds- Then the page has the "timeline set to years"diff --git a/e2e/features/animations/animations.gif.feature b/e2e/features/animations/animations.gif.featuredeleted file mode 100644index d867052b9..000000000--- a/e2e/features/animations/animations.gif.feature+++ /dev/null@@ -1,43 +0,0 @@-Feature: Animation GIF Downloads- Choose resolution of imagery and Download GIFs--Scenario: Downloading GIF when custom colormap is activated- Given Worldview is in "animation with custom colormap active" state- Then I see the "animation widget"- When I click the "create GIF button"- And I click the "GIF download icon"- Then I see "Would you like to temporarily revert"- When I click "OK"- Then I see the "GIF results" within 10 seconds- When I click the "GIF results close button"- Then the page doesn't have the "GIF results"- And I see the "animation widget"--Scenario: Downloading GIF when polar projection is rotated- Given Worldview is in "animation with polar projection rotated" state- Then I see the "animation widget"- When I click the "create GIF button"- And I click the "GIF download icon"- Then I see "Would you like to reset rotation"- When I click "OK"- And I click the "GIF download icon"- Then I see the "GIF results" within 10 seconds- When I click the "GIF results close button"- Then the page doesn't have the "GIF results"--Scenario: GIF selection preview is Accurate and selections that are too high disable GIF download- Given Worldview is in "animation widget active" state- Then I see the "animation widget"- When I click the "create GIF button"- And I wait 1 seconds- Then I see '2018-03-28' in the 'GIF preview start date value'- Then I see '2018-04-04' in the 'GIF preview end date value'- Then I see '3 Frames Per Second' in the 'GIF preview frame rate value'- Then I see a value of '40' in the 'GIF preview resolution selector'- Then I see 'GIF preview checkbox' is checked- Then I click the 'GIF preview resolution option 250m'- And I wait 1 seconds- Then I see a value of '1' in the 'GIF preview resolution selector'- Then I see 'GIF download icon' has style property 'color' equal to 'rgba(0, 0, 0, 0)'- Then I see 'GIF download button' is disabled-diff --git a/e2e/features/animations/gif-test.js b/e2e/features/animations/gif-test.jsnew file mode 100644index 000000000..e89de3360--- /dev/null+++ b/e2e/features/animations/gif-test.js@@ -0,0 +1,65 @@+const reuseables = require('../../reuseables/skip-tour.js');+const localSelectors = require('./selectors.js');+const localQuerystrings = require('./querystrings.js');+const TIME_LIMIT = 30000; // Sometimes takes a while to generate GIFs+const askDialog = '.wv-dialog-ask';+const askDialogOkButton = 'body > div.ui-dialog.ui-widget.ui-widget-content.ui-corner-all.ui-front.ui-dialog-buttons.ui-draggable > div.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix > div > button:nth-child(2) > span';++module.exports = {+ before: function (client) {+ reuseables.loadAndSkipTour(client, TIME_LIMIT);+ },+ 'Downloading GIF when custom colormap is activated': function(client) {+ if (client.options.desiredCapabilities.browser!== 'ie') { // Custom colormaps down exist in IE+ client.url(client.globals.url + localQuerystrings.activeCustomColormap);+ client.waitForElementVisible(localSelectors.animationWidget, TIME_LIMIT, function() {+ client.click(localSelectors.createGifIcon)+ .pause(1000);+ client.click(localSelectors.gifDownloadIcon)+ .pause(1000);+ client.expect.element(askDialog).to.be.present;+ client.useCss().click(askDialogOkButton);+ client.waitForElementVisible(localSelectors.gifResults, TIME_LIMIT, function() {+ client.click(localSelectors.gifResultsCloseButton);+ client.expect.element(localSelectors.gifResults).to.not.be.present;+ client.waitForElementVisible(localSelectors.animationWidget, TIME_LIMIT);+ });+ });+ }+ },+ 'Downloading GIF when polar projection is rotated': function(client) {+ const globalSelectors = client.globals.selectors;+ client.url(client.globals.url + localQuerystrings.animationProjectionRotated);+ client.waitForElementVisible(localSelectors.animationWidget, TIME_LIMIT, function() {+ client.click(localSelectors.createGifIcon)+ .pause(1000);+ client.click(localSelectors.gifDownloadIcon)+ .pause(1000);+ client.useCss().assert.containsText(globalSelectors.clearRotationButton, '-18');+ client.expect.element(askDialog).to.be.present;+ client.useCss().click(askDialogOkButton)+ .pause(1000);+ client.useCss().assert.containsText(globalSelectors.clearRotationButton, '0');+ });+ },+ 'GIF selection preview is Accurate and selections that are too high disable GIF download': function(client) {+ client.url(client.globals.url + localQuerystrings.activeAnimationWidget);+ client.waitForElementVisible(localSelectors.animationWidget, TIME_LIMIT, function() {+ client.click(localSelectors.createGifIcon)+ .pause(1000);+ client.waitForElementVisible(localSelectors.createGifButton, TIME_LIMIT, function() {+ client.useCss().assert.containsText(localSelectors.gifPreviewStartDate, '2018-03-28');+ client.useCss().assert.containsText(localSelectors.gifPreviewEndDate, '2018-04-04');+ client.useCss().assert.containsText(localSelectors.gifPreviewFrameRateValue, '3 Frames Per Second');+ client.assert.ok('#wv-checkbox-gif'); // checkbox is checked+ client.click(localSelectors.gifPreviewEndResolutionOption250)+ .pause(1000);+ client.assert.value(localSelectors.gifPreviewEndResolutionSelector, '1');+ client.expect.element(localSelectors.gifDownloadButton).to.not.be.enabled;+ });+ });+ },+ after: function(client) {+ client.end();+ }+};diff --git a/e2e/features/animations/querystrings.js b/e2e/features/animations/querystrings.jsnew file mode 100644index 000000000..b9ee77e33--- /dev/null+++ b/e2e/features/animations/querystrings.js@@ -0,0 +1,5 @@+module.exports = {+ activeAnimationWidget: '?p=geographic&l=VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor,Reference_Labels(hidden),Reference_Features(hidden),Coastlines&t=2018-04-04&z=3&v=-177.94712426144758,-46.546875,-5.14662573855243,53.015625&ab=on&as=2018-03-28&ae=2018-04-04&av=3&al=false',+ activeCustomColormap: '?p=geographic&l=AIRS_CO_Total_Column_Day(palette=red_1)&t=2016-04-08&z=3&v=-223.875,-91.828125,162.84375,98.296875&ab=on&as=2016-03-25&ae=2016-04-08&av=3&al=false','animation with polar projection rotated': '?p=arctic&l=MODIS_Terra_CorrectedReflectance_TrueColor,Coastlines&t=2016-12-09&z=3&v=-2764195.2298414493,-88762.12734933128,2589496.903095221,3893331.478195751&r=-18.0000&ab=on&as=2016-12-02&ae=2016-12-09&av=3&al=true',+ animationProjectionRotated: '?p=arctic&l=MODIS_Terra_CorrectedReflectance_TrueColor,Coastlines&t=2016-12-09&z=3&v=-2764195.2298414493,-88762.12734933128,2589496.903095221,3893331.478195751&r=-18.0000&ab=on&as=2016-12-02&ae=2016-12-09&av=3&al=true'+};diff --git a/e2e/features/animations/selectors.js b/e2e/features/animations/selectors.jsnew file mode 100644index 000000000..48aca39fc--- /dev/null+++ b/e2e/features/animations/selectors.js@@ -0,0 +1,15 @@+module.exports = {+ createGifIcon: '.fa-file-video-o.wv-animation-widget-icon',+ createGifButton: '.gif-dialog .button-text',+ gifPreviewStartDate: '.gif-download-grid .grid-child:nth-child(2) span',+ gifPreviewEndDate: '.gif-download-grid .grid-child:nth-child(4) span',+ gifPreviewFrameRateValue: '.gif-download-grid .grid-child:nth-child(6) span',+ gifPreviewEndResolutionSelector: '.gif-selector-case #gif-resolution',+ gifPreviewEndResolutionOption250: '#gif-resolution option[value="1"]',+ gifDownloadIcon: '.jcrop-holder .fa-download',+ gifDownloadButton: '.animation-gif-dialog-wrapper .wv-button',+ gifResults: '.gif-results-dialog-case img',+ gifResultsCloseButton: '.wv-gif-results button.ui-dialog-titlebar-close',+ animationWidget: '#wv-animation-widget',+ animationButton: '#animate-button'+};