From 67e7521044c7a57a0bf9287c9967af4150780dd4 Mon Sep 17 00:00:00 2001 From: del Date: Fri, 21 May 2021 01:18:46 +0800 Subject: [PATCH] Reverted bulk trash logic --- tests/e2e/config/jest.setup.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/e2e/config/jest.setup.js b/tests/e2e/config/jest.setup.js index c1d14ff53fb..169c2269ba2 100644 --- a/tests/e2e/config/jest.setup.js +++ b/tests/e2e/config/jest.setup.js @@ -19,19 +19,21 @@ async function trashExistingPosts() { // If this selector doesn't exist there are no posts for us to delete. const bulkSelector = await page.$( '#bulk-action-selector-top' ); - if ( bulkSelector ) { - // Select all posts. - await page.waitForSelector( '#cb-select-all-1' ); - await page.click( '#cb-select-all-1' ); - // Select the "bulk actions" > "trash" option. - await page.select( '#bulk-action-selector-top', 'trash' ); - // Submit the form to send all draft/scheduled/published posts to the trash. - await page.click( '#doaction' ); - await page.waitForXPath( - '//*[contains(@class, "updated notice")]/p[contains(text(), "moved to the Trash.")]' - ); + if ( ! bulkSelector ) { + await merchant.logout(); + return; } - + + // Select all posts. + await page.waitForSelector( '#cb-select-all-1' ); + await page.click( '#cb-select-all-1' ); + // Select the "bulk actions" > "trash" option. + await page.select( '#bulk-action-selector-top', 'trash' ); + // Submit the form to send all draft/scheduled/published posts to the trash. + await page.click( '#doaction' ); + await page.waitForXPath( + '//*[contains(@class, "updated notice")]/p[contains(text(), "moved to the Trash.")]' + ); await merchant.logout(); }