BrowserStack Selenium SSR #110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "BrowserStack Selenium SSR" | |
on: | |
workflow_run: | |
workflows: ["BrowserStack Selenium Proxy"] | |
types: [completed] | |
jobs: | |
selenium-job: | |
name: "BrowserStack Selenium SSR 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-SSR-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/ssr.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 |