From cae3a69261ad8e23d635c0ea3643b3d115810634 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Fri, 3 May 2024 11:43:39 -0400 Subject: [PATCH] E2E: Update test to still pass with released versions of Gutenberg PR #90225 updated a test to pass in the run against the nightly Gutenberg release after WordPress/gutenberg#60632 changed some labels. Unfortunately that broke the runs against released versions of Gutenberg. This adjusts the test to match both the old and new labels, with a TODO comment pointing out that it can be adjusted once that Gutenberg change is released to all the environments we test against. --- .../src/lib/components/editor-settings-sidebar-component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/calypso-e2e/src/lib/components/editor-settings-sidebar-component.ts b/packages/calypso-e2e/src/lib/components/editor-settings-sidebar-component.ts index b3ee83c5ed6f6..b850640426533 100644 --- a/packages/calypso-e2e/src/lib/components/editor-settings-sidebar-component.ts +++ b/packages/calypso-e2e/src/lib/components/editor-settings-sidebar-component.ts @@ -368,8 +368,9 @@ export class EditorSettingsSidebarComponent { */ async enterUrlSlug( slug: string ) { const editorParent = await this.editor.parent(); - await editorParent.getByRole( 'button', { name: /Change link:/ } ).click(); - await editorParent.getByLabel( 'Link', { exact: true } ).fill( slug ); + // TODO: Once WordPress/gutenberg#60632 is everywhere, remove the alternation. + await editorParent.getByRole( 'button', { name: /Change (link|URL):/ } ).click(); + await editorParent.getByRole( 'textbox', { name: /^(Link|Permalink)$/ } ).fill( slug ); await editorParent.getByRole( 'button', { name: 'Close', exact: true } ).click(); } }