Skip to content

Commit c2267d5

Browse files
author
raza robson
committed
udpated README to mention npm run commands for launching tests.
1 parent 2498952 commit c2267d5

1 file changed

Lines changed: 36 additions & 78 deletions

File tree

Lines changed: 36 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,82 @@
11
#Node.js samples
22

3-
## prerequisites
4-
5-
Upgrade Mocha to the latest version:
6-
7-
```
8-
npm install -g -f mocha
9-
```
3+
## Prerequisites
104

115
Install local packages:
126

137
```
148
npm install
159
```
1610

17-
### to run tests locally
18-
19-
Install appium and start the appium server for your device, please refer to:
20-
21-
- http://appium.io
22-
- https://github.com/appium/appium/blob/master/README.md
23-
24-
### to run tests using Sauce Labs cloud
11+
### To run tests using Sauce Labs cloud
2512

2613
[Sign up here](https://saucelabs.com/signup/trial)
2714

28-
Configure your environment:
15+
Then when running the tests, add your Sauce Labs credentials as npm config parameters, example :
2916

3017
```
31-
export SAUCE_USERNAME=<SAUCE_USERNAME>
32-
export SAUCE_ACCESS_KEY=<SAUCE_ACCESS_KEY>
18+
npm run ios-simple appium-sample-code:sauce=1 appium-sample-code:sauce_username=<SAUCE_USERNAME> appium-sample-code:sauce_access_key=<SAUCE_ACCESS_KEY>
3319
```
3420

35-
If you also want to use Sauce Connect (secure tunelling):
21+
Or set the config parameters directly in package.json :
3622

37-
- [Read the doc here](https://saucelabs.com/docs/connect)
38-
- Install and start the Sauce Connect client
39-
40-
## running tests
41-
42-
###iOS
43-
44-
####local:
45-
46-
```
47-
mocha ios-simple.js
48-
mocha ios-complex.js
49-
mocha ios-webview.js
50-
mocha ios-actions.js
51-
mocha ios-local-server.js
52-
mocha ios-selenium-webdriver-bridge.js
5323
```
24+
// package.json
5425
55-
####using Sauce Labs:
56-
57-
```
58-
SAUCE=1 mocha ios-simple.js
59-
SAUCE=1 mocha ios-complex.js
60-
SAUCE=1 mocha ios-webview.js
61-
SAUCE=1 mocha ios-actions.js
62-
SAUCE=1 mocha ios-selenium-webdriver-bridge.js
26+
...
27+
"config":{
28+
sauce:"1",
29+
sauce_username:"<SAUCE_USERNAME>",
30+
sauce_access_key:"<SAUCE_ACCESS_KEY>"
31+
},
32+
...
6333
```
6434

65-
####using Sauce Labs + Sauce Connect:
35+
If you also want to use Sauce Connect (secure tunelling):
6636

67-
```
68-
SAUCE=1 mocha ios-local-server.js
69-
```
37+
- [Read the doc here](https://saucelabs.com/docs/connect)
38+
- Install and start the Sauce Connect client
7039

71-
###Android
7240

73-
####local:
41+
### To run tests locally
7442

75-
```
76-
mocha android-simple.js
77-
mocha android-complex.js
78-
mocha android-webview.js
79-
mocha android-local-server.js
80-
```
43+
Install appium and start the appium server for your device, please refer to:
8144

82-
####using Sauce Labs:
45+
- http://appium.io
46+
- https://github.com/appium/appium/blob/master/README.md
8347

84-
```
85-
SAUCE=1 mocha android-simple.js
86-
SAUCE=1 mocha android-complex.js
87-
SAUCE=1 mocha android-webview.js
88-
```
48+
## Running tests
8949

90-
####using Sauce Labs + Sauce Connect
50+
###iOS
9151

9252
```
93-
SAUCE=1 mocha android-local-server.js
53+
npm run ios-simple
54+
npm run ios-complex
55+
npm run ios-webview
56+
npm run ios-actions
57+
npm run ios-local-server
58+
npm run ios-selenium-webdriver-bridge
9459
```
9560

96-
###Selendroid
97-
98-
####local:
61+
###Android
9962

10063
```
101-
mocha selendroid-simple.js
64+
npm run android-simple
65+
npm run android-complex
66+
npm run android-webview
67+
npm run android-local-server
10268
```
10369

104-
####using Sauce Labs:
70+
###Selendroid
10571

10672
```
107-
SAUCE=1 mocha selendroid-simple.js
73+
npm run selendroid-simple
10874
```
10975

11076
###Node.js 0.11 + Generator with Yiewd
11177

11278
prerequisite: switch to node > 0.11
11379

114-
####local:
115-
116-
```
117-
mocha --harmony ios-yiewd.js
118-
```
119-
120-
####using Sauce Labs:
121-
12280
```
123-
SAUCE=1 mocha --harmony ios-yiewd.js
81+
npm run ios-yiewd
12482
```

0 commit comments

Comments
 (0)