diff --git a/.github/workflows/tests-e2e.yml b/.github/workflows/tests-e2e.yml index 3fbfce630fac..3768bb19bde1 100644 --- a/.github/workflows/tests-e2e.yml +++ b/.github/workflows/tests-e2e.yml @@ -74,6 +74,10 @@ jobs: - browser: 'chrome' wp: 'latest' snapshots: true + - browser: 'chrome' + wp: '5.9-RC1' + experimental: true + snapshots: false - browser: 'chrome' wp: '5.5' snapshots: false diff --git a/packages/e2e-test-utils/src/trashAllTerms.js b/packages/e2e-test-utils/src/trashAllTerms.js index 6639117037b3..467367e9a668 100644 --- a/packages/e2e-test-utils/src/trashAllTerms.js +++ b/packages/e2e-test-utils/src/trashAllTerms.js @@ -32,10 +32,14 @@ async function trashAllTerms(taxonomy) { await visitAdminPage('edit-tags.php', `taxonomy=${taxonomy}`); - await page.waitForSelector('[id^=cb-select-all-]'); - await page.click('[id^=cb-select-all-]'); - await page.select('#bulk-action-selector-top', 'delete'); - await Promise.all([page.waitForNavigation(), page.click('#doaction')]); + // If this selector doesn't exist there are no terms for us to delete. + const bulkSelector = await page.$('#bulk-action-selector-top'); + if (bulkSelector) { + await page.waitForSelector('[id^=cb-select-all-]'); + await page.click('[id^=cb-select-all-]'); + await page.select('#bulk-action-selector-top', 'delete'); + await Promise.all([page.waitForNavigation(), page.click('#doaction')]); + } await setCurrentUser(currentUser.username, currentUser.password); } diff --git a/packages/e2e-test-utils/src/visitBlockWidgetScreen.js b/packages/e2e-test-utils/src/visitBlockWidgetScreen.js index 07bd96d50421..775a7674e4fa 100644 --- a/packages/e2e-test-utils/src/visitBlockWidgetScreen.js +++ b/packages/e2e-test-utils/src/visitBlockWidgetScreen.js @@ -27,17 +27,28 @@ async function visitBlockWidgetScreen() { await visitAdminPage('widgets.php'); // Disable welcome guide if it is enabled. - const isWelcomeGuideActive = await page.evaluate(() => - wp.data - .select('core/edit-widgets') - .__unstableIsFeatureActive('welcomeGuide') - ); + // The former selector is for WP < 5.9 + const isWelcomeGuideActive = await page.evaluate(() => { + return ( + wp.data + .select('core/edit-widgets') + ?.__unstableIsFeatureActive?.('welcomeGuide') || + wp.data + .select('core/interface') + ?.isFeatureActive?.('core/edit-widgets', 'welcomeGuide') + ); + }); + if (isWelcomeGuideActive) { - await page.evaluate(() => + // The former action is for WP < 5.9 + await page.evaluate(() => { wp.data .dispatch('core/edit-widgets') - .__unstableToggleFeature('welcomeGuide') - ); + ?.__unstableToggleFeature?.('welcomeGuide'); + wp.data + .dispatch('core/interface') + ?.toggleFeature?.('core/edit-widgets', 'welcomeGuide'); + }); } } export default visitBlockWidgetScreen; diff --git a/packages/e2e-tests/src/config/bootstrap.js b/packages/e2e-tests/src/config/bootstrap.js index e09d25525191..6ac1e6f13d9c 100644 --- a/packages/e2e-tests/src/config/bootstrap.js +++ b/packages/e2e-tests/src/config/bootstrap.js @@ -89,6 +89,12 @@ const ALLOWED_ERROR_MESSAGES = [ // Another Firefox warning. 'Layout was forced before the page was fully loaded', + + // Upsteam issue in gutenberg and twentytwenty theme. + 'Stylesheet twentytwenty-block-editor-styles-css was not properly added.', + + // TODO(#9240): Fix usage in the web stories block. + "select( 'core' ).getAuthors() is deprecated since version 5.9.", ]; export function addAllowedErrorMessage(message) { diff --git a/packages/e2e-tests/src/specs/wordpress/blockWidget.js b/packages/e2e-tests/src/specs/wordpress/blockWidget.js index be2f8c50747c..9bff46c921fa 100644 --- a/packages/e2e-tests/src/specs/wordpress/blockWidget.js +++ b/packages/e2e-tests/src/specs/wordpress/blockWidget.js @@ -40,7 +40,7 @@ describe('Web Stories Widget Block', () => { it('should insert a new web stories block', async () => { await visitBlockWidgetScreen(); await expect(page).toClick('button[aria-label="Add block"]'); - await page.type('.block-editor-inserter__search-input', 'Web Stories'); + await page.type('input[placeholder="Search"]', 'Web Stories'); await expect(page).toClick('button span', { text: 'Web Stories' }); await page.waitForSelector('.web-stories-block-configuration-panel');