diff --git a/packages/e2e-test-utils/src/click-on-more-menu-item.js b/packages/e2e-test-utils/src/click-on-more-menu-item.js index 04d3709ac0e19..c52296040df51 100644 --- a/packages/e2e-test-utils/src/click-on-more-menu-item.js +++ b/packages/e2e-test-utils/src/click-on-more-menu-item.js @@ -16,7 +16,7 @@ import { toggleMoreMenu } from './toggle-more-menu'; export async function clickOnMoreMenuItem( buttonLabel ) { await toggleMoreMenu(); const moreMenuContainerSelector = - '//*[contains(concat(" ", @class, " "), " edit-post-more-menu__content ")]'; + '//*[contains(concat(" ", @class, " "), " interface-more-menu-dropdown__content ")]'; const elementToClick = first( await page.$x( `${ moreMenuContainerSelector }//span[contains(concat(" ", @class, " "), " components-menu-item__item ")][contains(text(), "${ buttonLabel }")]` diff --git a/packages/e2e-tests/experimental-features.js b/packages/e2e-tests/experimental-features.js index bcc6c3da8c843..e920ee7114db8 100644 --- a/packages/e2e-tests/experimental-features.js +++ b/packages/e2e-tests/experimental-features.js @@ -118,19 +118,6 @@ export const siteEditor = { ); }, - async clickOnMoreMenuItem( buttonLabel ) { - await this.toggleMoreMenu(); - const moreMenuContainerSelector = - '//*[contains(concat(" ", @class, " "), " edit-site-more-menu__content ")]'; - const elementToClick = ( - await page.$x( - `${ moreMenuContainerSelector }//span[contains(concat(" ", @class, " "), " components-menu-item__item ")][contains(text(), "${ buttonLabel }")]` - ) - )[ 0 ]; - - await elementToClick.click(); - }, - async getEditedPostContent() { return page.evaluate( async () => { const postId = window.wp.data diff --git a/packages/e2e-tests/specs/experiments/site-editor-export.test.js b/packages/e2e-tests/specs/experiments/site-editor-export.test.js index 961a19525c6a2..e97bc3b99e464 100644 --- a/packages/e2e-tests/specs/experiments/site-editor-export.test.js +++ b/packages/e2e-tests/specs/experiments/site-editor-export.test.js @@ -8,7 +8,11 @@ import os from 'os'; /** * WordPress dependencies */ -import { trashAllPosts, activateTheme } from '@wordpress/e2e-test-utils'; +import { + clickOnMoreMenuItem, + trashAllPosts, + activateTheme, +} from '@wordpress/e2e-test-utils'; /** * Internal dependencies @@ -52,7 +56,7 @@ describe( 'Site Editor Templates Export', () => { downloadPath: directory, } ); - await siteEditor.clickOnMoreMenuItem( 'Export' ); + await clickOnMoreMenuItem( 'Export' ); const filePath = path.join( directory, 'edit-site-export.zip' ); await waitForFileExists( filePath ); expect( fs.existsSync( filePath ) ).toBe( true );