Skip to content

Commit

Permalink
Merge pull request #145 from 10up/upkeep/141
Browse files Browse the repository at this point in the history
Fix E2E Tests and Upgrade Cypress to version 13
  • Loading branch information
dkotter committed Sep 15, 2023
2 parents 48e5364 + f7cd72f commit dd17ea2
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 85 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.7'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.8'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
steps:
- name: Checkout
Expand All @@ -71,10 +71,19 @@ jobs:
- run: npm ci
if: ${{ steps.cache-node.outputs.cache-hit != 'true' }}
- run: npm run build
if: ${{ steps.cache-build.outputs.cache-hit != 'true' }}
- name: Set the core version
run: ./tests/bin/set-core-version.js ${{ matrix.core.version }}
- name: Set up WP environment
run: npm run env:start
- name: Test
run: npm run cypress:run
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-artifact-insecure-content-warning
retention-days: 2
path: |
${{ github.workspace }}/tests/cypress/screenshots/
${{ github.workspace }}/tests/cypress/videos/
${{ github.workspace }}/tests/cypress/logs/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Compatible with both the block and classic editors.
## Requirements

* PHP 7.4+.
* WordPress 5.7+.
* WordPress 5.8+.
* A secure / SSL (HTTPS) website, front and back end.

## Installation
Expand Down
2 changes: 1 addition & 1 deletion insecure-content-warning.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://wordpress.org/plugins/insecure-content-warning/
* Description: Prevent editors from adding insecure content in the editor.
* Version: 1.1.0
* Requires at least: 5.7
* Requires at least: 5.8
* Requires PHP: 7.4
* Author: 10up
* Author URI: https://10up.com/
Expand Down
129 changes: 81 additions & 48 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
"underscore": "^1.12.1"
},
"devDependencies": {
"@10up/cypress-wp-utils": "github:10up/cypress-wp-utils#build",
"@wordpress/env": "^5.8.0",
"@10up/cypress-wp-utils": "^0.2.0",
"@wordpress/env": "^8.7.0",
"@wordpress/eslint-plugin": "^14.11.0",
"@wordpress/scripts": "^26.9.0",
"cypress": "^11.2.0",
"cypress": "^13.2.0",
"eslint": "^8.46.0",
"eslint-plugin-prettier": "^5.0.0",
"husky": "^3.1.0",
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=== Insecure Content Warning ===
Contributors: 10up, psorensen, adamsilverstein, tlovett, davidrgreen, dkotter, jeffpaul
Tags: publishing, publishers, secure content, https, ssl
Requires at least: 5.7
Requires at least: 5.8
Tested up to: 6.3
Requires PHP: 7.4
Stable tag: 1.1.0
Expand All @@ -19,7 +19,7 @@ Compatible with the "classic" editor as well as the block editor (aka Gutenberg)
=== Technical Notes ===

* Requires PHP 7.4+.
* Requires WordPress 5.7+.
* Requires WordPress 5.8+.
* Requires a secure / SSL (HTTPS) website, front and back end.

=== Usage ===
Expand Down
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
1 change: 1 addition & 0 deletions tests/cypress/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
chromeWebSecurity: false,
fixturesFolder: __dirname + "/fixtures",
screenshotsFolder: __dirname + "/screenshots",
videosFolder: __dirname + "/videos",
Expand Down
Loading

0 comments on commit dd17ea2

Please sign in to comment.