From de0a0c8b209462d4e37c7b7afa92c3c300d94cc5 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Fri, 29 Nov 2024 15:36:49 +0200 Subject: [PATCH 01/17] wp-now update to 0.1.74 --- .github/workflows/pwwpnow.yml | 10 +++++----- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pwwpnow.yml b/.github/workflows/pwwpnow.yml index ec626a1b5c43..6ff9a7f918de 100644 --- a/.github/workflows/pwwpnow.yml +++ b/.github/workflows/pwwpnow.yml @@ -117,11 +117,11 @@ jobs: - 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: WP Cli check +# run: | +# wp --info +# wp plugin list +# wp theme activate hello-elementor - name: Run wp-now CLI commands run: | diff --git a/package-lock.json b/package-lock.json index 3ca96f4c31f6..eeaa757a7f3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,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", diff --git a/package.json b/package.json index e7fe360af7e6..b71f6e0af84a 100644 --- a/package.json +++ b/package.json @@ -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", From 1f97f6d059f563d1b41bc4905bc9a9fa004c20ba Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Fri, 29 Nov 2024 15:43:44 +0200 Subject: [PATCH 02/17] wip --- .github/workflows/pwwpnow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pwwpnow.yml b/.github/workflows/pwwpnow.yml index 6ff9a7f918de..8a1dede4fe6c 100644 --- a/.github/workflows/pwwpnow.yml +++ b/.github/workflows/pwwpnow.yml @@ -36,10 +36,10 @@ 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: From 147e660c5d836e383f86d2d3102d0c9bc8e4bea9 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Fri, 29 Nov 2024 15:57:52 +0200 Subject: [PATCH 03/17] wip --- .github/workflows/pwwpnow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pwwpnow.yml b/.github/workflows/pwwpnow.yml index 8a1dede4fe6c..b67883f5c14a 100644 --- a/.github/workflows/pwwpnow.yml +++ b/.github/workflows/pwwpnow.yml @@ -122,7 +122,6 @@ jobs: # 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" From 98959fa5e445f031ca9137c00a534d0616f6447f Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Fri, 29 Nov 2024 16:10:43 +0200 Subject: [PATCH 04/17] wip --- .github/workflows/pwwpnow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pwwpnow.yml b/.github/workflows/pwwpnow.yml index b67883f5c14a..c9d16b357f75 100644 --- a/.github/workflows/pwwpnow.yml +++ b/.github/workflows/pwwpnow.yml @@ -122,9 +122,9 @@ jobs: # 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: 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 From 314791b1dbc3eb60f7a9af54e721d6736e0c0fc2 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 08:10:44 +0200 Subject: [PATCH 05/17] wip1 --- .github/workflows/pwwpnow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pwwpnow.yml b/.github/workflows/pwwpnow.yml index c9d16b357f75..a9a3a6df2190 100644 --- a/.github/workflows/pwwpnow.yml +++ b/.github/workflows/pwwpnow.yml @@ -127,7 +127,6 @@ jobs: # 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: From b669bf943e4eab69a999ded990cb24004a71944d Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 08:13:40 +0200 Subject: [PATCH 06/17] wip2 --- .github/workflows/playwright-wp-now-new.yml | 197 ++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 .github/workflows/playwright-wp-now-new.yml diff --git a/.github/workflows/playwright-wp-now-new.yml b/.github/workflows/playwright-wp-now-new.yml new file mode 100644 index 000000000000..79064439f46f --- /dev/null +++ b/.github/workflows/playwright-wp-now-new.yml @@ -0,0 +1,197 @@ +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,list + - 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 + +# 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: + if: startsWith( github.repository, 'elementor/' ) + name: Build Elementor Pro + uses: ./.github/workflows/build.yml + + Playwright: + name: Playwright test - ${{ matrix.shardIndex }} on PHP 7.4 + needs: [build-plugin] + if: ${{ github.event.pull_request.title == null || needs.build-plugin.outputs.changelog_diff }} + runs-on: ubuntu-22.04 + strategy: + fail-fast: ${{ inputs.fail_fast || false }} + matrix: + shardIndex: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 ] + shardTotal: [ 50 ] + include: + - shardIndex: "plugin-tester" + - shardIndex: "loop_taxonomy" + - shardIndex: "taxonomy_filter_1" + - shardIndex: "taxonomy_filter_2" + - shardIndex: "taxonomy_filter_3" + - shardIndex: "wc_archive_styling_1" + - shardIndex: "wc_archive_styling_2" + - shardIndex: "wc_product_styling_1" + - shardIndex: "wc_product_styling_2" + steps: + - name: Checkout source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: 'npm' + - name: Install Dependencies + run: | + export PUPPETEER_SKIP_DOWNLOAD=true + 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 Elementor Pro build artifact + uses: actions/download-artifact@v4 + with: + name: ${{ needs.build-plugin.outputs.artifact_name }} + path: ./ + - name: Unzip Elementor Pro + run: unzip -q ${{ needs.build-plugin.outputs.artifact_name }}.zip + - name: Download and unzip Elementor Core + run: | + curl --location -o ./elementor-core.zip https://downloads.wordpress.org/plugin/elementor.latest-stable.zip + unzip -q ./elementor-core.zip + - name: Install WordPress environment + run: | + npx wp-now start --php=8.0 --port=8888 --blueprint=./blueprint.json & + # - 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: Import Sample Data + # run: | + # npm run import-sample-data + # - name: Import Taxonomy Sample Data + # run: | + # npm run import-taxonomy-sample-data + - name: Run SQL query to activate Pro + env: + E2E_PRO_LICENSE: ${{ secrets.E2E_PRO_LICENSE }} + run: | + node ./.github/scripts/playwright-sql-query.js + npx wp-env run cli wp db query < query.sql + - name: Activate performance experiments + run: | + npx wp-env run cli bash -c 'bash elementor-config/setup-experiments.sh' + - name: Reset DB properties + run: | + npx wp-env run cli bash -c 'bash elementor-config/reset-db-props.sh' + - name: Deactivate plugins + run: | + npm run deactivate-plugins + - name: WordPress debug information + run: | + ls -l + # npx wp-env run cli wp plugin list + # npx wp-env run cli wp core version + # npx wp-env run cli wp --info + - name: Test setup for plugin tester + if: ${{ matrix.shardIndex == 'plugin-tester' }} + run: npm run test:setup + - name: Install playwright/test + run: npx playwright install chromium + - name: Run Playwright Plugin Tester + if: ${{ matrix.shardIndex == 'plugin-tester' }} + run: npm run test:playwright -- --grep=@pluginTester --reporter=${{ inputs.reporter || 'list,github' }} + - name: Run Playwright tests + if: ${{ + matrix.shardIndex != 'plugin-tester' && + matrix.shardIndex != 'loop_taxonomy' && + matrix.shardIndex != 'taxonomy_filter_1' && + matrix.shardIndex != 'taxonomy_filter_2' && + matrix.shardIndex != 'taxonomy_filter_3' && + matrix.shardIndex != 'wc_archive_styling_1' && + matrix.shardIndex != 'wc_archive_styling_2' && + matrix.shardIndex != 'wc_product_styling_1' && + matrix.shardIndex != 'wc_product_styling_2' + }} + run: npm run test:playwright -- --grep-invert="@latest|@pluginTester|@essentialLicense|@loop_taxonomy|@taxonomyFilter|@woocommerce-archive|@woocommerce-product" --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=${{ inputs.reporter || 'list,github' }} + - name: Run Playwright Loop Taxonomy tests + if: ${{ matrix.shardIndex == 'loop_taxonomy' }} + run: npm run test:playwright -- --grep="@loop_taxonomy" --reporter=${{ inputs.reporter || 'list,github' }} + - name: Run Playwright Taxonomy Filter 1 tests + if: ${{ matrix.shardIndex == 'taxonomy_filter_1' }} + run: npm run test:playwright -- --grep="@taxonomyFilter-1" --reporter=${{ inputs.reporter || 'list,github' }} + - name: Run Playwright Taxonomy Filter 2 tests + if: ${{ matrix.shardIndex == 'taxonomy_filter_2' }} + run: npm run test:playwright -- --grep="@taxonomyFilter-2" --reporter=${{ inputs.reporter || 'list,github' }} + - name: Run Playwright Taxonomy Filter 3 tests + if: ${{ matrix.shardIndex == 'taxonomy_filter_3' }} + run: npm run test:playwright -- --grep="@taxonomyFilter-3" --reporter=${{ inputs.reporter || 'list,github' }} + - name: Run Playwright WooCommerce archive styling tests - 1 + if: ${{ matrix.shardIndex == 'wc_archive_styling_1' }} + run: npm run test:playwright -- --grep="@woocommerce-archive-1" --reporter=${{ inputs.reporter || 'list,github' }} + - name: Run Playwright WooCommerce archive styling tests - 2 + if: ${{ matrix.shardIndex == 'wc_archive_styling_2' }} + run: npm run test:playwright -- --grep="@woocommerce-archive-2" --reporter=${{ inputs.reporter || 'list,github' }} + - name: Run Playwright WooCommerce product styling tests - 1 + if: ${{ matrix.shardIndex == 'wc_product_styling_1' }} + run: npm run test:playwright -- --grep="@woocommerce-product-1" --reporter=${{ inputs.reporter || 'list,github' }} + - name: Run Playwright WooCommerce product styling tests - 2 + if: ${{ matrix.shardIndex == 'wc_product_styling_2' }} + run: npm run test:playwright -- --grep="@woocommerce-product-2" --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/' }} + retention-days: 3 + if-no-files-found: ignore + + 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: Check Playwright matrix status + if: ${{ needs.Playwright.result != 'success' && needs.Playwright.result != 'skipped' }} + run: exit 1 From 407edcaa875eeb9f1c0272b189b5cde923107023 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 08:17:30 +0200 Subject: [PATCH 07/17] wip --- .github/workflows/playwright-wp-now-new.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright-wp-now-new.yml b/.github/workflows/playwright-wp-now-new.yml index 79064439f46f..5e98454a1c44 100644 --- a/.github/workflows/playwright-wp-now-new.yml +++ b/.github/workflows/playwright-wp-now-new.yml @@ -43,7 +43,7 @@ concurrency: jobs: build-plugin: - if: startsWith( github.repository, 'elementor/' ) +# if: startsWith( github.repository, 'elementor/' ) name: Build Elementor Pro uses: ./.github/workflows/build.yml From 5b787fb087c402335ddae3d6f930b53dc98cfdf6 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 08:21:26 +0200 Subject: [PATCH 08/17] wip3 --- .github/workflows/playwright-wp-now-new.yml | 223 ++++++++++---------- 1 file changed, 114 insertions(+), 109 deletions(-) diff --git a/.github/workflows/playwright-wp-now-new.yml b/.github/workflows/playwright-wp-now-new.yml index 5e98454a1c44..c078308e6bcd 100644 --- a/.github/workflows/playwright-wp-now-new.yml +++ b/.github/workflows/playwright-wp-now-new.yml @@ -1,4 +1,4 @@ -name: Playwright wp-now new +name: Playwright on: pull_request: @@ -9,6 +9,8 @@ on: - 'bin/**' - '.gitignore' - 'docs/**' + schedule: + - cron: '30 08 * * 0,1,2,3,4,5' workflow_dispatch: inputs: reporter: @@ -16,7 +18,7 @@ on: description: 'Select a reporter' type: choice options: - - allure-playwright,list + - allure-playwright - html - blob - list @@ -35,6 +37,9 @@ on: 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: @@ -43,146 +48,124 @@ concurrency: jobs: build-plugin: -# if: startsWith( github.repository, 'elementor/' ) - name: Build Elementor Pro + name: Build plugin uses: ./.github/workflows/build.yml - Playwright: - name: Playwright test - ${{ matrix.shardIndex }} on PHP 7.4 + 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 }} - runs-on: ubuntu-22.04 + 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, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 ] - shardTotal: [ 50 ] + shardIndex: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] + shardTotal: [ 10 ] include: - - shardIndex: "plugin-tester" - - shardIndex: "loop_taxonomy" - - shardIndex: "taxonomy_filter_1" - - shardIndex: "taxonomy_filter_2" - - shardIndex: "taxonomy_filter_3" - - shardIndex: "wc_archive_styling_1" - - shardIndex: "wc_archive_styling_2" - - shardIndex: "wc_product_styling_1" - - shardIndex: "wc_product_styling_2" + - shardIndex: "elements-regression" steps: - name: Checkout source code uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Install Node.js 20.x uses: actions/setup-node@v4 with: node-version: 20.x cache: 'npm' - - name: Install Dependencies + - name: Install dependencies run: | - export PUPPETEER_SKIP_DOWNLOAD=true 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 Elementor Pro build artifact + - name: Download build artifact uses: actions/download-artifact@v4 with: name: ${{ needs.build-plugin.outputs.artifact_name }} - path: ./ - - name: Unzip Elementor Pro - run: unzip -q ${{ needs.build-plugin.outputs.artifact_name }}.zip - - name: Download and unzip Elementor Core - run: | - curl --location -o ./elementor-core.zip https://downloads.wordpress.org/plugin/elementor.latest-stable.zip - unzip -q ./elementor-core.zip + 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 run: | npx wp-now start --php=8.0 --port=8888 --blueprint=./blueprint.json & - # - 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: Import Sample Data - # run: | - # npm run import-sample-data - # - name: Import Taxonomy Sample Data - # run: | - # npm run import-taxonomy-sample-data - - name: Run SQL query to activate Pro - env: - E2E_PRO_LICENSE: ${{ secrets.E2E_PRO_LICENSE }} - run: | - node ./.github/scripts/playwright-sql-query.js - npx wp-env run cli wp db query < query.sql - - name: Activate performance experiments + + - name: Install playwright/test run: | - npx wp-env run cli bash -c 'bash elementor-config/setup-experiments.sh' - - name: Reset DB properties + 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: | - npx wp-env run cli bash -c 'bash elementor-config/reset-db-props.sh' - - name: Deactivate plugins + 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 deactivate-plugins + npm run start-local-server + - name: Setup test data + run: npm run test:setup:playwright - name: WordPress debug information run: | - ls -l - # npx wp-env run cli wp plugin list - # npx wp-env run cli wp core version - # npx wp-env run cli wp --info - - name: Test setup for plugin tester - if: ${{ matrix.shardIndex == 'plugin-tester' }} - run: npm run test:setup + 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 Plugin Tester - if: ${{ matrix.shardIndex == 'plugin-tester' }} - run: npm run test:playwright -- --grep=@pluginTester --reporter=${{ inputs.reporter || 'list,github' }} + run: | + npx playwright install chromium - name: Run Playwright tests - if: ${{ - matrix.shardIndex != 'plugin-tester' && - matrix.shardIndex != 'loop_taxonomy' && - matrix.shardIndex != 'taxonomy_filter_1' && - matrix.shardIndex != 'taxonomy_filter_2' && - matrix.shardIndex != 'taxonomy_filter_3' && - matrix.shardIndex != 'wc_archive_styling_1' && - matrix.shardIndex != 'wc_archive_styling_2' && - matrix.shardIndex != 'wc_product_styling_1' && - matrix.shardIndex != 'wc_product_styling_2' - }} - run: npm run test:playwright -- --grep-invert="@latest|@pluginTester|@essentialLicense|@loop_taxonomy|@taxonomyFilter|@woocommerce-archive|@woocommerce-product" --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=${{ inputs.reporter || 'list,github' }} - - name: Run Playwright Loop Taxonomy tests - if: ${{ matrix.shardIndex == 'loop_taxonomy' }} - run: npm run test:playwright -- --grep="@loop_taxonomy" --reporter=${{ inputs.reporter || 'list,github' }} - - name: Run Playwright Taxonomy Filter 1 tests - if: ${{ matrix.shardIndex == 'taxonomy_filter_1' }} - run: npm run test:playwright -- --grep="@taxonomyFilter-1" --reporter=${{ inputs.reporter || 'list,github' }} - - name: Run Playwright Taxonomy Filter 2 tests - if: ${{ matrix.shardIndex == 'taxonomy_filter_2' }} - run: npm run test:playwright -- --grep="@taxonomyFilter-2" --reporter=${{ inputs.reporter || 'list,github' }} - - name: Run Playwright Taxonomy Filter 3 tests - if: ${{ matrix.shardIndex == 'taxonomy_filter_3' }} - run: npm run test:playwright -- --grep="@taxonomyFilter-3" --reporter=${{ inputs.reporter || 'list,github' }} - - name: Run Playwright WooCommerce archive styling tests - 1 - if: ${{ matrix.shardIndex == 'wc_archive_styling_1' }} - run: npm run test:playwright -- --grep="@woocommerce-archive-1" --reporter=${{ inputs.reporter || 'list,github' }} - - name: Run Playwright WooCommerce archive styling tests - 2 - if: ${{ matrix.shardIndex == 'wc_archive_styling_2' }} - run: npm run test:playwright -- --grep="@woocommerce-archive-2" --reporter=${{ inputs.reporter || 'list,github' }} - - name: Run Playwright WooCommerce product styling tests - 1 - if: ${{ matrix.shardIndex == 'wc_product_styling_1' }} - run: npm run test:playwright -- --grep="@woocommerce-product-1" --reporter=${{ inputs.reporter || 'list,github' }} - - name: Run Playwright WooCommerce product styling tests - 2 - if: ${{ matrix.shardIndex == 'wc_product_styling_2' }} - run: npm run test:playwright -- --grep="@woocommerce-product-2" --reporter=${{ inputs.reporter || 'list,github' }} + run: | + npm run test:playwright -- --grep="${{ inputs.tag }}" --reporter=list,allure-playwright - uses: actions/upload-artifact@v4 if: always() with: - name: playwright-test-results-${{ matrix.shardIndex }} + name: playwright-test-results-tagged-tests path: ${{ inputs.path-to-results || 'test-results/' }} - retention-days: 3 if-no-files-found: ignore + retention-days: 2 + test-result: needs: Playwright @@ -192,6 +175,28 @@ jobs: steps: - name: Test status run: echo "Test status is - ${{ needs.Playwright.result }}" - - name: Check Playwright matrix status - if: ${{ needs.Playwright.result != 'success' && needs.Playwright.result != 'skipped' }} - run: exit 1 + - 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 From 491e4414295e788d22c3d3e972471a056be693a7 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 08:22:56 +0200 Subject: [PATCH 09/17] wip --- .github/workflows/playwright-wp-now-new.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright-wp-now-new.yml b/.github/workflows/playwright-wp-now-new.yml index c078308e6bcd..8f9379118ef3 100644 --- a/.github/workflows/playwright-wp-now-new.yml +++ b/.github/workflows/playwright-wp-now-new.yml @@ -1,4 +1,4 @@ -name: Playwright +name: Playwright wp-now new on: pull_request: From 4ec5a926578a1247ddd3ed099a57ecffcf657052 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 08:34:11 +0200 Subject: [PATCH 10/17] wip --- .github/workflows/playwright-wp-now-new.yml | 2 -- .github/workflows/pwwpnow.yml | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/playwright-wp-now-new.yml b/.github/workflows/playwright-wp-now-new.yml index 8f9379118ef3..3de876c84324 100644 --- a/.github/workflows/playwright-wp-now-new.yml +++ b/.github/workflows/playwright-wp-now-new.yml @@ -9,8 +9,6 @@ on: - 'bin/**' - '.gitignore' - 'docs/**' - schedule: - - cron: '30 08 * * 0,1,2,3,4,5' workflow_dispatch: inputs: reporter: diff --git a/.github/workflows/pwwpnow.yml b/.github/workflows/pwwpnow.yml index a9a3a6df2190..15a79c695a4f 100644 --- a/.github/workflows/pwwpnow.yml +++ b/.github/workflows/pwwpnow.yml @@ -47,7 +47,9 @@ jobs: 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 @@ -113,7 +115,9 @@ 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 & From 020180ee96cf89b7ee5dfc4efeead99d4829af78 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 08:49:23 +0200 Subject: [PATCH 11/17] wip4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0db93d8e1cd6..656331b77e6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} From 076d9c66e399189463f2f6e260066136892e2ed3 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 09:06:37 +0200 Subject: [PATCH 12/17] fix blueprint --- blueprint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprint.json b/blueprint.json index 7e0c07f7b783..ccf8003af074 100644 --- a/blueprint.json +++ b/blueprint.json @@ -27,7 +27,7 @@ { "step": "activatePlugin", "pluginName": "elementor", - "pluginPath": ".elementor/build/" + "pluginPath": "elementor/build/" }, { "step": "login", From 5ae7c26f017a9261a3dc36aeaa1ddc84cc4cff4f Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 09:10:23 +0200 Subject: [PATCH 13/17] two instances in the same time --- .github/workflows/playwright-wp-now-new.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/playwright-wp-now-new.yml b/.github/workflows/playwright-wp-now-new.yml index 3de876c84324..a02286b8a229 100644 --- a/.github/workflows/playwright-wp-now-new.yml +++ b/.github/workflows/playwright-wp-now-new.yml @@ -96,7 +96,8 @@ jobs: # npx wp-env run cli wp --info - name: Install WordPress environment run: | - npx wp-now start --php=8.0 --port=8888 --blueprint=./blueprint.json & + npx wp-now start --php=8.0 --port=8888 --blueprint=./blueprint.json + npx wp-now start --php=8.0 --port=8889 --blueprint=./blueprint.json - name: Install playwright/test run: | From 0606cb28e9f4fd141611b298d09a89f02cb8b864 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 09:18:46 +0200 Subject: [PATCH 14/17] Composer install --- .github/workflows/playwright-wp-now-new.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/playwright-wp-now-new.yml b/.github/workflows/playwright-wp-now-new.yml index a02286b8a229..2afc0f083a3e 100644 --- a/.github/workflows/playwright-wp-now-new.yml +++ b/.github/workflows/playwright-wp-now-new.yml @@ -70,6 +70,7 @@ jobs: 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 From 219ac216b9d0712af9a623f2b68990b1a6a35c6d Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 09:29:42 +0200 Subject: [PATCH 15/17] wip --- .github/workflows/playwright-wp-now-new.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/playwright-wp-now-new.yml b/.github/workflows/playwright-wp-now-new.yml index 2afc0f083a3e..a7fa35e3323e 100644 --- a/.github/workflows/playwright-wp-now-new.yml +++ b/.github/workflows/playwright-wp-now-new.yml @@ -98,8 +98,9 @@ jobs: - name: Install WordPress environment run: | npx wp-now start --php=8.0 --port=8888 --blueprint=./blueprint.json + - name: Install WordPress environment + run: | npx wp-now start --php=8.0 --port=8889 --blueprint=./blueprint.json - - name: Install playwright/test run: | npx playwright install chromium From 21535a15a347022571486b13de5a9b84fe417818 Mon Sep 17 00:00:00 2001 From: David Seveloff Date: Sun, 1 Dec 2024 09:45:10 +0200 Subject: [PATCH 16/17] wip --- .github/workflows/playwright-wp-now-new.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright-wp-now-new.yml b/.github/workflows/playwright-wp-now-new.yml index a7fa35e3323e..230955079700 100644 --- a/.github/workflows/playwright-wp-now-new.yml +++ b/.github/workflows/playwright-wp-now-new.yml @@ -95,10 +95,10 @@ jobs: # run: | # npx wp-env run cli wp core version # npx wp-env run cli wp --info - - name: Install WordPress environment + - name: Install WordPress environment 8888 run: | npx wp-now start --php=8.0 --port=8888 --blueprint=./blueprint.json - - name: Install WordPress environment + - name: Install WordPress environment 8889 run: | npx wp-now start --php=8.0 --port=8889 --blueprint=./blueprint.json - name: Install playwright/test From fe64c12e7b8416447a567df8e2e94063dc6d20d3 Mon Sep 17 00:00:00 2001 From: Davids Seveloff <94905340+davseve@users.noreply.github.com> Date: Tue, 24 Dec 2024 10:07:18 +0200 Subject: [PATCH 17/17] Update playwright-wp-now-new.yml --- .github/workflows/playwright-wp-now-new.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright-wp-now-new.yml b/.github/workflows/playwright-wp-now-new.yml index 230955079700..ea1d49731a44 100644 --- a/.github/workflows/playwright-wp-now-new.yml +++ b/.github/workflows/playwright-wp-now-new.yml @@ -97,10 +97,10 @@ jobs: # 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 + 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 + npx wp-now start --php=8.0 --port=8889 --blueprint=./blueprint.json & - name: Install playwright/test run: | npx playwright install chromium