Skip to content

Commit

Permalink
Merge branch 'develop' into fix/64
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Sep 14, 2023
2 parents 44dd694 + 36e35c4 commit 354ae96
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 136 deletions.
240 changes: 126 additions & 114 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"author": "10up",
"license": "GNU General Public License v2.0",
"devDependencies": {
"@10up/cypress-wp-utils": "github:10up/cypress-wp-utils#build",
"@wordpress/env": "^5.2.0",
"@10up/cypress-wp-utils": "^0.2.0",
"@wordpress/env": "^8.7.0",
"@wordpress/scripts": "^23.0.0",
"cypress": "^13.1.0",
"cypress": "^13.2.0",
"cypress-file-upload": "^5.0.8",
"cypress-mochawesome-reporter": "^3.0.1"
"cypress-mochawesome-reporter": "^3.6.0"
}
}
4 changes: 2 additions & 2 deletions tests/bin/initialize.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
npm run env run tests-wordpress "chmod -c ugo+w /var/www/html"
npm run env run tests-cli "wp rewrite structure '/%postname%/' --hard"
wp-env run tests-wordpress chmod -c ugo+w /var/www/html
wp-env run tests-cli wp rewrite structure '/%postname%/' --hard
2 changes: 1 addition & 1 deletion tests/cypress/integration/admin.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Admin can login and make sure plugin is activated', () => {
before(() => {
beforeEach(() => {
cy.login();
});

Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/integration/avatars-migration.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Avatar migration', () => {
before(() => {
beforeEach(() => {
cy.login();
});

Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/integration/choose-default-avatar.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Check if a default avatar can be set', () => {
before(() => {
beforeEach(() => {
cy.login();
});

Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/integration/clear-avatars-cache.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Check if avatar cache can be cleared', () => {
before(() => {
beforeEach(() => {
cy.login();
});

Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/integration/delete-avatar.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'cypress-file-upload';

describe('Check if admin can delete avatar', () => {
before(() => {
beforeEach(() => {
cy.login();
});

Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/integration/set-avatar.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'cypress-file-upload';

describe('Check if admin can upload, crop and select local avatar', () => {
before(() => {
beforeEach(() => {
cy.login();
});

Expand Down
6 changes: 4 additions & 2 deletions tests/cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
wpEnvConfig = await readConfig("wp-env");
const cacheDirectory = await getCacheDirectory();
const wpEnvConfig = await loadConfig(cacheDirectory);

if (wpEnvConfig) {
const port = wpEnvConfig.env.tests.port || null;
Expand Down
8 changes: 0 additions & 8 deletions tests/cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,3 @@ import "@10up/cypress-wp-utils";

// Import commands.js using ES2015 syntax:
import "./commands";

// Alternatively you can use CommonJS syntax:
// require('./commands')
beforeEach(() => {
Cypress.Cookies.defaults({
preserve: /^wordpress.*?/,
});
});

0 comments on commit 354ae96

Please sign in to comment.