Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fix e2e tests

Jason Kent1efdefde7726
diff --git a/e2e/features/compare/compare-test.js b/e2e/features/compare/compare-test.js
index 721c3eafb..b98ba6af7 100644
--- a/e2e/features/compare/compare-test.js
+++ b/e2e/features/compare/compare-test.js
@@ -10,135 +10,135 @@ const ModisTruecolorLayerA = '#active-MODIS_Terra_CorrectedReflectance_TrueColor
const ModisTruecolorLayerB = '#activeB-MODIS_Terra_CorrectedReflectance_TrueColor';
const toggleButton = '.toggleIconHolder .accordionToggler';
const collapsedToggleButton = '#productsHoldertoggleButtonHolder .accordionToggler';
+const tooltipSelector = '.tooltip-inner';
-const TIME_LIMIT = 20000;
+const TIME_LIMIT = 10000;
module.exports = {
- before(client) {
- reuseables.loadAndSkipTour(client, TIME_LIMIT);
+ before(c) {
+ reuseables.loadAndSkipTour(c, TIME_LIMIT);
},
// load A|B and verify that it is active
- 'A|B is loaded': function(client) {
- client.url(client.globals.url + localQuerystrings.swipeAndAIsActive);
- client.waitForElementVisible(localSelectors.swipeDragger, TIME_LIMIT);
+ 'A|B is loaded': (c) => {
+ c.url(c.globals.url + localQuerystrings.swipeAndAIsActive);
+ c.waitForElementVisible(localSelectors.swipeDragger, TIME_LIMIT);
},
- 'Animation, image download, data-download, and events are disabled when in A|B': function(
- client,
- ) {
- // Verify Animation widget can't be clicked
- /* Button is obscured by #timeline-header, class check should be enough?
- client.click(animationButton);
- client.pause(100);
- client.expect.element('#wv-animation-widget').to.not.be.visible;
- */
- client.assert.cssClassPresent(animationButtonCase, 'wv-disabled-button');
- client.assert.attributeContains(
- animationButtonCase,
- 'title',
- 'Animation feature is deactivated when Compare feature is active',
- );
- // Verify image download can't be clicked
- client.click(ImageDownloadButton);
- client.pause(100);
- client.expect.element('#wv-image-resolution').to.not.be.present;
- client.assert.cssClassPresent(ImageDownloadButton, 'disabled');
- client.assert.attributeContains(
- ImageDownloadButton,
- 'title',
- 'You must exit comparison mode to use the snapshot feature',
- );
- // Verify events can't be clicked
- client
- .moveToElement(eventsTabButton, 1, 1)
- .mouseButtonDown(0)
- .pause(100);
- client.expect.element('#wv-eventscontent').to.not.be.visible;
- client.assert.cssClassPresent(eventsTabButton, 'disabled');
- client.assert.attributeContains(
- eventsTabButton,
- 'title',
- 'You must exit comparison mode to use the natural events feature',
- );
- // Verify Data Download can't be clicked
- client
- .moveToElement(dataDownloadTabButton, 1, 1)
- .mouseButtonDown(0)
- .pause(100);
- client.pause(100);
- client.expect.element('#wv-datacontent').to.not.be.visible;
- client.assert.cssClassPresent(dataDownloadTabButton, 'disabled');
- client.assert.attributeContains(
- dataDownloadTabButton,
- 'title',
- 'You must exit comparison mode to download data',
- );
+ 'Animation is disabled when compare mode active': (c) => {
+ const disableMessage = 'Animation feature is deactivated when Compare feature is active';
+ c.assert.cssClassPresent(animationButtonCase, 'wv-disabled-button');
+ c.assert.attributeContains(animationButtonCase, 'aria-label', disableMessage);
+ c.moveToElement(animationButtonCase, 5, 5);
+ c.waitForElementVisible(tooltipSelector, TIME_LIMIT, (e) => {
+ c.assert.containsText(tooltipSelector, disableMessage);
+ });
+
+ // Clicking does not activate animation
+ c.click(animationButtonCase);
+ c.expect.element('#wv-animation-widget').to.not.be.present;
+ },
+
+ 'Image download is disabled when compare mode active': (c) => {
+ const disableMessage = 'You must exit comparison mode to use the snapshot feature';
+ c.assert.cssClassPresent(ImageDownloadButton, 'disabled');
+ c.assert.attributeContains(ImageDownloadButton, 'aria-label', disableMessage);
+ c.moveToElement('#snapshot-btn-wrapper svg', 10, 10);
+ c.waitForElementVisible(tooltipSelector, TIME_LIMIT, (e) => {
+ c.assert.containsText(tooltipSelector, disableMessage);
+ });
+
+ // Clicking does not activate image download
+ c.click(ImageDownloadButton);
+ c.pause(100);
+ c.expect.element('#wv-image-resolution').to.not.be.present;
},
- 'Removing layer removes correct layer from correct layer group': function(
- client,
- ) {
- client.expect.element(ModisTruecolorLayerA).to.be.visible;
- client.click('#closeactiveMODIS_Terra_CorrectedReflectance_TrueColor');
- client.pause(100);
- client.expect.element(ModisTruecolorLayerA).to.not.be.present;
- client.expect.element(ModisTruecolorLayerB).to.not.be.present;
- client.click(localSelectors.bTab);
- client.waitForElementVisible(ModisTruecolorLayerB, TIME_LIMIT);
+
+ 'Data download is disabled when compare mode active': (c) => {
+ const disableMessage = 'You must exit comparison mode to download data';
+ c.assert.cssClassPresent(dataDownloadTabButton, 'disabled');
+ c.assert.attributeContains(dataDownloadTabButton, 'aria-label', disableMessage);
+ c.assert.attributeContains(dataDownloadTabButton, 'title', disableMessage);
+
+ // Clicking does not switch tabs
+ c.click(dataDownloadTabButton);
+ c.pause(100);
+ c.expect.element('#wv-datacontent').to.not.be.visible;
+ },
+
+ 'Events disabled when compare mode active': (c) => {
+ const disableMessage = 'You must exit comparison mode to use the natural events feature';
+
+ c.moveToElement(eventsTabButton, 1, 1);
+ c.click(eventsTabButton);
+ c.pause(100);
+ c.expect.element('#wv-eventscontent').to.not.be.visible;
+ c.assert.cssClassPresent(eventsTabButton, 'disabled');
+ c.assert.attributeContains(eventsTabButton, 'aria-label', disableMessage);
+ c.assert.attributeContains(eventsTabButton, 'title', disableMessage);
},
+
+ 'Removing layer removes correct layer from correct layer group': (c) => {
+ c.expect.element(ModisTruecolorLayerA).to.be.visible;
+ c.click('#closeactiveMODIS_Terra_CorrectedReflectance_TrueColor');
+ c.pause(100);
+ c.expect.element(ModisTruecolorLayerA).to.not.be.present;
+ c.expect.element(ModisTruecolorLayerB).to.not.be.present;
+ c.click(localSelectors.bTab);
+ c.waitForElementVisible(ModisTruecolorLayerB, TIME_LIMIT);
+ },
+
/**
* B state can layer list collapse
*/
- 'Collapse layer list with B state and test label shows correct number of layers': function(
- client,
- ) {
- client.url(client.globals.url + localQuerystrings.spyAndBIsActive);
+ 'Collapse layer list with B state and test label shows correct number of layers': (c) => {
+ c.url(c.globals.url + localQuerystrings.spyAndBIsActive);
- client.waitForElementVisible(toggleButton, TIME_LIMIT, () => {
- client.expect.element(collapsedToggleButton).to.not.be.visible;
- client.click(toggleButton);
- client.pause(100);
- client.expect.element(collapsedToggleButton).to.be.visible;
- client.waitForElementNotPresent(toggleButton, TIME_LIMIT);
- client.useCss().assert.containsText(collapsedToggleButton, '6');
- client.click(collapsedToggleButton);
- client.pause(100);
- client.waitForElementVisible('#activeB-Reference_Features', TIME_LIMIT);
+ c.waitForElementVisible(toggleButton, TIME_LIMIT, () => {
+ c.expect.element(collapsedToggleButton).to.not.be.present;
+ c.click(toggleButton);
+ c.pause(100);
+ c.expect.element(collapsedToggleButton).to.be.present;
+ c.waitForElementNotPresent(toggleButton, TIME_LIMIT);
+ c.useCss().assert.containsText(collapsedToggleButton, '6');
+ c.click(collapsedToggleButton);
+ c.pause(100);
+ c.waitForElementVisible('#activeB-Reference_Features', TIME_LIMIT);
});
},
+
/**
* Remove some layers from active state B and then toggle out of A|B mode to verify
* that layer-sidebar inherits B state layers
*/
- 'If you exit A|B with B selection active, the active state will then be the B state': function(
- client,
- ) {
- client.expect.element('#activeB-VIIRS_SNPP_CorrectedReflectance_TrueColor')
+ 'If you exit A|B with B selection active, the active state will then be the B state': (c) => {
+ c.expect.element('#activeB-VIIRS_SNPP_CorrectedReflectance_TrueColor')
.to.be.visible;
- client.expect.element('#activeB-MODIS_Aqua_CorrectedReflectance_TrueColor')
+ c.expect.element('#activeB-MODIS_Aqua_CorrectedReflectance_TrueColor')
.to.be.visible;
- client.click('#closeactiveBReference_Labels');
- client.click('#closeactiveBReference_Features');
- client.click('#closeactiveBVIIRS_SNPP_CorrectedReflectance_TrueColor');
- client.click('#closeactiveBMODIS_Aqua_CorrectedReflectance_TrueColor');
- client.pause(1000);
- client.click(localSelectors.compareButton);
- client.waitForElementNotPresent(
+ c.click('#closeactiveBReference_Labels');
+ c.click('#closeactiveBReference_Features');
+ c.click('#closeactiveBVIIRS_SNPP_CorrectedReflectance_TrueColor');
+ c.click('#closeactiveBMODIS_Aqua_CorrectedReflectance_TrueColor');
+ c.pause(1000);
+ c.click(localSelectors.compareButton);
+ c.waitForElementNotPresent(
'.timeline-dragger.draggerA',
TIME_LIMIT,
() => {
- client.expect.element('#activeB-Coastlines').to.be.visible;
- client.expect.element(
+ c.expect.element('#activeB-Coastlines').to.be.visible;
+ c.expect.element(
'#activeB-MODIS_Terra_CorrectedReflectance_TrueColor',
).to.be.visible;
- client.expect.element(
+ c.expect.element(
'#activeB-VIIRS_SNPP_CorrectedReflectance_TrueColor',
).to.not.be.present;
- client.expect.element(
+ c.expect.element(
'#activeB-MODIS_Aqua_CorrectedReflectance_TrueColor',
).to.not.be.present;
},
);
},
- after(client) {
- client.end();
+
+ after(c) {
+ c.end();
},
};
diff --git a/web/css/sidebar-panel.css b/web/css/sidebar-panel.css
index 014917ebd..9ad366508 100644
--- a/web/css/sidebar-panel.css
+++ b/web/css/sidebar-panel.css
@@ -435,8 +435,6 @@ li.item.productsitem.inmotion,
}
}
-
-
.productsitem a.button.wv-layers-close {
display: block;
float: right;
diff --git a/web/css/sidebar.css b/web/css/sidebar.css
index b103cdd5b..ba40a952f 100644
--- a/web/css/sidebar.css
+++ b/web/css/sidebar.css
@@ -75,6 +75,9 @@
}
.products-holder-case .nav-tabs .nav-link {
padding: 4px 8px;
+ &.disabled {
+ pointer-events: auto;
+ }
}
.products-holder-case .main-nav .nav-link {
margin: 1px 0;
diff --git a/web/css/toolbar.css b/web/css/toolbar.css
index 020d215ed..127ca7e83 100644
--- a/web/css/toolbar.css
+++ b/web/css/toolbar.css
@@ -37,6 +37,7 @@
.wv-toolbar .btn.disabled {
pointer-events: auto;
+ cursor: default;
}
.wv-toolbar .btn.disabled:hover i {
diff --git a/web/css/tooltip.css b/web/css/tooltip.css
index cd6409fa4..b487279f6 100644
--- a/web/css/tooltip.css
+++ b/web/css/tooltip.css
@@ -1,6 +1,7 @@
/* Bootstrap override */
.tooltip {
z-index: 1050;
+
/* Fixes issue with flicker but, breaks autohide=false */
pointer-events: none;
}
diff --git a/web/js/components/sidebar/nav/nav-item.js b/web/js/components/sidebar/nav/nav-item.js
index d34828c7a..48f627fc7 100644
--- a/web/js/components/sidebar/nav/nav-item.js
+++ b/web/js/components/sidebar/nav/nav-item.js
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { NavItem, NavLink, UncontrolledTooltip } from 'reactstrap';
+import { NavItem, NavLink } from 'reactstrap';
const CustomNavItem = (props) => {
const {
diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.js
index 787770b5d..7416971e5 100644
--- a/web/js/containers/toolbar.js
+++ b/web/js/containers/toolbar.js
@@ -198,20 +198,23 @@ class toolbarContainer extends Component {
: 'Take a snapshot';
return !isDistractionFreeModeActive && (
- <Button
- id={buttonId}
- className={
+ <div id="snapshot-btn-wrapper">
+ {this.renderTooltip('snapshot-btn-wrapper', labelText)}
+ <Button
+ id={buttonId}
+ className={
isImageDownloadActive
? 'wv-toolbar-button'
: 'wv-toolbar-button disabled'
}
- disabled={!isImageDownloadActive}
- aria-label={labelText}
- onClick={this.openImageDownload}
- >
- {this.renderTooltip(buttonId, labelText)}
- <FontAwesomeIcon icon="camera" size="2x" />
- </Button>
+ disabled={!isImageDownloadActive}
+ aria-label={labelText}
+ onClick={this.openImageDownload}
+ >
+ <FontAwesomeIcon icon="camera" size="2x" />
+ </Button>
+ </div>
+
);
}