Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
build-plugin:
name: Build plugin
runs-on: ubuntu-22.04
if: startsWith( github.repository, 'elementor/' )
# if: startsWith( github.repository, 'elementor/' )
outputs:
artifact_name: ${{ env.PLUGIN_FOLDER_FILENAME}}
changelog_diff: ${{ steps.changelog_diff_files.outputs.diff }}
Expand Down
203 changes: 203 additions & 0 deletions .github/workflows/playwright-wp-now-new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
name: Playwright wp-now new

on:
pull_request:
paths-ignore:
- '**.md'
- '**.txt'
- '.github/config.json'
- 'bin/**'
- '.gitignore'
- 'docs/**'
workflow_dispatch:
inputs:
reporter:
required: false
description: 'Select a reporter'
type: choice
options:
- allure-playwright
- html
- blob
- list
default: allure-playwright
path-to-results:
required: false
description: 'Provide path to reporter files'
default: allure-results
type: choice
options:
- test-results/
- tests/playwright/blob-report
- allure-results
fail_fast:
type: boolean
required: true
description: 'Cancel tests when one of them fails'
default: false
tag:
description: 'Provide @tag or a keyword'
required: false

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
build-plugin:
name: Build plugin
uses: ./.github/workflows/build.yml
Playwright:
name: Playwright test - ${{ matrix.shardIndex }} on PHP 8.0
runs-on: ubuntu-latest
needs: [build-plugin]
if: ${{ ( github.event.pull_request.title == null || needs.build-plugin.outputs.changelog_diff ) && github.event.inputs.tag == '' }}
strategy:
fail-fast: ${{ inputs.fail_fast || false }}
matrix:
shardIndex: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
shardTotal: [ 10 ]
include:
- shardIndex: "elements-regression"
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: |
composer install
npm ci
sed -i -e "s/image: 'mariadb:lts'/image: 'mariadb:11.2.4-jammy'/g" node_modules/@wordpress/env/lib/build-docker-compose-config.js
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build-plugin.outputs.artifact_name }}
path: ./build
# - name: Update wp-env.json file
# env:
# PHP_VERSION: '8.0'
# WP_CORE_VERSION: 'latest'
# run: node ./.github/scripts/build-wp-env.js
# - name: Install WordPress environment
# run: |
# npm run start-local-server
# - name: Update wordpress to nightly build
# if: ${{ github.event_name == 'schedule' }}
# run: npx wp-env run cli wp core update https://wordpress.org/nightly-builds/wordpress-latest.zip
# - name: Setup test data
# run: npm run test:setup:playwright
# - name: WordPress debug information
# run: |
# npx wp-env run cli wp core version
# npx wp-env run cli wp --info
- name: Install WordPress environment 8888
run: |
npx wp-now start --php=8.0 --port=8888 --blueprint=./blueprint.json &
- name: Install WordPress environment 8889
run: |
npx wp-now start --php=8.0 --port=8889 --blueprint=./blueprint.json &
- name: Install playwright/test
run: |
npx playwright install chromium
- name: Run Playwright tests
if: ${{ matrix.shardIndex != 'elements-regression' }}
run: npm run test:playwright -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=${{ inputs.reporter || 'list,github' }}
- name: Run element regression tests
if: ${{ matrix.shardIndex == 'elements-regression' }}
run: npm run test:playwright:elements-regression -- --reporter=${{ inputs.reporter || 'list,github' }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-test-results-${{ matrix.shardIndex }}
path: ${{ inputs.path-to-results || 'test-results/' }}
if-no-files-found: ignore
retention-days: 2
PlaywrightWithTag:
name: Playwright test - tagged tests on PHP 8.0
runs-on: ubuntu-latest
needs: [ build-plugin ]
if: ${{ github.event.inputs.tag }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: |
npm ci
sed -i -e "s/image: 'mariadb:lts'/image: 'mariadb:11.2.4-jammy'/g" node_modules/@wordpress/env/lib/build-docker-compose-config.js
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build-plugin.outputs.artifact_name }}
path: ./build
- name: Update wp-env.json file
env:
PHP_VERSION: '8.0'
WP_CORE_VERSION: 'latest'
run: node ./.github/scripts/build-wp-env.js
- name: Install WordPress environment
run: |
npm run start-local-server
- name: Setup test data
run: npm run test:setup:playwright
- name: WordPress debug information
run: |
npx wp-env run cli wp core version
npx wp-env run cli wp --info
- name: Install playwright/test
run: |
npx playwright install chromium
- name: Run Playwright tests
run: |
npm run test:playwright -- --grep="${{ inputs.tag }}" --reporter=list,allure-playwright
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-test-results-tagged-tests
path: ${{ inputs.path-to-results || 'test-results/' }}
if-no-files-found: ignore
retention-days: 2


test-result:
needs: Playwright
if: ${{ always() }} # Will be run even if 'Playwright' matrix will be skipped
runs-on: ubuntu-22.04
name: Playwright - Test Results
steps:
- name: Test status
run: echo "Test status is - ${{ needs.Playwright.result }}"
- name: Checkout source code
if: ${{ needs.Playwright.result == 'failure' && github.event_name == 'schedule' }}
uses: actions/checkout@v4
# - name: Send slack message
# if: ${{ needs.Playwright.result == 'failure' && github.event_name == 'schedule' }}
# uses: ./.github/workflows/post-to-slack
# with:
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_TOKEN }}
# SLACK_TAG_CHANNELS: ${{ secrets.TEST_AUTOMATION_RESULTS }}
# PAYLOAD: |
# {
# "text": "Elementor Core: Playwright with WordPress nightly has failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
# "blocks": [
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "Elementor Core: Playwright with WordPress nightly failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# }
# }
# ]
# }
# - name: Check Playwright matrix status
# if: ${{ needs.Playwright.result != 'success' && needs.Playwright.result != 'skipped' }}
# run: exit 1
30 changes: 16 additions & 14 deletions .github/workflows/pwwpnow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,20 @@ jobs:
.*/**/*
!readme.txt
!changelog.txt
- name: Install Node.js 18.x
- name: Install Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 20.x
- name: Restore NPM Cache
uses: actions/cache/restore@v3
with:
path: ~/.npm
key: npm-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
# if: github.event.pull_request.title == null || steps.changelog_diff_files.outputs.diff
run: npm i
run: |
npm i
composer install
- name: Build
# if: github.event.pull_request.title == null || steps.changelog_diff_files.outputs.diff
run: npx grunt build
Expand Down Expand Up @@ -113,22 +115,22 @@ jobs:
# chmod +x wp-cli.phar
# sudo mv wp-cli.phar /usr/local/bin/wp
- name: Install dependencies
run: npm i
run: |
composer install
npm i
- name: Install WordPress environment
run: |
npx wp-now start --php=8.0 --port=8888 --blueprint=./blueprint.json &
- name: WP Cli check
run: |
wp --info
wp plugin list
wp theme activate hello-elementor

- name: Run wp-now CLI commands
run: |
wp-now cli "wp elementor experiments activate e_optimized_css_loading"
# - name: WP Cli check
# run: |
# wp --info
# wp plugin list
# wp theme activate hello-elementor
# - name: Run wp-now CLI commands
# run: |
# wp-now cli "wp elementor experiments activate e_optimized_css_loading"
- name: Install playwright/test
run: |
npm run test:setup:playwright
npx playwright install chromium
- name: Run Playwright tests
env:
Expand Down
2 changes: 1 addition & 1 deletion blueprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{
"step": "activatePlugin",
"pluginName": "elementor",
"pluginPath": ".elementor/build/"
"pluginPath": "elementor/build/"
},
{
"step": "login",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"@wordpress/data": "^10.5.0",
"@wordpress/dom-ready": "^3.45.0",
"@wordpress/element": "^5.22.0",
"@wp-now/wp-now": "^0.1.72",
"@wp-now/wp-now": "^0.1.74",
"acorn": "^8.7.1",
"core-js": "^3.24.1",
"dompurify": "^3.1.3",
Expand Down
Loading