Skip to content

BrowserStack Selenium Proxy #108

BrowserStack Selenium Proxy

BrowserStack Selenium Proxy #108

name: "BrowserStack Selenium Proxy"
on:
workflow_run:
workflows: ["BrowserStack Selenium Module"]
types: [completed]
jobs:
selenium-job:
name: "BrowserStack Selenium Proxy Tests"
runs-on: ubuntu-latest # Can be self-hosted runner also
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup npm cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: "BrowserStack Env Setup" # Invokes the setup-env action
uses: browserstack/github-actions/setup-env@master
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
build-name: Dev - ${{ github.sha }}
- name: "BrowserStack Local Tunnel Setup" # Invokes the setup-local action
uses: browserstack/github-actions/setup-local@master
with:
local-testing: start
local-identifier: Selenium-Proxy-GH-Dev-${{ github.sha }}
# The next steps are for building the web application to be tested and starting the web server on the runner environment
- name: "Building web application to be tested"
run: npm install
working-directory: e2e
- name: "Build Frontity project"
run: npx frontity build
working-directory: e2e/project
- name: "Serve Frontity project"
run: npx frontity serve &
working-directory: e2e/project
- name: "Running test on BrowserStack" # Invokes the actual test script that would run on BrowserStack browsers
run: npx wdio selenium/conf/proxy.conf.js # See sample test script above
working-directory: e2e
- name: "BrowserStackLocal Stop" # Terminating the BrowserStackLocal tunnel connection
uses: browserstack/github-actions/setup-local@master
with:
local-testing: stop