Interactive interface for browsing global, full-resolution satellite imagery
Replace Layer and tour tests #930
Benjamin Kingf8417aa511bf
diff --git a/e2e/features/layers/layers-test.js b/e2e/features/layers/layers-test.jsnew file mode 100644index 000000000..f6da74115--- /dev/null+++ b/e2e/features/layers/layers-test.js@@ -0,0 +1,78 @@+const reuseables = require('../../reuseables/skip-tour.js');+const localSelectors = require('./selectors.js');+const TIME_LIMIT = 10000;++module.exports = {+ before: function (client) {+ reuseables.loadAndSkipTour(client, TIME_LIMIT);+ },+ 'Toggle layer Info': function(client) {+ client.click(localSelectors.infoButton);+ client.waitForElementVisible(localSelectors.infoDialog, 1000, function(e) {+ client.click(localSelectors.infoButton)+ .pause(100);+ client.expect.element(localSelectors.infoDialog).to.not.be.present;+ client.click(localSelectors.infoButton)+ .pause(1000);+ client.expect.element(localSelectors.infoDialog).to.be.present;+ });+ },+ 'Toggle Layer Options': function(client) {+ client.click(localSelectors.optionsButton);+ client.waitForElementVisible(localSelectors.optionsDialog, 1000, function(e) {+ client.click(localSelectors.optionsButton)+ .pause(100);+ client.expect.element(localSelectors.optionsDialog).to.not.be.present;+ client.click(localSelectors.optionsButton)+ .pause(1000);+ client.expect.element(localSelectors.optionsDialog).to.be.present;+ });+ },+ 'Finding VIIRs Corrected Reflectance layer with search': function(client) {+ client+ .click(localSelectors.addLayers);+ client.waitForElementVisible(localSelectors.layersSearchField, TIME_LIMIT, function(e) {+ client.setValue(localSelectors.layersSearchField, 'VIIRS_SNPP_Corrected');+ client.waitForElementVisible(localSelectors.sourceInfoIcon, TIME_LIMIT, function(e) {+ client.useCss().assert.containsText(localSelectors.layersAll, 'Corrected Reflectance (True Color)');+ client.useCss().assert.containsText(localSelectors.layersAll, 'Suomi NPP / VIIRS');+ });+ });+ },+ 'Verify Corrected Reflectance Layer is selected': function(client) {+ client.assert.cssClassPresent(localSelectors.layerHeader, 'checked');+ },+ 'Open And Close info about Layer found in search': function(client) {+ client.useCss().expect.element(localSelectors.layersAll).text.not.contains('VIIRS Corrected Reflectance');+ client+ .click(localSelectors.sourceInfoIcon)+ .pause(100);+ client.useCss().assert.containsText(localSelectors.layersAll, 'VIIRS Corrected Reflectance');+ client.useCss().moveToElement(localSelectors.sourceMetadataCloseButton, 10, 10);+ client.click(localSelectors.sourceMetadataCloseButton);+ client.useCss().expect.element(localSelectors.layersAll).text.not.contains('VIIRS Corrected Reflectance');+ },+ 'Close Layer modal': function(client) {+ client.click(localSelectors.layersModalCloseButton)+ .pause(2000);+ client.useCss().expect.element(localSelectors.layersAll).to.not.be.visible;+ },+ 'Open Layer modal and click breadcrumb to return to main selection': function(client) {+ client.click(localSelectors.addLayers);+ client.waitForElementVisible(localSelectors.backToCategories, TIME_LIMIT, function(e) {+ client.click(localSelectors.backToCategories);+ client.waitForElementVisible(localSelectors.aerosolOpticalDepth, TIME_LIMIT);+ });+ },+ 'Browsing Layers by Category: Aerosol Optical Depth': function(client) {+ client.click(localSelectors.aerosolOpticalDepth);+ client.waitForElementVisible(localSelectors.headerForAOD, 20000, function(e) { // This is a very slow process+ client.click('#ui-accordion-legacy-all-list-panel-0 > ul > li:nth-child(3) > a')+ .pause(1000);+ client.useCss().assert.containsText('#modis-terra-and-aqua-combined-value-added-aerosol-optical-depth', 'MODIS (Terra and Aqua) Combined Value-Added Aerosol Optical Depth');+ });+ },+ after: function(client) {+ client.end();+ }+};diff --git a/e2e/features/layers/querystrings.js b/e2e/features/layers/querystrings.jsnew file mode 100644index 000000000..6c7cdc89c--- /dev/null+++ b/e2e/features/layers/querystrings.js@@ -0,0 +1,4 @@+module.exports = {+ multipleDataLayers: '?p=geographic&l=MODIS_Terra_Aerosol,MODIS_Terra_Brightness_Temp_Band31_Day&t=2017-03-22&z=3&v=136.07019188386334,14.722152527011556,155.59817576644127,24.312819167567586',+ continuousDataLayers: '?p=geographic&l=MODIS_Terra_Brightness_Temp_Band31_Day&t=2015-05-25&z=2&v=-42.148380855752734,42.13121723408824,22.122734950093943,85.16225953076464'+};diff --git a/e2e/features/layers/running-data-test-wip.js b/e2e/features/layers/running-data-test-wip.jsnew file mode 100644index 000000000..41a34bfc1--- /dev/null+++ b/e2e/features/layers/running-data-test-wip.js@@ -0,0 +1,48 @@+const loadAndSkipTour = require('../../reuseables/skip-tour.js').loadAndSkipTour;+const localQuerystrings = require('./querystrings.js');+const TIME_LIMIT = 10000;+/**+ * selectors+ */+const runningDataLabel = '.wv-running-label';++module.exports = {+ before: function (client) {+ loadAndSkipTour(client, TIME_LIMIT);+ },+ 'Load Layer with continuous palette': function(client) {+ client.url(client.globals.url + localQuerystrings.continuousDataLayers);+ client.waitForElementVisible('.wv-palettes-colorbar', TIME_LIMIT);+ },+ 'Veryify running data label is correct when mouse hovers data': function(client) {+ client.getElementSize('#wv-map-geographic', (size) => {+ var x = size.value.width / 2;+ var y = size.value.height / 2;+ console.log(size.value);+ client.pause(4000);+ client.click('body');+ client.moveToElement('#guitarpick', -1, -1, () => {+ client.pause(1000);+ client.expect.element('.wv-running').to.be.present;+ client.getText(runningDataLabel, function (text) {+ this.assert.equal(text.value, '270.3 – 270.9 K');+ });+ // Firefox hack+ });+ });+ }+};+// Feature: Running Data+// When I hover over a data layer, I should see the values I'm hovering over displayed in the layers tab++// @wip+// Scenario: Running data on continuous layers+// Given Worldview is in "continuous data layers" state+// Then label says "270.9 – 271.6 K" when mouse is in the center+// And label says "260.9 – 261.5 K" when hovering on colorbar++// @wip+// Scenario: Running data on multiple data layers+// Given Worldview is in "multiple data layers" state+// Then label says "0.070 – 0.075" when mouse is in the center+// And label says "0.380 – 0.385" when hovering on colorbardiff --git a/e2e/features/layers/selectors.js b/e2e/features/layers/selectors.jsnew file mode 100644index 000000000..8e72c877e--- /dev/null+++ b/e2e/features/layers/selectors.js@@ -0,0 +1,17 @@+module.exports = {+ 'infoButton': '.wv-layers-info',+ 'optionsButton': '.wv-layers-options',+ 'infoDialog': '[aria-describedby="wv-layers-info-dialog"]',+ 'optionsDialog': '[aria-describedby="wv-layers-options-dialog"]',+ 'layersSearchField': 'input#layers-search-input',+ 'layersAll': '#layers-all',+ 'sourceInfoIcon': '.layers-all-layer .fa-info-circle',+ 'layerHeader': '.layers-all-header',+ 'addLayers': '#layers-add',+ 'layerModal': '#layer-modal-main',+ 'sourceMetadataCloseButton': '.source-metadata .metadata-more',+ 'layersModalCloseButton': '#layers-modal-close',+ 'aerosolOpticalDepth': '#legacy-all > div > ul > li:nth-child(1)',+ 'backToCategories': '#category-breadcrumb a',+ 'headerForAOD': '#accordion-legacy-all-aerosol-optical-depth'+};diff --git a/e2e/features/tour/tour-test.js b/e2e/features/tour/tour-test.jsnew file mode 100644index 000000000..1b5b7843e--- /dev/null+++ b/e2e/features/tour/tour-test.js@@ -0,0 +1,18 @@+const normalizeViewport = require('../../reuseables/normalize-viewport.js').normalizeViewport;+const TIME_LIMIT = 10000;++module.exports = {+ before: function(client) {+ normalizeViewport(client, 1000, 850);+ client.url(client.globals.url);+ },+ 'Verify that the tour is present when the page is loaded': function(client) {+ client.waitForElementVisible('#skipTour', TIME_LIMIT, function() {+ client.click('#takeTour');+ client.waitForElementVisible('.joyride-next-tip', 1000);+ });+ },+ after: function(client) {+ client.end();+ }+};