Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix e2e tests

Benjamin King0b06a89e1d59
diff --git a/e2e/features/animations/animation-test.js b/e2e/features/animations/animation-test.js
index cd7992e83..b2979f7b3 100644
--- a/e2e/features/animations/animation-test.js
+++ b/e2e/features/animations/animation-test.js
@@ -60,10 +60,10 @@ module.exports = {
function(el) {
client
.useCss()
- .moveToElement(globalSelectors.resolutionTooltip, 1, 1)
- .click(globalSelectors.yearlyResolutionTooltip);
+ .moveToElement('.wv-animation-widget-header .wv-tooltip-case', 1, 1)
+ .click('.wv-tooltip-case #year');
client.pause(1000);
- client.expect.element(globalSelectors.timelineSetToYears).to.be.present;
+ client.useCss().assert.containsText('#current-interval', '1 YEAR');
}
);
},
diff --git a/e2e/features/animations/gif-test.js b/e2e/features/animations/gif-test.js
index a7bf18173..2fada05a7 100644
--- a/e2e/features/animations/gif-test.js
+++ b/e2e/features/animations/gif-test.js
@@ -2,11 +2,9 @@ const reuseables = require('../../reuseables/skip-tour.js');
const localSelectors = require('../../reuseables/selectors.js');
const localQuerystrings = require('../../reuseables/querystrings.js');
const TIME_LIMIT = 30000; // Sometimes takes a while to generate GIFs
-const askDialog = '.wv-dialog-ask';
-const paletteDialogOkButton =
- '.gif-palette-warning .ui-dialog-buttonset > .ui-button:nth-child(2)';
-const rotationDialogOkButton =
- '.gif-rotation-warning .ui-dialog-buttonset > .ui-button:nth-child(2)';
+const askDialog = '.modal-body .notify';
+const paletteDialogOkButton = '#image_download_notify_palette .accept-notify';
+const rotationDialogOkButton = '#image_download_notify_rotate .accept-notify';
const articeRotationResetButton = '#wv-map-arctic .wv-map-reset-rotation';
module.exports = {
@@ -22,14 +20,17 @@ module.exports = {
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(paletteDialogOkButton);
+ client
+ .useCss()
+ .click(paletteDialogOkButton)
+ .pause(1000);
+ client.click(localSelectors.createGifButton).pause(1000);
client.waitForElementVisible(
localSelectors.gifResults,
TIME_LIMIT,
function() {
- client.click(localSelectors.gifResultsCloseButton);
+ client.click(client.globals.selectors.modalCloseButton);
client.expect.element(localSelectors.gifResults).to.not.be
.present;
client.waitForElementVisible(
@@ -51,9 +52,7 @@ module.exports = {
TIME_LIMIT,
function() {
client.click(localSelectors.createGifIcon).pause(1000);
- client.click(localSelectors.gifDownloadIcon).pause(1000);
client.useCss().assert.containsText(articeRotationResetButton, '-18');
- client.expect.element(askDialog).to.be.present;
client
.useCss()
.click(rotationDialogOkButton)
diff --git a/e2e/features/compare/compare-test.js b/e2e/features/compare/compare-test.js
index 84aa7ebea..0f608e3ef 100644
--- a/e2e/features/compare/compare-test.js
+++ b/e2e/features/compare/compare-test.js
@@ -43,10 +43,9 @@ module.exports = {
client.click(ImageDownloadButton);
client.pause(100);
client.expect.element('#wv-image-resolution').to.not.be.present;
- client.expect.element(ImageDownloadButton + ' #wv-image-button-check').to
- .not.be.enabled;
+ client.assert.cssClassPresent(ImageDownloadButton, 'disabled');
client.assert.attributeContains(
- ImageDownloadButton + ' label',
+ ImageDownloadButton,
'title',
'You must exit comparison mode to use the snapshot feature'
);
@@ -119,18 +118,22 @@ module.exports = {
client.click('#closeactiveBMODIS_Aqua_CorrectedReflectance_TrueColor');
client.pause(1000);
client.click(localSelectors.compareButton);
- client.waitForElementVisible('#guitarpick', TIME_LIMIT, function() {
- client.expect.element('#activeB-Coastlines').to.be.visible;
- client.expect.element(
- '#activeB-MODIS_Terra_CorrectedReflectance_TrueColor'
- ).to.be.visible;
- client.expect.element(
- '#activeB-VIIRS_SNPP_CorrectedReflectance_TrueColor'
- ).to.not.be.present;
- client.expect.element(
- '#activeB-MODIS_Aqua_CorrectedReflectance_TrueColor'
- ).to.not.be.present;
- });
+ client.waitForElementNotPresent(
+ '.timeline-dragger.draggerA',
+ TIME_LIMIT,
+ function() {
+ client.expect.element('#activeB-Coastlines').to.be.visible;
+ client.expect.element(
+ '#activeB-MODIS_Terra_CorrectedReflectance_TrueColor'
+ ).to.be.visible;
+ client.expect.element(
+ '#activeB-VIIRS_SNPP_CorrectedReflectance_TrueColor'
+ ).to.not.be.present;
+ client.expect.element(
+ '#activeB-MODIS_Aqua_CorrectedReflectance_TrueColor'
+ ).to.not.be.present;
+ }
+ );
},
after: function(client) {
client.end();
diff --git a/e2e/features/compare/layer-dialog-test.js b/e2e/features/compare/layer-dialog-test.js
index 8a1b472f1..0369db598 100644
--- a/e2e/features/compare/layer-dialog-test.js
+++ b/e2e/features/compare/layer-dialog-test.js
@@ -3,9 +3,11 @@ const localSelectors = require('../../reuseables/selectors.js');
const localQuerystrings = require('../../reuseables/querystrings.js');
const TIME_LIMIT = 20000;
const aerosolLayer = '#active-MODIS_Terra_Aerosol';
-const AodOptionsPanelBody = '#wv-options-body-MODIS_Terra_Aerosol';
-const AodOptionsPanelHeader = '#wv-options-header-MODIS_Terra_Aerosol';
-const AodInfoPanel = '.wv-info-panel-MODIS_Terra_Aerosol';
+const AodOptionsPanelBody =
+ '#layer_options_modal-modis_terra_aerosol .modal-body';
+const AodOptionsPanelHeader =
+ '#layer_options_modal-modis_terra_aerosol .modal-header';
+const AodInfoPanel = '.layer_info_modal-modis_terra_aerosol';
const correctedReflectanceBLayer =
'#activeB-MODIS_Terra_CorrectedReflectance_TrueColor';
const correctedReflectanceOptionsPanelHeader =
@@ -26,9 +28,10 @@ module.exports = {
client.expect.element(AodOptionsPanelBody).to.not.be.present;
client.click(aerosolLayer + ' .wv-layers-options');
client.waitForElementVisible(
- '#wv-layers-options-dialog',
+ '.layer-settings-modal',
TIME_LIMIT,
function() {
+ client.pause(1000);
client
.useCss()
.assert.containsText(
@@ -44,9 +47,10 @@ module.exports = {
});
},
'Layer info dialog works in A|B mode': function(client) {
+ client.click(AodOptionsPanelHeader + ' .close').pause(1000);
client.click(aerosolLayer + ' .wv-layers-info');
client.waitForElementVisible(
- AodInfoPanel + ' .layer-metadata',
+ AodInfoPanel + ' .layer-description',
TIME_LIMIT,
function() {
client
@@ -59,6 +63,7 @@ module.exports = {
);
},
'expect clicking A|B button to close options dialog': function(client) {
+ client.click(AodInfoPanel + ' .close').pause(1000);
client.click(localSelectors.compareButton);
client.waitForElementVisible(aerosolLayer, TIME_LIMIT, function() {
client.expect.element(AodOptionsPanelBody).to.not.be.present;
@@ -80,6 +85,7 @@ module.exports = {
});
},
'Layer info dialog works after exiting A|B mode': function(client) {
+ client.click(AodOptionsPanelHeader + ' .close').pause(1000);
client.click(aerosolLayer + ' .wv-layers-info');
client.waitForElementVisible(
AodInfoPanel + ' .layer-metadata',
@@ -97,8 +103,12 @@ module.exports = {
'expect reactivating A|B to close options dialog and activate B state': function(
client
) {
+ client.click(AodInfoPanel + ' .close').pause(1000);
+ client.click(aerosolLayer + ' .wv-layers-options').pause(1000);
+ client.click(AodOptionsPanelHeader + ' .close').pause(1000);
client.click(localSelectors.compareButton);
client.waitForElementVisible(aerosolLayer, TIME_LIMIT, function() {
+ client.pause(1000);
client.expect.element(AodOptionsPanelBody).to.not.be.present;
client.click(localSelectors.bTab);
});
@@ -111,7 +121,7 @@ module.exports = {
client.expect.element(AodOptionsPanelBody).to.not.be.present;
client.click(correctedReflectanceBLayer + ' .wv-layers-options');
client.waitForElementVisible(
- '#wv-layers-options-dialog',
+ '.layer-settings-modal',
TIME_LIMIT,
function() {
client
@@ -131,6 +141,7 @@ module.exports = {
);
},
'Layer info dialog works after clicking into B mode': function(client) {
+ client.click(AodOptionsPanelHeader + ' .close').pause(1000);
client.click(correctedReflectanceBLayer + ' .wv-layers-info');
client.waitForElementVisible(
correctedReflectanceInfoPanel + ' .layer-metadata',
diff --git a/e2e/globals.js b/e2e/globals.js
index 548882627..205332059 100644
--- a/e2e/globals.js
+++ b/e2e/globals.js
@@ -6,8 +6,7 @@ module.exports = {
dataTab: '#download-sidebar-tab',
yearlyResolutionTooltip: '#zoom-years',
timelineSetToYears: '#current-zoom.zoom-years',
- modalCloseButton:
- '.ui-dialog.ui-draggable.ui-resizable .ui-dialog-titlebar-close',
+ modalCloseButton: '.modal-header .close',
notificationDismissButton: '.ui-dialog.notify-alert .fa-times',
overlayLayerItems: '#overlays li',
resolutionTooltip: '#zoom-btn-container',
diff --git a/e2e/reuseables/selectors.js b/e2e/reuseables/selectors.js
index ae38726e2..5712edfcd 100644
--- a/e2e/reuseables/selectors.js
+++ b/e2e/reuseables/selectors.js
@@ -10,7 +10,6 @@ module.exports = {
gifDownloadIcon: '.animation-gif-dialog-wrapper .wv-button.gray',
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',