@@ -29,11 +29,6 @@ page](https://github.com/angular/webdriver-manager/blob/master/docs/mobile.md)).
2929
3030* Configure protractor:
3131
32- additional dependencies:
33- ``` shell
34- npm install --save-dev wd wd-bridge
35- ```
36-
3732Config File:
3833``` javascript
3934exports .config = {
@@ -49,17 +44,7 @@ exports.config = {
4944 deviceName: ' Android Emulator' ,
5045 },
5146
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'
6348};
6449```
6550* Note the following:*
@@ -91,11 +76,6 @@ Starting express web server in /workspace/protractor/testapp on port 8000
9176
9277* Configure protractor:
9378
94- additional dependencies:
95- ``` shell
96- npm install --save-dev wd wd-bridge
97- ```
98-
9979iPhone:
10080``` javascript
10181exports .config = {
@@ -113,17 +93,7 @@ exports.config = {
11393 deviceName: ' iPhone Simulator' ,
11494 },
11595
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'
12797};
12898```
12999
@@ -144,17 +114,7 @@ exports.config = {
144114 deviceName: ' IPad Simulator' ,
145115 },
146116
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'
158118};
159119
160120```
@@ -231,3 +191,30 @@ exports.config = {
231191* Note the following:*
232192 - browserName is 'android'
233193 - 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