Skip to content

feat: setup webdriverio #15

feat: setup webdriverio

feat: setup webdriverio #15

name: Blade BrowserStack E2E Tests
# Runs the action when
# 1. 'Run Interaction Tests' label is added to PR
# 2. Workflow is trigerred manually
# 3. PR is merged to master
on:
pull_request:
types: [labeled]
push:
branches:
- master
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
jobs:
browserstack-job:
name: Blade BrowserStack E2E Tests
runs-on: ubuntu-latest # nosemgrep: non-self-hosted-runner
if: ${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'Run Interaction Tests' || github.event_name == 'push' }}
steps:
- 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 }}
- name: 'BrowserStack Local Tunnel Setup' # Invokes the setup-local action
uses: browserstack/github-actions/setup-local@master
with:
local-testing: start
local-identifier: blade
- name: Checkout Codebase
uses: actions/checkout@v3
- name: Use Node v18
uses: actions/setup-node@v3
with:
node-version: 18.12.1
- name: Setup Cache & Install Dependencies
uses: ./.github/actions/install-dependencies
- name: Run Storybook
run: |
yarn react:storybook:build
yarn react:storybook:serve &
working-directory: packages/blade
- name: 'Run E2E Tests'
run: |
yarn e2e:bstack
working-directory: packages/blade
- name: 'BrowserStackLocal Stop' # Terminating the BrowserStackLocal tunnel connection
uses: browserstack/github-actions/setup-local@master
with:
local-testing: stop