Files
open-wc/packages/testing-karma-bs/README.md
2019-01-16 21:49:57 +01:00

2.4 KiB

Testing via Browserstack

Part of Open Web Component Recommendation open-wc

Open Web Components provides a set of defaults, recommendations and tools to help facilitate your Web Component. Our recommendations include: developing, linting, testing, tooling, demoing, publishing and automating.

CircleCI BrowserStack Status Renovate enabled

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

Using:

::: tip Info This is part of the default open-wc recommendation :::

Setup

npx -p yo -p generator-open-wc -c 'yo open-wc:testing-karma-bs'
# follow Setup user + key

Manual

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

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:es5:bs