Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

initial e2e tests

Jason Kentadbd5daac931
diff --git a/config/default/common/config/wv.json/stories/mock/joyride_tour.json b/config/default/common/config/wv.json/stories/mock/joyride_tour.json
index 8481630b6..d6b2de98a 100644
--- a/config/default/common/config/wv.json/stories/mock/joyride_tour.json
+++ b/config/default/common/config/wv.json/stories/mock/joyride_tour.json
@@ -8,16 +8,6 @@
"description": "Explore Hurricane Dorian with imagery from Geostationary satellites like GOES-East!",
"backgroundImage": "dorian_background.png",
"backgroundImageHover": "",
- "readMoreLinks": [
- {
- "title": "View the Earth Every 10 Minutes with Geostationary Imagery! (GIBS Blog)",
- "link": "https://wiki.earthdata.nasa.gov/display/GIBS/2019/10/21/View+the+Earth+Every+10+Minutes+with+Geostationary+Imagery"
- },
- {
- "title": "Now Available in NASA Worldview: Earth Every 10 Minutes (Earthdata)",
- "link": "https://earthdata.nasa.gov/learn/articles/geostationary-in-worldview"
- }
- ],
"steps": [
{
"description": "step001.html",
@@ -31,22 +21,22 @@
"steps": [
{
"target": "#hideGOES-East_ABI_Band2_Red_Visible_1km",
- "content": "Turn on and off the Red Visible layer to see the VIIRS Corrected Reflectance image underneath. Note the slight apparent shift in the clouds, which may be due to difference in the satellite angle between the polar orbiting and geostationary satellite.",
+ "content": "THIS IS STEP 1",
"placementBeacon": "right"
},
{
"target": ".wv-date-selector-widget",
- "content": "Note the change in the timeline after we added the geostationary layer! In addition to the date, you can now see the time in Hours and Minutes Z (Zulu Time which is equivalent to UTC - Coordinated Universal Time).",
+ "content": "THIS IS STEP 2",
"placementBeacon": "top"
},
{
"target": "#zoom-buttons-group",
- "content": "To the right of the \"Z\" are the < > increment arrows. Click on \"10 minute\" and see the available options - Year, Month, Day, Hour, Minute and Custom. Click on \"Custom\" and in the Custom Interval Selector the increment has been set to \"10\" and \"Minute\".",
+ "content": "THIS IS STEP 3",
"placementBeacon": "top"
},
{
"target": "#current-zoom",
- "content": "The timescale can also be changed here to HOURS or MINUTES",
+ "content": "THIS IS STEP 4",
"placementBeacon": "top"
}
]
diff --git a/e2e/features/tour/tour-joyride-test.js b/e2e/features/tour/tour-joyride-test.js
new file mode 100644
index 000000000..3f54d03a0
--- /dev/null
+++ b/e2e/features/tour/tour-joyride-test.js
@@ -0,0 +1,69 @@
+const { normalizeViewport } = require('../../reuseables/normalize-viewport.js');
+
+const TIME_LIMIT = 10000;
+
+const tourNext = '.step-container .step-next';
+const tourPrev = '.step-container .step-previous';
+const anyBeacon = '.react-joyride__beacon';
+const firstBeaconSelector = '#react-joyride-step-0 .react-joyride__beacon';
+const secondBeaconSelector = '#react-joyride-step-1 .react-joyride__beacon';
+const prevButton = '.react-joyride__tooltip div:nth-of-type(2) > button:first-of-type';
+const nextButtonAfterPrev = '.react-joyride__tooltip div:nth-of-type(2) > button:nth-of-type(2)';
+const tooltip = '.react-joyride__tooltip';
+const tooltipTextEl = '.react-joyride__tooltip > div > div';
+const tooltipClose = '.react-joyride__tooltip > button';
+
+module.exports = {
+ before(c) {
+ normalizeViewport(c, 1000, 850);
+ c.url(`${c.globals.url}?tr=hurricane_dorian_september_joyride&mockTour=true`);
+ },
+ 'Verify that all tour loads properly, Joyride beacon shows after progressing to Step 2': (c) => {
+ c.useCss().waitForElementVisible('.tour-in-progress .step-total', TIME_LIMIT);
+ c.click(tourNext);
+ c.waitForElementVisible(firstBeaconSelector, TIME_LIMIT);
+ },
+ 'Clicking beacon shows the floater tooltip': (c) => {
+ c.useCss().waitForElementVisible(firstBeaconSelector, TIME_LIMIT);
+ c.pause(500);
+ c.click(firstBeaconSelector);
+ c.waitForElementVisible(tooltip, TIME_LIMIT);
+ },
+ 'Closing tooltip advances to next step': (c) => {
+ c.useCss().waitForElementVisible(tooltipClose, TIME_LIMIT);
+ c.pause(500);
+ c.click(tooltipClose);
+ c.pause(500);
+ c.waitForElementVisible(secondBeaconSelector, TIME_LIMIT);
+ c.pause(500);
+ c.click(secondBeaconSelector);
+ c.waitForElementVisible(tooltip, TIME_LIMIT);
+ },
+ 'Clicking next advances to next step': (c) => {
+ c.click(nextButtonAfterPrev);
+ c.waitForElementVisible(tooltip, TIME_LIMIT);
+ c.assert.containsText(tooltipTextEl, 'THIS IS STEP 3');
+ },
+ 'Prev button goes back a step': (c) => {
+ c.click(prevButton);
+ c.waitForElementVisible(tooltip, TIME_LIMIT);
+ c.assert.containsText(tooltipTextEl, 'THIS IS STEP 2');
+ },
+ 'Closing tooltip on last step ends the Joyride': (c) => {
+ c.click(nextButtonAfterPrev);
+ c.waitForElementVisible(tooltip, TIME_LIMIT);
+ c.click(nextButtonAfterPrev);
+ c.waitForElementVisible(tooltip, TIME_LIMIT);
+ c.click(nextButtonAfterPrev);
+ c.expect.element(tooltip).not.to.be.present;
+ c.expect.element(anyBeacon).not.to.be.present;
+ },
+ 'Joyride resets when the Worldview tour is moved to a step with Joyride steps': (c) => {
+ c.click(tourNext);
+ c.click(tourPrev);
+ c.expect.element(firstBeaconSelector).to.be.present;
+ },
+ after(c) {
+ c.end();
+ },
+};
diff --git a/e2e/features/tour/tour-test.js b/e2e/features/tour/tour-test.js
index c427608a5..bbf6ca08d 100644
--- a/e2e/features/tour/tour-test.js
+++ b/e2e/features/tour/tour-test.js
@@ -4,24 +4,20 @@ const { localStorageEnabled } = require('../../reuseables/local-storage-check.js
const TIME_LIMIT = 10000;
const runTour = function(c) {
let totalSteps;
- c.waitForElementVisible('.tour-start', TIME_LIMIT, () => {
- c.click('.tour-box:first-child');
- c.waitForElementVisible('.tour-in-progress .step-total', 2000, () => {
- c
- .getText('.tour-in-progress .step-total', (result) => {
- totalSteps = parseInt(result.value, 10);
- })
- .perform(() => {
- for (let i = 0; i < totalSteps; i += 1) {
- c.pause(500);
- c.click('.step-container .step-next');
- }
- })
- .waitForElementVisible('.tour-complete button.close', 2000, () => {
- c.click('.tour-complete button.close');
- });
- });
- });
+ c.waitForElementVisible('.tour-start', TIME_LIMIT);
+ c.click('.tour-box:first-child');
+ c.waitForElementVisible('.tour-in-progress .step-total', 2000);
+ c.getText('.tour-in-progress .step-total', (result) => {
+ totalSteps = parseInt(result.value, 10);
+ })
+ .perform(() => {
+ for (let i = 0; i < totalSteps; i += 1) {
+ c.pause(500);
+ c.click('.step-container .step-next');
+ }
+ })
+ .waitForElementVisible('.tour-complete button.close', 2000);
+ c.click('.tour-complete button.close');
};
module.exports = {
@@ -36,20 +32,17 @@ module.exports = {
[],
function({ value }) {
if (!value) {
- c.waitForElementVisible('#wv-info-button', 1000, () => {
- c.click('#wv-info-button');
- c.waitForElementVisible('#start_tour_info_item', 1000, () => {
- c.click('#start_tour_info_item');
- runTour(c);
- });
- });
+ c.waitForElementVisible('#wv-info-button', 1000);
+ c.click('#wv-info-button');
+ c.waitForElementVisible('#start_tour_info_item', 1000);
+ c.click('#start_tour_info_item');
+ runTour(c);
} else {
runTour(c);
}
},
);
},
-
after(c) {
c.end();
},
diff --git a/web/js/components/tour/joyride-wrapper.js b/web/js/components/tour/joyride-wrapper.js
index 7110ae190..90e6f894e 100644
--- a/web/js/components/tour/joyride-wrapper.js
+++ b/web/js/components/tour/joyride-wrapper.js
@@ -89,7 +89,6 @@ export default function JoyrideWrapper ({
disableOverlayClose={disableOverlayClose}
styles={{ options: styleOptions }}
disableScrolling
- debug
/>
);
}