From 5d08594098268eb3b2f3903853dbb7be0a4d8f12 Mon Sep 17 00:00:00 2001 From: Peter Rushforth Date: Wed, 30 Oct 2024 11:09:08 -0400 Subject: [PATCH] Clean up test failures --- test/e2e/core/ArrowKeyNavContextMenu.test.js | 6 +++--- test/e2e/core/mapContextMenu.test.js | 8 ++++---- test/e2e/layers/queryLink.test.js | 2 +- test/e2e/mapml-viewer/viewerContextMenu.test.js | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/e2e/core/ArrowKeyNavContextMenu.test.js b/test/e2e/core/ArrowKeyNavContextMenu.test.js index e57a7397e..30628de32 100644 --- a/test/e2e/core/ArrowKeyNavContextMenu.test.js +++ b/test/e2e/core/ArrowKeyNavContextMenu.test.js @@ -154,7 +154,7 @@ test.describe('Using arrow keys to navigate context menu', () => { let activeElement = await page.evaluate( () => document.activeElement.shadowRoot.activeElement.innerHTML ); - expect(activeElement).toEqual('View Fullscreen (F)'); + expect(activeElement).toEqual('View fullscreen (F)'); await page.keyboard.press('ArrowDown'); await page.keyboard.press('ArrowDown'); @@ -186,7 +186,7 @@ test.describe('Using arrow keys to navigate context menu', () => { activeElement = await page.evaluate( () => document.activeElement.shadowRoot.activeElement.innerHTML ); - expect(activeElement).toEqual('View Fullscreen (F)'); + expect(activeElement).toEqual('View fullscreen (F)'); }); test('Right and Left Arrow keys to navigate the contextmenu', async () => { @@ -301,7 +301,7 @@ test.describe('Using arrow keys to navigate context menu', () => { activeElement = await page.evaluate( () => document.activeElement.shadowRoot.activeElement.innerHTML ); - expect(activeElement).toEqual('View Fullscreen (F)'); + expect(activeElement).toEqual('View fullscreen (F)'); await page.keyboard.press('ArrowDown'); diff --git a/test/e2e/core/mapContextMenu.test.js b/test/e2e/core/mapContextMenu.test.js index 20e1dd9eb..acbdb4fb5 100644 --- a/test/e2e/core/mapContextMenu.test.js +++ b/test/e2e/core/mapContextMenu.test.js @@ -76,7 +76,7 @@ test.describe('Playwright Map Context Menu Tests', () => { ); let name = await nameHandle.jsonValue(); await nameHandle.dispose(); - expect(name).toEqual('View Fullscreen (F)'); + expect(name).toEqual('View fullscreen (F)'); }); test('Context menu tab goes to next item', async () => { @@ -520,10 +520,10 @@ test.describe('Playwright Map Context Menu Tests', () => { 'body > map', (map) => map.layers[1].label ); - expect(layerLabel).toEqual('Pasted layer'); + expect(layerLabel).toEqual('Pasted Layer'); // clean up await page.$eval('body > map', (map) => - map.removeChild(map.querySelector('[label="Pasted layer"]')) + map.removeChild(map.querySelector('[label="Pasted Layer"]')) ); }); test('Submenu, copy location in tilematrix coordinates, which is not implemented, so faked with gcrs', async () => { @@ -804,7 +804,7 @@ test.describe('Playwright Map Context Menu Tests', () => { 'div > div.mapml-contextmenu > button:nth-child(4)', (btn) => btn.textContent ); - expect(fullScreen).toEqual('View Fullscreen (F)'); + expect(fullScreen).toEqual('View fullscreen (F)'); let copy = await page.$eval( 'div > div.mapml-contextmenu > button:nth-child(6)', (btn) => btn.textContent diff --git a/test/e2e/layers/queryLink.test.js b/test/e2e/layers/queryLink.test.js index ed0e193bf..79c758e4f 100644 --- a/test/e2e/layers/queryLink.test.js +++ b/test/e2e/layers/queryLink.test.js @@ -9,6 +9,7 @@ test.describe('Playwright Query Link Tests', () => { context.pages().find((page) => page.url() === 'about:blank') || (await context.newPage()); await page.goto('queryLink.html'); + await page.waitForTimeout(1000); }); test.afterAll(async function () { @@ -17,7 +18,6 @@ test.describe('Playwright Query Link Tests', () => { test.describe('Query Popup Tests', () => { test('Query link shows when within bounds', async () => { - await page.waitForTimeout(500); await page.getByLabel('Interactive map').click(); const popups = await page .locator('.leaflet-popup-pane') diff --git a/test/e2e/mapml-viewer/viewerContextMenu.test.js b/test/e2e/mapml-viewer/viewerContextMenu.test.js index 05282b6c8..2a5f669b2 100644 --- a/test/e2e/mapml-viewer/viewerContextMenu.test.js +++ b/test/e2e/mapml-viewer/viewerContextMenu.test.js @@ -67,7 +67,7 @@ test.describe('Playwright mapml-viewer Context Menu (and api) Tests', () => { ); let name = await nameHandle.jsonValue(); await nameHandle.dispose(); - expect(name).toEqual('View Fullscreen (F)'); + expect(name).toEqual('View fullscreen (F)'); }); test('Context menu tab goes to next item', async () => { @@ -111,7 +111,7 @@ test.describe('Playwright mapml-viewer Context Menu (and api) Tests', () => { ); let name = await nameHandle.jsonValue(); await nameHandle.dispose(); - expect(name).toEqual('View Fullscreen (F)'); + expect(name).toEqual('View fullscreen (F)'); }); test('Submenu opens on C with focus on first item', async () => { @@ -502,10 +502,10 @@ test.describe('Playwright mapml-viewer Context Menu (and api) Tests', () => { 'body > mapml-viewer', (map) => map.layers[1].label ); - expect(layerLabel).toEqual('Pasted layer'); + expect(layerLabel).toEqual('Pasted Layer'); // clean up await page.$eval('body > mapml-viewer', (map) => - map.removeChild(map.querySelector('[label="Pasted layer"]')) + map.removeChild(map.querySelector('[label="Pasted Layer"]')) ); }); // other cs not implemented yet: tile,map, @@ -718,7 +718,7 @@ test.describe('Playwright mapml-viewer Context Menu (and api) Tests', () => { 'div > div.mapml-contextmenu > button:nth-child(4)', (btn) => btn.textContent ); - expect(fullScreen).toEqual('View Fullscreen (F)'); + expect(fullScreen).toEqual('View fullscreen (F)'); let copy = await page.$eval( 'div > div.mapml-contextmenu > button:nth-child(6)', (btn) => btn.textContent