Skip to content

Commit

Permalink
Fix flaky DataViews list layout e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Aug 5, 2024
1 parent 8b1b939 commit c93b3ee
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ test.describe( 'Dataviews List Layout', () => {
await page.keyboard.press( 'Tab' );
await page.keyboard.press( 'Tab' );

const firstItem = page
.getByRole( 'grid' )
.getByRole( 'button' )
.first();

// Make sure the items have loaded before reaching for the 1st item in the list.
await expect( page.getByRole( 'grid' ) ).toBeVisible();
await page.keyboard.press( 'Tab' );
await expect( page.getByLabel( 'Privacy Policy' ) ).toBeFocused();
await expect( firstItem ).toBeFocused();

// Go to the preview.
await page.keyboard.press( 'Tab' );
Expand All @@ -91,7 +96,7 @@ test.describe( 'Dataviews List Layout', () => {

// Go back to the items list using SHIFT+TAB.
await page.keyboard.press( 'Shift+Tab' );
await expect( page.getByLabel( 'Privacy Policy' ) ).toBeFocused();
await expect( firstItem ).toBeFocused();
} );

test( 'Navigates the items list via UP/DOWN arrow keys', async ( {
Expand Down

0 comments on commit c93b3ee

Please sign in to comment.