Testing via Browserstack

This will run your local test via Browserstack browsers/devices. You will need to have a Browserstack automate account.

Using:

This is part of the default open-wc testing recommendation

Setup

npm init @open-wc
# Upgrade > Testing

# follow Setup user + key

Manual

  • yarn add @open-wc/testing-karma-bs --dev
  • Copy karma.bs.config.js to karma.bs.config.js
  • Add these scripts to your package.json
    "scripts": {
      "test:bs": "karma start karma.bs.config.js --legacy --coverage"
    },
    

Setup user + key

# for one time use only
export BROWSER_STACK_USERNAME=xxx
export BROWSER_STACK_ACCESS_KEY=xxx

# or add them to your .bashrc
echo "export BROWSER_STACK_USERNAME=xxx" >> ~/.bashrc
echo "export BROWSER_STACK_ACCESS_KEY=xxx" >> ~/.bashrc

# to verify, run:
echo "User: $BROWSER_STACK_USERNAME"
echo "Key: $BROWSER_STACK_ACCESS_KEY"

Usage

npm run test:bs
Last Updated: 1/13/2019, 10:46:34 AM