Skip to content

BrowserStack Tests #1566

BrowserStack Tests

BrowserStack Tests #1566

Workflow file for this run

name: BrowserStack Tests
# manually run this action using the GitHub UI
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
on:
workflow_dispatch:
inputs:
buttons_url:
description: Optional buttons url
required: false
default: ""
messages_url:
description: Optional messages url
required: false
default: ""
# run on push but only for the main branch
push:
branches: [main]
# run for every pull request
pull_request: {}
# run at the end of every day
schedule:
- cron: "0 0 * * *"
jobs:
test:
runs-on: macos-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: ⚙️ Setup BrowserStack Env
uses: "browserstack/github-actions/setup-env@master"
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
- name: ▶️ Run all tests
id: test
continue-on-error: true
run: BROWSERSTACK_BUILD_NAME="paypal-sdk-e2e-tests-$GITHUB_RUN_ID" BUYER_EMAIL=${{ secrets.BUYER_EMAIL }} BUYER_PASSWORD=${{ secrets.BUYER_PASSWORD }} BUTTONS_URL="${{ github.event.inputs.buttons_url }}" MESSAGES_URL="${{ github.event.inputs.messages_url }}" npm run test-browserstack
- name: ▶️ Run IP Geolocation tests for Germany
id: test_germany
continue-on-error: true
run: BROWSERSTACK_BUILD_NAME="paypal-sdk-e2e-tests-germany-$GITHUB_RUN_ID" BUYER_EMAIL=${{ secrets.BUYER_EMAIL }} BUYER_PASSWORD=${{ secrets.BUYER_PASSWORD }} BUTTONS_URL="${{ github.event.inputs.buttons_url }}" MESSAGES_URL="${{ github.event.inputs.messages_url }}" npm run test-browserstack-german -- --spec tests/suites/card-button-text.test.ts
- name: 🤞 Check if tests have passed
if: steps.test.outcome == 'failure' || steps.test_germany.outcome == 'failure'
run: exit 1