From 9a288a19536730ee1dd6759cce38b8d08e72b097 Mon Sep 17 00:00:00 2001 From: Dharmesh Patel Date: Thu, 31 Aug 2023 11:09:09 +0530 Subject: [PATCH] Upgrade Cypress to 13 --- index.js | 2 +- src/.github/workflows/cypress.yml | 2 +- src/tests/cypress/e2e/admin.test.js | 2 +- src/tests/cypress/support/e2e.js | 6 ------ 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 05989c3..5ba4954 100755 --- a/index.js +++ b/index.js @@ -23,7 +23,7 @@ try { try { execSync( - "npm install --save-dev cypress@10 @wordpress/env @10up/cypress-wp-utils", + "npm install --save-dev cypress@13 @wordpress/env @10up/cypress-wp-utils", { stdio: "inherit" } ); } catch (e) { diff --git a/src/.github/workflows/cypress.yml b/src/.github/workflows/cypress.yml index e8667f2..af055d6 100644 --- a/src/.github/workflows/cypress.yml +++ b/src/.github/workflows/cypress.yml @@ -16,7 +16,7 @@ jobs: matrix: core: - {name: 'WP latest', version: 'latest'} - - {name: 'WP minimum', version: 'WordPress/WordPress#5.2'} + - {name: 'WP minimum', version: 'WordPress/WordPress#5.7'} - {name: 'WP trunk', version: 'WordPress/WordPress#master'} steps: - name: Checkout diff --git a/src/tests/cypress/e2e/admin.test.js b/src/tests/cypress/e2e/admin.test.js index 9bc56da..f82e312 100644 --- a/src/tests/cypress/e2e/admin.test.js +++ b/src/tests/cypress/e2e/admin.test.js @@ -1,5 +1,5 @@ describe("Admin can login and open dashboard", () => { - before(() => { + beforeEach(() => { cy.login(); }); diff --git a/src/tests/cypress/support/e2e.js b/src/tests/cypress/support/e2e.js index 9790424..5f6442c 100644 --- a/src/tests/cypress/support/e2e.js +++ b/src/tests/cypress/support/e2e.js @@ -18,9 +18,3 @@ import "@10up/cypress-wp-utils"; // Import commands.js using ES2015 syntax: import "./commands"; -// Preserve WP cookies. -beforeEach(() => { - Cypress.Cookies.defaults({ - preserve: /^wordpress.*?/, - }); -});