From b22e328e86ed6ebaf79c4dbde5ded14318a8bedb Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Tue, 24 Aug 2021 14:41:47 -0300 Subject: [PATCH] reorder admin tests to same order as home repo --- package-lock.json | 2 +- tests/e2e/config/jest.setup.js | 13 +++++++++++-- .../analytics-overview.test.js | 0 .../analytics.test.js | 0 4 files changed, 12 insertions(+), 3 deletions(-) rename tests/e2e/specs/{analytics => admin-analytics}/analytics-overview.test.js (100%) rename tests/e2e/specs/{analytics => admin-analytics}/analytics.test.js (100%) diff --git a/package-lock.json b/package-lock.json index 697a9db0626..156ffb12b11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9767,7 +9767,7 @@ } }, "prettier": { - "version": "npm:prettier@1.19.1", + "version": "npm:wp-prettier@1.19.1", "resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-1.19.1.tgz", "integrity": "sha512-mqAC2r1NDmRjG+z3KCJ/i61tycKlmADIjxnDhQab+KBxSAGbF/W7/zwB2guy/ypIeKrrftNsIYkNZZQKf3vJcg==", "dev": true diff --git a/tests/e2e/config/jest.setup.js b/tests/e2e/config/jest.setup.js index c3d63a5bcb7..068fd99bbc0 100644 --- a/tests/e2e/config/jest.setup.js +++ b/tests/e2e/config/jest.setup.js @@ -52,7 +52,12 @@ beforeAll(async () => { // Prevent an error here causing tests to fail. } - await trashExistingPosts(); + // This sometimes returns a 401 in CI + try { + await trashExistingPosts(); + } catch ( error ) { + console.log( 'Error trashing posts' ); + } await withRestApi.deleteAllProducts(); await withRestApi.deleteAllCoupons(); await withRestApi.deleteAllOrders(); @@ -65,7 +70,11 @@ beforeAll(async () => { // This is to ensure that each test ends with no user logged in. afterAll(async () => { // Reset the ready page to published to allow future test runs - await updateReadyPageStatus('publish'); + try { + await updateReadyPageStatus('publish'); + } catch ( error ) { + // Prevent an error here causing tests to fail. + } const client = await page.target().createCDPSession(); await client.send('Network.clearBrowserCookies'); diff --git a/tests/e2e/specs/analytics/analytics-overview.test.js b/tests/e2e/specs/admin-analytics/analytics-overview.test.js similarity index 100% rename from tests/e2e/specs/analytics/analytics-overview.test.js rename to tests/e2e/specs/admin-analytics/analytics-overview.test.js diff --git a/tests/e2e/specs/analytics/analytics.test.js b/tests/e2e/specs/admin-analytics/analytics.test.js similarity index 100% rename from tests/e2e/specs/analytics/analytics.test.js rename to tests/e2e/specs/admin-analytics/analytics.test.js