Interactive interface for browsing global, full-resolution satellite imagery
fix e2e tests
Jason Kent36667acd05bf
diff --git a/e2e/features/compare/layer-sidebar-test.js b/e2e/features/compare/layer-sidebar-test.jsindex d71705b68..af6db7c8c 100644--- a/e2e/features/compare/layer-sidebar-test.js+++ b/e2e/features/compare/layer-sidebar-test.js@@ -2,70 +2,65 @@ const reuseables = require('../../reuseables/skip-tour.js');const selectors = require('../../reuseables/selectors.js');const localQueryStrings = require('../../reuseables/querystrings.js');+const aodChoices = '#accordion-legacy-all-aerosol-optical-depth .measure-row-contents';const aodCombinedValueId = 'MODIS_Combined_Value_Added_AOD';const aodMAIACId = 'MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth';-const aodCheckBox = '#checkbox-case-MODIS_Combined_Value_Added_AOD .wv-checkbox';-const aodMAIACCheckbox = '#checkbox-case-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth .wv-checkbox';+const aodCheckBox = '#MODIS_Combined_Value_Added_AOD-checkbox';+const aodMAIACCheckbox = '#checkbox-case-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth .wv-checkbox input';const TIME_LIMIT = 10000;module.exports = {- before: (client) => {- reuseables.loadAndSkipTour(client, client.globals.timeout);+ before: (c) => {+ reuseables.loadAndSkipTour(c, c.globals.timeout);},- 'Add AOD Layer to Layer Group A': (client) => {- client.url(client.globals.url + localQueryStrings.swipeAndAIsActive);- client.waitForElementVisible(selectors.swipeDragger, client.globals.timeout, () => {- client.click(selectors.addLayers);- client.waitForElementVisible(selectors.aerosolOpticalDepth, client.globals.timeout, () => {- client.click(selectors.aerosolOpticalDepth);- client.waitForElementVisible(aodCheckBox, client.globals.timeout, () => {- client.click(aodCheckBox);- client.waitForElementVisible(`#active-${aodCombinedValueId}`, client.globals.timeout);- client.click(selectors.layersModalCloseButton);- });- });- });- client.waitForElementNotPresent('#layer_picker_component', TIME_LIMIT);- client.pause(250);+ 'Add AOD Layer to Layer Group A': (c) => {+ c.url(c.globals.url + localQueryStrings.swipeAndAIsActive);+ c.waitForElementVisible(selectors.swipeDragger, c.globals.timeout);+ c.click(selectors.addLayers);+ c.waitForElementVisible(selectors.aerosolOpticalDepth, c.globals.timeout);+ c.click(selectors.aerosolOpticalDepth);++ c.waitForElementVisible(aodChoices, TIME_LIMIT);+ c.click(aodCheckBox);+ c.waitForElementVisible(`#active-${aodCombinedValueId}`, c.globals.timeout);+ c.click(selectors.layersModalCloseButton);+ c.waitForElementNotPresent('#layer_picker_component', TIME_LIMIT);+ c.pause(250);},- 'Toggle compare mode to Active state B': (client) => {- client.click(`${selectors.bTab} .productsIcon`);- client.waitForElementVisible('#activeB-Coastlines_15m', client.globals.timeout);+ 'Toggle compare mode to Active state B': (c) => {+ c.click(`${selectors.bTab} .productsIcon`);+ c.waitForElementVisible('#activeB-Coastlines_15m', c.globals.timeout);},- 'Verify that AOD layer is not visible': (client) => {- client.expect.element(`#active-${aodCombinedValueId}`).to.not.be.present;+ 'Verify that AOD layer is not visible': (c) => {+ c.expect.element(`#active-${aodCombinedValueId}`).to.not.be.present;},- 'Add AOD index layer to Active state B and verify it has been added': (client) => {- client.click(selectors.addLayers);- client.waitForElementVisible(- aodMAIACCheckbox,- client.globals.timeout, () => {- client.click(aodMAIACCheckbox);- client.waitForElementVisible(- '#activeB-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth',- client.globals.timeout,- );- client.expect.element(`#activeB-${aodCombinedValueId}`).to.not.be.present;- client.expect.element(`#active-${aodCombinedValueId}`).to.not.be.present;- },+ 'Add AOD index layer to Active state B and verify it has been added': (c) => {+ c.click(selectors.addLayers);+ c.waitForElementVisible(aodChoices, c.globals.timeout);+ c.click(aodMAIACCheckbox);+ c.waitForElementVisible(+ '#activeB-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth',+ c.globals.timeout,);+ c.expect.element(`#activeB-${aodCombinedValueId}`).to.not.be.present;+ c.expect.element(`#active-${aodCombinedValueId}`).to.not.be.present;},'Verify that AOD combined is visible and AOD index is not present in Layer list A': function(- client,+ c,) {- client.click(selectors.layersModalCloseButton);- client.pause(100);- client.click(selectors.aTab);- client.waitForElementVisible(+ c.click(selectors.layersModalCloseButton);+ c.pause(100);+ c.click(selectors.aTab);+ c.waitForElementVisible(`#active-${aodCombinedValueId}`,- client.globals.timeout,+ c.globals.timeout,() => {- client.expect.element(`#activeB-${aodCombinedValueId}`).to.not.be.present;- client.expect.element(`#activeA-${aodMAIACId}`).to.not.be.present;+ c.expect.element(`#activeB-${aodCombinedValueId}`).to.not.be.present;+ c.expect.element(`#activeA-${aodMAIACId}`).to.not.be.present;},);},- after(client) {- client.end();+ after(c) {+ c.end();},};diff --git a/e2e/features/layers/layer-picker-mobile-test.js b/e2e/features/layers/layer-picker-mobile-test.jsindex 51d4e1159..8828babe0 100644--- a/e2e/features/layers/layer-picker-mobile-test.js+++ b/e2e/features/layers/layer-picker-mobile-test.js@@ -64,7 +64,7 @@ module.exports = {c.click(addLayers);c.waitForElementVisible('.categories-dropdown-header', TIME_LIMIT, assertCategories(c));},- 'Clicking a measurement': (c) => {+ 'Clicking a measurement shows choices, indicates unavailability': (c) => {c.click(aodAllMeasurement);c.waitForElementVisible(aodAllMeasurementContents, TIME_LIMIT, (e) => {c.expect.element(sourceMetadataCollapsed).to.be.present;@@ -72,9 +72,9 @@ module.exports = {c.expect.element(aodCheckboxMODIS).to.be.present;c.expect.element(aodCheckboxMAIAC).to.be.present;// Indicate that MODIS Combined layer has no available coverage- c.assert.cssClassPresent(aodCheckboxMODIS, 'unavailable');+ c.expect.element(`${aodCheckboxMODIS} + svg#availability-info`).to.be.present;// Indicate that MAIAC layer has no available coverage- c.assert.cssClassPresent(aodCheckboxMAIAC, 'unavailable');+ c.expect.element(`${aodCheckboxMAIAC} + svg#availability-info`).to.be.present;c.expect.elements(sourceTabs).count.to.equal(8);});},@@ -157,7 +157,7 @@ module.exports = {c.assert.not.cssClassPresent(aodSearchCheckbox, 'checked');c.assert.containsText(addToMapButton, 'Add Layer');// Add it again- c.click(aodSearchCheckbox).pause(200);+ c.click(aodCheckbox).pause(200);c.assert.containsText(addToMapButton, 'Remove Layer');c.assert.cssClassPresent(aodSearchCheckbox, 'checked');},diff --git a/e2e/features/layers/layer-picker-test.js b/e2e/features/layers/layer-picker-test.jsindex 0a1122b8b..499b1d8f1 100644--- a/e2e/features/layers/layer-picker-test.js+++ b/e2e/features/layers/layer-picker-test.js@@ -43,6 +43,8 @@ const {dayDown,} = require('../../reuseables/selectors.js');+const aodChoices = '#accordion-atmosphere-aerosol-optical-depth .measure-row-contents';+const TIME_LIMIT = 10000;module.exports = {@@ -223,17 +225,13 @@ module.exports = {c.expect.element(aodCheckboxMODIS).to.be.present;c.expect.element(aodCheckboxMAIAC).to.be.present;// Indicate that MODIS Combined layer has no available coverage- c- .assert- .cssClassPresent(aodCheckboxMODIS, 'unavailable list-group-item');+ c.expect.element(`${aodCheckboxMODIS} + svg#availability-info`).to.be.present;// Indicate that MAIAC layer has no available coverage- c- .assert- .cssClassPresent(aodCheckboxMAIAC, 'unavailable list-group-item');+ c.expect.element(`${aodCheckboxMAIAC} + svg#availability-info`).to.be.present;});});},- 'Available grid source layer measuremet does not have unavaiable coverage class': (c) => {+ 'Available grid source layer measuremet does not have unavaiable coverage icon': (c) => {// swith to Aqua/MODIS measurement nav itemc.click(aquaModisTab);c.waitForElementVisible(aodTabContentAquaMODIS, TIME_LIMIT, (e) => {@@ -242,17 +240,14 @@ module.exports = {.containsText(layerDetailHeader, 'Aqua/MODIS');// Checkboxes for layer is visiblec.expect.element(aodCheckboxAquaMODIS).to.be.present;- // Avaialable layer does not have unavailable class- c- .assert- .not- .cssClassPresent(aodCheckboxAquaMODIS, 'unavailable');+ // Avaialable layer does not have unavailable icon+ c.expect.element(`${aodCheckboxMODIS} + svg#availability-info`).to.not.be.present;// switch back to previous 'Aqua and Terra/MODIS' measurement nav itemc.click(aquaTerraMODISTab);});},'Selecting layers from product picker adds them to the sidebar/map': (c) => {- c.waitForElementVisible(aodCheckboxMODIS, TIME_LIMIT, (e) => {+ c.waitForElementVisible(aodChoices, TIME_LIMIT, (e) => {c.click(aodCheckboxMODIS);c.click(aodCheckboxMAIAC);// Reset to category mode view for future testdiff --git a/e2e/features/smart-handoff/smart-handoff-test.js b/e2e/features/smart-handoff/smart-handoff-test.jsindex 3dc657df4..2d90753f2 100644--- a/e2e/features/smart-handoff/smart-handoff-test.js+++ b/e2e/features/smart-handoff/smart-handoff-test.js@@ -42,8 +42,8 @@ module.exports = {// Add specified layer to layer listc.waitForElementVisible(layerBrowseList, TIME_LIMIT, (e) => {c.click('#accordion-legacy-all-cloud-effective-radius');- c.waitForElementVisible('#checkbox-case-MODIS_Aqua_Cloud_Effective_Radius', TIME_LIMIT, (e) => {- c.click('#checkbox-case-MODIS_Aqua_Cloud_Effective_Radius');+ c.waitForElementVisible('#accordion-legacy-all-cloud-effective-radius .measure-row-contents', TIME_LIMIT, (e) => {+ c.click('#MODIS_Aqua_Cloud_Effective_Radius-checkbox');c.click(layersModalCloseButton);});});@@ -61,12 +61,12 @@ module.exports = {c.expect.element('.granule-count-header').to.have.text.equal('Available granules for 2019 Dec 01:');- c.assert.containsText('.granule-count-info', '289');+ c.waitForElementVisible('.granule-count-info', TIME_LIMIT);},'Enable area of interest': (c) => {c.click('#chk-crop-toggle');- c.assert.containsText('.granule-count-info', 'of 289');+ c.waitForElementVisible('.granule-count-info', TIME_LIMIT);},'Download via Earthdata Search': (c) => {diff --git a/e2e/reuseables/selectors.js b/e2e/reuseables/selectors.jsindex 3ab2b5531..e236f898d 100644--- a/e2e/reuseables/selectors.js+++ b/e2e/reuseables/selectors.js@@ -102,10 +102,10 @@ module.exports = {aodMeasurementContents: '#accordion-atmosphere-aerosol-optical-depth .measure-row-contents',aodAllMeasurementContents: '#accordion-legacy-all-aerosol-optical-depth',aodTabContentAquaMODIS: '#aerosol-optical-depth-aqua-modis',- aodCheckbox: '#checkbox-case-MODIS_Aqua_Aerosol',- aodCheckboxMODIS: '#checkbox-case-MODIS_Combined_Value_Added_AOD',- aodCheckboxMAIAC: '#checkbox-case-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth',- aodCheckboxAquaMODIS: '#checkbox-case-MODIS_Aqua_Aerosol',+ aodCheckbox: '#MODIS_Aqua_Aerosol-checkbox',+ aodCheckboxMODIS: '#MODIS_Combined_Value_Added_AOD-checkbox',+ aodCheckboxMAIAC: '#MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth-checkbox',+ aodCheckboxAquaMODIS: '#MODIS_Aqua_Aerosol-checkbox',aquaTerraMODISTab: '#aqua-terra-modis-0-source-Nav',aquaModisTab: '#aqua-modis-1-source-Nav',correctedReflectanceCheckboxContainer: '#checkbox-case-MODIS_Aqua_CorrectedReflectance_TrueColor',