Skip to content

Commit b9d735e

Browse files
Merge branch 'dev/PCP-6288-cc-integration' into dev/PCP-6288-cc-unit-test-rules
2 parents 0686888 + d63383e commit b9d735e

898 files changed

Lines changed: 83806 additions & 86302 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.distignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,16 @@ patchwork.json
3232
README.md
3333
AGENTS.md
3434
CLAUDE.md
35+
E2E-TESTS.md
3536
wordpress_org_assets*
3637
.DS_Store
3738
auth.json
3839
*.log
3940
scoper.inc.php
4041
jsconfig.json
42+
.eslintignore
43+
.wp-env.json
44+
playwright.config.ts
45+
tsconfig.json
46+
wp-cli.yml
47+
.npmrc
File renamed without changes.

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
# Global owners - will be requested for review on all changes
66
# @Dinamiko is listed first as dev lead, followed by team members in alphabetical order
7-
* @Dinamiko @AlexP11223 @danieldudzic @hmouhtar @mmaymo @Narek13 @stracker-phil
7+
* @Dinamiko @AlexP11223 @danieldudzic @mmaymo @Narek13 @stracker-phil
88

99
# You can also add specific patterns for different parts of the codebase:
1010
# Examples (uncomment and modify as needed):
1111
# /src/ @Dinamiko @stracker-phil
12-
# /tests/ @AlexP11223 @hmouhtar
12+
# /tests/ @AlexP11223
1313
# /assets/ @danieldudzic
1414
# /.github/workflows/ @Narek13
1515
# /docs/ @Dinamiko

.github/workflows-config/typos.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ extend-exclude = [
66
"stubs/",
77
"tests/",
88
# German
9-
"modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php",
9+
"modules/ppcp-local-alternative-payment-methods/src/PayUponInvoice/",
10+
"modules/ppcp-local-alternative-payment-methods/resources/js/pui-payment-method.js",
1011
# Files outside the repository
1112
"node_modules/",
1213
"vendor/",

.github/workflows/build-and-distribute.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
GITHUB_USER_NAME: ${{ secrets.DEPLOYBOT_USER }}
3232
GITHUB_USER_SSH_KEY: ${{ secrets.DEPLOYBOT_SSH_PRIVATE_KEY }}
3333
GITHUB_USER_SSH_PUBLIC_KEY: ${{ secrets.DEPLOYBOT_SSH_PUBLIC_KEY }}
34+
NPM_REGISTRY_TOKEN: ${{ secrets.DEPLOYBOT_GITHUB_TOKEN_PACKAGES }}
3435
with:
3536
PACKAGE_VERSION: ${{ inputs.PACKAGE_VERSION }}
3637
NODE_VERSION: 22

.github/workflows/e2e-tests.yml

Lines changed: 93 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,47 @@
11
name: E2E Tests
22

33
on:
4+
workflow_run:
5+
workflows: [ "Build and distribute" ]
6+
types: [ completed ]
7+
branches: [ dev/develop ]
48
workflow_dispatch:
59
inputs:
610
TEST_SUITE:
711
description: 'Test suite'
812
required: true
9-
default: 'e2e:test:dev'
13+
default: 'smoke:parallel'
1014
type: choice
1115
options:
12-
- e2e:test:plugin-foundation
13-
- e2e:test:dev
14-
- e2e:test:smoke
15-
- e2e:test:critical
16-
- e2e:test:stress
17-
- e2e:test:all
16+
- all:parallel
17+
- smoke:parallel
18+
- critical:parallel
19+
- shard:plugin-foundation
20+
- shard:onboarding
21+
- shard:settings
22+
- shard:transaction-usa
23+
- shard:transaction-mexico
24+
- shard:transaction-germany
25+
- shard:refund
26+
- shard:vaulting
27+
- shard:subscription
28+
- stress
1829
XRAY_TEST_EXEC_KEY:
1930
description: 'Xray Test Execution Key'
2031
required: false
2132
default: ''
2233
type: string
2334

2435
concurrency:
25-
group: ${{ github.workflow }}-${{ github.ref }}
36+
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.ref }}
2637
cancel-in-progress: true
2738

2839
jobs:
2940
build:
3041
name: Build tested plugin package
42+
if: >-
43+
github.event_name == 'workflow_dispatch' ||
44+
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
3145
uses: inpsyde/reusable-workflows/.github/workflows/build-and-distribute.yml@main
3246
secrets:
3347
GITHUB_USER_EMAIL: ${{ secrets.DEPLOYBOT_EMAIL }}
@@ -39,38 +53,87 @@ jobs:
3953
PACKAGE_NAME: woocommerce-paypal-payments
4054
NODE_VERSION: 22
4155

56+
resolve-playwright-matrix:
57+
name: Resolve Playwright matrix
58+
runs-on: ubuntu-latest
59+
if: >-
60+
github.event_name == 'workflow_dispatch' ||
61+
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
62+
outputs:
63+
matrix: ${{ steps.resolve.outputs.matrix }}
64+
steps:
65+
- name: Resolve test scripts
66+
id: resolve
67+
shell: bash
68+
run: |
69+
SHARDS=(
70+
plugin-foundation
71+
onboarding
72+
settings
73+
transaction-usa
74+
transaction-mexico
75+
transaction-germany
76+
refund
77+
vaulting
78+
subscription
79+
)
80+
81+
TEST_SUITE='${{ inputs.TEST_SUITE || 'smoke:parallel' }}'
82+
83+
if [[ "$TEST_SUITE" == *':parallel' ]]; then
84+
SUFFIX=""
85+
[[ "$TEST_SUITE" != "all:parallel" ]] && SUFFIX=":${TEST_SUITE%:parallel}"
86+
87+
entry() { echo "{\"script\":\"e2e:test:shard:${1}${SUFFIX}\",\"name_suffix\":\" / ${1}\",\"artifact_name\":\"playwright-artifact-${1}\"}"; }
88+
89+
ITEMS=()
90+
for shard in "${SHARDS[@]}"; do
91+
ITEMS+=("$(entry "$shard")")
92+
done
93+
JOINED=$(IFS=,; echo "${ITEMS[*]}")
94+
95+
echo "matrix={\"include\":[${JOINED}]}" >> "$GITHUB_OUTPUT"
96+
else
97+
NAME="${TEST_SUITE#shard:}"
98+
echo "matrix={\"include\":[{\"script\":\"e2e:test:${TEST_SUITE}\",\"name_suffix\":\" / ${NAME}\",\"artifact_name\":\"playwright-artifact-${NAME}\"}]}" >> "$GITHUB_OUTPUT"
99+
fi
100+
42101
e2e-playwright:
43-
name: Run Playwright E2E Tests
44-
needs: build
45-
uses: inpsyde/reusable-workflows/.github/workflows/test-playwright.yml@fix/test-playwright
102+
name: Run Playwright E2E Tests${{ matrix.name_suffix }}
103+
needs:
104+
- build
105+
- resolve-playwright-matrix
106+
strategy:
107+
fail-fast: false
108+
matrix: ${{ fromJson(needs.resolve-playwright-matrix.outputs.matrix) }}
109+
uses: inpsyde/reusable-workflows/.github/workflows/test-playwright.yml@main
46110
with:
47-
WORK_DIR: tests/qa
48-
PLAYWRIGHT_SCRIPT: ${{ inputs.TEST_SUITE }}
49-
ARTIFACT_PATH: |
50-
tests/qa/artifacts/*
51-
tests/qa/playwright-report/
52-
tests/qa/test-results/
53-
ARTIFACT_INCLUDE_HIDDEN_FILES: true
111+
PLAYWRIGHT_SCRIPT: ${{ matrix.script }}
112+
PLAYWRIGHT_ARTIFACT_NAME: ${{ matrix.artifact_name }}
113+
PLAYWRIGHT_ARTIFACT_PATH: |
114+
artifacts/*
115+
playwright-report/
116+
test-results/
117+
PLAYWRIGHT_ARTIFACT_INCLUDE_HIDDEN_FILES: true
54118
NODE_VERSION: 22
55119
PLAYWRIGHT_BROWSER_ARGS: 'chromium --with-deps'
56120
XRAY_TEST_EXEC_KEY: ${{ inputs.XRAY_TEST_EXEC_KEY }}
57121
PRE_SCRIPT: |
58122
# 1. Download and unzip the built plugin
59-
gh run download ${{ github.run_id }} -p "woocommerce-paypal-payments-*" -D resources/files
60-
pushd resources/files
61-
mv woocommerce-paypal-payments-*/woocommerce-paypal-payments .
62-
zip -r woocommerce-paypal-payments.zip woocommerce-paypal-payments
63-
rm -rf woocommerce-paypal-payments woocommerce-paypal-payments-*/
64-
popd
123+
gh run download ${{ github.run_id }} -p "woocommerce-paypal-payments-*" -D tests/qa/resources/files
124+
(
125+
cd tests/qa/resources/files
126+
mv woocommerce-paypal-payments-*/woocommerce-paypal-payments .
127+
zip -rq woocommerce-paypal-payments.zip woocommerce-paypal-payments
128+
rm -rf woocommerce-paypal-payments woocommerce-paypal-payments-*/
129+
)
65130
66131
# 2. Add private composer repository and download WooCommerce Subscriptions
67-
pushd ../../
132+
# Pinned below 9.0.0: that release folded "All Products for Subscriptions" into
133+
# core and replaced the legacy `type: subscription` + `_subscription_*` meta
134+
# product-creation API our test data relies on with a plan-based model.
68135
composer config repositories.repo-name composer https://repo.packagist.com/inpsyde/payment-gateways/
69-
composer require inpsyde-mirror/woocommerce-subscriptions
70-
popd
71-
72-
# 3. Setup wp-env
73-
npm run e2e:setup:env
136+
composer require "inpsyde-mirror/woocommerce-subscriptions:<9.0"
74137
secrets:
75138
ENV_FILE_DATA: ${{ secrets.QA_ENV_FILE }}
76139
NPM_REGISTRY_TOKEN: ${{ secrets.DEPLOYBOT_GITHUB_TOKEN_PACKAGES }}

.github/workflows/js-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ jobs:
3535
uses: actions/setup-node@v4
3636
with:
3737
node-version: 20
38+
registry-url: https://npm.pkg.github.com
3839

3940
- name: Install dependencies
4041
run: npm ci
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.DEPLOYBOT_GITHUB_TOKEN_PACKAGES }}
4144

4245
- name: Run JavaScript unit tests
4346
run: npm run test:unit-js

.github/workflows/weekly-builds.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,30 @@ jobs:
106106
asset_name: woocommerce-paypal-payments-${{ needs.create-tag.outputs.weekly_tag }}.zip
107107
asset_content_type: application/zip
108108

109+
trigger-e2e:
110+
if: github.repository_owner == 'woocommerce'
111+
name: Trigger E2E tests (all:parallel)
112+
runs-on: ubuntu-latest
113+
needs: [ create-tag, build, deploy ]
114+
continue-on-error: true
115+
permissions:
116+
actions: write
117+
steps:
118+
- name: Trigger E2E workflow
119+
uses: actions/github-script@v7
120+
with:
121+
github-token: ${{ secrets.GITHUB_TOKEN }}
122+
script: |
123+
await github.rest.actions.createWorkflowDispatch({
124+
owner: context.repo.owner,
125+
repo: context.repo.repo,
126+
workflow_id: 'e2e-tests.yml',
127+
ref: process.env.SOURCE_REF,
128+
inputs: {
129+
TEST_SUITE: 'all:parallel',
130+
},
131+
});
132+
109133
notify-slack:
110134
if: always() && github.repository_owner == 'woocommerce'
111135
name: Send Slack notification

.gitignore

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,46 @@
1+
# Do not track private authentication details
2+
auth.json
3+
.npmrc
4+
.env*
5+
6+
# Exclude runtime artifacts by file types
7+
*.cache
8+
*.bak
9+
*.log
10+
*.zip
11+
.DS_Store
12+
13+
# Ignore IDE settings
14+
/.idea/
15+
.vscode
16+
117
/vendor/
218
/build/
3-
/.idea/
419
node_modules
5-
.phpunit.result.cache
6-
phpunit.xml.dist.bak
7-
yarn-error.log
820
modules/*/vendor/*
921
modules/*/assets/*
1022
!modules/ppcp-wc-gateway/assets/images
11-
*.zip
1223
!tests/qa/resources/files/*.zip
1324
!tests/qa-legacy-ui/resources/files/*.zip
14-
.env
15-
.env.integration
16-
auth.json
17-
.DS_Store
18-
tests/.DS_Store
25+
!.env.example*
1926
.composer_compiled_assets
2027
/coverage/
21-
assets
28+
/assets
29+
!modules/ppcp-local-alternative-payment-methods/assets/images
2230
tests/inc/inpsyde/
2331

2432
# Track Claude Code configuration.
2533
!.claude
2634

2735
# Ignore all kind of local files - settings.local.json, CLAUDE.local.md, ...
2836
*.local.*
37+
38+
# QA and tests
39+
playwright-utils
40+
playwright-report*
41+
snapshots
42+
storage-states
43+
test-results
44+
/tests/qa/resources/files/woocommerce-paypal-payments*.zip
45+
/tests/qa/resources/files/woocommerce-subscriptions*.zip
46+
.google-session.json

0 commit comments

Comments
 (0)