From 7da8efa72aed59ca9e64be06025be45c26cf0a8a Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 25 Oct 2022 13:06:37 +0400 Subject: [PATCH] Rafactor to use role selectors --- test/e2e/specs/editor/blocks/gallery.spec.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/e2e/specs/editor/blocks/gallery.spec.js b/test/e2e/specs/editor/blocks/gallery.spec.js index 40a005e05c801..936942c9688fa 100644 --- a/test/e2e/specs/editor/blocks/gallery.spec.js +++ b/test/e2e/specs/editor/blocks/gallery.spec.js @@ -205,13 +205,14 @@ test.describe( 'Gallery', () => { await editor.insertBlock( { name: 'core/gallery' } ); await page.click( 'role=button[name="Media Library"i]' ); - await expect( page.locator( '.media-frame' ) ).toBeVisible(); - await expect( page.locator( '.media-frame-title h1' ) ).toContainText( - 'Create gallery' + const mediaLibrary = page.locator( + 'role=dialog[name="Create gallery"i]' ); + + await expect( mediaLibrary ).toBeVisible(); await expect( - page.locator( '.media-toolbar-primary button' ) - ).toContainText( 'Create a new gallery' ); + mediaLibrary.locator( 'role=button[name="Create a new gallery"i]' ) + ).toBeVisible(); } ); } );