Skip to content

Latest commit

 

History

History
 
 

testing-karma-bs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Testing via Browserstack

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

Using:

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

Setup

npm init @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
<script> export default { mounted() { const editLink = document.querySelector('.edit-link a'); if (editLink) { const url = editLink.href; editLink.href = url.substr(0, url.indexOf('/master/')) + '/master/packages/testing-karma-bs/README.md'; } } } </script>