Skip to content

Commit 9d6bf33

Browse files
committed
Merge pull request #2 from browserstack/module
Create Module Structure
2 parents dbf27b5 + c99fdde commit 9d6bf33

File tree

5 files changed

+58
-2541
lines changed

5 files changed

+58
-2541
lines changed

README.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +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-
- 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`
2035

2136
###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.
2540

26-
[here]:https://github.com/browserstack/karma-browserstack-launcher
2741
[dashboard]:https://www.browserstack.com/automate
2842
[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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "karma-browserstack-example",
3+
"version": "1.0.0",
4+
"description": "Sample To test Karma with BrowserStack",
5+
"main": "karma.conf.js",
6+
"directories": {
7+
"test": "tests"
8+
},
9+
"scripts": {
10+
"test": "karma start"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/browserstack/karma-browserstack-example.git"
15+
},
16+
"author": "",
17+
"license": "MIT",
18+
"bugs": {
19+
"url": "https://github.com/browserstack/karma-browserstack-example/issues"
20+
},
21+
"homepage": "https://github.com/browserstack/karma-browserstack-example#readme",
22+
"dependencies": {
23+
"karma": "^0.13.11",
24+
"karma-browserstack-launcher": "^0.1.5",
25+
"karma-qunit": "^0.1.5",
26+
"qunitjs": "^1.19.0"
27+
}
28+
}

resources/qunit.css

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

0 commit comments

Comments
 (0)