Skip to content

Commit b2a8344

Browse files
authored
fix(appium): type of setNetworkConnection() (#3994)
1 parent e2846bc commit b2a8344

File tree

4 files changed

+75
-70
lines changed

4 files changed

+75
-70
lines changed

docs/helpers/Appium.md

+67-65
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,13 @@ I.setNetworkConnection(6) // airplane mode off, wifi on, data on
520520

521521
See corresponding [webdriverio reference][9].
522522

523+
Appium: support only Android
524+
523525
#### Parameters
524526

525-
- `value`
527+
- `value` **[number][10]** The network connection mode bitmask
526528

527-
Returns **[Promise][6]<{}>** Appium: support only Android
529+
Returns **[Promise][6]<[number][10]>**
528530

529531
### setSettings
530532

@@ -536,7 +538,7 @@ I.setSettings({cyberdelia: 'open'});
536538

537539
#### Parameters
538540

539-
- `settings` **[object][10]** objectAppium: support Android and iOS
541+
- `settings` **[object][11]** objectAppium: support Android and iOS
540542

541543
### hideDeviceKeyboard
542544

@@ -561,15 +563,15 @@ Appium: support Android and iOS
561563
### sendDeviceKeyEvent
562564

563565
Send a key event to the device.
564-
List of keys: [https://developer.android.com/reference/android/view/KeyEvent.html][11]
566+
List of keys: [https://developer.android.com/reference/android/view/KeyEvent.html][12]
565567

566568
```js
567569
I.sendDeviceKeyEvent(3);
568570
```
569571

570572
#### Parameters
571573

572-
- `keyValue` **[number][12]** Device specific key value
574+
- `keyValue` **[number][10]** Device specific key value
573575

574576
Returns **[Promise][6]<void>** Appium: support only Android
575577

@@ -631,10 +633,10 @@ I.swipe(locator, 800, 1200, 1000);
631633

632634
#### Parameters
633635

634-
- `locator` **([string][5] \| [object][10])**
635-
- `xoffset` **[number][12]**
636-
- `yoffset` **[number][12]**
637-
- `speed` **[number][12]** (optional), 1000 by default (optional, default `1000`)
636+
- `locator` **([string][5] \| [object][11])**
637+
- `xoffset` **[number][10]**
638+
- `yoffset` **[number][10]**
639+
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
638640

639641
Returns **[Promise][6]<void>** Appium: support Android and iOS
640642

@@ -648,8 +650,8 @@ I.performSwipe({ x: 300, y: 100 }, { x: 200, y: 100 });
648650

649651
#### Parameters
650652

651-
- `from` **[object][10]**
652-
- `to` **[object][10]** Appium: support Android and iOS
653+
- `from` **[object][11]**
654+
- `to` **[object][11]** Appium: support Android and iOS
653655

654656
### swipeDown
655657

@@ -664,9 +666,9 @@ I.swipeDown(locator, 1200, 1000); // set offset and speed
664666

665667
#### Parameters
666668

667-
- `locator` **([string][5] \| [object][10])**
668-
- `yoffset` **[number][12]?** (optional) (optional, default `1000`)
669-
- `speed` **[number][12]** (optional), 1000 by default (optional, default `1000`)
669+
- `locator` **([string][5] \| [object][11])**
670+
- `yoffset` **[number][10]?** (optional) (optional, default `1000`)
671+
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
670672

671673
Returns **[Promise][6]<void>** Appium: support Android and iOS
672674

@@ -683,9 +685,9 @@ I.swipeLeft(locator, 1200, 1000); // set offset and speed
683685

684686
#### Parameters
685687

686-
- `locator` **([string][5] \| [object][10])**
687-
- `xoffset` **[number][12]?** (optional) (optional, default `1000`)
688-
- `speed` **[number][12]** (optional), 1000 by default (optional, default `1000`)
688+
- `locator` **([string][5] \| [object][11])**
689+
- `xoffset` **[number][10]?** (optional) (optional, default `1000`)
690+
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
689691

690692
Returns **[Promise][6]<void>** Appium: support Android and iOS
691693

@@ -702,9 +704,9 @@ I.swipeRight(locator, 1200, 1000); // set offset and speed
702704

703705
#### Parameters
704706

705-
- `locator` **([string][5] \| [object][10])**
706-
- `xoffset` **[number][12]?** (optional) (optional, default `1000`)
707-
- `speed` **[number][12]** (optional), 1000 by default (optional, default `1000`)
707+
- `locator` **([string][5] \| [object][11])**
708+
- `xoffset` **[number][10]?** (optional) (optional, default `1000`)
709+
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
708710

709711
Returns **[Promise][6]<void>** Appium: support Android and iOS
710712

@@ -721,9 +723,9 @@ I.swipeUp(locator, 1200, 1000); // set offset and speed
721723

722724
#### Parameters
723725

724-
- `locator` **([string][5] \| [object][10])**
725-
- `yoffset` **[number][12]?** (optional) (optional, default `1000`)
726-
- `speed` **[number][12]** (optional), 1000 by default (optional, default `1000`)
726+
- `locator` **([string][5] \| [object][11])**
727+
- `yoffset` **[number][10]?** (optional) (optional, default `1000`)
728+
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
727729

728730
Returns **[Promise][6]<void>** Appium: support Android and iOS
729731

@@ -746,9 +748,9 @@ I.swipeTo(
746748
- `searchableLocator` **[string][5]**
747749
- `scrollLocator` **[string][5]**
748750
- `direction` **[string][5]**
749-
- `timeout` **[number][12]**
750-
- `offset` **[number][12]**
751-
- `speed` **[number][12]**
751+
- `timeout` **[number][10]**
752+
- `offset` **[number][10]**
753+
- `speed` **[number][10]**
752754

753755
Returns **[Promise][6]<void>** Appium: support Android and iOS
754756

@@ -884,7 +886,7 @@ I.appendField('password', secret('123456'));
884886

885887
#### Parameters
886888

887-
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator
889+
- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator
888890
- `value` **[string][5]** text value to append.
889891

890892
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
@@ -904,8 +906,8 @@ I.checkOption('agree', '//form');
904906

905907
#### Parameters
906908

907-
- `field` **([string][5] \| [object][10])** checkbox located by label | name | CSS | XPath | strict locator.
908-
- `context` **([string][5]? | [object][10])** (optional, `null` by default) element located by CSS | XPath | strict locator. (optional, default `null`)
909+
- `field` **([string][5] \| [object][11])** checkbox located by label | name | CSS | XPath | strict locator.
910+
- `context` **([string][5]? | [object][11])** (optional, `null` by default) element located by CSS | XPath | strict locator. (optional, default `null`)
909911

910912
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
911913

@@ -935,8 +937,8 @@ I.click({css: 'nav a.login'});
935937

936938
#### Parameters
937939

938-
- `locator` **([string][5] \| [object][10])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
939-
- `context` **([string][5]? | [object][10] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. (optional, default `null`)
940+
- `locator` **([string][5] \| [object][11])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
941+
- `context` **([string][5]? | [object][11] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. (optional, default `null`)
940942

941943
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
942944

@@ -952,7 +954,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
952954

953955
#### Parameters
954956

955-
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
957+
- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator.
956958

957959
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
958960

@@ -966,7 +968,7 @@ I.dontSeeElement('.modal'); // modal is not shown
966968

967969
#### Parameters
968970

969-
- `locator` **([string][5] \| [object][10])** located by CSS|XPath|Strict locator.
971+
- `locator` **([string][5] \| [object][11])** located by CSS|XPath|Strict locator.
970972

971973
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
972974

@@ -982,8 +984,8 @@ I.dontSeeInField({ css: 'form input.email' }, '[email protected]'); // field by CSS
982984

983985
#### Parameters
984986

985-
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
986-
- `value` **([string][5] \| [object][10])** value to check.
987+
- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator.
988+
- `value` **([string][5] \| [object][11])** value to check.
987989

988990
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
989991

@@ -1000,7 +1002,7 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
10001002
#### Parameters
10011003

10021004
- `text` **[string][5]** which is not present.
1003-
- `context` **([string][5] \| [object][10])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. (optional, default `null`)
1005+
- `context` **([string][5] \| [object][11])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. (optional, default `null`)
10041006

10051007
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
10061008

@@ -1022,8 +1024,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
10221024

10231025
#### Parameters
10241026

1025-
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
1026-
- `value` **([string][5] \| [object][10])** text value to fill.
1027+
- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator.
1028+
- `value` **([string][5] \| [object][11])** text value to fill.
10271029

10281030
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
10291031

@@ -1038,7 +1040,7 @@ let pins = await I.grabTextFromAll('#pin li');
10381040

10391041
#### Parameters
10401042

1041-
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
1043+
- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator.
10421044

10431045
Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value
10441046

@@ -1055,7 +1057,7 @@ If multiple elements found returns first element.
10551057

10561058
#### Parameters
10571059

1058-
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
1060+
- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator.
10591061

10601062
Returns **[Promise][6]<[string][5]>** attribute value
10611063

@@ -1070,9 +1072,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
10701072

10711073
#### Parameters
10721074

1073-
- `locator` **([string][5] \| [object][10])** located by CSS|XPath|strict locator.
1075+
- `locator` **([string][5] \| [object][11])** located by CSS|XPath|strict locator.
10741076

1075-
Returns **[Promise][6]<[number][12]>** number of visible elements
1077+
Returns **[Promise][6]<[number][10]>** number of visible elements
10761078

10771079
### grabAttributeFrom
10781080

@@ -1088,7 +1090,7 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
10881090

10891091
#### Parameters
10901092

1091-
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
1093+
- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator.
10921094
- `attr` **[string][5]** attribute name.
10931095

10941096
Returns **[Promise][6]<[string][5]>** attribute value
@@ -1105,7 +1107,7 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
11051107

11061108
#### Parameters
11071109

1108-
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
1110+
- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator.
11091111
- `attr` **[string][5]** attribute name.
11101112

11111113
Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value
@@ -1121,7 +1123,7 @@ let inputs = await I.grabValueFromAll('//form/input');
11211123

11221124
#### Parameters
11231125

1124-
- `locator` **([string][5] \| [object][10])** field located by label|name|CSS|XPath|strict locator.
1126+
- `locator` **([string][5] \| [object][11])** field located by label|name|CSS|XPath|strict locator.
11251127

11261128
Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value
11271129

@@ -1137,7 +1139,7 @@ let email = await I.grabValueFrom('input[name=email]');
11371139

11381140
#### Parameters
11391141

1140-
- `locator` **([string][5] \| [object][10])** field located by label|name|CSS|XPath|strict locator.
1142+
- `locator` **([string][5] \| [object][11])** field located by label|name|CSS|XPath|strict locator.
11411143

11421144
Returns **[Promise][6]<[string][5]>** attribute value
11431145

@@ -1168,7 +1170,7 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
11681170

11691171
#### Parameters
11701172

1171-
- `locator` **([string][5] \| [object][10])** located by CSS|XPath|strict locator.
1173+
- `locator` **([string][5] \| [object][11])** located by CSS|XPath|strict locator.
11721174
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][17].
11731175

11741176
Returns **[Promise][6]<void>** automatically synchronized promise through #recorderSupported only for web testing
@@ -1185,7 +1187,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
11851187

11861188
#### Parameters
11871189

1188-
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
1190+
- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator.
11891191

11901192
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
11911193

@@ -1200,7 +1202,7 @@ I.seeElement('#modal');
12001202

12011203
#### Parameters
12021204

1203-
- `locator` **([string][5] \| [object][10])** located by CSS|XPath|strict locator.
1205+
- `locator` **([string][5] \| [object][11])** located by CSS|XPath|strict locator.
12041206

12051207
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
12061208

@@ -1218,8 +1220,8 @@ I.seeInField('#searchform input','Search');
12181220

12191221
#### Parameters
12201222

1221-
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
1222-
- `value` **([string][5] \| [object][10])** value to check.
1223+
- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator.
1224+
- `value` **([string][5] \| [object][11])** value to check.
12231225

12241226
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
12251227

@@ -1237,7 +1239,7 @@ I.see('Register', {css: 'form.register'}); // use strict locator
12371239
#### Parameters
12381240

12391241
- `text` **[string][5]** expected on page.
1240-
- `context` **([string][5]? | [object][10])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text. (optional, default `null`)
1242+
- `context` **([string][5]? | [object][11])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text. (optional, default `null`)
12411243

12421244
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
12431245

@@ -1264,7 +1266,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
12641266

12651267
#### Parameters
12661268

1267-
- `select` **([string][5] \| [object][10])** field located by label|name|CSS|XPath|strict locator.
1269+
- `select` **([string][5] \| [object][11])** field located by label|name|CSS|XPath|strict locator.
12681270
- `option` **([string][5] \| [Array][8]<any>)** visible text or value of option.
12691271

12701272
Returns **[Promise][6]<void>** automatically synchronized promise through #recorderSupported only for web testing
@@ -1281,8 +1283,8 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
12811283

12821284
#### Parameters
12831285

1284-
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
1285-
- `sec` **[number][12]?** (optional, `1` by default) time in seconds to wait (optional, default `null`)
1286+
- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator.
1287+
- `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait (optional, default `null`)
12861288

12871289
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
12881290

@@ -1297,8 +1299,8 @@ I.waitForVisible('#popup');
12971299

12981300
#### Parameters
12991301

1300-
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
1301-
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
1302+
- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator.
1303+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
13021304

13031305
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
13041306

@@ -1313,8 +1315,8 @@ I.waitForInvisible('#popup');
13131315

13141316
#### Parameters
13151317

1316-
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
1317-
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
1318+
- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator.
1319+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
13181320

13191321
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
13201322

@@ -1332,8 +1334,8 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
13321334
#### Parameters
13331335

13341336
- `text` **[string][5]** to wait for.
1335-
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
1336-
- `context` **([string][5] \| [object][10])?** (optional) element located by CSS|XPath|strict locator. (optional, default `null`)
1337+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
1338+
- `context` **([string][5] \| [object][11])?** (optional) element located by CSS|XPath|strict locator. (optional, default `null`)
13371339

13381340
Returns **[Promise][6]<void>** automatically synchronized promise through #recorder
13391341

@@ -1353,13 +1355,13 @@ Returns **[Promise][6]<void>** automatically synchronized promise through #re
13531355

13541356
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
13551357

1356-
[9]: http://webdriver.io/api/mobile/setNetworkConnection.html
1358+
[9]: https://webdriver.io/docs/api/chromium/#setnetworkconnection
13571359

1358-
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
1360+
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
13591361

1360-
[11]: https://developer.android.com/reference/android/view/KeyEvent.html
1362+
[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
13611363

1362-
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
1364+
[12]: https://developer.android.com/reference/android/view/KeyEvent.html
13631365

13641366
[13]: http://webdriver.io/api/mobile/touchAction.html
13651367

0 commit comments

Comments
 (0)