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
177 changes: 177 additions & 0 deletions .github/workflows/post-release-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: Post-Release Check

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- '.github/workflows/post-release-check.yml'
- 'actions/post-release-verify/**'
- 'actions/post-release-smoke/**'
- 'packages/editor-github-actions-utils/**'
- 'stubs/upgrade-templates/**'
workflow_dispatch:
inputs:
core_version:
description: 'Core version (e.g. 4.2.2)'
required: true
type: string
pro_version:
description: 'Pro version. Leave empty for Core-only.'
required: false
type: string
default: ''
skip_wordpress_org:
description: 'Skip wordpress.org SVN/download (use when the tag is not on .org yet)'
required: false
type: boolean
default: false
skip_smoke:
description: 'Run API/zip checks only'
required: false
type: boolean
default: false
dry_run:
description: 'Record failures in the summary without failing verify'
required: false
type: boolean
default: false
workflow_call:
inputs:
core_version:
required: true
type: string
pro_version:
required: false
type: string
default: ''
skip_wordpress_org:
required: false
type: boolean
default: false
skip_smoke:
required: false
type: boolean
default: false
dry_run:
required: false
type: boolean
default: false
secrets:
MAINTAIN_TOKEN:
required: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
actions: write

jobs:
verify-published:
name: Verify published artifacts
runs-on: ubuntu-latest
if: startsWith(github.repository, 'elementor/')
outputs:
core_version: ${{ steps.versions.outputs.core }}
pro_version: ${{ steps.versions.outputs.pro }}
core_zip_available: ${{ steps.verify.outputs.core-zip-path != '' }}
pro_zip_available: ${{ steps.verify.outputs.pro-zip-path != '' }}
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Resolve versions
id: versions
env:
INPUT_CORE: ${{ inputs.core_version }}
INPUT_PRO: ${{ inputs.pro_version }}
run: |
if [ -n "$INPUT_CORE" ]; then
echo "core=$INPUT_CORE" >> "$GITHUB_OUTPUT"
else
CORE=$(curl -fsSL -A 'elementor-post-release-check' \
'https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request%5Bslug%5D=elementor' \
| jq -r '.version')
if [ -z "$CORE" ] || [ "$CORE" = 'null' ]; then
echo 'Failed to resolve current Core version from wordpress.org'
exit 1
fi
echo "PR run: using wordpress.org current Core $CORE"
echo "core=$CORE" >> "$GITHUB_OUTPUT"
fi
echo "pro=$INPUT_PRO" >> "$GITHUB_OUTPUT"

- name: Install Dependencies
uses: ./.github/actions/install-deps

- name: Verify release
id: verify
uses: ./actions/post-release-verify
with:
core-version: ${{ steps.versions.outputs.core }}
pro-version: ${{ steps.versions.outputs.pro }}
github-token: ${{ secrets.MAINTAIN_TOKEN || github.token }}
skip-wordpress-org: ${{ inputs.skip_wordpress_org || false }}
dry-run: ${{ inputs.dry_run || false }}

- name: Upload plugin zips
if: steps.verify.outputs.core-zip-path != ''
uses: actions/upload-artifact@v4
with:
name: released-plugins
path: post-release-artifacts/*.zip
if-no-files-found: error
retention-days: 3

smoke-editor:
name: Upgrade site smoke
needs: verify-published
runs-on: ubuntu-latest
if: >-
startsWith(github.repository, 'elementor/')
&& inputs.skip_smoke != true
&& needs.verify-published.outputs.core_zip_available == 'true'
steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Install Dependencies
uses: ./.github/actions/install-deps

- name: Download plugin zips
uses: actions/download-artifact@v4
with:
name: released-plugins
path: released-plugins

- name: Setup WP Env
uses: ./actions/setup-wp-env
with:
php: '8.0'
wp: '7.0.1'
active-theme: 'hello-elementor'
themes: |-
https://downloads.wordpress.org/theme/hello-elementor.zip
mappings: |-
elementor-templates:./stubs/upgrade-templates
released-plugins:./released-plugins
config: |-
ELEMENTOR_SHOW_HIDDEN_EXPERIMENTS:1

- name: Install current wordpress.org Elementor
run: npx wp-env run tests-cli wp plugin install elementor --activate

- name: Setup Elementor Env
uses: ./actions/setup-elementor-env
with:
env: 'testing'
templates: |-
elementor-templates

- name: Upgrade site and run editor smoke
uses: ./actions/post-release-smoke
with:
core-version: ${{ needs.verify-published.outputs.core_version }}
pro-version: ${{ needs.verify-published.outputs.pro_version }}
12 changes: 12 additions & 0 deletions actions/post-release-smoke/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Post-release smoke

Mirrors Core [`plugin-upgrade-test.yml`](https://github.com/elementor/elementor/blob/main/.github/workflows/plugin-upgrade-test.yml):

1. Start wp-env **without** mounting Elementor, then `wp plugin install elementor` from wordpress.org (same as Core's empty plugins + CLI install).
2. Import a heading page (same idea as `setup.sh` + heading template).
3. Deactivate/uninstall, then `wp plugin install <released-zip> --activate` (avoid in-place `--force` while Elementor hooks still run).
4. Playwright: frontend heading still says `Test title`, edit that page, create a new page, canvas iframe loads.

This is not Core elements-regression screenshots. It only checks that the **published** zip upgrades a current `.org` site and the editor boots.

The `Post-Release Check` workflow in this repo wires the steps. Do not add this suite to Core/Pro PR CI.
77 changes: 77 additions & 0 deletions actions/post-release-smoke/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Post-release smoke
description: Upgrade from wordpress.org current Elementor to the released zip, then smoke the editor like Core plugin-upgrade-test.yml.

inputs:
core-version:
description: 'Expected Core plugin version after upgrade.'
required: true
pro-version:
description: 'Expected Pro plugin version after install. Empty skips Pro.'
required: false
default: ''
base-url:
description: 'wp-env testing URL.'
required: false
default: 'http://localhost:8889'
wp-username:
required: false
default: 'admin'
wp-password:
required: false
default: 'password'

runs:
using: composite
steps:
- name: Quiet editor popups
shell: bash
run: |
npx wp-env run tests-cli wp option update e_editor_counter 10
npx wp-env run tests-cli wp option update elementor_checklist '{"last_opened_timestamp":null,"first_closed_checklist_in_editor":true,"is_popup_minimized":false,"steps":[],"should_open_in_editor":false,"editor_visit_count":10}'
npx wp-env run tests-cli wp user meta add admin announcements_user_counter 999 || true

- name: Resolve existing heading page
id: seed
shell: bash
run: |
RAW=$(npx wp-env run tests-cli wp post list \
--post_type=page \
--name=upgrade-heading \
--field=ID \
--posts_per_page=1)
PAGE_ID=$(echo "$RAW" | tail -n 1 | tr -d '\r')
if [ -z "$PAGE_ID" ]; then
echo "Imported upgrade-heading page was not found."
exit 1
fi
echo "existing_page_id=$PAGE_ID" >> "$GITHUB_OUTPUT"

- name: Upgrade site
shell: bash
run: |
npx wp-env run tests-cli wp plugin uninstall elementor --deactivate
npx wp-env run tests-cli wp plugin install ./released-plugins/elementor.zip --activate
if [ -f ./released-plugins/elementor-pro.zip ]; then
npx wp-env run tests-cli wp plugin uninstall elementor-pro --deactivate || true
npx wp-env run tests-cli wp plugin install ./released-plugins/elementor-pro.zip --activate
fi
npx wp-env run tests-cli wp plugin list
npx wp-env run tests-cli wp cache flush
npx wp-env run tests-cli wp elementor flush-css

- name: Install Playwright Chromium
shell: bash
working-directory: ${{ github.action_path }}
run: npx playwright install chromium

- name: Run editor smoke
shell: bash
working-directory: ${{ github.action_path }}
env:
WP_BASE_URL: ${{ inputs.base-url }}
WP_USERNAME: ${{ inputs.wp-username }}
WP_PASSWORD: ${{ inputs.wp-password }}
CORE_VERSION: ${{ inputs.core-version }}
PRO_VERSION: ${{ inputs.pro-version }}
EXISTING_PAGE_ID: ${{ steps.seed.outputs.existing_page_id }}
run: npx playwright test
9 changes: 9 additions & 0 deletions actions/post-release-smoke/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@elementor/post-release-smoke",
"author": "Elementor Team",
"license": "GPL-3.0-or-later",
"private": true,
"dependencies": {
"@playwright/test": "^1.51.0"
}
}
22 changes: 22 additions & 0 deletions actions/post-release-smoke/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defineConfig } from '@playwright/test';

import { timeouts } from './timeouts';

const baseURL = process.env.WP_BASE_URL ?? 'http://localhost:8889';

export default defineConfig({
testDir: './tests',
timeout: timeouts.editorLoad,
expect: {
timeout: timeouts.longAction,
},
fullyParallel: false,
retries: 0,
workers: 1,
use: {
baseURL,
headless: true,
viewport: { width: 1440, height: 960 },
trace: 'retain-on-failure',
},
});
90 changes: 90 additions & 0 deletions actions/post-release-smoke/tests/editor-smoke.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { expect, test, type Page } from '@playwright/test';

import { timeouts } from '../timeouts';

const adminUser = process.env.WP_USERNAME ?? 'admin';
const adminPassword = process.env.WP_PASSWORD ?? 'password';
const coreVersion = process.env.CORE_VERSION ?? '';
const proVersion = process.env.PRO_VERSION ?? '';
const existingPageId = process.env.EXISTING_PAGE_ID ?? '';

test.describe('Post-release upgrade smoke', () => {
test.beforeEach(async ({ page }) => {
await login(page);
});

test('plugins screen shows the released version(s)', async ({ page }) => {
await page.goto('/wp-admin/plugins.php');

await expect(
page.locator(
'tr[data-slug="elementor"] .plugin-version-author-uri',
),
).toContainText(`Version ${coreVersion}`);

if (proVersion) {
await expect(
page.locator(
'tr[data-slug="elementor-pro"] .plugin-version-author-uri',
),
).toContainText(`Version ${proVersion}`);
}
});

test('existing heading page still renders after upgrade', async ({
page,
}) => {
await page.goto('/upgrade-heading/');
await expect(page.getByText('Test title')).toBeVisible({
timeout: timeouts.longAction,
});
});

test('edits the existing heading page in the editor', async ({ page }) => {
test.skip(
!existingPageId,
'EXISTING_PAGE_ID was not resolved after template import',
);

await page.goto(
`/wp-admin/post.php?post=${existingPageId}&action=elementor`,
);
await dismissEditorChrome(page);
await page
.locator('#elementor-preview-iframe')
.waitFor({ state: 'visible', timeout: timeouts.editorLoad });
});

test('creates a new Elementor page after upgrade', async ({ page }) => {
await page.goto('/wp-admin/post-new.php?post_type=page');
await page.keyboard.press('Escape');
await page.locator('#elementor-switch-mode-button').click();
await page.waitForURL(/action=elementor/, {
timeout: timeouts.longAction,
});
await dismissEditorChrome(page);
await page
.locator('#elementor-preview-iframe')
.waitFor({ state: 'visible', timeout: timeouts.editorLoad });
});
});

async function login(page: Page) {
await page.goto('/wp-login.php');
await page.locator('#user_login').fill(adminUser);
await page.locator('#user_pass').fill(adminPassword);
await page.locator('#wp-submit').click();
await page.waitForURL(/wp-admin/, { timeout: timeouts.longAction });
}

async function dismissEditorChrome(page: Page) {
const closeButton = page.locator('.dialog-close-button').first();

if (
await closeButton
.isVisible({ timeout: timeouts.shortAction })
.catch(() => false)
) {
await closeButton.click();
}
}
5 changes: 5 additions & 0 deletions actions/post-release-smoke/timeouts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const timeouts = {
shortAction: 5_000,
longAction: 30_000,
editorLoad: 60_000,
} as const;
Loading
Loading