Skip to content

E2E test workflow

E2E test workflow #8

Workflow file for this run

name: Salesforce b2b e2e test
on:
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
B2B_E2E_AUTH_URL: ${{ secrets.B2B_E2E_AUTH_URL }}
steps:
- name: Checkout This Repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Salesforce CLI
run: npm install @salesforce/cli --global
- name: Create authentication file from secret
run: echo ${B2B_E2E_AUTH_URL} > secret.json
- name: Authenticate to E2E org
run: sf org login sfdx-url -f secret.json --set-default --alias e2eOrg
- name: Checkout Apex-Library Repository
uses: actions/checkout@v4
with:
repository: Adyen/adyen-apex-api-library
ref: develop
path: dependency-repo
- name: Push Apex Lib Source to the Org
run: |
cd dependency-repo
sf project deploy start --target-org e2eOrg
- name: Checkout This Repository Back
uses: actions/checkout@v4
- name: Install xmlstarlet
run: sudo apt-get install -y xmlstarlet
- name: Update customMetadata XML
run: |
chmod +x ./scripts/updateCustomMetadata.sh
./scripts/updateCustomMetadata.sh
env:
MERCHANT_ACCOUNT: ${{ secrets.B2B_E2E_MERCHANT_ACCOUNT }}
CLIENT_KEY: ${{ secrets.B2B_E2E_CLIENT_KEY }}
HMAC_KEY: ${{ secrets.B2B_E2E_HMAC_KEY }}
- name: Deploy This Repository Code and run unit tests
run: sf project deploy start --target-org e2eOrg --test-level RunLocalTests --ignore-conflicts
e2e-testing:
runs-on: ubuntu-latest
needs: build-and-deploy
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
working-directory: ./e2e
run: npm ci
- name: Install Playwright dependencies
working-directory: ./e2e
run: npx playwright install --with-deps
- name: Run Playwright tests
working-directory: ./e2e
run: npx playwright test
env:
STORE_BASE_URL: ${{ secrets.STORE_BASE_URL }}
STORE_ID: ${{ secrets.STORE_ID }}
STORE_USERNAME: ${{ secrets.STORE_USERNAME }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30