From a7c09c4305e5ac48779ac7c79f8674010aae9563 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Tue, 16 May 2023 15:33:36 -0500 Subject: [PATCH] Create pages before tests requiring link control to find pages --- .../specs/editor/blocks/navigation.spec.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/e2e/specs/editor/blocks/navigation.spec.js b/test/e2e/specs/editor/blocks/navigation.spec.js index dc30314195731..e776b160d55bc 100644 --- a/test/e2e/specs/editor/blocks/navigation.spec.js +++ b/test/e2e/specs/editor/blocks/navigation.spec.js @@ -396,6 +396,26 @@ test.describe( 'Navigation block', () => { `, }; + test.beforeAll( async ( { requestUtils } ) => { + // We need pages to be published so the Link Control can return pages + await requestUtils.createPage( { + title: 'Test Page 1', + status: 'publish', + } ); + await requestUtils.createPage( { + title: 'Test Page 2', + status: 'publish', + } ); + await requestUtils.createPage( { + title: 'Test Page 3', + status: 'publish', + } ); + } ); + + test.afterAll( async ( { requestUtils } ) => { + await requestUtils.deleteAllPages(); + } ); + test.use( { linkControl: async ( { page }, use ) => { await use( new LinkControl( { page } ) );