Skip to content

feat: add PaymentController v2 architecture #40

feat: add PaymentController v2 architecture

feat: add PaymentController v2 architecture #40

Workflow file for this run

name: E2E Tests
on:
pull_request:
paths:
- "payments/**"
- "tests/e2e/**"
- "playwright.config.js"
- ".github/workflows/e2e-tests.yml"
workflow_dispatch:
inputs:
debug:
description: "Enable debug mode"
required: false
default: false
type: boolean
test_invoice_name:
description: "Existing Sales Invoice name (leave empty to create dynamically)"
required: false
type: string
test_payment_gateway:
description: "Payment Gateway name"
required: false
default: "Stripe-Stripe"
type: string
concurrency:
group: e2e-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
stripe-e2e:
name: Stripe E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 30
# Only run if secrets are available (won't run on forks without secrets)
if: ${{ github.event_name == 'workflow_dispatch' || github.repository == 'frappe/payments' || github.repository == 'nlvegan/payments' }}
services:
mysql:
image: mariadb:10.6
env:
MARIADB_ROOT_PASSWORD: "root"
ports:
- 3306:3306
options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: "npm"
cache-dependency-path: package.json
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Add Hosts Entry
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
- name: Setup Frappe Bench
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
FRAPPE_USER: frappe
FRAPPE_BRANCH: develop
- name: Install Playwright
run: |
cd ${GITHUB_WORKSPACE}
npm ci
npx playwright install --with-deps chromium
- name: Start Frappe Server
run: |
cd ~/frappe-bench
bench start &
sleep 30
env:
CI: true
- name: Run Stripe E2E Tests
run: |
cd ${GITHUB_WORKSPACE}
npx playwright test --project stripe-checkout
env:
CI: true
# Secrets (sensitive credentials)
STRIPE_TEST_SECRET_KEY: ${{ secrets.STRIPE_TEST_SECRET_KEY }}
STRIPE_TEST_PUBLISHABLE_KEY: ${{ secrets.STRIPE_TEST_PUBLISHABLE_KEY }}
STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }}
# Optional inputs for workflow_dispatch (leave empty for dynamic creation)
TEST_INVOICE_NAME: ${{ inputs.test_invoice_name }}
TEST_PAYMENT_GATEWAY: ${{ inputs.test_payment_gateway || 'Stripe-Stripe' }}
# Fixed values
TEST_SITE_URL: http://test_site:8000
ADMIN_PASSWORD: admin
PWDEBUG: ${{ inputs.debug && '1' || '0' }}
- name: Upload Test Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 7
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results
path: test-results/
retention-days: 7