diff --git a/package-lock.json b/package-lock.json index 9376d60e..9ae376db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,17 +12,17 @@ "use-debounce": "^8.0.4" }, "devDependencies": { - "@10up/cypress-wp-utils": "github:10up/cypress-wp-utils#build", - "@wordpress/env": "^5.4.0", + "@10up/cypress-wp-utils": "^0.2.0", + "@wordpress/env": "^8.7.0", "@wordpress/plugins": "^6.2.0", "@wordpress/prettier-config": "^2.2.0", "@wordpress/scripts": "^26.5.0", "ansi-regex": ">=6.0.1", "copy-webpack-plugin": "^11.0.0", - "cypress": "^11.2.0", + "cypress": "^13.2.0", "cypress-file-upload": "^5.0.8", - "cypress-localstorage-commands": "^2.2.2", - "cypress-mochawesome-reporter": "^3.4.0", + "cypress-localstorage-commands": "^2.2.4", + "cypress-mochawesome-reporter": "^3.6.0", "eslint-plugin-cypress": "^2.12.1", "husky": "^8.0.1", "json-schema": ">=0.4.0", @@ -35,10 +35,10 @@ } }, "node_modules/@10up/cypress-wp-utils": { - "version": "0.1.0", - "resolved": "git+ssh://git@github.com/10up/cypress-wp-utils.git#dfd99433b9d63a757810e1e4e285796d63fdc140", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@10up/cypress-wp-utils/-/cypress-wp-utils-0.2.0.tgz", + "integrity": "sha512-5gzamtHIFojT+wx0OzSAEeVY6FVrlcVPHVFH23uExkaqQhNsJvrnpdtqtT98wAYkXg56c1qDN7Ju7ZRTaNzP5g==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.0" } @@ -2082,9 +2082,9 @@ } }, "node_modules/@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", + "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "dev": true, "dependencies": { "aws-sign2": "~0.7.0", @@ -2100,7 +2100,7 @@ "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "~6.10.3", + "qs": "6.10.4", "safe-buffer": "^5.1.2", "tough-cookie": "^4.1.3", "tunnel-agent": "^0.6.0", @@ -5145,9 +5145,9 @@ } }, "node_modules/@wordpress/env": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-5.16.0.tgz", - "integrity": "sha512-zx6UO8PuJBrQ34cfeedK1HlGHLFaj7oWzTo9tTt+noB79Ttqc4+a0lYwDqBLLJhlHU+cWgcyOP2lB6TboXH0xA==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-8.7.0.tgz", + "integrity": "sha512-cqjDjFFLZ8691mzsuPaakoNbUJ5d6DNNRMyN6UZefLGKhthlqmyK5DqzXZUzCr9cgF/kdc//v3ZmBy9nywBYSA==", "dev": true, "dependencies": { "chalk": "^4.0.0", @@ -8114,15 +8114,15 @@ } }, "node_modules/cypress": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-11.2.0.tgz", - "integrity": "sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.2.0.tgz", + "integrity": "sha512-AvDQxBydE771GTq0TR4ZUBvv9m9ffXuB/ueEtpDF/6gOcvFR96amgwSJP16Yhqw6VhmwqspT5nAGzoxxB+D89g==", "dev": true, "hasInstallScript": true, "dependencies": { - "@cypress/request": "^2.88.10", + "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^14.14.31", + "@types/node": "^18.17.5", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", @@ -8134,10 +8134,10 @@ "check-more-types": "^2.24.0", "cli-cursor": "^3.1.0", "cli-table3": "~0.6.1", - "commander": "^5.1.0", + "commander": "^6.2.1", "common-tags": "^1.8.0", "dayjs": "^1.10.4", - "debug": "^4.3.2", + "debug": "^4.3.4", "enquirer": "^2.3.6", "eventemitter2": "6.4.7", "execa": "4.1.0", @@ -8152,12 +8152,13 @@ "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", - "minimist": "^1.2.6", + "minimist": "^1.2.8", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", + "process": "^0.11.10", "proxy-from-env": "1.0.0", "request-progress": "^3.0.0", - "semver": "^7.3.2", + "semver": "^7.5.3", "supports-color": "^8.1.1", "tmp": "~0.2.1", "untildify": "^4.0.0", @@ -8167,7 +8168,7 @@ "cypress": "bin/cypress" }, "engines": { - "node": ">=12.0.0" + "node": "^16.0.0 || ^18.0.0 || >=20.0.0" } }, "node_modules/cypress-file-upload": { @@ -8183,9 +8184,9 @@ } }, "node_modules/cypress-localstorage-commands": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/cypress-localstorage-commands/-/cypress-localstorage-commands-2.2.3.tgz", - "integrity": "sha512-EUEaHzbstw9AsEheIqr+RyXuxIzUS64nBBwl+Q4/mSdzfXpfcaV1nrHF+6H9zbTuFVTc+oWu6eC1l8aSjiWW6w==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/cypress-localstorage-commands/-/cypress-localstorage-commands-2.2.4.tgz", + "integrity": "sha512-XiWFJhhgcoWf7p6sS5igGuN8WWGF0K1jRCPo2XlikwEWgts1uvPl80cybGiztYoNrU1xCbQO9/IOz6Y0eTl4Lg==", "dev": true, "engines": { "node": ">=14.0.0" @@ -8195,16 +8196,20 @@ } }, "node_modules/cypress-mochawesome-reporter": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/cypress-mochawesome-reporter/-/cypress-mochawesome-reporter-3.5.1.tgz", - "integrity": "sha512-/5ahFTyTxLujdzfTvmQrzKrJ8GWv12rUbOHvzWfVRYlAp/088ffU/1QbcfacEa2HTs28onSIIBiIKqSOID/bTw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/cypress-mochawesome-reporter/-/cypress-mochawesome-reporter-3.6.0.tgz", + "integrity": "sha512-NeYpeZVB5YCU10I3a1yA2qHt+YREo0jZw4Gj83JTJ7YX/ZLFfd8MYKl2O19d/yYC8np/fpMufp5gt3ympd9DWQ==", "dev": true, "dependencies": { + "commander": "^10.0.1", "fs-extra": "^10.0.1", "mochawesome": "^7.1.3", "mochawesome-merge": "^4.2.1", "mochawesome-report-generator": "^6.2.0" }, + "bin": { + "generate-mochawesome-report": "cli.js" + }, "engines": { "node": ">=14" }, @@ -8215,6 +8220,15 @@ "cypress": ">=6.2.0" } }, + "node_modules/cypress-mochawesome-reporter/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/cypress-mochawesome-reporter/node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -8230,11 +8244,20 @@ } }, "node_modules/cypress/node_modules/@types/node": { - "version": "14.18.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.54.tgz", - "integrity": "sha512-uq7O52wvo2Lggsx1x21tKZgqkJpvwCseBBPtX/nKQfpVlEsLOb11zZ1CRsWUKvJF0+lzuA9jwvA7Pr2Wt7i3xw==", + "version": "18.17.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.17.tgz", + "integrity": "sha512-cOxcXsQ2sxiwkykdJqvyFS+MLQPLvIdwh5l6gNg8qF6s+C7XSkEWOZjK+XhUZd+mYvHV/180g2cnCcIl4l06Pw==", "dev": true }, + "node_modules/cypress/node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/cypress/node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -16899,6 +16922,15 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -21203,9 +21235,10 @@ }, "dependencies": { "@10up/cypress-wp-utils": { - "version": "git+ssh://git@github.com/10up/cypress-wp-utils.git#dfd99433b9d63a757810e1e4e285796d63fdc140", - "dev": true, - "from": "@10up/cypress-wp-utils@github:10up/cypress-wp-utils#build" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@10up/cypress-wp-utils/-/cypress-wp-utils-0.2.0.tgz", + "integrity": "sha512-5gzamtHIFojT+wx0OzSAEeVY6FVrlcVPHVFH23uExkaqQhNsJvrnpdtqtT98wAYkXg56c1qDN7Ju7ZRTaNzP5g==", + "dev": true }, "@aashutoshrathi/word-wrap": { "version": "1.2.6", @@ -22608,9 +22641,9 @@ "requires": {} }, "@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", + "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "dev": true, "requires": { "aws-sign2": "~0.7.0", @@ -22626,7 +22659,7 @@ "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "~6.10.3", + "qs": "6.10.4", "safe-buffer": "^5.1.2", "tough-cookie": "^4.1.3", "tunnel-agent": "^0.6.0", @@ -25057,9 +25090,9 @@ } }, "@wordpress/env": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-5.16.0.tgz", - "integrity": "sha512-zx6UO8PuJBrQ34cfeedK1HlGHLFaj7oWzTo9tTt+noB79Ttqc4+a0lYwDqBLLJhlHU+cWgcyOP2lB6TboXH0xA==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-8.7.0.tgz", + "integrity": "sha512-cqjDjFFLZ8691mzsuPaakoNbUJ5d6DNNRMyN6UZefLGKhthlqmyK5DqzXZUzCr9cgF/kdc//v3ZmBy9nywBYSA==", "dev": true, "requires": { "chalk": "^4.0.0", @@ -27246,14 +27279,14 @@ } }, "cypress": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-11.2.0.tgz", - "integrity": "sha512-u61UGwtu7lpsNWLUma/FKNOsrjcI6wleNmda/TyKHe0dOBcVjbCPlp1N6uwFZ0doXev7f/91YDpU9bqDCFeBLA==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.2.0.tgz", + "integrity": "sha512-AvDQxBydE771GTq0TR4ZUBvv9m9ffXuB/ueEtpDF/6gOcvFR96amgwSJP16Yhqw6VhmwqspT5nAGzoxxB+D89g==", "dev": true, "requires": { - "@cypress/request": "^2.88.10", + "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^14.14.31", + "@types/node": "^18.17.5", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", @@ -27265,10 +27298,10 @@ "check-more-types": "^2.24.0", "cli-cursor": "^3.1.0", "cli-table3": "~0.6.1", - "commander": "^5.1.0", + "commander": "^6.2.1", "common-tags": "^1.8.0", "dayjs": "^1.10.4", - "debug": "^4.3.2", + "debug": "^4.3.4", "enquirer": "^2.3.6", "eventemitter2": "6.4.7", "execa": "4.1.0", @@ -27283,12 +27316,13 @@ "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", - "minimist": "^1.2.6", + "minimist": "^1.2.8", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", + "process": "^0.11.10", "proxy-from-env": "1.0.0", "request-progress": "^3.0.0", - "semver": "^7.3.2", + "semver": "^7.5.3", "supports-color": "^8.1.1", "tmp": "~0.2.1", "untildify": "^4.0.0", @@ -27296,9 +27330,15 @@ }, "dependencies": { "@types/node": { - "version": "14.18.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.54.tgz", - "integrity": "sha512-uq7O52wvo2Lggsx1x21tKZgqkJpvwCseBBPtX/nKQfpVlEsLOb11zZ1CRsWUKvJF0+lzuA9jwvA7Pr2Wt7i3xw==", + "version": "18.17.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.17.tgz", + "integrity": "sha512-cOxcXsQ2sxiwkykdJqvyFS+MLQPLvIdwh5l6gNg8qF6s+C7XSkEWOZjK+XhUZd+mYvHV/180g2cnCcIl4l06Pw==", + "dev": true + }, + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true }, "extract-zip": { @@ -27356,24 +27396,31 @@ "requires": {} }, "cypress-localstorage-commands": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/cypress-localstorage-commands/-/cypress-localstorage-commands-2.2.3.tgz", - "integrity": "sha512-EUEaHzbstw9AsEheIqr+RyXuxIzUS64nBBwl+Q4/mSdzfXpfcaV1nrHF+6H9zbTuFVTc+oWu6eC1l8aSjiWW6w==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/cypress-localstorage-commands/-/cypress-localstorage-commands-2.2.4.tgz", + "integrity": "sha512-XiWFJhhgcoWf7p6sS5igGuN8WWGF0K1jRCPo2XlikwEWgts1uvPl80cybGiztYoNrU1xCbQO9/IOz6Y0eTl4Lg==", "dev": true, "requires": {} }, "cypress-mochawesome-reporter": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/cypress-mochawesome-reporter/-/cypress-mochawesome-reporter-3.5.1.tgz", - "integrity": "sha512-/5ahFTyTxLujdzfTvmQrzKrJ8GWv12rUbOHvzWfVRYlAp/088ffU/1QbcfacEa2HTs28onSIIBiIKqSOID/bTw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/cypress-mochawesome-reporter/-/cypress-mochawesome-reporter-3.6.0.tgz", + "integrity": "sha512-NeYpeZVB5YCU10I3a1yA2qHt+YREo0jZw4Gj83JTJ7YX/ZLFfd8MYKl2O19d/yYC8np/fpMufp5gt3ympd9DWQ==", "dev": true, "requires": { + "commander": "^10.0.1", "fs-extra": "^10.0.1", "mochawesome": "^7.1.3", "mochawesome-merge": "^4.2.1", "mochawesome-report-generator": "^6.2.0" }, "dependencies": { + "commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true + }, "fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -33781,6 +33828,12 @@ } } }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", diff --git a/package.json b/package.json index 8acd8a18..4697d735 100644 --- a/package.json +++ b/package.json @@ -39,17 +39,17 @@ ] }, "devDependencies": { - "@10up/cypress-wp-utils": "github:10up/cypress-wp-utils#build", - "@wordpress/env": "^5.4.0", + "@10up/cypress-wp-utils": "^0.2.0", + "@wordpress/env": "^8.7.0", "@wordpress/plugins": "^6.2.0", "@wordpress/prettier-config": "^2.2.0", "@wordpress/scripts": "^26.5.0", "ansi-regex": ">=6.0.1", "copy-webpack-plugin": "^11.0.0", - "cypress": "^11.2.0", + "cypress": "^13.2.0", "cypress-file-upload": "^5.0.8", - "cypress-localstorage-commands": "^2.2.2", - "cypress-mochawesome-reporter": "^3.4.0", + "cypress-localstorage-commands": "^2.2.4", + "cypress-mochawesome-reporter": "^3.6.0", "eslint-plugin-cypress": "^2.12.1", "husky": "^8.0.1", "json-schema": ">=0.4.0", diff --git a/tests/cypress/integration/admin.test.js b/tests/cypress/integration/admin.test.js index cd9353fe..00745564 100644 --- a/tests/cypress/integration/admin.test.js +++ b/tests/cypress/integration/admin.test.js @@ -1,5 +1,5 @@ describe('Admin can login and make sure plugin is activated', () => { - before(() => { + beforeEach(() => { cy.login(); }); diff --git a/tests/cypress/integration/onboarding.test.js b/tests/cypress/integration/onboarding.test.js index d2e0028d..3f1fcfa9 100644 --- a/tests/cypress/integration/onboarding.test.js +++ b/tests/cypress/integration/onboarding.test.js @@ -5,11 +5,8 @@ const { } = require('../support/functions'); describe('Onboarding tests', () => { - before(() => { - cy.login(); - }); - beforeEach(() => { + cy.login(); cy.uploadMedia('tests/cypress/fixtures/example.jpg'); cy.activatePlugin('simple-podcasting'); cy.visit( diff --git a/tests/cypress/integration/podcast-setting-panel.test.js b/tests/cypress/integration/podcast-setting-panel.test.js index 0cb3e06a..79150393 100644 --- a/tests/cypress/integration/podcast-setting-panel.test.js +++ b/tests/cypress/integration/podcast-setting-panel.test.js @@ -13,6 +13,14 @@ describe('Create podcast setting panel', () => { }); } }); + + cy.visit('/wp-admin/post-new.php'); + closeWelcomeGuide(); + openEditorSidebar(); + }); + + beforeEach(() => { + cy.login(); }); /** @@ -32,6 +40,19 @@ describe('Create podcast setting panel', () => { }); } + function openEditorSidebar() { + cy.get('button.components-button[aria-label="Settings"]').should( + 'exist' + ); + cy.get('body').then(($body) => { + if (!$body.find('.edit-post-sidebar').length) { + cy.get( + 'button.components-button[aria-label="Settings"]' + ).click(); + } + }); + } + it('Podcast setting panel exists', () => { cy.visit('/wp-admin/post-new.php'); closeWelcomeGuide(); diff --git a/tests/cypress/integration/taxonomy.test.js b/tests/cypress/integration/taxonomy.test.js index e5db76d6..3b5c44a6 100644 --- a/tests/cypress/integration/taxonomy.test.js +++ b/tests/cypress/integration/taxonomy.test.js @@ -5,7 +5,7 @@ const { } = require('../support/functions'); describe('Admin can create and update podcast taxonomy', () => { - before(() => { + beforeEach(() => { cy.login(); }); diff --git a/tests/cypress/plugins/index.js b/tests/cypress/plugins/index.js index 6b79d990..b8eff11a 100644 --- a/tests/cypress/plugins/index.js +++ b/tests/cypress/plugins/index.js @@ -12,14 +12,16 @@ // This function is called when a project is opened or re-opened (e.g. due to // the project's config changing) -const { readConfig } = require('@wordpress/env/lib/config'); +const { loadConfig } = require('@wordpress/env/lib/config'); +const getCacheDirectory = require('@wordpress/env/lib/config/get-cache-directory'); /** * @type {Cypress.PluginConfig} */ // eslint-disable-next-line no-unused-vars module.exports = async (on, config) => { - const wpEnvConfig = await readConfig('wp-env'); + const cacheDirectory = await getCacheDirectory(); + const wpEnvConfig = await loadConfig(cacheDirectory); if (wpEnvConfig) { const port = wpEnvConfig.env.tests.port || null; diff --git a/tests/cypress/support/index.js b/tests/cypress/support/index.js index 8e35fd3f..c579ef3c 100644 --- a/tests/cypress/support/index.js +++ b/tests/cypress/support/index.js @@ -15,9 +15,3 @@ import '@10up/cypress-wp-utils'; import 'cypress-file-upload'; - -beforeEach(() => { - Cypress.Cookies.defaults({ - preserve: /^wordpress.*?/, - }); -});