From fce116ddbf0c7e5a78657fd4427f0933d5df9eb2 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 20 Oct 2021 11:24:05 -0700 Subject: [PATCH] Create a post before going to the onboarding wizard so there is something to preview --- tests/e2e/utils/onboarding-wizard-utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/utils/onboarding-wizard-utils.js b/tests/e2e/utils/onboarding-wizard-utils.js index e9f8286a262..124ac3f9e98 100644 --- a/tests/e2e/utils/onboarding-wizard-utils.js +++ b/tests/e2e/utils/onboarding-wizard-utils.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { visitAdminPage } from '@wordpress/e2e-test-utils'; +import { createNewPost, visitAdminPage } from '@wordpress/e2e-test-utils'; export const NEXT_BUTTON_SELECTOR = '#next-button'; export const PREV_BUTTON_SELECTOR = '.amp-settings-nav__prev-next button:not(.is-primary)'; @@ -9,6 +9,7 @@ export const PREV_BUTTON_SELECTOR = '.amp-settings-nav__prev-next button:not(.is export async function goToOnboardingWizard() { await visitAdminPage( 'index.php' ); await expect( page ).not.toMatchElement( '#amp-onboarding-wizard' ); + await createNewPost(); // So that there is a post to appear on the done screen. await visitAdminPage( 'admin.php', 'page=amp-onboarding-wizard' ); await expect( page ).toMatchElement( '#amp-onboarding-wizard' ); }