diff --git a/.eslintrc b/.eslintrc index 8e00567ca43..98c80c96018 100644 --- a/.eslintrc +++ b/.eslintrc @@ -21,8 +21,7 @@ "wcpaySettings": true, "page": true, "browser": true, - "context": true, - "jestPuppeteer": true + "context": true }, "settings": { "react": { diff --git a/.github/actions/e2e-pw/run-log-tests/action.yml b/.github/actions/e2e-pw/run-log-tests/action.yml index b8244fc375e..1cb524f9e77 100644 --- a/.github/actions/e2e-pw/run-log-tests/action.yml +++ b/.github/actions/e2e-pw/run-log-tests/action.yml @@ -8,7 +8,7 @@ runs: id: first_run_e2e_pw_tests # Use +e to trap errors when running E2E tests. shell: /bin/bash +e {0} - run: npm run test:e2e-pw-ci + run: npm run test:e2e-ci - uses: actions/upload-artifact@v4 if: always() with: diff --git a/.github/actions/e2e/atomic-prepare-and-run/action.yml b/.github/actions/e2e/atomic-prepare-and-run/action.yml index 83669e72f14..69e267a449f 100644 --- a/.github/actions/e2e/atomic-prepare-and-run/action.yml +++ b/.github/actions/e2e/atomic-prepare-and-run/action.yml @@ -25,5 +25,9 @@ runs: run: | mkdir screenshots + - name: Install Playwright + shell: bash + run: npx playwright install chromium + - name: "Run tests, upload screenshots & logs" uses: ./.github/actions/e2e/run-log-tests diff --git a/.github/actions/e2e/run-log-tests/action.yml b/.github/actions/e2e/run-log-tests/action.yml index 8707bc46394..f2f9a4b236e 100644 --- a/.github/actions/e2e/run-log-tests/action.yml +++ b/.github/actions/e2e/run-log-tests/action.yml @@ -9,10 +9,10 @@ runs: # Use +e to trap errors when running E2E tests. shell: /bin/bash +e {0} run: | - npm run test:e2e -- --json --outputFile="$E2E_RESULT_FILEPATH" --NODE_ENV="$NODE_ENV" + npm run test:e2e-ci if [[ -f "$E2E_RESULT_FILEPATH" ]]; then - E2E_NUM_FAILED_TEST_SUITES=$(cat "$E2E_RESULT_FILEPATH" | jq '.numFailedTestSuites') + E2E_NUM_FAILED_TEST_SUITES=$(cat "$E2E_RESULT_FILEPATH" | jq '.stats["unexpected"]') echo "FIRST_RUN_FAILED_TEST_SUITES=$(echo $E2E_NUM_FAILED_TEST_SUITES)" >> $GITHUB_OUTPUT if [[ ${E2E_NUM_FAILED_TEST_SUITES} -gt 0 ]]; then echo "::notice::${E2E_NUM_FAILED_TEST_SUITES} test suite(s) failed in the first run but we will try (it) them again in the second run." @@ -20,8 +20,7 @@ runs: fi else echo "FIRST_RUN_FAILED_TEST_SUITES=0" >> $GITHUB_OUTPUT - echo "::notice::${E2E_RESULT_FILEPATH} doesn't exist so results are unclear and we will not try again." - exit 1 + exit 0 fi # Retry failed E2E tests @@ -30,18 +29,17 @@ runs: shell: bash # Filter failed E2E files from the result JSON file, and re-run them. run: | - cat "$E2E_RESULT_FILEPATH" | jq '.testResults[] | select(.status == "failed") | .name' | xargs npm run test:e2e -- --NODE_ENV="$NODE_ENV" + npm run test:e2e-ci $(cat $E2E_RESULT_FILEPATH | jq -r '[.suites[] | (if has("suites") then .suites[] | .specs[] else .specs[] end) | select(.tests[].status == "unexpected") | .file] | unique | .[]') # Archive screenshots if any - name: Archive e2e test screenshots & logs - if: ${{ failure() }} + if: ${{ always() }} uses: actions/upload-artifact@v4 with: name: wp(${{ env.E2E_WP_VERSION }})-wc(${{ env.E2E_WC_VERSION }})-${{ env.E2E_GROUP }}-${{ env.E2E_BRANCH }} path: | - screenshots - tests/e2e/screenshots - tests/e2e/docker/wordpress/wp-content/debug.log + playwright-report/ + tests/e2e/test-results ${{ env.E2E_RESULT_FILEPATH }} if-no-files-found: ignore retention-days: 14 diff --git a/.github/workflows/e2e-pull-request.yml b/.github/workflows/e2e-pull-request.yml index e1226644daf..625f6ac578b 100644 --- a/.github/workflows/e2e-pull-request.yml +++ b/.github/workflows/e2e-pull-request.yml @@ -3,9 +3,8 @@ name: E2E Tests - Pull Request on: pull_request: branches: - # - develop - # - trunk - - dev/10240-update-npm-scripts # [TODO] Remove this line after the branch is merged. + - develop + - trunk workflow_dispatch: workflow_call: inputs: @@ -28,7 +27,7 @@ env: E2E_BLOG_TOKEN: ${{ secrets.E2E_BLOG_TOKEN }} E2E_USER_TOKEN: ${{ secrets.E2E_USER_TOKEN }} WC_E2E_SCREENSHOTS: 1 - E2E_SLACK_CHANNEL: ${{ secrets.E2E_SLACK_CHANNEL }} + E2E_SLACK_CHANNEL_ID: ${{ secrets.E2E_SLACK_CHANNEL_ID }} E2E_SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }} E2E_USE_LOCAL_SERVER: false E2E_RESULT_FILEPATH: 'tests/e2e/results.json' @@ -75,5 +74,9 @@ jobs: - name: Setup E2E environment uses: ./.github/actions/e2e/env-setup + - name: Install Playwright + shell: bash + run: npx playwright install chromium + - name: Run tests, upload screenshots & logs uses: ./.github/actions/e2e/run-log-tests diff --git a/.github/workflows/e2e-pw-pull-request.yml b/.github/workflows/e2e-pw-pull-request.yml index da6765fb51b..63e5edbb31b 100644 --- a/.github/workflows/e2e-pw-pull-request.yml +++ b/.github/workflows/e2e-pw-pull-request.yml @@ -27,7 +27,7 @@ env: E2E_BLOG_TOKEN: ${{ secrets.E2E_BLOG_TOKEN }} E2E_USER_TOKEN: ${{ secrets.E2E_USER_TOKEN }} WC_E2E_SCREENSHOTS: 1 - E2E_SLACK_CHANNEL: ${{ secrets.E2E_SLACK_CHANNEL }} + E2E_SLACK_CHANNEL_ID: ${{ secrets.E2E_SLACK_CHANNEL_ID }} E2E_SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }} E2E_USE_LOCAL_SERVER: false E2E_RESULT_FILEPATH: 'tests/e2e/results.json' @@ -71,4 +71,4 @@ jobs: run: npx playwright install chromium - name: Run tests, upload screenshots & logs - uses: ./.github/actions/e2e-pw/run-log-tests + uses: ./.github/actions/e2e/run-log-tests diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 1d1f0b1bd71..9360cb297a4 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -19,7 +19,7 @@ env: E2E_BLOG_TOKEN: ${{ secrets.E2E_BLOG_TOKEN }} E2E_USER_TOKEN: ${{ secrets.E2E_USER_TOKEN }} WC_E2E_SCREENSHOTS: 1 - E2E_SLACK_CHANNEL: ${{ secrets.E2E_SLACK_CHANNEL }} + E2E_SLACK_CHANNEL_ID: ${{ secrets.E2E_SLACK_CHANNEL_ID }} E2E_SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }} E2E_USE_LOCAL_SERVER: false E2E_RESULT_FILEPATH: 'tests/e2e/results.json' @@ -64,6 +64,10 @@ jobs: - name: Setup E2E environment uses: ./.github/actions/e2e/env-setup + - name: Install Playwright + shell: bash + run: npx playwright install chromium + - name: Run tests, upload screenshots & logs uses: ./.github/actions/e2e/run-log-tests @@ -116,5 +120,9 @@ jobs: - name: Setup E2E environment uses: ./.github/actions/e2e/env-setup + - name: Install Playwright + shell: bash + run: npx playwright install chromium + - name: Run tests, upload screenshots & logs uses: ./.github/actions/e2e/run-log-tests diff --git a/.github/workflows/e2e-tests-atomic.yml b/.github/workflows/e2e-tests-atomic.yml index be25eddd88a..206d2c7a8f3 100644 --- a/.github/workflows/e2e-tests-atomic.yml +++ b/.github/workflows/e2e-tests-atomic.yml @@ -6,7 +6,7 @@ on: env: WC_E2E_SCREENSHOTS: 1 - E2E_SLACK_CHANNEL: ${{ secrets.E2E_SLACK_CHANNEL }} + E2E_SLACK_CHANNEL_ID: ${{ secrets.E2E_SLACK_CHANNEL_ID }} E2E_SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }} E2E_WP_VERSION: 'nightly' E2E_WC_VERSION: 'latest' diff --git a/.gitignore b/.gitignore index 8a1b9da0119..0248c9744e8 100644 --- a/.gitignore +++ b/.gitignore @@ -85,16 +85,15 @@ local.env # Screenshots created locally when running e2e tests tests/e2e/screenshots -# E2E Performance test results +# E2E test results tests/e2e/reports - -# E2E Playwright /playwright-report/ /blob-report/ -tests/e2e-pw/.auth/ -tests/e2e-pw/test-results/ -tests/e2e-pw/playwright/.cache/ -tests/e2e-pw/tests/e2e-pw/.auth/* +tests/e2e/.auth/ +tests/e2e/test-results/ +tests/e2e/playwright/.cache/ +tests/e2e/tests/e2e/.auth/* + # Slate docs docs/rest-api/build/* diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs deleted file mode 100644 index 8c0e0bd08b6..00000000000 --- a/.puppeteerrc.cjs +++ /dev/null @@ -1,9 +0,0 @@ -const {join} = require('path'); - -/** - * @type {import("puppeteer").Configuration} - */ -module.exports = { - // Changes the cache location for Puppeteer. - cacheDirectory: join(__dirname, 'node_modules', '.cache', 'puppeteer'), -}; \ No newline at end of file diff --git a/assets/css/admin.css b/assets/css/admin.css index 7b6d75945de..7d120b47f08 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -67,6 +67,10 @@ background-image: url( '../images/cards/visa.svg' ); } +.payment-method__brand--alipay { + background-image: url( '../images/payment-methods/alipay-logo.svg' ); +} + .payment-method__brand--cartes_bancaires { background-image: url( '../images/cards/cartes_bancaires.svg' ); } @@ -135,6 +139,14 @@ background-image: url( '../images/payment-methods/klarna.svg' ); } +.payment-method__brand--grabpay { + background-image: url( '../images/payment-methods/grabpay.svg' ); +} + +.payment-method__brand--wechat_pay { + background-image: url( '../images/payment-methods/wechat-pay.svg' ); +} + .wc_gateways tr[data-gateway_id='woocommerce_payments'] .payment-method__icon { border: 1px solid #ddd; border-radius: 2px; diff --git a/assets/images/payment-method-icons/grabpay.svg b/assets/images/payment-method-icons/grabpay.svg new file mode 100644 index 00000000000..21c382f34b2 --- /dev/null +++ b/assets/images/payment-method-icons/grabpay.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/payment-method-icons/wechat-pay.svg b/assets/images/payment-method-icons/wechat-pay.svg new file mode 100644 index 00000000000..8ce9bc9e8c8 --- /dev/null +++ b/assets/images/payment-method-icons/wechat-pay.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/payment-methods/alipay-logo.svg b/assets/images/payment-methods/alipay-logo.svg new file mode 100644 index 00000000000..f9ce0c8b603 --- /dev/null +++ b/assets/images/payment-methods/alipay-logo.svg @@ -0,0 +1 @@ + diff --git a/assets/images/payment-methods/grabpay.svg b/assets/images/payment-methods/grabpay.svg new file mode 100644 index 00000000000..21c382f34b2 --- /dev/null +++ b/assets/images/payment-methods/grabpay.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/payment-methods/wechat-pay.svg b/assets/images/payment-methods/wechat-pay.svg new file mode 100644 index 00000000000..8ce9bc9e8c8 --- /dev/null +++ b/assets/images/payment-methods/wechat-pay.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/payment-methods/woopay.svg b/assets/images/payment-methods/woopay.svg deleted file mode 100644 index 4398c382d43..00000000000 --- a/assets/images/payment-methods/woopay.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bin/run-tests.sh b/bin/run-tests.sh index cf194d39079..7a2ac899263 100755 --- a/bin/run-tests.sh +++ b/bin/run-tests.sh @@ -28,7 +28,7 @@ if $WATCH_FLAG; then else echo "Running the tests..." - docker-compose exec -u www-data wordpress \ + docker compose exec -u www-data wordpress \ /var/www/html/wp-content/plugins/woocommerce-payments/vendor/bin/phpunit \ --configuration /var/www/html/wp-content/plugins/woocommerce-payments/phpunit.xml.dist \ $* diff --git a/bin/wcpay-live-branches/wcpay-live-branches.user.js b/bin/wcpay-live-branches/wcpay-live-branches.user.js index 73df0f3abca..100e5706a19 100644 --- a/bin/wcpay-live-branches/wcpay-live-branches.user.js +++ b/bin/wcpay-live-branches/wcpay-live-branches.user.js @@ -388,7 +388,7 @@ */ function appendHtml( el, contents ) { const $el = $( el ); - const wooColor = '#7F54B3'; // https://woocommerce.com/brand-and-logo-guidelines/ + const wooColor = '#873eff'; // https://woocommerce.com/brand-and-logo-guidelines/ const styles = $( '