Interactive interface for browsing global, full-resolution satellite imagery
WV-3465: Split-up Long Playwright Test Files (#6525)
christof-wittreich0585309def01
diff --git a/e2e/features/animation/gif-test.spec.js b/e2e/features/animation/gif-test.spec.jsindex e9556b87b..1f7516f97 100644--- a/e2e/features/animation/gif-test.spec.js+++ b/e2e/features/animation/gif-test.spec.js@@ -31,6 +31,7 @@ test('Clicking the animation widget button opens the widget', async () => {await createGifIcon.click()await expect(arcticRotationResetButton).toHaveText('-18')await rotationDialogOkButton.click()+ await page.waitForTimeout(1000)await expect(arcticRotationResetButton).toHaveText('0')})diff --git a/e2e/features/events/event-2-test.spec.js b/e2e/features/events/event-2-test.spec.jsnew file mode 100644index 000000000..3aad564c6--- /dev/null+++ b/e2e/features/events/event-2-test.spec.js@@ -0,0 +1,46 @@+// @ts-check+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')++/** @type {import('@playwright/test').Page} */+let page+/** @type {Record<string, import('@playwright/test').Locator>} */+let selectors+test.describe.configure({ mode: 'serial' })++test.beforeAll(async ({ browser }) => {+ page = await browser.newPage()+ selectors = createSelectors(page)+})++test.afterAll(async () => {+ await page.close()+})++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 closeModal(page)+ await page.waitForTimeout(1500)+ await secondEvent.click()+ await expect(trackMarker).toHaveCount(5, { timeout: 10000 })+ await layersTab.hover()+ await page.waitForTimeout(500)+ await layersTab.click()+ await expect(trackMarker).not.toBeVisible()+ await expect(eventIcons).not.toBeVisible()+ await eventsTab.click()+ await expect(trackMarker).toHaveCount(5)+ await expect(eventIcons).toHaveCount(8)+})++test('Clicking an event in the list selects the event', async () => {+ const { firstEvent, selectedFirstEvent } = selectors+ await page.waitForTimeout(500)+ await expect(firstEvent).toBeVisible()+ await firstEvent.click()+ await page.waitForTimeout(250)+ await expect(selectedFirstEvent).toBeVisible()+})diff --git a/e2e/features/events/event-3-test.spec.js b/e2e/features/events/event-3-test.spec.jsnew file mode 100644index 000000000..c75b7458a--- /dev/null+++ b/e2e/features/events/event-3-test.spec.js@@ -0,0 +1,59 @@+// @ts-check+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')++/** @type {import('@playwright/test').Page} */+let page+/** @type {Record<string, import('@playwright/test').Locator>} */+let selectors+test.describe.configure({ mode: 'serial' })++test.beforeAll(async ({ browser }) => {+ page = await browser.newPage()+ selectors = createSelectors(page)+})++test.afterAll(async () => {+ await page.close()+})++test('Verify that Url is updated', async () => {+ await page.goto(mockEvents)+ await closeModal(page)+ await page.waitForTimeout(5000)+ 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 () => {+ const { firstEvent, notifyMessage } = selectors+ await page.goto(mockEvents)+ await closeModal(page)+ await page.waitForTimeout(500)+ await expect(firstEvent).toBeVisible()+ 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 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 () => {+ const { firstEvent, selectedFirstEvent, eventsTab } = selectors+ await page.goto(mockEvents)+ await closeModal(page)+ await page.waitForTimeout(500)+ await expect(firstEvent).toBeVisible()+ await firstEvent.click()+ await selectedFirstEvent.click()+ await eventsTab.hover()+ await expect(selectedFirstEvent).not.toBeVisible()+})diff --git a/e2e/features/events/event-filter-2-test.spec.js b/e2e/features/events/event-filter-2-test.spec.jsnew file mode 100644index 000000000..723d203b3--- /dev/null+++ b/e2e/features/events/event-filter-2-test.spec.js@@ -0,0 +1,78 @@+// @ts-check+const { test, expect } = require('@playwright/test')+const createSelectors = require('../../test-utils/global-variables/selectors')+const { backwardsCompatibleEventUrl, extentsUrl } = require('../../test-utils/global-variables/querystrings')+const { switchProjections, closeModal } = require('../../test-utils/hooks/wvHooks')++/** @type {import('@playwright/test').Page} */+let page+/** @type {Record<string, import('@playwright/test').Locator>} */+let selectors+test.describe.configure({ mode: 'serial' })++test.beforeAll(async ({ browser }) => {+ page = await browser.newPage()+ selectors = createSelectors(page)+})++const assertDateInputValues = async (/** @type {string} */ start, /** @type {string} */ end) => {+ const {+ startInputYear,+ startInputMonth,+ startInputDay,+ endInputYear,+ endInputMonth,+ endInputDay+ } = selectors+ const [startYear, startMonth, startDay] = start.split('-')+ const [endYear, endMonth, endDay] = end.split('-')+ expect(startInputYear).toHaveValue(startYear)+ expect(startInputMonth).toHaveValue(startMonth)+ expect(startInputDay).toHaveValue(startDay)+ expect(endInputYear).toHaveValue(endYear)+ expect(endInputMonth).toHaveValue(endMonth)+ expect(endInputDay).toHaveValue(endDay)+}++test.afterAll(async () => {+ await page.close()+})++test('Event Selected, No Filter Params: Shows only day of event, all categories, checkbox unchecked', async () => {+ const {+ filterDates,+ filterButton,+ filterIcons,+ mapExtentFilterCheckbox+ } = selectors+ await page.goto(backwardsCompatibleEventUrl)+ await closeModal(page)+ await expect(filterDates).toContainText('2005 DEC 31 - 2005 DEC 31')+ await filterButton.click()+ await assertDateInputValues('2005-DEC-31', '2005-DEC-31')+ await expect(filterIcons).toHaveCount(9)+ await expect(mapExtentFilterCheckbox).not.toBeChecked()+ await page.locator('.modal-close-btn').click()+})++test('No extent search checkbox in polar projections', async () => {+ const { filterButton, mapExtentFilterCheckbox } = selectors+ await page.goto(extentsUrl)+ await closeModal(page)+ await filterButton.click()+ await expect(mapExtentFilterCheckbox).toBeVisible()+ await expect(mapExtentFilterCheckbox).toBeChecked()+ await page.locator('.modal-close-btn').click()+ await switchProjections(page, 'arctic')+ await filterButton.click()+ await expect(mapExtentFilterCheckbox).not.toBeVisible()+ await page.locator('.modal-close-btn').click()+ await switchProjections(page, 'geographic')+ await filterButton.click()+ await expect(mapExtentFilterCheckbox).toBeChecked()+ await page.locator('.modal-close-btn').click()+ await switchProjections(page, 'antarctic')+ await filterButton.click()+ await expect(mapExtentFilterCheckbox).not.toBeVisible()+ await page.locator('.modal-close-btn').click()+})diff --git a/e2e/features/events/event-filter-test.spec.js b/e2e/features/events/event-filter-test.spec.jsindex 4a4d51f24..b419673b3 100644--- a/e2e/features/events/event-filter-test.spec.js+++ b/e2e/features/events/event-filter-test.spec.js@@ -1,8 +1,8 @@// @ts-checkconst { 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, closeModal } = require('../../test-utils/hooks/wvHooks')+const { fixedAppNow, wildfiresWithDates } = require('../../test-utils/global-variables/querystrings')+const { clickAndWait, closeModal } = require('../../test-utils/hooks/wvHooks')/** @type {import('@playwright/test').Page} */let page@@ -15,7 +15,7 @@ test.beforeAll(async ({ browser }) => {selectors = createSelectors(page)})-const assertDateInputValues = async (start, end) => {+const assertDateInputValues = async (/** @type {string} */ start, /** @type {string} */ end) => {const {startInputYear,startInputMonth,@@ -219,43 +219,3 @@ test('Changing criteria in modal DOES update summary of criteria in sidebar on Aawait expect(volcanoesIcon).toBeVisible()await expect(wildfiresIcon).not.toBeVisible()})--test('Event Selected, No Filter Params: Shows only day of event, all categories, checkbox unchecked', async () => {- const {- filterDates,- filterButton,- filterIcons,- mapExtentFilterCheckbox- } = selectors- await page.goto(backwardsCompatibleEventUrl)- await closeModal(page)- await expect(filterDates).toContainText('2005 DEC 31 - 2005 DEC 31')- await filterButton.click()- await assertDateInputValues('2005-DEC-31', '2005-DEC-31')- await expect(filterIcons).toHaveCount(9)- await expect(mapExtentFilterCheckbox).not.toBeChecked()- await page.locator('.modal-close-btn').click()-})--test('No extent search checkbox in polar projections', async () => {- const { filterButton, mapExtentFilterCheckbox } = selectors- await page.goto(extentsUrl)- await closeModal(page)- await filterButton.click()- await expect(mapExtentFilterCheckbox).toBeVisible()- await expect(mapExtentFilterCheckbox).toBeChecked()- await page.locator('.modal-close-btn').click()- await switchProjections(page, 'arctic')- await filterButton.click()- await expect(mapExtentFilterCheckbox).not.toBeVisible()- await page.locator('.modal-close-btn').click()- await switchProjections(page, 'geographic')- await page.waitForTimeout(5000)- await filterButton.click()- await expect(mapExtentFilterCheckbox).toBeChecked()- await page.locator('.modal-close-btn').click()- await switchProjections(page, 'antarctic')- await filterButton.click()- await expect(mapExtentFilterCheckbox).not.toBeVisible()- await page.locator('.modal-close-btn').click()-})diff --git a/e2e/features/events/event-test.spec.js b/e2e/features/events/event-test.spec.jsindex d71570fb3..fc1e4d940 100644--- a/e2e/features/events/event-test.spec.js+++ b/e2e/features/events/event-test.spec.js@@ -23,6 +23,7 @@ test('Make sure that 4 fire layers are not present in layer list: use mock', asyconst { sidebarEvent, thermAnomSNPPday, thermAnomSNPPnight, thermAnomVIIRSday, thermAnomVIIRSnight } = selectorsawait page.goto(mockEvents)await closeModal(page)+ await page.waitForTimeout(500)await expect(sidebarEvent).toBeVisible()await expect(thermAnomSNPPday).not.toBeVisible()await expect(thermAnomSNPPnight).not.toBeVisible()@@ -35,13 +36,13 @@ test('Check that 4 fire layers are now present', async ({ browserName }) => {const { layersTab, sidebarEvent, thermAnomSNPPday, thermAnomSNPPnight, thermAnomVIIRSday, thermAnomVIIRSnight } = selectorsawait page.goto(mockEvents)await closeModal(page)+ await page.waitForTimeout(1000)await sidebarEvent.click()await layersTab.click()- await page.waitForTimeout(5000)- await expect(thermAnomSNPPday).toBeVisible()- await expect(thermAnomSNPPnight).toBeVisible()- await expect(thermAnomVIIRSday).toBeVisible()- await expect(thermAnomVIIRSnight).toBeVisible()+ await expect(thermAnomSNPPday).toBeVisible({ timeout: 10000 })+ await expect(thermAnomSNPPnight).toBeVisible({ timeout: 10000 })+ await expect(thermAnomVIIRSday).toBeVisible({ timeout: 10000 })+ await expect(thermAnomVIIRSnight).toBeVisible({ timeout: 10000 })})test('Use Mock to make sure appropriate number of event markers are appended to map', async () => {@@ -51,64 +52,3 @@ test('Use Mock to make sure appropriate number of event markers are appended toawait 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 () => {- const { eventIcons, eventsTab, layersTab, secondEvent, trackMarker } = selectors- await page.goto(mockEvents)- await closeModal(page)- await page.waitForTimeout(1000)- await secondEvent.click()- await page.waitForTimeout(5000)- await expect(trackMarker).toHaveCount(5)- await layersTab.hover()- await page.waitForTimeout(1000)- await layersTab.click()- await expect(trackMarker).not.toBeVisible()- await expect(eventIcons).not.toBeVisible()- await eventsTab.click()- await expect(trackMarker).toHaveCount(5)- await expect(eventIcons).toHaveCount(8)-})--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 () => {- await page.waitForTimeout(5000)- await page.goto(mockEvents)- 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 () => {- const { firstEvent, notifyMessage } = selectors- await page.goto(mockEvents)- 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 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 () => {- const { firstEvent, selectedFirstEvent, eventsTab } = selectors- await page.goto(mockEvents)- await closeModal(page)- await firstEvent.click()- await selectedFirstEvent.click()- await eventsTab.hover()- await page.waitForTimeout(5000)- await expect(selectedFirstEvent).not.toBeVisible()-})diff --git a/e2e/features/layers/layers-sidebar-2-test.spec.js b/e2e/features/layers/layers-sidebar-2-test.spec.jsnew file mode 100644index 000000000..f2bf6d7d8--- /dev/null+++ b/e2e/features/layers/layers-sidebar-2-test.spec.js@@ -0,0 +1,185 @@+// @ts-check+const { test, expect } = require('@playwright/test')+const createSelectors = require('../../test-utils/global-variables/selectors')+const { assertLayerOrdering, closeModal } = require('../../test-utils/hooks/wvHooks')++/** @type {import('@playwright/test').Page} */+let page+/** @type {Record<string, import('@playwright/test').Locator>} */+let selectors+const vectorsQueryString = 'http://localhost:3000/?v=-70.43215000968726,28.678203599725197,-59.81569241792232,31.62330063930118&l=GRanD_Dams,Reference_Labels_15m(hidden),Reference_Features_15m(hidden),Coastlines_15m,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),VIIRS_NOAA20_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor'+const twoGroupsQueryString = 'http://localhost:3000/?v=-107.15747724134027,-81.6706340523014,47.81381180183274,89.12472754295932&l=VIIRS_SNPP_Thermal_Anomalies_375m_All,VIIRS_NOAA20_Thermal_Anomalies_375m_All,MODIS_Combined_Value_Added_AOD,MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth,Reference_Features_15m,MODIS_Terra_CorrectedReflectance_TrueColor&lg=true'+const mixedLayersGroupsDisabledQueryString = 'http://localhost:3000/?v=-107.15747724134027,-81.6706340523014,47.81381180183274,89.12472754295932&l=Reference_Features_15m,VIIRS_SNPP_Thermal_Anomalies_375m_All,MODIS_Combined_Value_Added_AOD,VIIRS_NOAA20_Thermal_Anomalies_375m_All,MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth,MODIS_Terra_CorrectedReflectance_TrueColor&lg=false'++const mixedLayerIdOrder = [+ 'active-Reference_Features_15m',+ 'active-VIIRS_SNPP_Thermal_Anomalies_375m_All',+ 'active-MODIS_Combined_Value_Added_AOD',+ 'active-VIIRS_NOAA20_Thermal_Anomalies_375m_All',+ 'active-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth'+]+const groupedLayerIdOrder = [+ 'active-Reference_Features_15m',+ 'active-VIIRS_SNPP_Thermal_Anomalies_375m_All',+ 'active-VIIRS_NOAA20_Thermal_Anomalies_375m_All',+ 'active-MODIS_Combined_Value_Added_AOD',+ 'active-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth',+ 'active-MODIS_Terra_CorrectedReflectance_TrueColor'+]+const ungroupedReorderdLayerIdOrder = [+ 'active-MODIS_Combined_Value_Added_AOD',+ 'active-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth',+ 'active-VIIRS_SNPP_Thermal_Anomalies_375m_All',+ 'active-VIIRS_NOAA20_Thermal_Anomalies_375m_All',+ 'active-Reference_Features_15m'+]++test.describe.configure({ mode: 'serial' })++test.beforeAll(async ({ browser }) => {+ page = await browser.newPage()+ selectors = createSelectors(page)+})++test.afterAll(async () => {+ await page.close()+})++test('Load multiple groups from permalink', async () => {+ const {+ aodGroup,+ firesGroup,+ groupCheckbox+ } = selectors+ await page.goto(twoGroupsQueryString)+ await closeModal(page)+ await expect(groupCheckbox).toBeVisible()+ await expect(groupCheckbox).toBeChecked()+ await expect(firesGroup).toBeVisible()+ await expect(aodGroup).toBeVisible()+ const fireGroupItems = await page.locator('#active-Fires_and_Thermal_Anomalies ul > li')+ const aodGroupItems = await page.locator('#active-Aerosol_Optical_Depth ul > li')+ await expect(fireGroupItems).toHaveCount(2)+ await expect(aodGroupItems).toHaveCount(2)+})++test('Hide all...', async () => {+ const { sidebarContainer, aodGroupHeader } = selectors+ await sidebarContainer.hover()+ 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 #hide-all').click()+ const aodGroupHiddenLayers = await page.locator('#active-Aerosol_Optical_Depth li.layer-hidden')+ const aodGroupVisibleLayers = await page.locator('#active-Aerosol_Optical_Depth li.layer-visible')+ await expect(aodGroupHiddenLayers).toHaveCount(2)+ await expect(aodGroupVisibleLayers).toHaveCount(0)+})++test('Show all...', async () => {+ const { sidebarContainer, aodGroupHeader } = selectors+ await sidebarContainer.hover()+ 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 #show-all').click()+ const aodGroupHiddenLayers = await page.locator('#active-Aerosol_Optical_Depth li.layer-hidden')+ const aodGroupVisibleLayers = await page.locator('#active-Aerosol_Optical_Depth li.layer-visible')+ await expect(aodGroupHiddenLayers).toHaveCount(0)+ await expect(aodGroupVisibleLayers).toHaveCount(2)+})++test('Ungrouped: Removing baselayers/overlays removes the layers but not the header', async () => {+ const {+ groupCheckbox,+ firesLayer,+ overlaysGroupHeader,+ overlaysGroup+ } = selectors+ await groupCheckbox.click()+ await firesLayer.hover()+ await overlaysGroupHeader.hover()+ await page.locator('#active-overlays .layer-group-more-options > button').click()+ await page.locator('#active-overlays .layer-group-more-options #remove-group').click()+ await expect(overlaysGroup).toBeVisible()+ const overlayGroupItems = page.locator('#active-overlays ul > li')+ await expect(overlayGroupItems).toHaveCount(0)+})++test('Re-ordering groups, then disabling groups keeps individual layer order', async () => {+ const {+ aodGroupHeader,+ firesGroupHeader,+ groupCheckbox+ } = selectors+ await page.goto(twoGroupsQueryString)+ await closeModal(page)+ const aodBoundingBox = await aodGroupHeader.boundingBox() || { x: 0, y: 0 }+ const firesBoundingBox = await firesGroupHeader.boundingBox() || { x: 0, y: 0, width: 0, height: 0 }+ // this 'steps' option is important for making the drag action work with the 'react-draggable' library+ await page.mouse.move(+ aodBoundingBox.x,+ aodBoundingBox.y,+ { steps: 10 }+ )+ await page.mouse.down()+ const x = firesBoundingBox.x + firesBoundingBox.width / 2+ const y = firesBoundingBox.y + firesBoundingBox.height / 2+ await page.mouse.move(x, y, { steps: 10 })+ await page.mouse.up()+ await page.waitForTimeout(300)+ await groupCheckbox.click()+ const layersContainer = '#active-overlays li'+ await assertLayerOrdering(page, layersContainer, ungroupedReorderdLayerIdOrder)+})++test('Enabling groups re-orders layers into their groups', async () => {+ const {+ aodGroup,+ firesGroup,+ groupCheckbox+ } = selectors+ await page.goto(mixedLayersGroupsDisabledQueryString)+ await closeModal(page)+ const layersContainer = '#active-overlays li'+ await assertLayerOrdering(page, layersContainer, mixedLayerIdOrder)+ await groupCheckbox.click()+ await expect(aodGroup).toBeVisible()+ await expect(firesGroup).toBeVisible()+ const groupedLayersContainer = '.layer-container ul .productsitem'+ await assertLayerOrdering(page, groupedLayersContainer, groupedLayerIdOrder)+})++test('Immediately disabling groups restores mixed ordering', async () => {+ const {+ aodGroup,+ firesGroup,+ groupCheckbox+ } = selectors+ await groupCheckbox.click()+ await expect(aodGroup).not.toBeVisible()+ await expect(firesGroup).not.toBeVisible()+ const layersContainer = '#active-overlays li'+ await assertLayerOrdering(page, layersContainer, mixedLayerIdOrder)+})++test('Making a change to grouped layers causes group ordering to be retained when ungrouped', async () => {+ const { groupCheckbox, aodGroupHeader } = selectors+ await page.goto(mixedLayersGroupsDisabledQueryString)+ await closeModal(page)+ await groupCheckbox.click()+ 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 #hide-all').click()+ await groupCheckbox.click()+ const groupedLayersContainer = '.layer-container ul .productsitem'+ await assertLayerOrdering(page, groupedLayersContainer, groupedLayerIdOrder)+})++test('Vector layer has pointer icon & clicking vector layer pointer shows modal', async () => {+ await page.goto(vectorsQueryString)+ await closeModal(page)+ const handPointer = await page.locator('#active-GRanD_Dams .fa-hand-pointer')+ await expect(handPointer).toBeVisible()+ await handPointer.click()+ const modalContent = await page.locator('.modal-content')+ await expect(modalContent).toContainText('Vector features may not be clickable at all zoom levels.')+})diff --git a/e2e/features/layers/layers-sidebar-test.spec.js b/e2e/features/layers/layers-sidebar-test.spec.jsindex 2545022f1..223f6012c 100644--- a/e2e/features/layers/layers-sidebar-test.spec.js+++ b/e2e/features/layers/layers-sidebar-test.spec.js@@ -1,40 +1,16 @@// @ts-checkconst { test, expect } = require('@playwright/test')const createSelectors = require('../../test-utils/global-variables/selectors')-const { assertLayerOrdering, closeModal } = require('../../test-utils/hooks/wvHooks')+const { closeModal } = require('../../test-utils/hooks/wvHooks')/** @type {import('@playwright/test').Page} */let page/** @type {Record<string, import('@playwright/test').Locator>} */let selectors-const vectorsQueryString = 'http://localhost:3000/?v=-70.43215000968726,28.678203599725197,-59.81569241792232,31.62330063930118&l=GRanD_Dams,Reference_Labels_15m(hidden),Reference_Features_15m(hidden),Coastlines_15m,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),VIIRS_NOAA20_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor'const someGroupsQueryString = 'http://localhost:3000/?l=MODIS_Combined_Value_Added_AOD,MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth,Reference_Labels_15m(hidden),Reference_Features_15m,MODIS_Terra_CorrectedReflectance_TrueColor&lg=true'const twoGroupsQueryString = 'http://localhost:3000/?v=-107.15747724134027,-81.6706340523014,47.81381180183274,89.12472754295932&l=VIIRS_SNPP_Thermal_Anomalies_375m_All,VIIRS_NOAA20_Thermal_Anomalies_375m_All,MODIS_Combined_Value_Added_AOD,MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth,Reference_Features_15m,MODIS_Terra_CorrectedReflectance_TrueColor&lg=true'const mixedLayersGroupsDisabledQueryString = 'http://localhost:3000/?v=-107.15747724134027,-81.6706340523014,47.81381180183274,89.12472754295932&l=Reference_Features_15m,VIIRS_SNPP_Thermal_Anomalies_375m_All,MODIS_Combined_Value_Added_AOD,VIIRS_NOAA20_Thermal_Anomalies_375m_All,MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth,MODIS_Terra_CorrectedReflectance_TrueColor&lg=false'-const mixedLayerIdOrder = [- 'active-Reference_Features_15m',- 'active-VIIRS_SNPP_Thermal_Anomalies_375m_All',- 'active-MODIS_Combined_Value_Added_AOD',- 'active-VIIRS_NOAA20_Thermal_Anomalies_375m_All',- 'active-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth'-]-const groupedLayerIdOrder = [- 'active-Reference_Features_15m',- 'active-VIIRS_SNPP_Thermal_Anomalies_375m_All',- 'active-VIIRS_NOAA20_Thermal_Anomalies_375m_All',- 'active-MODIS_Combined_Value_Added_AOD',- 'active-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth',- 'active-MODIS_Terra_CorrectedReflectance_TrueColor'-]-const ungroupedReorderdLayerIdOrder = [- 'active-MODIS_Combined_Value_Added_AOD',- 'active-MODIS_Combined_MAIAC_L2G_AerosolOpticalDepth',- 'active-VIIRS_SNPP_Thermal_Anomalies_375m_All',- 'active-VIIRS_NOAA20_Thermal_Anomalies_375m_All',- 'active-Reference_Features_15m'-]-test.describe.configure({ mode: 'serial' })test.beforeAll(async ({ browser }) => {@@ -153,142 +129,3 @@ test('Load with groups disabled from permalink', async () => {const overlayGroupItems = await page.locator('#active-overlays ul > li')await expect(overlayGroupItems).toHaveCount(5)})--test('Load multiple groups from permalink', async () => {- const {- aodGroup,- firesGroup,- groupCheckbox- } = selectors- await page.goto(twoGroupsQueryString)- await closeModal(page)- await expect(groupCheckbox).toBeVisible()- await expect(groupCheckbox).toBeChecked()- await expect(firesGroup).toBeVisible()- await expect(aodGroup).toBeVisible()- const fireGroupItems = await page.locator('#active-Fires_and_Thermal_Anomalies ul > li')- const aodGroupItems = await page.locator('#active-Aerosol_Optical_Depth ul > li')- await expect(fireGroupItems).toHaveCount(2)- await expect(aodGroupItems).toHaveCount(2)-})--test('Hide all...', async () => {- const { sidebarContainer, aodGroupHeader } = selectors- await sidebarContainer.hover()- 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 #hide-all').click()- const aodGroupHiddenLayers = await page.locator('#active-Aerosol_Optical_Depth li.layer-hidden')- const aodGroupVisibleLayers = await page.locator('#active-Aerosol_Optical_Depth li.layer-visible')- await expect(aodGroupHiddenLayers).toHaveCount(2)- await expect(aodGroupVisibleLayers).toHaveCount(0)-})--test('Show all...', async () => {- const { sidebarContainer, aodGroupHeader } = selectors- await sidebarContainer.hover()- 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 #show-all').click()- const aodGroupHiddenLayers = await page.locator('#active-Aerosol_Optical_Depth li.layer-hidden')- const aodGroupVisibleLayers = await page.locator('#active-Aerosol_Optical_Depth li.layer-visible')- await expect(aodGroupHiddenLayers).toHaveCount(0)- await expect(aodGroupVisibleLayers).toHaveCount(2)-})--test('Ungrouped: Removing baselayers/overlays removes the layers but not the header', async () => {- const {- groupCheckbox,- firesLayer,- overlaysGroupHeader,- overlaysGroup- } = selectors- await groupCheckbox.click()- await firesLayer.hover()- await overlaysGroupHeader.hover()- await page.locator('#active-overlays .layer-group-more-options > button').click()- await page.locator('#active-overlays .layer-group-more-options #remove-group').click()- await expect(overlaysGroup).toBeVisible()- const overlayGroupItems = page.locator('#active-overlays ul > li')- await expect(overlayGroupItems).toHaveCount(0)-})--test('Re-ordering groups, then disabling groups keeps individual layer order', async () => {- const {- aodGroupHeader,- firesGroupHeader,- groupCheckbox- } = selectors- await page.goto(twoGroupsQueryString)- 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- await page.mouse.move(- aodBoundingBox.x,- aodBoundingBox.y,- { steps: 10 }- )- await page.mouse.down()- const x = firesBoundingBox.x + firesBoundingBox.width / 2- const y = firesBoundingBox.y + firesBoundingBox.height / 2- await page.mouse.move(x, y, { steps: 10 })- await page.mouse.up()- await page.waitForTimeout(300)- await groupCheckbox.click()- const layersContainer = '#active-overlays li'- await assertLayerOrdering(page, layersContainer, ungroupedReorderdLayerIdOrder)-})--test('Enabling groups re-orders layers into their groups', async () => {- const {- aodGroup,- firesGroup,- groupCheckbox- } = selectors- await page.goto(mixedLayersGroupsDisabledQueryString)- await closeModal(page)- const layersContainer = '#active-overlays li'- await assertLayerOrdering(page, layersContainer, mixedLayerIdOrder)- await groupCheckbox.click()- await expect(aodGroup).toBeVisible()- await expect(firesGroup).toBeVisible()- const groupedLayersContainer = '.layer-container ul .productsitem'- await assertLayerOrdering(page, groupedLayersContainer, groupedLayerIdOrder)-})--test('Immediately disabling groups restores mixed ordering', async () => {- const {- aodGroup,- firesGroup,- groupCheckbox- } = selectors- await groupCheckbox.click()- await expect(aodGroup).not.toBeVisible()- await expect(firesGroup).not.toBeVisible()- const layersContainer = '#active-overlays li'- await assertLayerOrdering(page, layersContainer, mixedLayerIdOrder)-})--test('Making a change to grouped layers causes group ordering to be retained when ungrouped', async () => {- const { groupCheckbox, aodGroupHeader } = selectors- await page.goto(mixedLayersGroupsDisabledQueryString)- await closeModal(page)- await groupCheckbox.click()- 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 #hide-all').click()- await groupCheckbox.click()- const groupedLayersContainer = '.layer-container ul .productsitem'- await assertLayerOrdering(page, groupedLayersContainer, groupedLayerIdOrder)-})--test('Vector layer has pointer icon & clicking vector layer pointer shows modal', async () => {- await page.goto(vectorsQueryString)- await closeModal(page)- const handPointer = await page.locator('#active-GRanD_Dams .fa-hand-pointer')- await expect(handPointer).toBeVisible()- await handPointer.click()- const modalContent = await page.locator('.modal-content')- await expect(modalContent).toContainText('Vector features may not be clickable at all zoom levels.')-})diff --git a/e2e/features/share/share-test.spec.js b/e2e/features/share/share-test.spec.jsindex 04d0f6d63..f4e6fa69b 100644--- a/e2e/features/share/share-test.spec.js+++ b/e2e/features/share/share-test.spec.js@@ -78,10 +78,10 @@ test('Clicking Shorten link works with links less than 2049 characters', async (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 closeModal(page)- const linkShortenCase = await page.locator('#wv-link-shorten-case')+ const linkShortenCase = await page.locator('#wv-link-shorten')await shareToolbarButton.click()await linkShortenCase.click()- await expect(linkShortenCase).toHaveClass(/checked/)+ await expect(linkShortenCase).toBeChecked()})test('Clicking Shorten link is refused with links greater than 2048 characters', async () => {@@ -89,8 +89,8 @@ test('Clicking Shorten link is refused with links greater than 2048 characters',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_AOD_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 closeModal(page)- const linkShortenCase = await page.locator('#wv-link-shorten-case')+ const linkShortenCase = await page.locator('#wv-link-shorten')await shareToolbarButton.click()await linkShortenCase.click()- await expect(linkShortenCase).not.toHaveClass(/checked/)+ await expect(linkShortenCase).not.toBeChecked()})diff --git a/e2e/test-utils/hooks/wvHooks.js b/e2e/test-utils/hooks/wvHooks.jsindex 680cab83d..8a0f412b2 100644--- a/e2e/test-utils/hooks/wvHooks.js+++ b/e2e/test-utils/hooks/wvHooks.js@@ -20,6 +20,7 @@ const clickDownload = async (page) => {const closeImageDownloadPanel = async (page) => {await page.locator('.modal-close-btn').click()+ await page.waitForTimeout(250)}const zoomIn = async (page) => {@@ -134,6 +135,7 @@ const createDistanceMeasurement = async (page, start, finish) => {await page.locator('#wv-measure-button').click()await page.locator('#measure-distance-button').click()await page.mouse.click(start[0], start[1])+ await page.waitForTimeout(250)await page.mouse.dblclick(finish[0], finish[1])}diff --git a/playwright.config.js b/playwright.config.jsindex ee932dccb..a6473dcd9 100644--- a/playwright.config.js+++ b/playwright.config.js@@ -14,6 +14,8 @@ module.exports = defineConfig({fullyParallel: true,/* Fail the build on CI if you accidentally left test.only in the source code. */forbidOnly: !!process.env.CI,+ /* Stop the tests if any test fails */+ maxFailures: 1,/* Retry on CI only */retries: process.env.CI ? 2 : 0,/* Opt out of parallel tests on CI. */diff --git a/web/js/components/image-download/image-download-panel.js b/web/js/components/image-download/image-download-panel.jsindex a63ae8a69..3d4f62206 100644--- a/web/js/components/image-download/image-download-panel.js+++ b/web/js/components/image-download/image-download-panel.js@@ -80,6 +80,10 @@ function ImageDownloadPanel(props) {setShowGranuleWarning(isTruncated);}, []);+ useEffect(() => {+ setResolution(resolution);+ }, [resolution]);+const onDownload = (width, height) => {const time = new Date(date.getTime());