|
4 | 4 | Sample for using karma-browserstack-launcher to run Karma tests (QUnit framework) on BrowserStack infrastructure. |
5 | 5 | One test is failing on purpose as a demo of BrowserStack catching bugs in different browsers. |
6 | 6 |
|
7 | | -###Clone this repository |
8 | | -- `git clone https://github.com/browserstack/karma-browserstack-example.git` |
| 7 | +### Prerequisites |
| 8 | +Node and npm |
9 | 9 |
|
10 | | -###Install karma-browserstack-launcher |
11 | | -- `npm -g install karma-browserstack-launcher` |
| 10 | +### Clone this repository |
| 11 | +`git clone https://github.com/browserstack/karma-browserstack-example.git` |
12 | 12 |
|
13 | | -###Configuring the json |
14 | | - - Open `karma.conf.js` |
15 | | - - Replace `username` and `key` with your BrowserStack credentials. Don't have one? Get one on BrowserStack [dashboard] |
16 | | - - You can further customize configuration in karma.conf.js. For detailed reference, visit karma-browserstack-launcher github repository [here]. |
| 13 | +### Install dependencies |
17 | 14 |
|
18 | | -###Sample test |
19 | | - - To run: `karma start` |
| 15 | +Navigate to appropriate directory for testing and then install the dependencies by running |
| 16 | + |
| 17 | +`npm install` |
| 18 | + |
| 19 | +### BrowserStack Configuration |
| 20 | + |
| 21 | +Export the environment variables for the username and access key of your BrowserStack account. |
| 22 | +These can be found on the automate accounts page on [BrowserStack](https://www.browserstack.com/accounts/automate). |
| 23 | + |
| 24 | +`export BROWSERSTACK_USERNAME=<browserstack-username>` |
| 25 | + |
| 26 | +`export BROWSERSTACK_KEY=<browserstack-access-key>` |
| 27 | + |
| 28 | +You can further customize configuration in karma.conf.js. For detailed reference, visit karma-browserstack-launcher github repository [here](https://github.com/browserstack/karma-browserstack-launcher). |
| 29 | + |
| 30 | +#### Run the tests |
| 31 | + |
| 32 | +Execute the following command to run the karma tests: |
| 33 | + |
| 34 | +`npm test` |
20 | 35 |
|
21 | 36 | ###Note |
22 | | - - IE 6 and 7 Tests on Karma version 0.13 may fail(output - browser not captured). |
23 | | - - Use Karmav0.12 or below and add `transports: ['websocket','jsonp-polling']` to the karma.conf.js file |
24 | | - - Checkout [karma issue] for more details. |
| 37 | +- IE 6 and 7 Tests on Karma version 0.13 may fail(output - browser not captured). |
| 38 | +- Use Karmav0.12 or below and add `transports: ['websocket','jsonp-polling']` to the karma.conf.js file |
| 39 | +- Checkout [karma issue] for more details. |
25 | 40 |
|
26 | | -[here]:https://github.com/browserstack/karma-browserstack-launcher |
27 | 41 | [dashboard]:https://www.browserstack.com/automate |
28 | 42 | [karma issue]:https://github.com/karma-runner/karma/issues/983 |
0 commit comments