Skip to content

Commit c99fdde

Browse files
committed
suggestions
1 parent 11feda1 commit c99fdde

5 files changed

Lines changed: 30 additions & 2543 deletions

File tree

README.md

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,39 @@
44
Sample for using karma-browserstack-launcher to run Karma tests (QUnit framework) on BrowserStack infrastructure.
55
One test is failing on purpose as a demo of BrowserStack catching bugs in different browsers.
66

7-
###Clone this repository
8-
- `git clone https://github.com/browserstack/karma-browserstack-example.git`
7+
### Prerequisites
8+
Node and npm
99

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`
1212

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
1714

18-
###Sample test
19-
- Run `npm install` to install all dependencies
20-
- Run `npm test` to start karma testing
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`
2135

2236
###Note
23-
- IE 6 and 7 Tests on Karma version 0.13 may fail(output - browser not captured).
24-
- Use Karmav0.12 or below and add `transports: ['websocket','jsonp-polling']` to the karma.conf.js file
25-
- 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.
2640

27-
[here]:https://github.com/browserstack/karma-browserstack-launcher
2841
[dashboard]:https://www.browserstack.com/automate
2942
[karma issue]:https://github.com/karma-runner/karma/issues/983

karma.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ module.exports = function(config) {
5454
autoWatch: false,
5555

5656
browserStack: {
57-
username: 'jamesbond',
58-
accessKey: '007'
57+
username: process.env.BROWSERSTACK_USERNAME,
58+
accessKey: process.env.BROWSERSTACK_KEY
5959
},
6060

6161
// define browsers

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"karma": "^0.13.11",
2424
"karma-browserstack-launcher": "^0.1.5",
2525
"karma-qunit": "^0.1.5",
26-
"qunit": "^0.7.7",
2726
"qunitjs": "^1.19.0"
2827
}
2928
}

resources/qunit.css

Lines changed: 0 additions & 237 deletions
This file was deleted.

0 commit comments

Comments
 (0)