@@ -29,11 +29,6 @@ page](https://github.com/angular/webdriver-manager/blob/master/docs/mobile.md)).
29
29
30
30
* Configure protractor:
31
31
32
- additional dependencies:
33
- ``` shell
34
- npm install --save-dev wd wd-bridge
35
- ```
36
-
37
32
Config File:
38
33
``` javascript
39
34
exports .config = {
@@ -49,17 +44,7 @@ exports.config = {
49
44
deviceName: ' Android Emulator' ,
50
45
},
51
46
52
- baseUrl: ' http://10.0.2.2:8000' ,
53
-
54
- // configuring wd in onPrepare
55
- // wdBridge helps to bridge wd driver with other selenium clients
56
- // See https://github.com/sebv/wd-bridge/blob/master/README.md
57
- onPrepare : function () {
58
- var wd = require (' wd' ),
59
- protractor = require (' protractor' ),
60
- wdBridge = require (' wd-bridge' )(protractor, wd);
61
- wdBridge .initFromProtractor (exports .config );
62
- }
47
+ baseUrl: ' http://10.0.2.2:8000'
63
48
};
64
49
```
65
50
* Note the following:*
@@ -91,11 +76,6 @@ Starting express web server in /workspace/protractor/testapp on port 8000
91
76
92
77
* Configure protractor:
93
78
94
- additional dependencies:
95
- ``` shell
96
- npm install --save-dev wd wd-bridge
97
- ```
98
-
99
79
iPhone:
100
80
``` javascript
101
81
exports .config = {
@@ -113,17 +93,7 @@ exports.config = {
113
93
deviceName: ' iPhone Simulator' ,
114
94
},
115
95
116
- baseUrl: ' http://localhost:8000' ,
117
-
118
- // configuring wd in onPrepare
119
- // wdBridge helps to bridge wd driver with other selenium clients
120
- // See https://github.com/sebv/wd-bridge/blob/master/README.md
121
- onPrepare : function () {
122
- var wd = require (' wd' ),
123
- protractor = require (' protractor' ),
124
- wdBridge = require (' wd-bridge' )(protractor, wd);
125
- wdBridge .initFromProtractor (exports .config );
126
- }
96
+ baseUrl: ' http://localhost:8000'
127
97
};
128
98
```
129
99
@@ -144,17 +114,7 @@ exports.config = {
144
114
deviceName: ' IPad Simulator' ,
145
115
},
146
116
147
- baseUrl: ' http://localhost:8000' ,
148
-
149
- // configuring wd in onPrepare
150
- // wdBridge helps to bridge wd driver with other selenium clients
151
- // See https://github.com/sebv/wd-bridge/blob/master/README.md
152
- onPrepare : function () {
153
- var wd = require (' wd' ),
154
- protractor = require (' protractor' ),
155
- wdBridge = require (' wd-bridge' )(protractor, wd);
156
- wdBridge .initFromProtractor (exports .config );
157
- }
117
+ baseUrl: ' http://localhost:8000'
158
118
};
159
119
160
120
```
@@ -231,3 +191,30 @@ exports.config = {
231
191
* Note the following:*
232
192
- browserName is 'android'
233
193
- baseUrl is 10.0.2.2 instead of localhost because it is used to access the localhost of the host machine in the android emulator
194
+
195
+ Using ` wd ` and ` wd-bridge `
196
+ -------------------------------------
197
+
198
+ As of version 5.1.0, Protractor uses ` webdriver-js-extender ` to provide all the
199
+ mobile commands you should need (see the API page for details). However, if you
200
+ prefer ` wd ` , you can access it via ` wd-bridge ` . First, install both ` wd ` and
201
+ ` wd-bridge ` as ` devDependencies ` :
202
+
203
+ ``` shell
204
+ npm install --save-dev wd wd-bridge
205
+ ```
206
+
207
+ Then, in your config file:
208
+
209
+ ``` javascript
210
+ // configuring wd in onPrepare
211
+ // wdBridge helps to bridge wd driver with other selenium clients
212
+ // See https://github.com/sebv/wd-bridge/blob/master/README.md
213
+ onPrepare : function () {
214
+ var wd = require (' wd' ),
215
+ protractor = require (' protractor' ),
216
+ wdBridge = require (' wd-bridge' )(protractor, wd);
217
+ wdBridge .initFromProtractor (exports .config );
218
+ }
219
+ ```
220
+
0 commit comments