Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Adding conditionals for E2E test notifications (#4950)

Ryan Weileradfce432e228
diff --git a/e2e/features/animation/animation-test.spec.js b/e2e/features/animation/animation-test.spec.js
index bfcaaae38..5f178c311 100644
--- a/e2e/features/animation/animation-test.spec.js
+++ b/e2e/features/animation/animation-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { skipTour, activeAnimationWidget, animationGeostationary } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -18,9 +19,9 @@ test.afterAll(async () => {
})
test('Clicking the animation widget button opens the widget', async () => {
- const { dragger, animationWidget, animationButton, modalCloseButton } = selectors
+ const { dragger, animationWidget, animationButton } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(dragger).toBeVisible()
await expect(animationWidget).not.toBeVisible()
await animationButton.click()
@@ -28,9 +29,8 @@ test('Clicking the animation widget button opens the widget', async () => {
})
test('Opening custom interval widget', async () => {
- const { modalCloseButton } = selectors
await page.goto(activeAnimationWidget)
- await modalCloseButton.click()
+ await closeModal(page)
await page.locator('.wv-animation-widget-header #timeline-interval-btn-container #current-interval').hover()
const yearInterval = page.locator('.wv-animation-widget-header .timeline-interval .interval-years')
await expect(yearInterval).toBeVisible()
@@ -45,9 +45,9 @@ test('Opening custom interval widget', async () => {
})
test('Changing animation time interval', async () => {
- const { animationButton, modalCloseButton } = selectors
+ const { animationButton } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await animationButton.click()
await page.locator('.wv-animation-widget-header #timeline-interval-btn-container #current-interval').hover()
const yearInterval = page.locator('.wv-animation-widget-header .timeline-interval .interval-years')
@@ -61,9 +61,9 @@ test('Changing animation time interval', async () => {
})
test('Disable playback when max frames exceeded', async () => {
- const { modalCloseButton, playButton, yearStartInput } = selectors
+ const { playButton, yearStartInput } = selectors
await page.goto(animationGeostationary)
- await modalCloseButton.click()
+ await closeModal(page)
const animateYearDown = page.locator('.wv-date-range-selector > div > div > div:nth-child(3) > svg > .downarrow').first()
const animateYearUp = page.locator('.wv-date-range-selector > div > div > div > svg > .uparrow').first()
await animateYearDown.click()
diff --git a/e2e/features/animation/gif-test.spec.js b/e2e/features/animation/gif-test.spec.js
index 4d391eae6..9901c1f56 100644
--- a/e2e/features/animation/gif-test.spec.js
+++ b/e2e/features/animation/gif-test.spec.js
@@ -7,6 +7,7 @@ const {
animationTooManyFramesGif,
animationProjectionRotated
} = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -23,9 +24,9 @@ test.afterAll(async () => {
})
test('Clicking the animation widget button opens the widget', async () => {
- const { createGifIcon, arcticRotationResetButton, modalCloseButton, rotationDialogOkButton } = selectors
+ const { createGifIcon, arcticRotationResetButton, rotationDialogOkButton } = selectors
await page.goto(animationProjectionRotated)
- await modalCloseButton.click()
+ await closeModal(page)
await createGifIcon.click()
await expect(arcticRotationResetButton).toHaveText('-18')
await rotationDialogOkButton.click()
@@ -39,11 +40,10 @@ test('GIF selection preview is Accurate and selections that are too high disable
gifPreviewEndDate,
gifPreviewFrameRateValue,
gifPreviewEndResolutionSelector,
- gifDownloadButton,
- modalCloseButton
+ gifDownloadButton
} = selectors
await page.goto(activeAnimationWidget)
- await modalCloseButton.click()
+ await closeModal(page)
await createGifIcon.click()
await expect(gifPreviewStartDate).toHaveText('2018 MAR 28')
await expect(gifPreviewEndDate).toHaveText('2018 APR 04')
@@ -60,17 +60,15 @@ test('GIF selection preview is Accurate and selections that are too high disable
})
test('GIF download is disabled when too many frames would be requested with standard interval', async () => {
- const { modalCloseButton } = selectors
await page.goto(animationTooManyFramesGif)
- await modalCloseButton.click()
+ await closeModal(page)
const createGif = page.locator('#create-gif-button')
await expect(createGif).toHaveClass(/disabled/)
})
test('GIF download is disabled when too many frames would be requested with custom interval', async () => {
- const { modalCloseButton } = selectors
await page.goto(animationTooManyFramesGifCustomInterval)
- await modalCloseButton.click()
+ await closeModal(page)
const createGif = page.locator('#create-gif-button')
await expect(createGif).toHaveClass(/disabled/)
})
diff --git a/e2e/features/animation/mobile-animation-test.spec.js b/e2e/features/animation/mobile-animation-test.spec.js
index a97581d85..eb1082784 100644
--- a/e2e/features/animation/mobile-animation-test.spec.js
+++ b/e2e/features/animation/mobile-animation-test.spec.js
@@ -1,6 +1,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { knownDate } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -20,9 +21,9 @@ test.afterAll(async () => {
})
test('Clicking the animation widget button opens the widget', async () => {
- const { mobileAnimateButton, modalCloseButton } = selectors
+ const { mobileAnimateButton } = selectors
await page.goto(knownDate)
- await modalCloseButton.click()
+ await closeModal(page)
await mobileAnimateButton.click()
const customIntervalInput = page.locator('.custom-interval-delta-input')
await expect(customIntervalInput).toHaveValue('1')
diff --git a/e2e/features/compare/compare-mobile-test.spec.js b/e2e/features/compare/compare-mobile-test.spec.js
index dc472067a..ebd8e92ad 100644
--- a/e2e/features/compare/compare-mobile-test.spec.js
+++ b/e2e/features/compare/compare-mobile-test.spec.js
@@ -1,6 +1,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { swipeAndAIsActive, spyAndBIsActive, opacityAndBIsActive } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -20,9 +21,8 @@ test.afterAll(async () => {
})
test('Mobile comparison A|B toggle buttons are visible and only A is selected by default', async () => {
- const { modalCloseButton } = selectors
await page.goto(swipeAndAIsActive)
- await modalCloseButton.click()
+ await closeModal(page)
const aMobileCompareButton = page.locator('.comparison-mobile-select-toggle > div:nth-child(1)')
const bMobileCompareButton = page.locator('.comparison-mobile-select-toggle > div:nth-child(2)')
await expect(aMobileCompareButton).toHaveClass(/compare-btn-selected/)
diff --git a/e2e/features/compare/compare-test.spec.js b/e2e/features/compare/compare-test.spec.js
index e0979759a..7aac62f8d 100644
--- a/e2e/features/compare/compare-test.spec.js
+++ b/e2e/features/compare/compare-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { swipeAndAIsActive, spyAndBIsActive } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -18,9 +19,9 @@ test.afterAll(async () => {
})
test('Animation is disabled when compare mode active', async () => {
- const { animationButtonCase, animationWidget, modalCloseButton } = selectors
+ const { animationButtonCase, animationWidget } = selectors
await page.goto(swipeAndAIsActive)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(animationButtonCase).toHaveClass(/wv-disabled-button/)
const disableMessage = 'Animation feature is deactivated when Compare feature is active'
await expect(animationButtonCase).toHaveAttribute('aria-label', disableMessage)
@@ -83,9 +84,9 @@ test('Removing layer removes correct layer from correct layer group', async () =
})
test('Collapse layer list with B state and test label shows correct number of layers', async () => {
- const { toggleButton, collapsedToggleButton, modalCloseButton } = selectors
+ const { toggleButton, collapsedToggleButton } = selectors
await page.goto(spyAndBIsActive)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(collapsedToggleButton).not.toBeVisible()
await toggleButton.click()
await expect(collapsedToggleButton).toBeVisible()
diff --git a/e2e/features/compare/layer-dialog-test.spec.js b/e2e/features/compare/layer-dialog-test.spec.js
index 9f6fc7858..0f234b04b 100644
--- a/e2e/features/compare/layer-dialog-test.spec.js
+++ b/e2e/features/compare/layer-dialog-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { swipeAOD } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -28,9 +29,8 @@ test.afterAll(async () => {
})
test('Layer option features work in A|B mode', async () => {
- const { modalCloseButton } = selectors
await page.goto(swipeAOD)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(AodOptionsPanelBody).not.toBeVisible()
await aerosolLayer.hover()
await page.locator('#active-MODIS_Terra_Aerosol .wv-layers-options').click()
diff --git a/e2e/features/compare/layer-sidebar-test.spec.js b/e2e/features/compare/layer-sidebar-test.spec.js
index 320c7abf8..6b072f8ed 100644
--- a/e2e/features/compare/layer-sidebar-test.spec.js
+++ b/e2e/features/compare/layer-sidebar-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { swipeAndAIsActive } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -25,11 +26,10 @@ test('Add AOD Layer to Layer Group A', async () => {
const {
addLayers,
aerosolOpticalDepth,
- layersModalCloseButton,
- modalCloseButton
+ layersModalCloseButton
} = selectors
await page.goto(swipeAndAIsActive)
- await modalCloseButton.click()
+ await closeModal(page)
await addLayers.click()
await aerosolOpticalDepth.click()
await aodCheckBox.click()
diff --git a/e2e/features/compare/permalinks-test.spec.js b/e2e/features/compare/permalinks-test.spec.js
index ebd8c024b..7cf3f5f4c 100644
--- a/e2e/features/compare/permalinks-test.spec.js
+++ b/e2e/features/compare/permalinks-test.spec.js
@@ -6,6 +6,7 @@ const {
opacityAndBIsActive,
spyAndBIsActive
} = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -22,36 +23,35 @@ test.afterAll(async () => {
})
test('Swipe mode and A|B state A are active and date is correct', async () => {
- const { modalCloseButton, swipeButton, aTab } = selectors
+ const { swipeButton, aTab } = selectors
await page.goto(swipeAndAIsActive)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(swipeButton).not.toBeEnabled()
await expect(aTab).toHaveClass(/active/)
await expect(aTab).toContainText('A: 2018 AUG 17')
})
test('Opacity mode and A|B state B are active and date is correct', async () => {
- const { modalCloseButton, opacityButton, bTab } = selectors
+ const { opacityButton, bTab } = selectors
await page.goto(opacityAndBIsActive)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(opacityButton).not.toBeEnabled()
await expect(bTab).toHaveClass(/active/)
await expect(bTab).toContainText('B: 2018 AUG 16')
})
test('Spy mode is active in B state', async () => {
- const { modalCloseButton, spyButton, bTab } = selectors
+ const { spyButton, bTab } = selectors
await page.goto(spyAndBIsActive)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(spyButton).not.toBeEnabled()
await expect(bTab).toHaveClass(/active/)
await expect(bTab).toContainText('B: 2018 AUG 16')
})
test('A|B loaded with only one layer in A section -- Corrected Reflectance (True Color)', async () => {
- const { modalCloseButton } = selectors
await page.goto(swipeAndAIsActive)
- await modalCloseButton.click()
+ await closeModal(page)
const overlayLayer = page.locator('.ab-tabs-case .tab-pane.active ul#overlays .item')
const correctedReflectance = page.locator('#active-MODIS_Terra_CorrectedReflectance_TrueColor')
await expect(overlayLayer).not.toBeVisible()
diff --git a/e2e/features/compare/timeline-test.spec.js b/e2e/features/compare/timeline-test.spec.js
index e3fda9f69..f932432a1 100644
--- a/e2e/features/compare/timeline-test.spec.js
+++ b/e2e/features/compare/timeline-test.spec.js
@@ -2,7 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { swipeAndAIsActive } = require('../../test-utils/global-variables/querystrings')
-const { timelineDrag, dateSelectorMonthDay } = require('../../test-utils/hooks/wvHooks')
+const { timelineDrag, dateSelectorMonthDay, closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -19,9 +19,9 @@ test.afterAll(async () => {
})
test('Verify that A|B draggers are visible', async () => {
- const { draggerA, draggerB, modalCloseButton } = selectors
+ const { draggerA, draggerB } = selectors
await page.goto(swipeAndAIsActive)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(draggerA).toBeVisible()
await expect(draggerB).toBeVisible()
})
diff --git a/e2e/features/events/event-filter-test.spec.js b/e2e/features/events/event-filter-test.spec.js
index 4609dc070..80f6f78f7 100644
--- a/e2e/features/events/event-filter-test.spec.js
+++ b/e2e/features/events/event-filter-test.spec.js
@@ -2,7 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { fixedAppNow, wildfiresWithDates, backwardsCompatibleEventUrl, extentsUrl } = require('../../test-utils/global-variables/querystrings')
-const { switchProjections, clickAndWait } = require('../../test-utils/hooks/wvHooks')
+const { switchProjections, clickAndWait, closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -38,9 +38,9 @@ test.afterAll(async () => {
})
test('Default filtering includes last 120 days and all categories', async () => {
- const { eventsTab, filterIcons, filterDates, modalCloseButton } = selectors
+ const { eventsTab, filterIcons, filterDates } = selectors
await page.goto(fixedAppNow)
- await modalCloseButton.click()
+ await closeModal(page)
await eventsTab.click()
await expect(filterIcons).toHaveCount(8)
await expect(filterDates).toContainText('2011 SEP 02 - 2011 DEC 31')
@@ -88,7 +88,6 @@ test('Loading from permalink sets all criteria properly', async () => {
filterIcons,
manmadeSwitch,
mapExtentFilterCheckbox,
- modalCloseButton,
seaLakeIceSwitch,
severeStormsSwitch,
snowSwitch,
@@ -98,7 +97,7 @@ test('Loading from permalink sets all criteria properly', async () => {
wildfiresIcon
} = selectors
await page.goto(wildfiresWithDates)
- await modalCloseButton.click()
+ await closeModal(page)
const currentUrl = await page.url()
@@ -133,14 +132,13 @@ test('Changing criteria in modal DOES NOT update summary of criteria in sidebar
filterDates,
filterIcons,
filterModalCancel,
- modalCloseButton,
startInputYear,
startInputMonth,
startInputDay,
wildfiresIcon
} = selectors
await page.goto(wildfiresWithDates)
- await modalCloseButton.click()
+ await closeModal(page)
await filterButton.click()
await startInputYear.fill('2000')
await startInputMonth.fill('APR')
@@ -220,11 +218,10 @@ test('Event Selected, No Filter Params: Shows only day of event, all categories,
filterDates,
filterButton,
filterIcons,
- mapExtentFilterCheckbox,
- modalCloseButton
+ mapExtentFilterCheckbox
} = selectors
await page.goto(backwardsCompatibleEventUrl)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(filterDates).toContainText('2005 DEC 31 - 2005 DEC 31')
await filterButton.click()
await assertDateInputValues('2005-DEC-31', '2005-DEC-31')
@@ -234,9 +231,9 @@ test('Event Selected, No Filter Params: Shows only day of event, all categories,
})
test('No extent search checkbox in polar projections', async () => {
- const { filterButton, mapExtentFilterCheckbox, modalCloseButton } = selectors
+ const { filterButton, mapExtentFilterCheckbox } = selectors
await page.goto(extentsUrl)
- await modalCloseButton.click()
+ await closeModal(page)
await filterButton.click()
await expect(mapExtentFilterCheckbox).toBeVisible()
await expect(mapExtentFilterCheckbox).toBeChecked()
diff --git a/e2e/features/events/event-test.spec.js b/e2e/features/events/event-test.spec.js
index b0090129e..631ccddd6 100644
--- a/e2e/features/events/event-test.spec.js
+++ b/e2e/features/events/event-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { mockEvents } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -17,10 +18,10 @@ test.afterAll(async () => {
await page.close()
})
-test('Make sure that 4 fire layers are not present in layer list: use mock', async ({ browserName }) => {
- const { modalCloseButton, sidebarEvent, thermAnomSNPPday, thermAnomSNPPnight, thermAnomVIIRSday, thermAnomVIIRSnight } = selectors
+test('Make sure that 4 fire layers are not present in layer list: use mock', async () => {
+ const { sidebarEvent, thermAnomSNPPday, thermAnomSNPPnight, thermAnomVIIRSday, thermAnomVIIRSnight } = selectors
await page.goto(mockEvents)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(sidebarEvent).toBeVisible()
await expect(thermAnomSNPPday).not.toBeVisible()
await expect(thermAnomSNPPnight).not.toBeVisible()
@@ -30,9 +31,9 @@ test('Make sure that 4 fire layers are not present in layer list: use mock', asy
test('Check that 4 fire layers are now present', async ({ browserName }) => {
test.skip(browserName === 'firefox', 'firefox cant find iceberg event sometimes')
- const { layersTab, modalCloseButton, sidebarEvent, thermAnomSNPPday, thermAnomSNPPnight, thermAnomVIIRSday, thermAnomVIIRSnight } = selectors
+ const { layersTab, sidebarEvent, thermAnomSNPPday, thermAnomSNPPnight, thermAnomVIIRSday, thermAnomVIIRSnight } = selectors
await page.goto(mockEvents)
- await modalCloseButton.click()
+ await closeModal(page)
await sidebarEvent.click()
await layersTab.click()
await page.waitForTimeout(5000)
@@ -42,18 +43,18 @@ test('Check that 4 fire layers are now present', async ({ browserName }) => {
await expect(thermAnomVIIRSnight).toBeVisible()
})
-test('Use Mock to make sure appropriate number of event markers are appended to map', async ({ browserName }) => {
- const { eventIcons, listOfEvents, modalCloseButton } = selectors
+test('Use Mock to make sure appropriate number of event markers are appended to map', async () => {
+ const { eventIcons, listOfEvents } = selectors
await page.goto(mockEvents)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(listOfEvents).toBeVisible()
await expect(eventIcons).toHaveCount(8)
})
-test('Selecting event shows track points and markers which are not visible when switched to layer tab', async ({ browserName }) => {
- const { eventIcons, eventsTab, layersTab, modalCloseButton, secondEvent, trackMarker } = selectors
+test('Selecting event shows track points and markers which are not visible when switched to layer tab', async () => {
+ const { eventIcons, eventsTab, layersTab, secondEvent, trackMarker } = selectors
await page.goto(mockEvents)
- await modalCloseButton.click()
+ await closeModal(page)
await page.waitForTimeout(1000)
await secondEvent.click()
await page.waitForTimeout(5000)
@@ -68,43 +69,42 @@ test('Selecting event shows track points and markers which are not visible when
await expect(eventIcons).toHaveCount(8)
})
-test('Clicking an event in the list selects the event', async ({ browserName }) => {
+test('Clicking an event in the list selects the event', async () => {
const { firstEvent, selectedFirstEvent } = selectors
await firstEvent.click()
await page.waitForTimeout(6000)
await expect(selectedFirstEvent).toBeVisible()
})
-test('Verify that Url is updated', async ({ browserName }) => {
- const { modalCloseButton } = selectors
+test('Verify that Url is updated', async () => {
await page.waitForTimeout(5000)
await page.goto(mockEvents)
- await modalCloseButton.click()
+ await closeModal(page)
const currentUrl = await page.url()
expect(currentUrl).toContain('efs=true')
expect(currentUrl).toContain('efa=false')
expect(currentUrl).toContain('lg=false')
})
-test('Verify Events message and clicking message opens dialog', async ({ browserName }) => {
- const { firstEvent, notifyMessage, modalCloseButton } = selectors
+test('Verify Events message and clicking message opens dialog', async () => {
+ const { firstEvent, notifyMessage } = selectors
await page.goto(mockEvents)
- await modalCloseButton.click()
+ await closeModal(page)
await firstEvent.click()
await expect(notifyMessage).toBeVisible()
await expect(notifyMessage).toContainText('Events may not be visible at all times.')
await notifyMessage.click()
await expect(page.locator('#event_visibility_info h1')).toContainText('Why can’t I see an event?')
- await modalCloseButton.click()
+ await closeModal(page)
await expect(page.locator('#event_visibility_info')).not.toBeVisible()
await page.locator('#event-alert-close').click()
await expect(page.locator('.wv-alert .close-alert .fa-times')).not.toBeVisible()
})
-test('Clicking selected event deselects event', async ({ browserName }) => {
- const { firstEvent, selectedFirstEvent, eventsTab, modalCloseButton } = selectors
+test('Clicking selected event deselects event', async () => {
+ const { firstEvent, selectedFirstEvent, eventsTab } = selectors
await page.goto(mockEvents)
- await modalCloseButton.click()
+ await closeModal(page)
await firstEvent.click()
await selectedFirstEvent.click()
await eventsTab.hover()
diff --git a/e2e/features/events/events-mobile-test.spec.js b/e2e/features/events/events-mobile-test.spec.js
index 2bcb3cfd6..4c8b2910b 100644
--- a/e2e/features/events/events-mobile-test.spec.js
+++ b/e2e/features/events/events-mobile-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { mockEvents, stormEventSelected } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -24,9 +25,9 @@ test.afterAll(async () => {
test('Events populated in sidebar', async ({ browserName }) => {
test.skip(browserName === 'firefox', 'firefox cant find iceberg event sometimes')
- const { modalCloseButton, sidebarButton, sidebarContent, eventsTab, icebergEvent } = selectors
+ const { sidebarButton, sidebarContent, eventsTab, icebergEvent } = selectors
await page.goto(mockEvents)
- await modalCloseButton.click()
+ await closeModal(page)
await sidebarButton.click()
await expect(sidebarContent).toBeVisible()
await eventsTab.click()
@@ -45,9 +46,9 @@ test('Clicking event in list closes sidebar and selects marker for event on map'
test('Events load when arriving via permalink', async ({ browserName }) => {
test.skip(browserName === 'firefox', 'firefox cant find iceberg event sometimes')
- const { modalCloseButton, sidebarButton, sidebarContent, selectedMarker } = selectors
+ const { sidebarButton, sidebarContent, selectedMarker } = selectors
await page.goto(stormEventSelected)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(selectedMarker).toBeVisible()
await expect(sidebarContent).not.toBeVisible()
await expect(sidebarButton).toBeVisible()
diff --git a/e2e/features/global-unit/coordinate-format-test.spec.js b/e2e/features/global-unit/coordinate-format-test.spec.js
index 842081d89..cc2d83951 100644
--- a/e2e/features/global-unit/coordinate-format-test.spec.js
+++ b/e2e/features/global-unit/coordinate-format-test.spec.js
@@ -1,12 +1,11 @@
// @ts-check
const { test, expect } = require('@playwright/test')
-const createSelectors = require('../../test-utils/global-variables/selectors')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
const url = 'http://localhost:3000/?v=-78.52435703125,37.8608744140625,-75.56244296875,39.7483255859375&l=Reference_Labels_15m,Reference_Features_15m(hidden),Coastlines_15m,VIIRS_NOAA20_CorrectedReflectance_TrueColor(hidden),VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&lg=false&s=-77.0434,38.8046&t=2023-02-15-T19%3A53%3A41Z'
let page
let dmButton
let marker
-let selectors
test.describe.configure({ mode: 'serial' })
@@ -14,7 +13,6 @@ test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
dmButton = page.getByRole('button', { name: 'Set latlon-dm Format' })
marker = page.locator('.tooltip-coordinates')
- selectors = createSelectors(page)
})
test.afterAll(async () => {
@@ -22,9 +20,8 @@ test.afterAll(async () => {
})
test('Open page', async () => {
- const { modalCloseButton } = selectors
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(page).toHaveTitle('@OFFICIAL_NAME@')
})
diff --git a/e2e/features/global-unit/global-unit-test.spec.js b/e2e/features/global-unit/global-unit-test.spec.js
index 92a1c9fc2..a1f1e36ff 100644
--- a/e2e/features/global-unit/global-unit-test.spec.js
+++ b/e2e/features/global-unit/global-unit-test.spec.js
@@ -1,6 +1,6 @@
// @ts-check
const { test, expect } = require('@playwright/test')
-const createSelectors = require('../../test-utils/global-variables/selectors')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
const SSTQueryString = 'http://localhost:3000/?l=GHRSST_L4_MUR_Sea_Surface_Temperature,Reference_Labels_15m(hidden),Reference_Features_15m(hidden),Coastlines_15m,VIIRS_NOAA20_CorrectedReflectance_TrueColor(hidden),VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&lg=false&t=2020-09-28-T20%3A40%3A53Z'
@@ -10,7 +10,6 @@ let settingContainer
let SSTMinPalette
let SSTMaxPalette
let kelvinButton
-let selectors
test.describe.configure({ mode: 'serial' })
@@ -21,7 +20,6 @@ test.beforeAll(async ({ browser }) => {
SSTMinPalette = page.locator('#GHRSST_L4_MUR_Sea_Surface_Temperature_GHRSST_Sea_Surface_Temperature_0_legend_0 > div.wv-palettes-min')
SSTMaxPalette = page.locator('#GHRSST_L4_MUR_Sea_Surface_Temperature_GHRSST_Sea_Surface_Temperature_0_legend_0 > div.wv-palettes-max')
kelvinButton = page.getByRole('button', { name: 'Kelvin' })
- selectors = createSelectors(page)
})
test.afterAll(async () => {
@@ -29,9 +27,8 @@ test.afterAll(async () => {
})
test('Global settings menu item opens global settings modal', async () => {
- const { modalCloseButton } = selectors
await page.goto(SSTQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
await page.getByRole('button', { name: 'Information' }).click()
await page.getByRole('button', { name: 'Settings' }).click()
await expect(globalSettingsModal).toBeVisible()
@@ -50,9 +47,8 @@ test('Selecting Kelvin unit changes unit being used in layer palette legend', as
})
test('Kelvin global unit is retained via localStorage and active on new url', async () => {
- const { modalCloseButton } = selectors
await page.goto(SSTQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
await page.getByRole('button', { name: 'Information' }).click()
await page.getByRole('button', { name: 'Settings' }).click()
await expect(kelvinButton).toHaveClass(/active/)
diff --git a/e2e/features/image-download/crosses-dateline-test.spec.js b/e2e/features/image-download/crosses-dateline-test.spec.js
index 6b64eb901..73dba1434 100644
--- a/e2e/features/image-download/crosses-dateline-test.spec.js
+++ b/e2e/features/image-download/crosses-dateline-test.spec.js
@@ -1,9 +1,8 @@
// @ts-check
const { test, expect } = require('@playwright/test')
-const createSelectors = require('../../test-utils/global-variables/selectors')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
-let selectors
const withinMapURLParams = 'http://localhost:3000/?v=-67.80916012733559,-56.052180562072095,-30.50743102883792,-30.873513420586164&t=2021-08-08-T0'
const crossesPrevDayURLParams = 'http://localhost:3000/?v=161.16767164758798,-54.46571918482002,198.46940074608565,-29.287052043334096&t=2021-08-08-T0'
@@ -13,7 +12,6 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- selectors = createSelectors(page)
})
test.afterAll(async () => {
@@ -21,18 +19,16 @@ test.afterAll(async () => {
})
test('No dateline alert notification with message if not crossing dateline(s)', async () => {
- const { modalCloseButton } = selectors
await page.goto(withinMapURLParams)
- await modalCloseButton.click()
+ await closeModal(page)
await page.locator('#wv-image-button').click()
const datelineAlert = page.locator('#snapshot-dateline-alert')
await expect(datelineAlert).not.toBeVisible()
})
test('Dateline alert notification with previous day message if crosses previous day dateline', async () => {
- const { modalCloseButton } = selectors
await page.goto(crossesPrevDayURLParams)
- await modalCloseButton.click()
+ await closeModal(page)
await page.locator('#wv-image-button').click()
const datelineAlert = page.locator('#snapshot-dateline-alert')
const datelineAlertMessage = page.locator('#snapshot-dateline-alert .wv-alert-message')
@@ -41,9 +37,8 @@ test('Dateline alert notification with previous day message if crosses previous
})
test('Dateline alert notification with next day message if crosses next day dateline', async () => {
- const { modalCloseButton } = selectors
await page.goto(crossesNextDayURLParams)
- await modalCloseButton.click()
+ await closeModal(page)
await page.locator('#wv-image-button').click()
const datelineAlert = page.locator('#snapshot-dateline-alert')
const datelineAlertMessage = page.locator('#snapshot-dateline-alert .wv-alert-message')
diff --git a/e2e/features/image-download/formats-test.spec.js b/e2e/features/image-download/formats-test.spec.js
index f56b84471..d2dfc902d 100644
--- a/e2e/features/image-download/formats-test.spec.js
+++ b/e2e/features/image-download/formats-test.spec.js
@@ -4,18 +4,16 @@ const {
clickDownload,
closeImageDownloadPanel,
openImageDownloadPanel,
- switchProjections
+ switchProjections,
+ closeModal
} = require('../../test-utils/hooks/wvHooks')
const {
getAttribute,
joinUrl,
selectOption
} = require('../../test-utils/hooks/basicHooks')
-const createSelectors = require('../../test-utils/global-variables/selectors')
let page
-let selectors
-
const startParams = [
'l=MODIS_Terra_CorrectedReflectance_TrueColor',
'v=-1,-1,1,1',
@@ -27,7 +25,6 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- selectors = createSelectors(page)
})
test.afterAll(async () => {
@@ -35,10 +32,9 @@ test.afterAll(async () => {
})
test('JPEG is the default', async () => {
- const { modalCloseButton } = selectors
const url = await joinUrl(startParams, null)
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await clickDownload(page)
const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
diff --git a/e2e/features/image-download/global-select-test.spec.js b/e2e/features/image-download/global-select-test.spec.js
index 19df4f780..fa88613aa 100644
--- a/e2e/features/image-download/global-select-test.spec.js
+++ b/e2e/features/image-download/global-select-test.spec.js
@@ -1,7 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
-const { openImageDownloadPanel } = require('../../test-utils/hooks/wvHooks')
+const { openImageDownloadPanel, closeModal } = require('../../test-utils/hooks/wvHooks')
const { joinUrl } = require('../../test-utils/hooks/basicHooks')
let page
@@ -30,10 +30,10 @@ test.afterAll(async () => {
})
test('Verify that global select is present and not selected', async () => {
- const { globalSelectInput, modalCloseButton } = selectors
+ const { globalSelectInput } = selectors
const url = await joinUrl(startParams, null)
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await expect(globalSelectInput).toBeVisible()
await expect(globalSelectInput).not.toBeChecked()
diff --git a/e2e/features/image-download/initial-state-test.spec.js b/e2e/features/image-download/initial-state-test.spec.js
index e84ab1775..8944872a7 100644
--- a/e2e/features/image-download/initial-state-test.spec.js
+++ b/e2e/features/image-download/initial-state-test.spec.js
@@ -5,7 +5,8 @@ const createSelectors = require('../../test-utils/global-variables/selectors')
const {
openImageDownloadPanel,
closeImageDownloadPanel,
- switchProjections
+ switchProjections,
+ closeModal
} = require('../../test-utils/hooks/wvHooks')
let page
@@ -29,9 +30,9 @@ test.afterAll(async () => {
})
test('Check resolutions', async () => {
- const { imageResolution, modalCloseButton } = selectors
+ const { imageResolution } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await expect(imageResolution).toContainText(expectedResolutions)
})
diff --git a/e2e/features/image-download/layers-test.spec.js b/e2e/features/image-download/layers-test.spec.js
index 8ab1b050c..724443e6d 100644
--- a/e2e/features/image-download/layers-test.spec.js
+++ b/e2e/features/image-download/layers-test.spec.js
@@ -1,11 +1,9 @@
// @ts-check
const { test, expect } = require('@playwright/test')
-const { openImageDownloadPanel, clickDownload } = require('../../test-utils/hooks/wvHooks')
+const { openImageDownloadPanel, clickDownload, closeModal } = require('../../test-utils/hooks/wvHooks')
const { joinUrl, getAttribute } = require('../../test-utils/hooks/basicHooks')
-const createSelectors = require('../../test-utils/global-variables/selectors')
let page
-let selectors
const startParams = [
'v=-180,-90,180,90',
@@ -17,7 +15,6 @@ test.describe.configure({ mode: 'serial' })
test.beforeEach(async ({ browser }) => {
page = await browser.newPage()
- selectors = createSelectors(page)
})
test.afterEach(async () => {
@@ -25,10 +22,9 @@ test.afterEach(async () => {
})
test('List layers in draw order', async () => {
- const { modalCloseButton } = selectors
const url = await joinUrl(startParams, '&l=MODIS_Terra_CorrectedReflectance_TrueColor,Reference_Features_15m,MODIS_Terra_Aerosol')
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await clickDownload(page)
const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
@@ -37,11 +33,10 @@ test('List layers in draw order', async () => {
test('Move AOD over the reference features', async ({ browserName }) => {
test.skip(browserName === 'firefox', 'firefox fails this test for unknown reasons')
- const { modalCloseButton } = selectors
const url = await joinUrl(startParams, '&l=MODIS_Terra_CorrectedReflectance_TrueColor,MODIS_Terra_Aerosol,Reference_Features_15m')
await page.goto(url)
await page.waitForTimeout(1000)
- await modalCloseButton.click()
+ await closeModal(page)
await page.waitForTimeout(1000)
await openImageDownloadPanel(page)
await clickDownload(page)
@@ -50,10 +45,9 @@ test('Move AOD over the reference features', async ({ browserName }) => {
})
test('Do not include obscured layers', async () => {
- const { modalCloseButton } = selectors
const url = await joinUrl(startParams, '&l=MODIS_Terra_CorrectedReflectance_TrueColor,MODIS_Terra_Aerosol,Reference_Features_15m')
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await clickDownload(page)
const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
@@ -61,10 +55,9 @@ test('Do not include obscured layers', async () => {
})
test('Multiple base layers when one is semi-transparent', async () => {
- const { modalCloseButton } = selectors
const url = await joinUrl(startParams, '&l=MODIS_Terra_CorrectedReflectance_TrueColor(opacity=0.5),MODIS_Aqua_CorrectedReflectance_TrueColor')
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await clickDownload(page)
const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
diff --git a/e2e/features/image-download/projection-test.spec.js b/e2e/features/image-download/projection-test.spec.js
index ac634bba1..f08f6bfe7 100644
--- a/e2e/features/image-download/projection-test.spec.js
+++ b/e2e/features/image-download/projection-test.spec.js
@@ -3,14 +3,13 @@ const { test, expect } = require('@playwright/test')
const {
openImageDownloadPanel,
closeImageDownloadPanel,
- clickDownload
+ clickDownload,
+ closeModal
} = require('../../test-utils/hooks/wvHooks')
const { joinUrl, getAttribute } = require('../../test-utils/hooks/basicHooks')
const { switchProjections } = require('../../test-utils/hooks/wvHooks')
-const createSelectors = require('../../test-utils/global-variables/selectors')
let page
-let selectors
const startParams = [
'l=MODIS_Terra_CorrectedReflectance_TrueColor',
@@ -22,7 +21,6 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- selectors = createSelectors(page)
})
test.afterAll(async () => {
@@ -30,10 +28,9 @@ test.afterAll(async () => {
})
test('Geographic is EPSG:4326', async () => {
- const { modalCloseButton } = selectors
const url = await joinUrl(startParams, null)
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await clickDownload(page)
const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
diff --git a/e2e/features/image-download/resolutions3413-test.spec.js b/e2e/features/image-download/resolutions3413-test.spec.js
index 2f410c06b..0c4bbf3c8 100644
--- a/e2e/features/image-download/resolutions3413-test.spec.js
+++ b/e2e/features/image-download/resolutions3413-test.spec.js
@@ -5,7 +5,8 @@ const {
openImageDownloadPanel,
closeImageDownloadPanel,
clickDownload,
- zoomIn
+ zoomIn,
+ closeModal
} = require('../../test-utils/hooks/wvHooks')
const { joinUrl, getAttribute } = require('../../test-utils/hooks/basicHooks')
@@ -32,10 +33,10 @@ test.afterAll(async () => {
})
test('In the arctic, top zoom levels is 5km', async () => {
- const { imageResolution, modalCloseButton } = selectors
+ const { imageResolution } = selectors
const url = await joinUrl(startParams, null)
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await expect(imageResolution).toHaveValue('20')
await closeImageDownloadPanel(page)
diff --git a/e2e/features/image-download/resolutions4326-test.spec.js b/e2e/features/image-download/resolutions4326-test.spec.js
index ac30a7515..027502983 100644
--- a/e2e/features/image-download/resolutions4326-test.spec.js
+++ b/e2e/features/image-download/resolutions4326-test.spec.js
@@ -5,7 +5,8 @@ const {
openImageDownloadPanel,
closeImageDownloadPanel,
clickDownload,
- zoomIn
+ zoomIn,
+ closeModal
} = require('../../test-utils/hooks/wvHooks')
const { joinUrl, getAttribute } = require('../../test-utils/hooks/basicHooks')
@@ -32,10 +33,10 @@ test.afterAll(async () => {
})
test('In geographic, top two zoom levels are 10km', async () => {
- const { imageResolution, modalCloseButton } = selectors
+ const { imageResolution } = selectors
const url = await joinUrl(startParams, null)
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await expect(imageResolution).toHaveValue('40')
await closeImageDownloadPanel(page)
diff --git a/e2e/features/image-download/time-test.spec.js b/e2e/features/image-download/time-test.spec.js
index 85a4c3e04..240543d2d 100644
--- a/e2e/features/image-download/time-test.spec.js
+++ b/e2e/features/image-download/time-test.spec.js
@@ -3,13 +3,12 @@ const { test, expect } = require('@playwright/test')
const {
openImageDownloadPanel,
closeImageDownloadPanel,
- clickDownload
+ clickDownload,
+ closeModal
} = require('../../test-utils/hooks/wvHooks')
const { joinUrl, getAttribute } = require('../../test-utils/hooks/basicHooks')
-const createSelectors = require('../../test-utils/global-variables/selectors')
let page
-let selectors
const startParams = [
'imageDownload='
@@ -19,7 +18,6 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- selectors = createSelectors(page)
})
test.afterAll(async () => {
@@ -27,10 +25,9 @@ test.afterAll(async () => {
})
test('Image for today', async () => {
- const { modalCloseButton } = selectors
const url = await joinUrl(startParams, '&now=2018-06-01T3')
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await clickDownload(page)
const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
@@ -39,10 +36,9 @@ test('Image for today', async () => {
})
test('Image for yesterday', async () => {
- const { modalCloseButton } = selectors
const url = await joinUrl(startParams, '&now=2018-06-01T0')
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await clickDownload(page)
const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
@@ -51,10 +47,9 @@ test('Image for yesterday', async () => {
})
test('Image for 2018-05-15', async () => {
- const { modalCloseButton } = selectors
const url = await joinUrl(startParams, '&t=2018-05-15')
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await openImageDownloadPanel(page)
await clickDownload(page)
const urlAttribute = await getAttribute(page, '#wv-image-download-url', 'url')
diff --git a/e2e/features/image-download/unsupported-test.spec.js b/e2e/features/image-download/unsupported-test.spec.js
index 4c168ba24..cce0c6a18 100644
--- a/e2e/features/image-download/unsupported-test.spec.js
+++ b/e2e/features/image-download/unsupported-test.spec.js
@@ -1,7 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
-const { closeImageDownloadPanel } = require('../../test-utils/hooks/wvHooks')
+const { closeImageDownloadPanel, closeModal } = require('../../test-utils/hooks/wvHooks')
const { joinUrl } = require('../../test-utils/hooks/basicHooks')
let page
@@ -29,10 +29,10 @@ test.afterAll(async () => {
})
test('Custom palettes are not supported dialog', async () => {
- const { modalCloseButton, snapshotToolbarButton } = selectors
+ const { snapshotToolbarButton } = selectors
const url = await joinUrl(startParams, '&l=MODIS_Terra_Aerosol(palette=red_1)')
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await snapshotToolbarButton.click()
await expect(notify).toBeVisible()
})
@@ -54,10 +54,10 @@ test('Custom palettes: OK button brings up download panel', async () => {
})
test('Rotation is not supported dialog', async () => {
- const { modalCloseButton, snapshotToolbarButton } = selectors
+ const { snapshotToolbarButton } = selectors
const url = await joinUrl(startParams, '&p=arctic&r=18')
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await snapshotToolbarButton.click()
await expect(notify).toBeVisible()
})
diff --git a/e2e/features/layers/layer-picker-mobile-test.spec.js b/e2e/features/layers/layer-picker-mobile-test.spec.js
index 8d0889cf8..1762a7c52 100644
--- a/e2e/features/layers/layer-picker-mobile-test.spec.js
+++ b/e2e/features/layers/layer-picker-mobile-test.spec.js
@@ -1,7 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
-const { assertDefaultLayers, assertCategories } = require('../../test-utils/hooks/wvHooks')
+const { assertDefaultLayers, assertCategories, closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -23,9 +23,9 @@ test.afterAll(async () => {
})
test('Initial state indicates layer count', async () => {
- const { layerCount, modalCloseButton } = selectors
+ const { layerCount } = selectors
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(layerCount).toBeVisible()
await expect(layerCount).toContainText('7')
})
@@ -178,14 +178,14 @@ test('Clicking the selected row deselects it and hides the details', async () =>
})
test('Close product picker and confirm added layers show in sidebar', async () => {
- const { layersModalCloseButton } = selectors
- await layersModalCloseButton.click()
+ await closeModal(page)
const activeLayer = page.locator('#active-MODIS_Aqua_Aerosol')
await expect(activeLayer).toBeVisible()
})
test('Collapse sidebar and confirm layer count updated', async () => {
const { layerCount } = selectors
+ await page.locator('.layer-btn-close').click()
await page.locator('#toggleIconHolder').click()
await expect(layerCount).toContainText('8')
})
diff --git a/e2e/features/layers/layer-picker-test.spec.js b/e2e/features/layers/layer-picker-test.spec.js
index b9c315a0a..46973a914 100644
--- a/e2e/features/layers/layer-picker-test.spec.js
+++ b/e2e/features/layers/layer-picker-test.spec.js
@@ -1,7 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
-const { assertCategories, switchProjections } = require('../../test-utils/hooks/wvHooks')
+const { assertCategories, switchProjections, closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -20,9 +20,9 @@ test.afterAll(async () => {
})
test('Layer picker shows categories when first opened', async () => {
- const { addLayers, modalCloseButton } = selectors
+ const { addLayers } = selectors
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await addLayers.click()
await assertCategories(page)
})
diff --git a/e2e/features/layers/layers-sidebar-test.spec.js b/e2e/features/layers/layers-sidebar-test.spec.js
index 56f36d52a..4a65c0dca 100644
--- a/e2e/features/layers/layers-sidebar-test.spec.js
+++ b/e2e/features/layers/layers-sidebar-test.spec.js
@@ -1,7 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
-const { assertLayerOrdering } = require('../../test-utils/hooks/wvHooks')
+const { assertLayerOrdering, closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -49,11 +49,10 @@ test('Toggle layer Info', async () => {
const {
firesLayer,
infoButton,
- infoDialog,
- modalCloseButton
+ infoDialog
} = selectors
await page.goto(twoGroupsQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
await firesLayer.hover()
await infoButton.click()
await infoButton.click()
@@ -80,11 +79,10 @@ test('Adding a layer causes it to appear in the appropriate group', async () =>
firesLayer,
layersModalCloseButton,
layersSearchField,
- modalCloseButton,
viirsFiresCheckbox
} = selectors
await page.goto(someGroupsQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
await addLayers.click()
await layersSearchField.fill('fires')
await viirsFiresCheckbox.click()
@@ -128,9 +126,9 @@ test('Removing the last layer in a group removes the group', async () => {
})
test('Removing a group removes all layers and the group header', async () => {
- const { aodGroupHeader, aodGroup, modalCloseButton } = selectors
+ const { aodGroupHeader, aodGroup } = selectors
await page.goto(twoGroupsQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
await aodGroupHeader.hover()
await page.locator('#active-Aerosol_Optical_Depth .layer-group-more-options > button').click()
await page.locator('#active-Aerosol_Optical_Depth .layer-group-more-options #remove-group').click()
@@ -142,11 +140,10 @@ test('Load with groups disabled from permalink', async () => {
aodGroup,
firesGroup,
groupCheckbox,
- modalCloseButton,
overlaysGroup
} = selectors
await page.goto(mixedLayersGroupsDisabledQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(groupCheckbox).toBeVisible()
await expect(groupCheckbox).not.toBeChecked()
await expect(firesGroup).not.toBeVisible()
@@ -160,11 +157,10 @@ test('Load multiple groups from permalink', async () => {
const {
aodGroup,
firesGroup,
- groupCheckbox,
- modalCloseButton
+ groupCheckbox
} = selectors
await page.goto(twoGroupsQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(groupCheckbox).toBeVisible()
await expect(groupCheckbox).toBeChecked()
await expect(firesGroup).toBeVisible()
@@ -220,11 +216,10 @@ test('Re-ordering groups, then disabling groups keeps individual layer order', a
const {
aodGroupHeader,
firesGroupHeader,
- groupCheckbox,
- modalCloseButton
+ groupCheckbox
} = selectors
await page.goto(twoGroupsQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
const aodBoundingBox = await aodGroupHeader.boundingBox()
const firesBoundingBox = await firesGroupHeader.boundingBox()
// this 'steps' option is important for making the drag action work with the 'react-draggable' library
@@ -248,11 +243,10 @@ test('Enabling groups re-orders layers into their groups', async () => {
const {
aodGroup,
firesGroup,
- groupCheckbox,
- modalCloseButton
+ groupCheckbox
} = selectors
await page.goto(mixedLayersGroupsDisabledQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
const layersContainer = '#active-overlays li'
await assertLayerOrdering(page, layersContainer, mixedLayerIdOrder)
await groupCheckbox.click()
@@ -276,9 +270,9 @@ test('Immediately disabling groups restores mixed ordering', async () => {
})
test('Making a change to grouped layers causes group ordering to be retained when ungrouped', async () => {
- const { groupCheckbox, aodGroupHeader, modalCloseButton } = selectors
+ const { groupCheckbox, aodGroupHeader } = selectors
await page.goto(mixedLayersGroupsDisabledQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
await groupCheckbox.click()
await aodGroupHeader.hover()
await page.locator('#active-Aerosol_Optical_Depth .layer-group-more-options > button').click()
@@ -289,9 +283,8 @@ test('Making a change to grouped layers causes group ordering to be retained whe
})
test('Vector layer has pointer icon & clicking vector layer pointer shows modal', async () => {
- const { modalCloseButton } = selectors
await page.goto(vectorsQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
const handPointer = await page.locator('#active-GRanD_Dams .fa-hand-pointer')
await expect(handPointer).toBeVisible()
await handPointer.click()
diff --git a/e2e/features/layers/layers-vector-test.spec.js b/e2e/features/layers/layers-vector-test.spec.js
index af0afc6c2..073eaa84b 100644
--- a/e2e/features/layers/layers-vector-test.spec.js
+++ b/e2e/features/layers/layers-vector-test.spec.js
@@ -1,6 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -20,9 +21,9 @@ test.afterAll(async () => {
})
test('Vector layer click does not show alert when all vector layers are clickable', async () => {
- const { geographicMap, modalCloseButton, notifyMessage } = selectors
+ const { geographicMap, notifyMessage } = selectors
await page.goto(damsLayerUrl)
- await modalCloseButton.click()
+ await closeModal(page)
const pointerIcon = await page.locator('#active-GRanD_Dams .fa-hand-pointer')
await expect(pointerIcon).toBeVisible()
await geographicMap.click()
@@ -31,9 +32,9 @@ test('Vector layer click does not show alert when all vector layers are clickabl
test('Vectors show alert when not clickable', async ({ browserName }) => {
test.skip(browserName === 'firefox', 'issue identifying pointer')
- const { geographicMap, modalCloseButton, notifyMessage } = selectors
+ const { geographicMap, notifyMessage } = selectors
await page.goto(damsLayerWMSZoomLevelUrl)
- await modalCloseButton.click()
+ await closeModal(page)
const pointerIcon = await page.locator('#active-GRanD_Dams .fa-hand-pointer')
await expect(pointerIcon).toBeVisible()
await geographicMap.click()
diff --git a/e2e/features/layers/options-test.spec.js b/e2e/features/layers/options-test.spec.js
index 80ed0ba5d..23b5e6a3f 100644
--- a/e2e/features/layers/options-test.spec.js
+++ b/e2e/features/layers/options-test.spec.js
@@ -1,6 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -19,9 +20,9 @@ test.afterAll(async () => {
})
test('Verify that settings button opens settings modal', async () => {
- const { aodSidebarLayer, modalCloseButton } = selectors
+ const { aodSidebarLayer } = selectors
await page.goto(customsSquashedQuerystring)
- await modalCloseButton.click()
+ await closeModal(page)
await aodSidebarLayer.hover()
const thresholdMinLabel = await page.locator('#wv-layer-options-threshold0 .wv-label-range-min')
const combinedAodSettingsButton = await page.locator('#active-MODIS_Combined_Value_Added_AOD .wv-layers-options')
diff --git a/e2e/features/layers/recent-layers-mobile-test.spec.js b/e2e/features/layers/recent-layers-mobile-test.spec.js
index c42e0ca7c..586a0052e 100644
--- a/e2e/features/layers/recent-layers-mobile-test.spec.js
+++ b/e2e/features/layers/recent-layers-mobile-test.spec.js
@@ -1,7 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
-const { assertCategories } = require('../../test-utils/hooks/wvHooks')
+const { assertCategories, closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -23,9 +23,9 @@ test.afterAll(async () => {
})
test('Layer picker shows categories when first opened', async () => {
- const { addLayers, collapsedLayerButton, modalCloseButton } = selectors
+ const { addLayers, collapsedLayerButton } = selectors
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await collapsedLayerButton.click()
await addLayers.click()
await assertCategories(page)
diff --git a/e2e/features/layers/recent-layers-test.spec.js b/e2e/features/layers/recent-layers-test.spec.js
index fa684b1be..549bd4362 100644
--- a/e2e/features/layers/recent-layers-test.spec.js
+++ b/e2e/features/layers/recent-layers-test.spec.js
@@ -1,7 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
-const { assertCategories } = require('../../test-utils/hooks/wvHooks')
+const { assertCategories, closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -20,9 +20,9 @@ test.afterAll(async () => {
})
test('Layer picker shows categories when first opened', async () => {
- const { addLayers, modalCloseButton } = selectors
+ const { addLayers } = selectors
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await addLayers.click()
await assertCategories(page)
})
diff --git a/e2e/features/location-search/location-search-mobile-test.spec.js b/e2e/features/location-search/location-search-mobile-test.spec.js
index b6271dc45..c9b9c3dec 100644
--- a/e2e/features/location-search/location-search-mobile-test.spec.js
+++ b/e2e/features/location-search/location-search-mobile-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { skipTour } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -21,9 +22,9 @@ test.afterAll(async () => {
})
test('Location Search component is visible by default', async () => {
- const { locationSearchMobileDialog, modalCloseButton } = selectors
+ const { locationSearchMobileDialog } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(locationSearchMobileDialog).not.toBeVisible()
})
diff --git a/e2e/features/location-search/location-search-test.spec.js b/e2e/features/location-search/location-search-test.spec.js
index 8608e75ab..91ed297c0 100644
--- a/e2e/features/location-search/location-search-test.spec.js
+++ b/e2e/features/location-search/location-search-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { skipTour } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -22,9 +23,9 @@ test.afterAll(async () => {
})
test('Location Search component is visible by default', async () => {
- const { locationSearchComponent, modalCloseButton } = selectors
+ const { locationSearchComponent } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(locationSearchComponent).toBeVisible()
})
@@ -35,9 +36,9 @@ test('Clicking the minimize button minimizes the Location Search component', asy
})
test('Location Search component remains hidden on subsequent page loads per user preference', async () => {
- const { locationSearchComponent, modalCloseButton } = selectors
+ const { locationSearchComponent } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(locationSearchComponent).not.toBeVisible()
})
@@ -48,10 +49,9 @@ test('Clicking Location Search toolbar button expands the Location Search compon
})
test('Coordinates dialog for permalink marker is visible by default on page load', async () => {
- const { modalCloseButton } = selectors
const testMarkerEncodedID = await page.locator('.coordinates-map-marker_-77__2E__032__2C__38__2E__8904')
await page.goto(markerUrl)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(testMarkerEncodedID).toBeVisible()
})
@@ -68,9 +68,9 @@ test('Clicking minimize tooltip hides the coordinates dialog', async () => {
})
test('Clicking close tooltip removes the marker and coordinates dialog', async () => {
- const { coordinatesMapMarker, modalCloseButton, tooltipCoordinatesCloseButton } = selectors
+ const { coordinatesMapMarker, tooltipCoordinatesCloseButton } = selectors
await page.goto(removeMarkerUrl)
- await modalCloseButton.click()
+ await closeModal(page)
await tooltipCoordinatesCloseButton.click()
await expect(coordinatesMapMarker).not.toBeVisible()
const url = await page.url()
@@ -78,9 +78,9 @@ test('Clicking close tooltip removes the marker and coordinates dialog', async (
})
test('Invalid marker query string parameter prevents state update', async () => {
- const { coordinatesMapMarker, modalCloseButton } = selectors
+ const { coordinatesMapMarker } = selectors
await page.goto(invalidMarkerQuery)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(coordinatesMapMarker).not.toBeVisible()
const url = await page.url()
expect(url).not.toContain('s=')
diff --git a/e2e/features/measure/measure-test.spec.js b/e2e/features/measure/measure-test.spec.js
index e4c8b19e6..35dff2182 100644
--- a/e2e/features/measure/measure-test.spec.js
+++ b/e2e/features/measure/measure-test.spec.js
@@ -6,7 +6,8 @@ const { getAttribute } = require('../../test-utils/hooks/basicHooks')
const {
createDistanceMeasurement,
createAreaMeasurement,
- switchProjections
+ switchProjections,
+ closeModal
} = require('../../test-utils/hooks/wvHooks')
let page
@@ -27,11 +28,10 @@ test.afterAll(async () => {
})
test('Clicking the measure button opens the menu', async ({ browserName }) => {
- const { modalCloseButton } = selectors
test.skip(browserName === 'firefox', 'firefox pointer issue')
const { measureMenu, measureBtn } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(measureMenu).not.toBeVisible()
await measureBtn.click()
})
diff --git a/e2e/features/modal/about-modal-test.spec.js b/e2e/features/modal/about-modal-test.spec.js
index afe125517..cbd4d243b 100644
--- a/e2e/features/modal/about-modal-test.spec.js
+++ b/e2e/features/modal/about-modal-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { skipTour } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -22,9 +23,8 @@ test.afterAll(async () => {
})
test('About modal not open when URL param not present', async () => {
- const { modalCloseButton } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(aboutPage).not.toBeVisible()
})
@@ -38,8 +38,6 @@ test('Opening about modal from menu sets URL param', async () => {
})
test('About modal is open when URL param is present', async () => {
- const { modalCloseButton } = selectors
await page.goto(aboutOpenURL)
- await modalCloseButton.click()
await expect(aboutPage).toBeVisible()
})
diff --git a/e2e/features/notifications/notify-test.spec.js b/e2e/features/notifications/notify-test.spec.js
index 7d001cc56..68acce789 100644
--- a/e2e/features/notifications/notify-test.spec.js
+++ b/e2e/features/notifications/notify-test.spec.js
@@ -1,6 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -40,10 +41,9 @@ test('No visible notifications with mockAlert parameter set to no_types', async
})
test('Verify that layer notices don\'t show up in the notification list or contribute to the count', async () => {
- const { modalCloseButton } = selectors
const url = `${layerNoticesQuery}&mockAlerts=all_types`
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
await infoButtonIcon.click()
const badge = await page.getByRole('button', { name: 'Notifications 2' })
await expect(badge).toBeVisible()
@@ -65,10 +65,9 @@ test('Verify that the user is only alerted if they have not already stored all i
})
test('Verify that zots show for the layers that have notices', async () => {
- const { modalCloseButton } = selectors
const url = `${layerNoticesQuery}&mockAlerts=all_types`
await page.goto(url)
- await modalCloseButton.click()
+ await closeModal(page)
const aquaZot = await page.locator('#MODIS_Aqua_CorrectedReflectance_TrueColor-zot')
const particulateZot = await page.locator('#Particulate_Matter_Below_2__2E__5micrometers_2001-2010-zot')
await expect(aquaZot).toBeVisible()
diff --git a/e2e/features/palettes/disable-test.spec.js b/e2e/features/palettes/disable-test.spec.js
index 3756337b8..3c609573a 100644
--- a/e2e/features/palettes/disable-test.spec.js
+++ b/e2e/features/palettes/disable-test.spec.js
@@ -1,9 +1,8 @@
// @ts-check
const { test, expect } = require('@playwright/test')
-const createSelectors = require('../../test-utils/global-variables/selectors')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
-let selectors
const enabledPermalink = 'http://localhost:3000/?l=Last_of_the_Wild_1995-2004'
const disabledPermalink = 'http://localhost:3000/?l=Last_of_the_Wild_1995-2004(disabled=0-13-12-1-2-6)'
@@ -12,7 +11,6 @@ test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- selectors = createSelectors(page)
})
test.afterAll(async () => {
@@ -20,9 +18,8 @@ test.afterAll(async () => {
})
test('Verify that toggling class updates permalink and layer-legend', async () => {
- const { modalCloseButton } = selectors
await page.goto(enabledPermalink)
- await modalCloseButton.click()
+ await closeModal(page)
const disabledClassification = await page.locator('#active-Last_of_the_Wild_1995-2004 .disabled-classification')
await expect(disabledClassification).not.toBeVisible()
await page.locator('#active-Last_of_the_Wild_1995-2004').hover()
@@ -53,9 +50,8 @@ test('Verify that toggling class-all on updates permalink and layer-legend', asy
})
test('Verify that loaded permalink disables classes', async () => {
- const { modalCloseButton } = selectors
await page.goto(disabledPermalink)
- await modalCloseButton.click()
+ await closeModal(page)
const colorBoxDisabledZero = await page.locator('#Last_of_the_Wild_1995-2004_0_legend-color-Last_of_the_Wild_1995-2004-active0.disabled-classification')
const colorBoxDisabledThirteen = await page.locator('#Last_of_the_Wild_1995-2004_0_legend-color-Last_of_the_Wild_1995-2004-active13.disabled-classification')
const colorBoxDisabledSix = await page.locator('#Last_of_the_Wild_1995-2004_0_legend-color-Last_of_the_Wild_1995-2004-active6.disabled-classification')
diff --git a/e2e/features/projections/projections-test.spec.js b/e2e/features/projections/projections-test.spec.js
index 17b7f7b70..541e11c20 100644
--- a/e2e/features/projections/projections-test.spec.js
+++ b/e2e/features/projections/projections-test.spec.js
@@ -1,7 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
-const { switchProjections } = require('../../test-utils/hooks/wvHooks')
+const { switchProjections, closeModal } = require('../../test-utils/hooks/wvHooks')
const { skipTour } = require('../../test-utils/global-variables/querystrings')
let page
@@ -19,9 +19,9 @@ test.afterAll(async () => {
})
test('Verify default page shows projection toolbar button in geographic projection map', async () => {
- const { geographicMap, modalCloseButton, projToolbarButton } = selectors
+ const { geographicMap, projToolbarButton } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(projToolbarButton).toBeVisible()
await expect(geographicMap).toBeVisible()
})
diff --git a/e2e/features/share/share-test.spec.js b/e2e/features/share/share-test.spec.js
index b787dc8b7..4409ce4e6 100644
--- a/e2e/features/share/share-test.spec.js
+++ b/e2e/features/share/share-test.spec.js
@@ -3,6 +3,7 @@ const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { skipTour } = require('../../test-utils/global-variables/querystrings')
const { getAttribute } = require('../../test-utils/hooks/basicHooks')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -21,9 +22,9 @@ test.afterAll(async () => {
})
test('Clicking the share link button opens the share dialog', async () => {
- const { modalCloseButton, shareToolbarButton, shareToolbar } = selectors
+ const { shareToolbarButton, shareToolbar } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await shareToolbarButton.click()
await expect(shareToolbar).toBeVisible()
})
@@ -38,10 +39,10 @@ test('Share tabs link and social are visible and enabled', async () => {
})
test('Share link clipboard with existing time query string param in the page url will have the same serialized time', async () => {
- const { modalCloseButton, shareToolbarButton, shareLinkInput } = selectors
+ const { shareToolbarButton, shareLinkInput } = selectors
const queryString = 'http://localhost:3000/?t=2018-12-31'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await shareToolbarButton.click()
const url = await page.url()
expect(url).toContain('t=')
@@ -49,10 +50,10 @@ test('Share link clipboard with existing time query string param in the page url
})
test('Share link clipboard with no time query string param in the page url will have the same serialized time (partial YYYY-MM-DD)', async () => {
- const { modalCloseButton, shareToolbarButton } = selectors
+ const { shareToolbarButton } = selectors
const queryString = 'http://localhost:3000/'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await page.getByRole('button', { name: '×' }).click()
await shareToolbarButton.click()
const minutesOffset = 40 * 60000 // 40 minutes
@@ -86,10 +87,10 @@ test('Clicking the social tab displays social share buttons', async () => {
})
test('Clicking Shorten link works with links less than 2049 characters', async () => {
- const { modalCloseButton, shareToolbarButton } = selectors
+ const { shareToolbarButton } = selectors
const shortQueryString = 'http://localhost:3000/?l=Reference_Labels_15m,Reference_Features_15m,Coastlines_15m,VIIRS_NOAA20_CorrectedReflectance_TrueColor(hidden),VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&lg=true&t=2022-08-10-T15%3A15%3A05Z'
await page.goto(shortQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
const linkShortenCase = await page.locator('#wv-link-shorten-case')
await shareToolbarButton.click()
await linkShortenCase.click()
@@ -97,10 +98,10 @@ test('Clicking Shorten link works with links less than 2049 characters', async (
})
test('Clicking Shorten link is refused with links greater than 2048 characters', async () => {
- const { modalCloseButton, shareToolbarButton } = selectors
+ const { shareToolbarButton } = selectors
const longQueryString = 'http://localhost:3000/?l=MODIS_Terra_AOD_Deep_Blue_Combined,MODIS_Terra_AOD_Deep_Blue_Land,MODIS_Terra_Angstrom_Exponent_Ocean,MODIS_Terra_Angstrom_Exponent_Land,MODIS_Terra_Aerosol_Optical_Depth_3km,MODIS_Terra_Aerosol,MISR_Aerosol_Optical_Depth_Avg_Green_Monthly,VIIRS_SNPP_Angstrom_Exponent_Dark_Target_Ocean,VIIRS_SNPP_AOT_Dark_Target_Land_Ocean,VIIRS_SNPP_Angstrom_Exponent_Deep_Blue_Best_Estimate,VIIRS_SNPP_AOT_Deep_Blue_Best_Estimate,SWDB_Aerosol_Angstrom_Exponent_Monthly,SWDB_Aerosol_Optical_Thickness_550nm_Monthly,SWDB_Aerosol_Angstrom_Exponent_Daily,SWDB_Aerosol_Optical_Thickness_550nm_Daily,MERRA2_Total_Aerosol_Optical_Thickness_550nm_Extinction_Monthly,MERRA2_Total_Aerosol_Optical_Thickness_550nm_Scattering_Monthly,OMI_Absorbing_Aerosol_Optical_Thickness_MW_388,OMI_Absorbing_Aerosol_Optical_Depth,OMI_Aerosol_Optical_Depth,MODIS_Aqua_AOD_Deep_Blue_Combined,MODIS_Aqua_AOD_Deep_Blue_Land,MODIS_Aqua_Angstrom_Exponent_Ocean,MODIS_Aqua_Angstrom_Exponent_Land,MODIS_Aqua_Aerosol_Optical_Depth_3km,MODIS_Aqua_Aerosol,MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth,MODIS_Combined_Value_Added_AOD,MLS_CO_215hPa_Night,MLS_CO_215hPa_Day,AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Monthly_Night,AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Monthly_Day,AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Daily_Night,AIRS_L3_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Daily_Day,AIRS_L2_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Night,AIRS_L2_Carbon_Monoxide_500hPa_Volume_Mixing_Ratio_Day,OrbitTracks_Aura_Descending,OrbitTracks_Aura_Ascending,OrbitTracks_Aqua_Ascending,OrbitTracks_Suomi_NPP_Ascending,VIIRS_SNPP_Aerosol_Type_Deep_Blue_Best_Estimate,Reference_Labels_15m,Reference_Features_15m,Coastlines_15m,MODIS_Combined_L3_Nadir-BRDF_Daily,MODIS_Combined_MAIAC_L2G_BidirectionalReflectance_Bands143,VIIRS_NOAA20_CorrectedReflectance_TrueColor(hidden),VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor&lg=true&t=2022-08-10-T15%3A15%3A05Z'
await page.goto(longQueryString)
- await modalCloseButton.click()
+ await closeModal(page)
const linkShortenCase = await page.locator('#wv-link-shorten-case')
await shareToolbarButton.click()
await linkShortenCase.click()
diff --git a/e2e/features/timeline/date-selector-test.spec.js b/e2e/features/timeline/date-selector-test.spec.js
index 1c89500a1..b6bfd88e5 100644
--- a/e2e/features/timeline/date-selector-test.spec.js
+++ b/e2e/features/timeline/date-selector-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { subdailyLayerIntervalTimescale, knownDate } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -23,11 +24,10 @@ test('Verify subdaily default year, month, day, hour, minute date selector input
dateSelectorHourInput,
dateSelectorDayInput,
dateSelectorMonthInput,
- dateSelectorYearInput,
- modalCloseButton
+ dateSelectorYearInput
} = selectors
await page.goto(subdailyLayerIntervalTimescale)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(dateSelectorMinuteInput).toBeVisible()
await expect(dateSelectorHourInput).toBeVisible()
await expect(dateSelectorDayInput).toBeVisible()
@@ -36,9 +36,9 @@ test('Verify subdaily default year, month, day, hour, minute date selector input
})
test('Change date using left/right arrows', async () => {
- const { dateSelectorDayInput, modalCloseButton } = selectors
+ const { dateSelectorDayInput } = selectors
await page.goto(knownDate)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(dateSelectorDayInput).toHaveValue('22')
await page.locator('#left-arrow-group').click()
await expect(dateSelectorDayInput).toHaveValue('21')
@@ -47,10 +47,9 @@ test('Change date using left/right arrows', async () => {
})
test('Left timeline arrow will not be disabled by default', async () => {
- const { modalCloseButton } = selectors
const queryString = 'http://localhost:3000/'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await page.getByRole('button', { name: '×' }).click()
const leftArrow = await page.locator('#left-arrow-group')
await expect(leftArrow).not.toHaveClass(/button-disabled/)
@@ -75,17 +74,15 @@ test('Left timeline arrow will not be disabled by default', async () => {
// })
test('Right timeline arrow will not be disabled', async () => {
- const { modalCloseButton } = selectors
await page.goto(knownDate)
- await modalCloseButton.click()
+ await closeModal(page)
const rightArrow = await page.locator('#right-arrow-group')
await expect(rightArrow).not.toHaveClass(/button-disabled/)
})
test('Now button will not be disabled if date is not on now', async () => {
- const { modalCloseButton } = selectors
await page.goto(knownDate)
- await modalCloseButton.click()
+ await closeModal(page)
const nowButton = await page.locator('#now-button-group')
await expect(nowButton).not.toHaveClass(/button-disabled/)
})
@@ -94,12 +91,11 @@ test('Verify date selector is populated with date YYYY-MON-DD', async () => {
const {
dateSelectorDayInput,
dateSelectorMonthInput,
- dateSelectorYearInput,
- modalCloseButton
+ dateSelectorYearInput
} = selectors
const queryString = 'http://localhost:3000/?t=2019-02-22'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(dateSelectorDayInput).toHaveValue('22')
await expect(dateSelectorMonthInput).toHaveValue('FEB')
await expect(dateSelectorYearInput).toHaveValue('2019')
@@ -111,11 +107,10 @@ test('Verify subdaily date selector is populated with date YYYY-MON-DD-HH-MM', a
dateSelectorMonthInput,
dateSelectorYearInput,
dateSelectorHourInput,
- dateSelectorMinuteInput,
- modalCloseButton
+ dateSelectorMinuteInput
} = selectors
await page.goto(subdailyLayerIntervalTimescale)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(dateSelectorMinuteInput).toHaveValue('46')
await expect(dateSelectorHourInput).toHaveValue('09')
await expect(dateSelectorDayInput).toHaveValue('04')
@@ -124,10 +119,10 @@ test('Verify subdaily date selector is populated with date YYYY-MON-DD-HH-MM', a
})
test('Allow invalid day values in date selector', async () => {
- const { dateSelectorDayInput, modalCloseButton } = selectors
+ const { dateSelectorDayInput } = selectors
const queryString = 'http://localhost:3000/?t=2019-02-22'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await dateSelectorDayInput.fill('31')
await page.keyboard.press('Enter')
await expect(dateSelectorDayInput).toHaveClass(/invalid-input/)
@@ -137,12 +132,11 @@ test('Allow invalid year to valid year values in date selector', async () => {
const {
dateSelectorDayInput,
dateSelectorMonthInput,
- dateSelectorYearInput,
- modalCloseButton
+ dateSelectorYearInput
} = selectors
const queryString = 'http://localhost:3000/?t=2019-02-22'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await dateSelectorYearInput.fill('2020')
await dateSelectorMonthInput.fill('MAR')
await dateSelectorDayInput.fill('31')
@@ -156,12 +150,11 @@ test('Verify invalid days are rolled over', async () => {
const {
dateSelectorDayInput,
dateSelectorMonthInput,
- dateSelectorYearInput,
- modalCloseButton
+ dateSelectorYearInput
} = selectors
const queryString = 'http://localhost:3000/?t=2013-02-29'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(dateSelectorDayInput).toHaveValue('01')
await expect(dateSelectorMonthInput).toHaveValue('MAR')
await expect(dateSelectorYearInput).toHaveValue('2013')
@@ -173,12 +166,11 @@ test('Date selector up arrow rolls over from Feb 28 to 1 (non leap year) and the
dayDown,
dateSelectorDayInput,
dateSelectorMonthInput,
- dateSelectorYearInput,
- modalCloseButton
+ dateSelectorYearInput
} = selectors
const queryString = 'http://localhost:3000/?t=2013-02-28'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await dayUp.click()
await expect(dateSelectorDayInput).toHaveValue('01')
await expect(dateSelectorMonthInput).toHaveValue('FEB')
@@ -190,10 +182,9 @@ test('Date selector up arrow rolls over from Feb 28 to 1 (non leap year) and the
})
test('Added future layer and right timeline arrow is not disabled', async () => {
- const { modalCloseButton } = selectors
const queryString = 'http://localhost:3000/?mockFutureLayer=VIIRS_SNPP_CorrectedReflectance_TrueColor,3D'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
const rightArrow = await page.locator('#right-arrow-group')
await expect(rightArrow).not.toHaveClass(/button-disabled/)
await rightArrow.click()
diff --git a/e2e/features/timeline/layer-coverage-panel-test.spec.js b/e2e/features/timeline/layer-coverage-panel-test.spec.js
index a53ed019f..737009010 100644
--- a/e2e/features/timeline/layer-coverage-panel-test.spec.js
+++ b/e2e/features/timeline/layer-coverage-panel-test.spec.js
@@ -1,16 +1,14 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const { skipTour, referenceLayersOnly } = require('../../test-utils/global-variables/querystrings')
-const createSelectors = require('../../test-utils/global-variables/selectors')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
-let selectors
test.describe.configure({ mode: 'serial' })
test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
- selectors = createSelectors(page)
})
test.afterAll(async () => {
@@ -18,17 +16,15 @@ test.afterAll(async () => {
})
test('Layer coverage is shown by default', async () => {
- const { modalCloseButton } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
const layerCoverageAxisLine = await page.locator('.axis-matching-layer-coverage-line')
await expect(layerCoverageAxisLine).toBeVisible()
})
test('No layer coverage is shown by default', async () => {
- const { modalCloseButton } = selectors
await page.goto(referenceLayersOnly)
- await modalCloseButton.click()
+ await closeModal(page)
const layerCoverageAxisLine = await page.locator('.axis-matching-layer-coverage-line')
const layerCoverageHandle = await page.locator('#timeline-layer-coverage-panel-handle')
await expect(layerCoverageHandle).toBeVisible()
@@ -36,9 +32,8 @@ test('No layer coverage is shown by default', async () => {
})
test('Panel opens on handle click', async () => {
- const { modalCloseButton } = selectors
await page.goto(referenceLayersOnly)
- await modalCloseButton.click()
+ await closeModal(page)
const layerCoverageContainer = await page.locator('.timeline-layer-coverage-container')
const layerCoverageHandle = await page.locator('#timeline-layer-coverage-panel-handle')
await layerCoverageHandle.click()
diff --git a/e2e/features/timeline/timeline-mobile-test.spec.js b/e2e/features/timeline/timeline-mobile-test.spec.js
index 7f4f86060..5c7d6909e 100644
--- a/e2e/features/timeline/timeline-mobile-test.spec.js
+++ b/e2e/features/timeline/timeline-mobile-test.spec.js
@@ -1,6 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -20,10 +21,10 @@ test.afterAll(async () => {
})
test('date.mob.init.2a: Before 3:00 UTC: load yesterdays date', async () => {
- const { mobileDatePickerSelectBtn, modalCloseButton } = selectors
+ const { mobileDatePickerSelectBtn } = selectors
const queryString = 'http://localhost:3000/?now=2013-03-15T0'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(mobileDatePickerSelectBtn).toContainText('2013 MAR 14')
})
@@ -36,10 +37,10 @@ test('date.mob.init.2b: Before 3:00 UTC: right button is not disabled', async ()
})
test('date.mob.init.3a: After 3:00 UTC: load todays date', async () => {
- const { mobileDatePickerSelectBtn, modalCloseButton } = selectors
+ const { mobileDatePickerSelectBtn } = selectors
const queryString = 'http://localhost:3000/?now=2013-03-15T4'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(mobileDatePickerSelectBtn).toContainText('2013 MAR 15')
})
@@ -50,10 +51,10 @@ test('date.mob.init.3b:After 3:00 UTC: right button is disabled', async () => {
})
test('date.mob.range.1: Date label should show 2013-03-15', async () => {
- const { mobileDatePickerSelectBtn, modalCloseButton } = selectors
+ const { mobileDatePickerSelectBtn } = selectors
const queryString = 'http://localhost:3000/?now=2013-03-15T12'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(mobileDatePickerSelectBtn).toContainText('2013 MAR 15')
})
@@ -106,10 +107,10 @@ test('date.mob.range.6: Click okay button verify date has updated', async ({ bro
})
test('date.mob.nav.1: Date label should show 2013 JUL 20', async () => {
- const { mobileDatePickerSelectBtn, modalCloseButton } = selectors
+ const { mobileDatePickerSelectBtn } = selectors
const queryString = 'http://localhost:3000/?now=2014-03-15&t=2013-07-20T12'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(mobileDatePickerSelectBtn).toContainText('2013 JUL 20')
})
diff --git a/e2e/features/timeline/timeline-test.spec.js b/e2e/features/timeline/timeline-test.spec.js
index b0bb2839a..872ee6cce 100644
--- a/e2e/features/timeline/timeline-test.spec.js
+++ b/e2e/features/timeline/timeline-test.spec.js
@@ -6,6 +6,7 @@ const {
subdailyLayerIntervalTimescale,
knownDate
} = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -22,9 +23,9 @@ test.afterAll(async () => {
})
test('Dragger is visible', async () => {
- const { dragger, modalCloseButton } = selectors
+ const { dragger } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(dragger).toBeVisible()
})
@@ -71,9 +72,8 @@ test('Change to year zoom level and axis changes', async () => {
})
test('Interval state of HOUR restored from permalink', async () => {
- const { modalCloseButton } = selectors
await page.goto(subdailyLayerIntervalTimescale)
- await modalCloseButton.click()
+ await closeModal(page)
const currentInteval = await page.locator('#current-interval')
await page.locator('#timeline-interval-btn-container').hover()
await expect(currentInteval).toContainText('1 hour')
@@ -101,10 +101,10 @@ test('Custom interval widget opens on selecting custom', async () => {
})
test('Select custom interval changes current interval and changes date by current interval', async () => {
- const { dateSelectorDayInput, modalCloseButton } = selectors
+ const { dateSelectorDayInput } = selectors
const customInterval = await page.locator('#current-interval')
await page.goto(knownDate)
- await modalCloseButton.click()
+ await closeModal(page)
await expect(dateSelectorDayInput).toHaveValue('22')
await page.locator('#timeline-interval-btn-container').hover()
await page.locator('#interval-custom-static').click()
@@ -117,22 +117,20 @@ test('Select custom interval changes current interval and changes date by curren
})
test('Timescale zoom level defaults to DAY', async () => {
- const { modalCloseButton } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
const currentZoom = await page.locator('#current-zoom')
await expect(currentZoom).toContainText('day')
})
test('Timescale zoom subdaily default year, month, day, hour, minute, and custom intervals', async () => {
- const { modalCloseButton } = selectors
const zoomYears = await page.locator('#zoom-years')
const zoomMonths = await page.locator('#zoom-months')
const zoomDays = await page.locator('#zoom-days')
const zoomHours = await page.locator('#zoom-hours')
const zoomMinutes = await page.locator('#zoom-minutes')
await page.goto(subdailyLayerIntervalTimescale)
- await modalCloseButton.click()
+ await closeModal(page)
await page.locator('#current-zoom').hover()
await expect(zoomYears).toBeVisible()
await expect(zoomMonths).toBeVisible()
@@ -147,18 +145,16 @@ test('Timescale zoom HOUR restored from permalink', async () => {
})
test('Date tooltip date present load', async () => {
- const { modalCloseButton } = selectors
const queryString = 'http://localhost:3000/?t=2019-02-22'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
const dateTooltip = await page.locator('.date-tooltip')
await expect(dateTooltip).toContainText('2019 FEB 22 (DOY 053)')
})
test('Date subdaily tooltip date present on load', async () => {
- const { modalCloseButton } = selectors
await page.goto(subdailyLayerIntervalTimescale)
- await modalCloseButton.click()
+ await closeModal(page)
const dateTooltip = await page.locator('.date-tooltip')
await expect(dateTooltip).toContainText('2019 OCT 04 09:46Z (DOY 277)')
})
diff --git a/e2e/features/tour/tour-test.spec.js b/e2e/features/tour/tour-test.spec.js
index 0054599f3..73676573f 100644
--- a/e2e/features/tour/tour-test.spec.js
+++ b/e2e/features/tour/tour-test.spec.js
@@ -2,6 +2,7 @@
const { test } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { skipTour } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -18,9 +19,9 @@ test.afterAll(async () => {
})
test('Verify that all tour modals are present when the page is loaded', async () => {
- const { infoToolbarButton, modalCloseButton } = selectors
+ const { infoToolbarButton } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
await infoToolbarButton.click()
await page.locator('#start_tour_info_item').click()
})
diff --git a/e2e/features/ui/distraction-free-mode-test.spec.js b/e2e/features/ui/distraction-free-mode-test.spec.js
index d2daf6409..be87d9716 100644
--- a/e2e/features/ui/distraction-free-mode-test.spec.js
+++ b/e2e/features/ui/distraction-free-mode-test.spec.js
@@ -1,6 +1,7 @@
// @ts-check
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -71,10 +72,10 @@ const distractionFreeModeValidElsRemoved = async (proj, isActive) => {
}
test('Enabling distraction free mode with shortcut key hides UI elements', async () => {
- const { locationSearchMinimizeButton, infoToolbarButton, modalCloseButton } = selectors
+ const { locationSearchMinimizeButton, infoToolbarButton } = selectors
const queryString = 'http://localhost:3000/?p=arctic'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await locationSearchMinimizeButton.click()
await infoToolbarButton.click()
await page.locator('#distraction_free_info_item').click()
@@ -88,9 +89,8 @@ test('Disabling distraction free mode with shortcut key returns UI elements', as
})
test('Enabling distraction free mode activates query string parameter df', async () => {
- const { modalCloseButton } = selectors
const queryString = 'http://localhost:3000/?df=true'
await page.goto(queryString)
- await modalCloseButton.click()
+ await closeModal(page)
await distractionFreeModeValidElsRemoved('geographic', true)
})
diff --git a/e2e/features/ui/info-mobile-test.spec.js b/e2e/features/ui/info-mobile-test.spec.js
index 942cf1af0..242121848 100644
--- a/e2e/features/ui/info-mobile-test.spec.js
+++ b/e2e/features/ui/info-mobile-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { skipTour } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -21,9 +22,9 @@ test.afterAll(async () => {
})
test('Mobile info toolbar is visible and contains valid mobile menu items', async () => {
- const { infoToolbarButton, modalCloseButton } = selectors
+ const { infoToolbarButton } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
const sendFeedback = await page.locator('#send_feedback_info_item')
const settingsInfo = await page.locator('#settings_info_item')
const aboutInfo = await page.locator('#about_info_item')
diff --git a/e2e/features/ui/info-test.spec.js b/e2e/features/ui/info-test.spec.js
index 51daee1ec..db2daf944 100644
--- a/e2e/features/ui/info-test.spec.js
+++ b/e2e/features/ui/info-test.spec.js
@@ -2,6 +2,7 @@
const { test, expect } = require('@playwright/test')
const createSelectors = require('../../test-utils/global-variables/selectors')
const { skipTour } = require('../../test-utils/global-variables/querystrings')
+const { closeModal } = require('../../test-utils/hooks/wvHooks')
let page
let selectors
@@ -18,9 +19,9 @@ test.afterAll(async () => {
})
test('Info toolbar is visible and contains valid menu items', async () => {
- const { infoToolbarButton, modalCloseButton } = selectors
+ const { infoToolbarButton } = selectors
await page.goto(skipTour)
- await modalCloseButton.click()
+ await closeModal(page)
const sendFeedback = await page.locator('#send_feedback_info_item')
const startTour = await page.locator('#start_tour_info_item')
const settingsInfo = await page.locator('#settings_info_item')
diff --git a/e2e/test-utils/hooks/wvHooks.js b/e2e/test-utils/hooks/wvHooks.js
index 2becce1eb..0332cb1e0 100644
--- a/e2e/test-utils/hooks/wvHooks.js
+++ b/e2e/test-utils/hooks/wvHooks.js
@@ -169,12 +169,20 @@ const clickAndWait = async (page, locator) => {
await page.waitForTimeout(200)
}
+const closeModal = async (page) => {
+ const closeButton = page.locator('.modal-close-btn')
+ if (await closeButton.count() > 0) {
+ await closeButton.click()
+ }
+}
+
module.exports = {
assertCategories,
assertDefaultLayers,
assertLayerOrdering,
clickDownload,
closeImageDownloadPanel,
+ closeModal,
createAreaMeasurement,
createDistanceMeasurement,
dateSelectorMonthDay,