@@ -23,7 +23,8 @@ test.describe('Playwright Keyboard Navigation + Query Layer Tests', () => {
2323 await page . evaluateHandle ( ( ) =>
2424 document . getElementById ( 'query' ) . removeAttribute ( 'checked' )
2525 ) ;
26- await page . click ( 'body' ) ;
26+ const body = page . locator ( 'body' ) ;
27+ await body . click ( ) ;
2728 await page . keyboard . press ( 'Tab' ) ; // focus map
2829
2930 await page . keyboard . press ( 'Tab' ) ; // focus feature
@@ -301,7 +302,8 @@ test.describe('Playwright Keyboard Navigation + Query Layer Tests', () => {
301302
302303 test ( 'Focus Controls focuses the first <button> child in control div' , async ( ) => {
303304 await page . waitForTimeout ( 1000 ) ;
304- await page . click ( 'body > mapml-viewer' ) ;
305+ const viewer = page . locator ( 'mapml-viewer' ) ;
306+ await viewer . click ( ) ;
305307 await page . keyboard . press ( 'Tab' ) ;
306308 await page . keyboard . press ( 'Tab' ) ;
307309 await page . keyboard . press ( 'Tab' ) ;
@@ -328,7 +330,8 @@ test.describe('Playwright Keyboard Navigation + Query Layer Tests', () => {
328330 } ) ;
329331
330332 test ( 'Zoom link zooms to the zoom level = zoom attribute' , async ( ) => {
331- await page . click ( 'body' ) ;
333+ const body = page . locator ( 'body' ) ;
334+ await body . click ( ) ;
332335 await page . keyboard . press ( 'Tab' ) ; // focus map
333336 await page . keyboard . press ( 'Tab' ) ; // focus feature
334337 await page . keyboard . press ( 'Enter' ) ; // display popup with link in it
@@ -344,14 +347,15 @@ test.describe('Playwright Keyboard Navigation + Query Layer Tests', () => {
344347 } ) ;
345348
346349 test ( 'Zoom link zooms to the maximum zoom level that can show the feature completely when zoom attribute does not present' , async ( ) => {
347- await page . click ( 'body' ) ;
350+ const body = page . locator ( 'body' ) ;
351+ await body . click ( ) ;
348352 await page . keyboard . press ( 'Tab' ) ; // focus map
349353 await page . keyboard . press ( 'Tab' ) ; // focus feature
350354 await page . keyboard . press ( 'Tab' ) ;
351355 await page . keyboard . press ( 'Tab' ) ;
352356 await page . keyboard . press ( 'Enter' ) ; // zoom out
353357 await page . waitForTimeout ( 200 ) ;
354- await page . click ( 'body' ) ;
358+ await body . click ( ) ;
355359 await page . keyboard . press ( 'Tab' ) ; // focus map
356360 await page . keyboard . press ( 'Tab' ) ;
357361 await page . keyboard . press ( 'ArrowLeft' ) ; // focus targeted feature
0 commit comments