Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/playwright-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Playwright End-to-End Tests

on:
pull_request:

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
e2e-playwright:
name: Playwright E2E Tests
runs-on: ubuntu-latest

steps:
- name: Configure environment variables
run: |
echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV
echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV

- name: Checkout repository
uses: actions/checkout@v4

# Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node JS
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache node modules
uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Log debug information
run: |
npm --version
yarn --version
node --version
curl --version
git --version
php --version
php -i
locale -a

- name: Install Composer dependencies
run: |
composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction --no-scripts
echo "${PWD}/vendor/bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install JS Dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install

- name: Build Gravity PDF
run: yarn build

- name: Install / Setup Gravity PDF + WordPress
run: |
yarn wp-env start
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run the tests
run: |
yarn test:e2e:playwright:headless

- name: Archive debug artifacts (screenshots, traces)
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-artifacts
path: artifacts/test-results
if-no-files-found: ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ build/assets/*
/coverage
/screenshots
/artifacts
/tests/playwright/artifacts

# Others
_notes
Expand Down
2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"core": "https://wordpress.org/latest.zip",
"core": "https://wordpress.org/wordpress-6.8-beta2.zip",
"phpVersion": "8.3",
"plugins": [
"gravityforms/gravityformscli",
Expand Down
373 changes: 372 additions & 1 deletion CHANGELOG.txt

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ fi

# Install Gravity PDF Dependencies
composer install
# this is triggers as post install script
# composer run prefix

# disable for now as it loops the installation
# Start local environment
#if [[ $PHP_ENABLE_XDEBUG ]]; then
# npm run wp-env start -- --upgrade --xdebug=debug,coverage
#else
# npm run wp-env start -- --upgrade
#fi

echo "Install Gravity Forms..."
bash ./bin/install-gravityforms.sh
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"private": true,
"dependencies": {
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"@wordpress/e2e-test-utils": "^11.19.0",
"@wordpress/e2e-test-utils-playwright": "^1.19.0",
"algoliasearch": "^5.10.2",
"classnames": "^2.3.1",
"core-js": "^3.23.4",
Expand All @@ -26,7 +28,7 @@
"devDependencies": {
"@babel/core": "^7.18.6",
"@cfaester/enzyme-adapter-react-18": "^0.8.0",
"@playwright/test": "^1.49.0",
"@playwright/test": "^1.51.0",
"@redux-devtools/extension": "^3.3.0",
"@wordpress/babel-preset-default": "^8.11.0",
"@wordpress/env": "^10.10.0",
Expand All @@ -45,6 +47,7 @@
"enzyme": "^3.11.0",
"eslint": "^8",
"file-loader": "^6.2.0",
"filenamify": "4.2.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-enzyme": "^7.1.2",
Expand Down Expand Up @@ -72,12 +75,16 @@
"dev:build": "yarn run dev --no-watch",
"build": "wp-scripts build --webpack-src-dir=./src/assets/js --webpack-no-externals",
"wp-env": "wp-env",
"format": "wp-scripts format ./src/assets ./tests/js-unit && yarn run lint:js --fix && yarn run lint:css --fix",
"format": "wp-scripts format ./src/assets ./tests/js-unit ./tests/playwright && yarn run lint:js --fix && yarn run lint:css --fix",
"lint:css": "wp-scripts lint-style ./src/assets/**/*.scss ./src/assets/**/*.pcss",
"lint:js": "wp-scripts lint-js ./src/assets/js ./tests/js-unit",
"lint:js": "wp-scripts lint-js ./src/assets/js ./tests/js-unit ./tests/playwright",
"test:e2e": "cross-env NODE_ENV=test testcafe chrome",
"test:e2e:headless": "cross-env NODE_ENV=test testcafe chrome:headless",
"test:e2e:watch": "cross-env NODE_ENV=test testcafe chrome -L",
"test:e2e:playwright": "wp-scripts test-playwright --config tests/playwright/playwright.config.ts",
"test:e2e:playwright:debug": "wp-scripts test-playwright --config tests/playwright/playwright.config.ts --ui",

"reset:e2e": "yarn wp-env clean && yarn wp-env run tests-cli wp plugin activate gravityforms gravityformspolls gravityformsquiz gravityformssurvey && bash bin/install-database.sh",
"test:php": "npm run wp-env run tests-wordpress env PHP_IDE_CONFIG=serverName=localhost /var/www/html/wp-content/plugins/gravity-pdf/vendor/bin/phpunit -- -c /var/www/html/wp-content/plugins/gravity-pdf/phpunit.xml.dist",
"test:php:multisite": "npm run wp-env run tests-wordpress env PHP_IDE_CONFIG=serverName=localhost /var/www/html/wp-content/plugins/gravity-pdf/vendor/bin/phpunit -- -c /var/www/html/wp-content/plugins/gravity-pdf/tests/phpunit/multisite.xml",
"test:js": "jest --verbose",
Expand Down
4 changes: 2 additions & 2 deletions pdf.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: Gravity PDF
Version: 6.12.4
Version: 6.12.5
Description: Automatically generate highly-customizable PDF documents using Gravity Forms and WordPress (canonical)
Author: Blue Liquid Designs
Author URI: https://blueliquiddesigns.com.au
Expand Down Expand Up @@ -36,7 +36,7 @@
/*
* Set base constants we'll use throughout the plugin
*/
define( 'PDF_EXTENDED_VERSION', '6.12.4' ); /* the current plugin version */
define( 'PDF_EXTENDED_VERSION', '6.12.5' ); /* the current plugin version */
define( 'PDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /* plugin directory path */
define( 'PDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /* plugin directory url */
define( 'PDF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /* the plugin basename */
Expand Down
Loading
Loading