Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add e2e tests

Edward Platoffc993cdce4f
diff --git a/e2e/features/ui/distraction-free-mode-test.js b/e2e/features/ui/distraction-free-mode-test.js
new file mode 100644
index 000000000..a38a7c91b
--- /dev/null
+++ b/e2e/features/ui/distraction-free-mode-test.js
@@ -0,0 +1,53 @@
+const reuseables = require('../../reuseables/skip-tour.js');
+const localSelectors = require('../../reuseables/selectors.js');
+const TIME_LIMIT = 5000;
+
+module.exports = {
+ before: client => {
+ reuseables.loadAndSkipTour(client, TIME_LIMIT);
+ },
+
+ // verify distraction free mode shortcut hides ui elements
+ 'Enabling distraction free mode with shortcut key hides UI elements': client => {
+ client.pause(300);
+ client.sendKeys('body', [client.Keys.SHIFT, 'd', client.Keys.NULL]);
+ client.pause(300);
+ client.waitForElementPresent('#wv-distraction-free-mode-button', TIME_LIMIT);
+
+ client.waitForElementNotVisible('.timeline-container', TIME_LIMIT);
+ client.waitForElementNotVisible(localSelectors.sidebarContainer, TIME_LIMIT);
+ client.waitForElementNotPresent('#wv-link-button', TIME_LIMIT);
+ client.waitForElementNotPresent('#wv-proj-button', TIME_LIMIT);
+ client.waitForElementNotPresent('#wv-image-button', TIME_LIMIT);
+ client.waitForElementNotPresent('#wv-info-button', TIME_LIMIT);
+ client.waitForElementNotVisible(localSelectors.measureBtn, TIME_LIMIT);
+ client.waitForElementNotVisible('.wv-map-zoom-in', TIME_LIMIT);
+ client.waitForElementNotVisible('.wv-map-zoom-out', TIME_LIMIT);
+ client.waitForElementNotVisible('.wv-map-scale-metric', TIME_LIMIT);
+ client.waitForElementNotVisible('.wv-map-scale-imperial', TIME_LIMIT);
+ },
+
+ // verify turning off distraction free mode shortcut returns hidden ui elements
+ 'Disabling distraction free mode with shortcut key returns UI elements': client => {
+ client.pause(300);
+ client.sendKeys('body', [client.Keys.SHIFT, 'd', client.Keys.NULL]);
+ client.pause(300);
+ client.waitForElementNotPresent('#wv-distraction-free-mode-button', TIME_LIMIT);
+
+ client.waitForElementVisible('.timeline-container', TIME_LIMIT);
+ client.waitForElementVisible(localSelectors.sidebarContainer, TIME_LIMIT);
+ client.waitForElementVisible('#wv-link-button', TIME_LIMIT);
+ client.waitForElementPresent('#wv-proj-button', TIME_LIMIT);
+ client.waitForElementPresent('#wv-image-button', TIME_LIMIT);
+ client.waitForElementPresent('#wv-info-button', TIME_LIMIT);
+ client.waitForElementVisible(localSelectors.measureBtn, TIME_LIMIT);
+ client.waitForElementPresent('.wv-map-zoom-in', TIME_LIMIT);
+ client.waitForElementPresent('.wv-map-zoom-out', TIME_LIMIT);
+ client.waitForElementPresent('.wv-map-scale-metric', TIME_LIMIT);
+ client.waitForElementPresent('.wv-map-scale-imperial', TIME_LIMIT);
+ },
+
+ after: client => {
+ client.end();
+ }
+};