Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c8d87ff
WIP
mgascam Aug 8, 2025
b04bb13
Update e2e-test workflow to include blocks test group and adjust job …
mgascam Aug 8, 2025
ef41d8d
Refine e2e-test workflow comments to clarify blocks tests strategy fo…
mgascam Aug 11, 2025
1d8b8b1
Update e2e-test workflow to include skip_blocks parameter for legacy …
mgascam Aug 11, 2025
1e8d58d
Refine comments in e2e-test workflow to clarify block-based checkout …
mgascam Aug 12, 2025
c40d544
Update e2e-test workflow to include block-based checkout tests for L-…
mgascam Aug 12, 2025
fcfbd76
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Aug 13, 2025
ae31c90
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Aug 13, 2025
518769e
Add support for 'blocks' test group in E2E pull request workflow
mgascam Aug 13, 2025
e2c46cd
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Aug 13, 2025
a2220a1
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Aug 13, 2025
38c89e1
Amend docs
mgascam Aug 13, 2025
3f3e1c6
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Aug 13, 2025
b9e6b4e
Update e2e-test.yml to simplify SKIP_WC_BLOCKS_TESTS condition
mgascam Aug 13, 2025
c504b85
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Aug 13, 2025
530a068
Remove skips_blocks field
mgascam Aug 14, 2025
70199e9
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Aug 14, 2025
0712bdf
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Aug 14, 2025
ff14dc3
Merge remote-tracking branch 'origin/dev/woopmnt-5249-e2e-ensure-vers…
mgascam Aug 14, 2025
fd59905
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Aug 14, 2025
22f78b5
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Aug 14, 2025
c4ea9b6
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocom…
mgascam Sep 1, 2025
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
5 changes: 5 additions & 0 deletions .github/workflows/e2e-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
PHP_STABLE="8.3"
TEST_GROUPS_WCPAY="wcpay"
TEST_GROUPS_SUBSCRIPTIONS="subscriptions"
TEST_GROUPS_BLOCKS="blocks"
TEST_BRANCHES_MERCHANT="merchant"
TEST_BRANCHES_SHOPPER="shopper"

Expand All @@ -78,12 +79,14 @@ jobs:
MATRIX_ENTRIES+=("{\"woocommerce\":\"$L1_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$L1_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$L1_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$L1_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_BLOCKS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")

# Add latest with PHP 8.3
MATRIX_ENTRIES+=("{\"woocommerce\":\"latest\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"latest\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"latest\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"latest\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"latest\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_BLOCKS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")

# Convert array to JSON
MATRIX_INCLUDE=$(printf '%s\n' "${MATRIX_ENTRIES[@]}" | jq -s . -c)
Expand All @@ -105,6 +108,8 @@ jobs:
E2E_PHP_VERSION: ${{ matrix.php }}
E2E_GROUP: ${{ matrix.test_groups }}
E2E_BRANCH: ${{ matrix.test_branches }}
SKIP_WC_SUBSCRIPTIONS_TESTS: ${{ matrix.test_groups == 'blocks' && '1' || '' }}
SKIP_WC_ACTION_SCHEDULER_TESTS: ${{ matrix.test_groups == 'blocks' && '1' || '' }}

steps:
- name: Checkout WCPay repository
Expand Down
65 changes: 30 additions & 35 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,58 +62,71 @@ jobs:

# Create optimized matrix with selective PHP version testing
# Build matrix dynamically based on WC versions
#
# BLOCK-BASED CHECKOUT TESTS STRATEGY:
# - Run block-based checkout tests on current stable and newer WC versions where blocks support is mature
# - WC 7.7.0: NO block-based checkout tests (too old, limited support) - uses skip_blocks=1
# - WC L-1: YES block-based checkout tests (recent version with full block support)
# - WC latest: YES block-based checkout tests (current stable, full support)
# - WC beta: YES block-based checkout tests (newer version, test latest features)
# - WC RC: YES blocks tests (newest version, test upcoming release)

# Define common values to reduce repetition
PHP_LEGACY="7.3"
PHP_STABLE="8.3"
PHP_LATEST="8.4"
TEST_GROUPS_WCPAY="wcpay"
TEST_GROUPS_SUBSCRIPTIONS="subscriptions"
TEST_GROUPS_BLOCKS="blocks"
TEST_BRANCHES_MERCHANT="merchant"
TEST_BRANCHES_SHOPPER="shopper"

# Initialize empty matrix array
MATRIX_ENTRIES=()

# Add WC 7.7.0 with PHP 7.3 only (legacy)
MATRIX_ENTRIES+=("{\"woocommerce\":\"7.7.0\",\"php\":\"$PHP_LEGACY\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"7.7.0\",\"php\":\"$PHP_LEGACY\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"7.7.0\",\"php\":\"$PHP_LEGACY\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"7.7.0\",\"php\":\"$PHP_LEGACY\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
# Add WC 7.7.0 with PHP 7.3 only (legacy - NO blocks tests)
MATRIX_ENTRIES+=("{\"woocommerce\":\"7.7.0\",\"php\":\"$PHP_LEGACY\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\",\"skip_blocks\":\"1\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"7.7.0\",\"php\":\"$PHP_LEGACY\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\",\"skip_blocks\":\"1\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"7.7.0\",\"php\":\"$PHP_LEGACY\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\",\"skip_blocks\":\"1\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"7.7.0\",\"php\":\"$PHP_LEGACY\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\",\"skip_blocks\":\"1\"}")

# Add L-1 version with PHP 8.3 only
# Add L-1 version with PHP 8.3 only (INCLUDE blocks tests - recent version with full support)
MATRIX_ENTRIES+=("{\"woocommerce\":\"$L1_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$L1_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$L1_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$L1_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$L1_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_BLOCKS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")

# Add latest with PHP 8.3 only
# Add latest with PHP 8.3 (INCLUDE blocks tests - current stable, full support)
MATRIX_ENTRIES+=("{\"woocommerce\":\"latest\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"latest\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"latest\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"latest\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"latest\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_BLOCKS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")

# Add beta with PHP 8.3 only (only if beta version is available)
# Add beta with PHP 8.3 (INCLUDE blocks tests - newer version)
if [[ -n "$BETA_VERSION" ]]; then
MATRIX_ENTRIES+=("{\"woocommerce\":\"$BETA_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$BETA_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$BETA_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$BETA_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$BETA_VERSION\",\"php\":\"$PHP_STABLE\",\"test_groups\":\"$TEST_GROUPS_BLOCKS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
fi

# Add rc with PHP 8.4 only
# Add rc with PHP 8.4 (INCLUDE blocks tests - newest version)
MATRIX_ENTRIES+=("{\"woocommerce\":\"$RC_VERSION\",\"php\":\"$PHP_LATEST\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$RC_VERSION\",\"php\":\"$PHP_LATEST\",\"test_groups\":\"$TEST_GROUPS_WCPAY\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$RC_VERSION\",\"php\":\"$PHP_LATEST\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_MERCHANT\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$RC_VERSION\",\"php\":\"$PHP_LATEST\",\"test_groups\":\"$TEST_GROUPS_SUBSCRIPTIONS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")
MATRIX_ENTRIES+=("{\"woocommerce\":\"$RC_VERSION\",\"php\":\"$PHP_LATEST\",\"test_groups\":\"$TEST_GROUPS_BLOCKS\",\"test_branches\":\"$TEST_BRANCHES_SHOPPER\"}")

# Convert array to JSON
MATRIX_INCLUDE=$(printf '%s\n' "${MATRIX_ENTRIES[@]}" | jq -s . -c)

echo "matrix={\"include\":$MATRIX_INCLUDE}" >> $GITHUB_OUTPUT

# Run WCPay & subscriptions tests against specific WC versions with PHP variations
wcpay-subscriptions-tests:
# Run WCPay, subscriptions & blocks tests against specific WC versions with PHP variations
wcpay-subscriptions-blocks-tests:
runs-on: ubuntu-latest
needs: generate-matrix
strategy:
Expand All @@ -128,7 +141,9 @@ jobs:
E2E_PHP_VERSION: ${{ matrix.php }}
E2E_GROUP: ${{ matrix.test_groups }}
E2E_BRANCH: ${{ matrix.test_branches }}
SKIP_WC_BLOCKS_TESTS: 1 # skip running blocks tests
SKIP_WC_SUBSCRIPTIONS_TESTS: ${{ matrix.test_groups == 'blocks' && '1' || '' }}
SKIP_WC_ACTION_SCHEDULER_TESTS: ${{ matrix.test_groups == 'blocks' && '1' || '' }}
SKIP_WC_BLOCKS_TESTS: ${{ matrix.skip_blocks }}

steps:
- name: Checkout WCPay repository
Expand All @@ -144,38 +159,18 @@ jobs:
- name: Run tests, upload screenshots & logs
uses: ./.github/actions/e2e/run-log-tests

# Run tests against WC Checkout blocks & WC latest
# [TODO] Unskip blocks tests after investigating constant failures.
# blocks-tests:
# runs-on: ubuntu-latest
# name: WC - latest | blocks - shopper

# env:
# E2E_WP_VERSION: 'latest'
# E2E_WC_VERSION: 'latest'
# E2E_GROUP: 'blocks'
# E2E_BRANCH: 'shopper'
# SKIP_WC_SUBSCRIPTIONS_TESTS: 1 #skip installing & running subscriptions tests
# SKIP_WC_ACTION_SCHEDULER_TESTS: 1 #skip installing & running action scheduler tests

# steps:
# - name: Checkout WCPay repository
# uses: actions/checkout@v4

# - name: Setup E2E environment
# uses: ./.github/actions/e2e/env-setup

# - name: Run tests, upload screenshots & logs
# uses: ./.github/actions/e2e/run-log-tests

# Run tests against WP Nightly & WC latest
# This section tests new WordPress features with latest WC
# Blocks tests are included here since we're testing against WP nightly + WC latest
wp-nightly-tests:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
test_groups: [ 'wcpay', 'subscriptions' ] # [TODO] Unskip blocks tests after investigating constant failures.
test_groups: [ 'wcpay', 'subscriptions', 'blocks' ]
test_branches: [ 'merchant', 'shopper' ]

name: WP - nightly | WC - latest | ${{ matrix.test_groups }} - ${{ matrix.test_branches }}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ You can use the locator functionality to help correctly determine the locator sy

### Understanding Test Failures and Retries

When tests fail in CI, the retry mechanism automatically kicks in:
When tests fail in CI, Playwright's built-in retry mechanism automatically handles retries:

1. **Automatic retries**: Failed tests are automatically retried up to 2 times
2. **Retry logs**: Look for retry attempts in the test output
Expand Down
15 changes: 14 additions & 1 deletion tests/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config( { path: path.resolve( __dirname, '../e2e/config', 'local.env' ) } );

const { BASE_URL, NODE_ENV, E2E_GROUP, E2E_BRANCH } = process.env;

const validGroups = [ 'wcpay', 'subscriptions' ];
const validGroups = [ 'wcpay', 'subscriptions', 'blocks' ];
const validBranches = [ 'merchant', 'shopper' ];

const buildTestDir = ( group: string, branch: string ) => {
Expand All @@ -21,6 +21,14 @@ const buildTestDir = ( group: string, branch: string ) => {
return baseDir;
}

// Special handling for blocks tests - they are located in wcpay/shopper directory
if ( group === 'blocks' ) {
if ( ! branch || ! validBranches.includes( branch ) ) {
return `${ baseDir }\/wcpay`;
}
return `${ baseDir }\/wcpay\/${ branch }`;
}

if ( ! branch || ! validBranches.includes( branch ) ) {
return `${ baseDir }\/${ group }`;
}
Expand All @@ -31,6 +39,11 @@ const buildTestDir = ( group: string, branch: string ) => {
const getTestMatch = ( group: string, branch: string ) => {
const testDir = buildTestDir( group, branch );

// Special handling for blocks tests - filter for wc-blocks test files
if ( group === 'blocks' ) {
return new RegExp( `${ testDir }\/.*wc-blocks.*\.spec\.ts` );
}

return new RegExp( `${ testDir }\/.*\.spec\.ts` );
};

Expand Down