codeceptjs 2.1.3 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +125 -37
- package/README.md +15 -22
- package/bin/codecept.js +4 -1
- package/docs/acceptance.md +44 -1
- package/docs/advanced.md +1 -1
- package/docs/angular.md +6 -9
- package/docs/basics.md +388 -75
- package/docs/bdd.md +4 -3
- package/docs/best.md +1 -1
- package/docs/books.md +31 -0
- package/docs/build/Appium.js +215 -176
- package/docs/build/Nightmare.js +618 -489
- package/docs/build/Polly.js +189 -0
- package/docs/build/Protractor.js +747 -608
- package/docs/build/Puppeteer.js +914 -633
- package/docs/build/REST.js +1 -1
- package/docs/build/TestCafe.js +1835 -0
- package/docs/build/WebDriver.js +861 -805
- package/docs/build/WebDriverIO.js +616 -617
- package/docs/changelog.md +410 -316
- package/docs/commands.md +6 -6
- package/docs/community-helpers.md +2 -0
- package/docs/detox.md +235 -0
- package/docs/examples.md +23 -0
- package/docs/helpers/ApiDataFactory.md +11 -10
- package/docs/helpers/Appium.md +130 -61
- package/docs/helpers/Detox.md +579 -0
- package/docs/helpers/FileSystem.md +2 -1
- package/docs/helpers/Mochawesome.md +1 -0
- package/docs/helpers/Nightmare.md +348 -128
- package/docs/helpers/Polly.md +85 -0
- package/docs/helpers/Protractor.md +451 -184
- package/docs/helpers/Puppeteer-firefox.md +55 -0
- package/docs/helpers/Puppeteer.md +619 -183
- package/docs/helpers/REST.md +17 -16
- package/docs/helpers/SeleniumWebdriver.md +9 -8
- package/docs/helpers/TestCafe.md +1168 -0
- package/docs/helpers/WebDriver.md +600 -291
- package/docs/helpers/WebDriverIO.md +393 -278
- package/docs/helpers.md +37 -18
- package/docs/locators.md +2 -0
- package/docs/mobile-react-native-locators.md +64 -0
- package/docs/mobile.md +5 -0
- package/docs/plugins.md +54 -13
- package/docs/puppeteer.md +74 -26
- package/docs/quickstart.md +47 -12
- package/docs/react.md +67 -0
- package/docs/reports.md +1 -1
- package/docs/{webapi/_keys.mustache → shared/keys.mustache} +0 -0
- package/docs/shared/react.mustache +1 -0
- package/docs/testcafe.md +157 -0
- package/docs/videos.md +19 -0
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +2 -2
- package/docs/webapi/attachFile.mustache +2 -2
- package/docs/webapi/checkOption.mustache +2 -2
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +2 -2
- package/docs/webapi/clickLink.mustache +3 -3
- package/docs/webapi/dontSee.mustache +6 -3
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +7 -1
- package/docs/webapi/dontSeeCookie.mustache +5 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +6 -1
- package/docs/webapi/dontSeeElement.mustache +5 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +5 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +7 -2
- package/docs/webapi/dontSeeInSource.mustache +5 -1
- package/docs/webapi/dontSeeInTitle.mustache +5 -1
- package/docs/webapi/doubleClick.mustache +2 -2
- package/docs/webapi/downloadFile.mustache +2 -2
- package/docs/webapi/dragAndDrop.mustache +2 -2
- package/docs/webapi/dragSlider.mustache +2 -2
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +2 -2
- package/docs/webapi/grabAttributeFrom.mustache +3 -2
- package/docs/webapi/grabBrowserLogs.mustache +3 -1
- package/docs/webapi/grabCookie.mustache +2 -1
- package/docs/webapi/grabCssPropertyFrom.mustache +3 -2
- package/docs/webapi/grabCurrentUrl.mustache +3 -1
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +19 -0
- package/docs/webapi/grabHTMLFrom.mustache +2 -1
- package/docs/webapi/grabNumberOfOpenTabs.mustache +4 -2
- package/docs/webapi/grabNumberOfVisibleElements.mustache +3 -2
- package/docs/webapi/grabPageScrollPosition.mustache +3 -1
- package/docs/webapi/grabSource.mustache +3 -1
- package/docs/webapi/grabTextFrom.mustache +2 -1
- package/docs/webapi/grabTitle.mustache +3 -1
- package/docs/webapi/grabValueFrom.mustache +2 -1
- package/docs/webapi/moveCursorTo.mustache +3 -3
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/resizeWindow.mustache +2 -2
- package/docs/webapi/rightClick.mustache +2 -2
- package/docs/webapi/saveScreenshot.mustache +3 -3
- package/docs/webapi/say.mustache +2 -2
- package/docs/webapi/scrollPageToBottom.mustache +1 -1
- package/docs/webapi/scrollPageToTop.mustache +1 -1
- package/docs/webapi/scrollTo.mustache +3 -3
- package/docs/webapi/see.mustache +2 -2
- package/docs/webapi/seeAttributesOnElements.mustache +3 -3
- package/docs/webapi/seeCheckboxIsChecked.mustache +2 -1
- package/docs/webapi/seeCookie.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -2
- package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInCurrentUrl.mustache +1 -1
- package/docs/webapi/seeInField.mustache +2 -2
- package/docs/webapi/seeInSource.mustache +1 -1
- package/docs/webapi/seeInTitle.mustache +5 -1
- package/docs/webapi/seeNumberOfElements.mustache +10 -0
- package/docs/webapi/seeNumberOfVisibleElements.mustache +2 -2
- package/docs/webapi/selectOption.mustache +2 -2
- package/docs/webapi/setCookie.mustache +1 -1
- package/docs/webapi/switchTo.mustache +6 -1
- package/docs/webapi/uncheckOption.mustache +2 -2
- package/docs/webapi/wait.mustache +1 -2
- package/docs/webapi/waitForDetached.mustache +3 -3
- package/docs/webapi/waitForElement.mustache +2 -2
- package/docs/webapi/waitForEnabled.mustache +1 -1
- package/docs/webapi/waitForFunction.mustache +3 -3
- package/docs/webapi/waitForInvisible.mustache +3 -3
- package/docs/webapi/waitForText.mustache +3 -3
- package/docs/webapi/waitForValue.mustache +3 -3
- package/docs/webapi/waitForVisible.mustache +3 -3
- package/docs/webapi/waitInUrl.mustache +2 -2
- package/docs/webapi/waitNumberOfVisibleElements.mustache +3 -3
- package/docs/webapi/waitToHide.mustache +3 -3
- package/docs/webapi/waitUntil.mustache +3 -3
- package/docs/webapi/waitUrlEquals.mustache +2 -2
- package/docs/webdriver.md +453 -0
- package/lib/codecept.js +11 -9
- package/lib/command/definitions.js +183 -30
- package/lib/command/gherkin/snippets.js +29 -9
- package/lib/command/init.js +31 -9
- package/lib/command/run-multiple.js +46 -59
- package/lib/command/utils.js +1 -1
- package/lib/container.js +30 -4
- package/lib/data/dataScenarioConfig.js +18 -0
- package/lib/helper/Appium.js +24 -24
- package/lib/helper/Nightmare.js +81 -84
- package/lib/helper/Polly.js +189 -0
- package/lib/helper/Protractor.js +96 -86
- package/lib/helper/Puppeteer.js +238 -113
- package/lib/helper/REST.js +1 -1
- package/lib/helper/TestCafe.js +1257 -0
- package/lib/helper/WebDriver.js +217 -277
- package/lib/helper/WebDriverIO.js +75 -75
- package/lib/helper/clientscripts/nightmare.js +8 -0
- package/lib/helper/extras/React.js +55 -0
- package/lib/helper/testcafe/testControllerHolder.js +42 -0
- package/lib/helper/testcafe/testcafe-utils.js +63 -0
- package/lib/history.js +39 -0
- package/lib/hooks.js +25 -1
- package/lib/interfaces/gherkin.js +17 -1
- package/lib/interfaces/scenarioConfig.js +2 -2
- package/lib/listener/config.js +3 -3
- package/lib/locator.js +6 -0
- package/lib/pause.js +22 -1
- package/lib/plugin/allure.js +63 -0
- package/lib/plugin/autoLogin.js +65 -16
- package/lib/plugin/puppeteerCoverage.js +6 -1
- package/lib/plugin/stepByStepReport.js +4 -3
- package/lib/scenario.js +23 -17
- package/lib/step.js +5 -2
- package/lib/ui.js +1 -1
- package/lib/utils.js +70 -20
- package/package.json +20 -19
- package/translations/de-DE.js +69 -0
- package/translations/index.js +1 -0
- package/docs/video.md +0 -26
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
id: WebDriverIO
|
|
3
3
|
title: WebDriverIO
|
|
4
4
|
---
|
|
5
|
+
|
|
5
6
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
6
7
|
|
|
7
8
|
## WebDriverIO
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Extends Helper
|
|
10
11
|
|
|
11
12
|
WebDriverIO helper which wraps [webdriverio][1] library to
|
|
12
13
|
manipulate browser using Selenium WebDriver or PhantomJS.
|
|
@@ -19,22 +20,22 @@ This helper should be configured in codecept.json or codecept.conf.js
|
|
|
19
20
|
|
|
20
21
|
- `url`: base url of website to be tested.
|
|
21
22
|
- `browser`: browser in which to perform testing.
|
|
22
|
-
- `host`:
|
|
23
|
-
- `port`:
|
|
24
|
-
- `protocol`:
|
|
25
|
-
- `path`:
|
|
26
|
-
- `restart`:
|
|
27
|
-
- `smartWait`: (optional)
|
|
28
|
-
- `disableScreenshots`:
|
|
29
|
-
- `fullPageScreenshots`
|
|
30
|
-
- `uniqueScreenshotNames`:
|
|
31
|
-
- `keepBrowserState`:
|
|
32
|
-
- `keepCookies`:
|
|
23
|
+
- `host`: - WebDriver host to connect.
|
|
24
|
+
- `port`: - WebDriver port to connect.
|
|
25
|
+
- `protocol`: - protocol for WebDriver server.
|
|
26
|
+
- `path`: - path to WebDriver server,
|
|
27
|
+
- `restart`: - restart browser between tests.
|
|
28
|
+
- `smartWait`: (optional) enables [SmartWait][3]; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
|
|
29
|
+
- `disableScreenshots`: - don't save screenshots on failure.
|
|
30
|
+
- `fullPageScreenshots` - make full page screenshots on failure.
|
|
31
|
+
- `uniqueScreenshotNames`: - option to prevent screenshot override if you have scenarios with the same name in different suites.
|
|
32
|
+
- `keepBrowserState`: - keep browser state between tests when `restart` is set to false.
|
|
33
|
+
- `keepCookies`: - keep cookies between tests when `restart` set to false.
|
|
33
34
|
- `windowSize`: (optional) default window size. Set to `maximize` or a dimension in the format `640x480`.
|
|
34
|
-
- `waitForTimeout`:
|
|
35
|
+
- `waitForTimeout`: sets default wait time in _ms_ for all `wait` functions.
|
|
35
36
|
- `desiredCapabilities`: Selenium's [desired
|
|
36
37
|
capabilities][4].
|
|
37
|
-
- `manualStart`:
|
|
38
|
+
- `manualStart`: - do not start browser before a test, start it manually inside a helper
|
|
38
39
|
with `this.helpers["WebDriverIO"]._startBrowser()`.
|
|
39
40
|
- `timeouts`: [WebDriverIO timeouts][5] defined as hash.
|
|
40
41
|
|
|
@@ -210,7 +211,7 @@ this.helpers['WebDriverIO']._locate({name: 'password'}).then //...
|
|
|
210
211
|
#### Parameters
|
|
211
212
|
|
|
212
213
|
- `locator` element located by CSS|XPath|strict locator.
|
|
213
|
-
- `smartWait`
|
|
214
|
+
- `smartWait`
|
|
214
215
|
|
|
215
216
|
### \_locateCheckable
|
|
216
217
|
|
|
@@ -267,7 +268,9 @@ I.amOnPage('/login'); // opens a login page
|
|
|
267
268
|
|
|
268
269
|
#### Parameters
|
|
269
270
|
|
|
270
|
-
- `url`
|
|
271
|
+
- `url` [string][10] url path or global url.
|
|
272
|
+
|
|
273
|
+
|
|
271
274
|
Appium: support only web testing
|
|
272
275
|
|
|
273
276
|
### appendField
|
|
@@ -281,8 +284,10 @@ I.appendField('#myTextField', 'appended');
|
|
|
281
284
|
|
|
282
285
|
#### Parameters
|
|
283
286
|
|
|
284
|
-
- `field`
|
|
285
|
-
- `value`
|
|
287
|
+
- `field` ([string][10] \| [object][11]) located by label|name|CSS|XPath|strict locator
|
|
288
|
+
- `value` [string][10] text value to append.
|
|
289
|
+
|
|
290
|
+
|
|
286
291
|
Appium: support, but it's clear a field before insert in apps
|
|
287
292
|
|
|
288
293
|
### attachFile
|
|
@@ -298,8 +303,10 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
298
303
|
|
|
299
304
|
#### Parameters
|
|
300
305
|
|
|
301
|
-
- `locator`
|
|
302
|
-
- `pathToFile`
|
|
306
|
+
- `locator` ([string][10] \| [object][11]) field located by label|name|CSS|XPath|strict locator.
|
|
307
|
+
- `pathToFile` [string][10] local file path relative to codecept.json config file.
|
|
308
|
+
|
|
309
|
+
|
|
303
310
|
Appium: not tested
|
|
304
311
|
|
|
305
312
|
### cancelPopup
|
|
@@ -322,39 +329,29 @@ I.checkOption('agree', '//form');
|
|
|
322
329
|
|
|
323
330
|
#### Parameters
|
|
324
331
|
|
|
325
|
-
- `field`
|
|
326
|
-
- `context`
|
|
327
|
-
|
|
332
|
+
- `field` ([string][10] \| [object][11]) checkbox located by label | name | CSS | XPath | strict locator.
|
|
333
|
+
- `context` [string][10] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
334
|
+
|
|
328
335
|
|
|
329
|
-
|
|
336
|
+
Appium: not tested
|
|
330
337
|
|
|
331
|
-
|
|
332
|
-
if none provided clears all cookies.
|
|
338
|
+
### clearCookie
|
|
333
339
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
I.clearCookie('test');
|
|
337
|
-
```
|
|
340
|
+
{{> clearCookie}}
|
|
341
|
+
Appium: support only web testing
|
|
338
342
|
|
|
339
343
|
#### Parameters
|
|
340
344
|
|
|
341
|
-
- `cookie`
|
|
342
|
-
Appium: support only web testing
|
|
345
|
+
- `cookie`
|
|
343
346
|
|
|
344
347
|
### clearField
|
|
345
348
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
```js
|
|
349
|
-
I.clearField('Email');
|
|
350
|
-
I.clearField('user[email]');
|
|
351
|
-
I.clearField('#email');
|
|
352
|
-
```
|
|
349
|
+
{{> clearField}}
|
|
350
|
+
Appium: support
|
|
353
351
|
|
|
354
352
|
#### Parameters
|
|
355
353
|
|
|
356
|
-
- `field`
|
|
357
|
-
Appium: support
|
|
354
|
+
- `field`
|
|
358
355
|
|
|
359
356
|
### click
|
|
360
357
|
|
|
@@ -373,7 +370,7 @@ I.click('Submit');
|
|
|
373
370
|
// CSS button
|
|
374
371
|
I.click('#form input[type=submit]');
|
|
375
372
|
// XPath
|
|
376
|
-
I.click('//form
|
|
373
|
+
I.click('//form/[@type=submit]');
|
|
377
374
|
// link in context
|
|
378
375
|
I.click('Logout', '#nav');
|
|
379
376
|
// using strict locator
|
|
@@ -382,9 +379,11 @@ I.click({css: 'nav a.login'});
|
|
|
382
379
|
|
|
383
380
|
#### Parameters
|
|
384
381
|
|
|
385
|
-
- `locator`
|
|
386
|
-
- `context`
|
|
387
|
-
|
|
382
|
+
- `locator` ([string][10] \| [object][11]) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
383
|
+
- `context` ([string][10] \| [object][11]) (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
Appium: support
|
|
388
387
|
|
|
389
388
|
### closeCurrentTab
|
|
390
389
|
|
|
@@ -424,59 +423,82 @@ Opposite to `see`. Checks that a text is not present on a page.
|
|
|
424
423
|
Use context parameter to narrow down the search.
|
|
425
424
|
|
|
426
425
|
```js
|
|
427
|
-
I.dontSee('Login'); // assume we are already logged in
|
|
426
|
+
I.dontSee('Login'); // assume we are already logged in.
|
|
427
|
+
I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
428
428
|
```
|
|
429
429
|
|
|
430
430
|
#### Parameters
|
|
431
431
|
|
|
432
|
-
- `text`
|
|
433
|
-
- `context`
|
|
434
|
-
|
|
432
|
+
- `text` [string][10] which is not present.
|
|
433
|
+
- `context` ([string][10] \| [object][11]) (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
434
|
+
|
|
435
|
+
Appium: support with context in apps
|
|
435
436
|
|
|
436
437
|
### dontSeeCheckboxIsChecked
|
|
437
438
|
|
|
438
439
|
Verifies that the specified checkbox is not checked.
|
|
439
440
|
|
|
441
|
+
```js
|
|
442
|
+
I.dontSeeeCheckboxIsChedcked('#agree'); // located by ID
|
|
443
|
+
I.dontSeeeCheckboxIsChedcked('I agree to terms'); // located by label
|
|
444
|
+
I.dontSeeeCheckboxIsChedcked('agree'); // located by name
|
|
445
|
+
```
|
|
446
|
+
|
|
440
447
|
#### Parameters
|
|
441
448
|
|
|
442
|
-
- `field`
|
|
449
|
+
- `field` ([string][10] \| [object][11]) located by label|name|CSS|XPath|strict locator.
|
|
450
|
+
|
|
451
|
+
|
|
443
452
|
Appium: not tested
|
|
444
453
|
|
|
445
454
|
### dontSeeCookie
|
|
446
455
|
|
|
447
|
-
|
|
456
|
+
{{> dontSeeCookie}}
|
|
457
|
+
Appium: support only web testing
|
|
448
458
|
|
|
449
459
|
#### Parameters
|
|
450
460
|
|
|
451
|
-
- `name`
|
|
452
|
-
Appium: support only web testing
|
|
461
|
+
- `name`
|
|
453
462
|
|
|
454
463
|
### dontSeeCurrentUrlEquals
|
|
455
464
|
|
|
456
465
|
Checks that current url is not equal to provided one.
|
|
457
466
|
If a relative url provided, a configured url will be prepended to it.
|
|
458
467
|
|
|
468
|
+
```js
|
|
469
|
+
I.dontSeeCurrentUrlEquals('/login'); // relative url are ok
|
|
470
|
+
I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also ok
|
|
471
|
+
```
|
|
472
|
+
|
|
459
473
|
#### Parameters
|
|
460
474
|
|
|
461
|
-
- `url`
|
|
475
|
+
- `url` [string][10] value to check.
|
|
476
|
+
|
|
477
|
+
|
|
462
478
|
Appium: support only web testing
|
|
463
479
|
|
|
464
480
|
### dontSeeElement
|
|
465
481
|
|
|
466
|
-
|
|
482
|
+
{{> dontSeeElement}}
|
|
483
|
+
Appium: support
|
|
467
484
|
|
|
468
485
|
#### Parameters
|
|
469
486
|
|
|
470
|
-
- `locator`
|
|
471
|
-
Appium: support
|
|
487
|
+
- `locator`
|
|
472
488
|
|
|
473
489
|
### dontSeeElementInDOM
|
|
474
490
|
|
|
475
491
|
Opposite to `seeElementInDOM`. Checks that element is not on page.
|
|
476
492
|
|
|
493
|
+
```js
|
|
494
|
+
I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
|
|
495
|
+
```
|
|
496
|
+
|
|
477
497
|
#### Parameters
|
|
478
498
|
|
|
479
|
-
- `locator`
|
|
499
|
+
- `locator` ([string][10] \| [object][11]) located by CSS|XPath|Strict locator.
|
|
500
|
+
|
|
501
|
+
|
|
480
502
|
Appium: support
|
|
481
503
|
|
|
482
504
|
### dontSeeInCurrentUrl
|
|
@@ -485,7 +507,9 @@ Checks that current url does not contain a provided fragment.
|
|
|
485
507
|
|
|
486
508
|
#### Parameters
|
|
487
509
|
|
|
488
|
-
- `url`
|
|
510
|
+
- `url` [string][10] value to check.
|
|
511
|
+
|
|
512
|
+
|
|
489
513
|
Appium: support only web testing
|
|
490
514
|
|
|
491
515
|
### dontSeeInField
|
|
@@ -493,27 +517,48 @@ Checks that current url does not contain a provided fragment.
|
|
|
493
517
|
Checks that value of input field or textare doesn't equal to given value
|
|
494
518
|
Opposite to `seeInField`.
|
|
495
519
|
|
|
520
|
+
```js
|
|
521
|
+
I.dontSeeInField('email', 'user@user.com'); // field by name
|
|
522
|
+
I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
523
|
+
```
|
|
524
|
+
|
|
496
525
|
#### Parameters
|
|
497
526
|
|
|
498
|
-
- `field`
|
|
499
|
-
- `value`
|
|
527
|
+
- `field` ([string][10] \| [object][11]) located by label|name|CSS|XPath|strict locator.
|
|
528
|
+
- `value` [string][10] value to check.
|
|
529
|
+
|
|
530
|
+
|
|
500
531
|
Appium: support only web testing
|
|
501
532
|
|
|
502
533
|
### dontSeeInSource
|
|
503
534
|
|
|
504
535
|
Checks that the current page does not contains the given string in its raw source code.
|
|
505
536
|
|
|
537
|
+
```js
|
|
538
|
+
I.dontSeeInSource('<!--'); // no comments in source
|
|
539
|
+
```
|
|
540
|
+
|
|
506
541
|
#### Parameters
|
|
507
542
|
|
|
508
|
-
- `text`
|
|
543
|
+
- `text`
|
|
544
|
+
- `value` [string][10] to check.
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
Appium: support
|
|
509
548
|
|
|
510
549
|
### dontSeeInTitle
|
|
511
550
|
|
|
512
551
|
Checks that title does not contain text.
|
|
513
552
|
|
|
553
|
+
```js
|
|
554
|
+
I.dontSeeInTitle('Error');
|
|
555
|
+
```
|
|
556
|
+
|
|
514
557
|
#### Parameters
|
|
515
558
|
|
|
516
|
-
- `text`
|
|
559
|
+
- `text` [string][10] value to check.
|
|
560
|
+
|
|
561
|
+
|
|
517
562
|
Appium: support only web testing
|
|
518
563
|
|
|
519
564
|
### doubleClick
|
|
@@ -530,9 +575,11 @@ I.doubleClick('.btn.edit');
|
|
|
530
575
|
|
|
531
576
|
#### Parameters
|
|
532
577
|
|
|
533
|
-
- `locator`
|
|
534
|
-
- `context`
|
|
535
|
-
|
|
578
|
+
- `locator` ([string][10] \| [object][11]) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
579
|
+
- `context` ([string][10] \| [object][11]) (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
Appium: support only web testing
|
|
536
583
|
|
|
537
584
|
### dragAndDrop
|
|
538
585
|
|
|
@@ -544,8 +591,10 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
544
591
|
|
|
545
592
|
#### Parameters
|
|
546
593
|
|
|
547
|
-
- `srcElement`
|
|
548
|
-
- `destElement`
|
|
594
|
+
- `srcElement` ([string][10] \| [object][11]) located by CSS|XPath|strict locator.
|
|
595
|
+
- `destElement` ([string][10] \| [object][11]) located by CSS|XPath|strict locator.
|
|
596
|
+
|
|
597
|
+
|
|
549
598
|
Appium: not tested
|
|
550
599
|
|
|
551
600
|
### executeAsyncScript
|
|
@@ -553,11 +602,11 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
553
602
|
Executes async script on page.
|
|
554
603
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
555
604
|
|
|
556
|
-
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][
|
|
605
|
+
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][12].
|
|
557
606
|
|
|
558
607
|
```js
|
|
559
608
|
I.executeAsyncScript(function(done) {
|
|
560
|
-
Vue.nextTick(done); // waiting for next tick
|
|
609
|
+
Vue.nextTick(done); // waiting for next tick
|
|
561
610
|
});
|
|
562
611
|
```
|
|
563
612
|
|
|
@@ -566,14 +615,14 @@ Additional arguments can be passed as well, while `done` function is always last
|
|
|
566
615
|
|
|
567
616
|
```js
|
|
568
617
|
let val = await I.executeAsyncScript(function(url, done) {
|
|
569
|
-
// in browser context
|
|
570
|
-
$.ajax(url, { success: (data) => done(data); }
|
|
618
|
+
// in browser context
|
|
619
|
+
$.ajax(url, { success: (data) => done(data); }
|
|
571
620
|
}, 'http://ajax.callback.url/');
|
|
572
621
|
```
|
|
573
622
|
|
|
574
623
|
#### Parameters
|
|
575
624
|
|
|
576
|
-
- `fn`
|
|
625
|
+
- `fn` ([string][10] \| [function][13]) function to be executed in browser context.
|
|
577
626
|
|
|
578
627
|
### executeScript
|
|
579
628
|
|
|
@@ -587,8 +636,8 @@ Example with jQuery DatePicker:
|
|
|
587
636
|
```js
|
|
588
637
|
// change date of jQuery DatePicker
|
|
589
638
|
I.executeScript(function() {
|
|
590
|
-
// now we are inside browser context
|
|
591
|
-
$('date').datetimepicker('setDate', new Date());
|
|
639
|
+
// now we are inside browser context
|
|
640
|
+
$('date').datetimepicker('setDate', new Date());
|
|
592
641
|
});
|
|
593
642
|
```
|
|
594
643
|
|
|
@@ -596,14 +645,14 @@ Can return values. Don't forget to use `await` to get them.
|
|
|
596
645
|
|
|
597
646
|
```js
|
|
598
647
|
let date = await I.executeScript(function(el) {
|
|
599
|
-
// only basic types can be returned
|
|
600
|
-
return $(el).datetimepicker('getDate').toString();
|
|
648
|
+
// only basic types can be returned
|
|
649
|
+
return $(el).datetimepicker('getDate').toString();
|
|
601
650
|
}, '#date'); // passing jquery selector
|
|
602
651
|
```
|
|
603
652
|
|
|
604
653
|
#### Parameters
|
|
605
654
|
|
|
606
|
-
- `fn`
|
|
655
|
+
- `fn` ([string][10] \| [function][13]) function to be executed in browser context.
|
|
607
656
|
|
|
608
657
|
### fillField
|
|
609
658
|
|
|
@@ -623,14 +672,17 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
623
672
|
|
|
624
673
|
#### Parameters
|
|
625
674
|
|
|
626
|
-
- `field`
|
|
627
|
-
- `value`
|
|
675
|
+
- `field` ([string][10] \| [object][11]) located by label|name|CSS|XPath|strict locator.
|
|
676
|
+
- `value` [string][10] text value to fill.
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
Appium: support
|
|
628
680
|
|
|
629
681
|
### grabAttributeFrom
|
|
630
682
|
|
|
631
683
|
Retrieves an attribute from an element located by CSS or XPath and returns it to test.
|
|
632
684
|
An array as a result will be returned if there are more than one matched element.
|
|
633
|
-
Resumes test execution, so
|
|
685
|
+
Resumes test execution, so should be used inside async with `await` operator.
|
|
634
686
|
|
|
635
687
|
```js
|
|
636
688
|
let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
@@ -638,9 +690,13 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
638
690
|
|
|
639
691
|
#### Parameters
|
|
640
692
|
|
|
641
|
-
- `locator`
|
|
642
|
-
- `attr`
|
|
643
|
-
|
|
693
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
694
|
+
- `attr` [string][10] attribute name.
|
|
695
|
+
|
|
696
|
+
Returns [Promise][14]<[string][10]> attribute value
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
Appium: can be used for apps only with several values ("contentDescription", "text", "className", "resourceId")
|
|
644
700
|
|
|
645
701
|
### grabBrowserLogs
|
|
646
702
|
|
|
@@ -653,24 +709,17 @@ console.log(JSON.stringify(logs))
|
|
|
653
709
|
|
|
654
710
|
### grabCookie
|
|
655
711
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
Resumes test execution, so **should be used inside async with `await`** operator.
|
|
659
|
-
|
|
660
|
-
```js
|
|
661
|
-
let cookie = await I.grabCookie('auth');
|
|
662
|
-
assert(cookie.value, '123456');
|
|
663
|
-
```
|
|
712
|
+
{{> grabCookie}}
|
|
713
|
+
Appium: support only web testing
|
|
664
714
|
|
|
665
715
|
#### Parameters
|
|
666
716
|
|
|
667
|
-
- `name`
|
|
668
|
-
Appium: support only web testing
|
|
717
|
+
- `name`
|
|
669
718
|
|
|
670
719
|
### grabCssPropertyFrom
|
|
671
720
|
|
|
672
721
|
Grab CSS property for given locator
|
|
673
|
-
Resumes test execution, so
|
|
722
|
+
Resumes test execution, so should be used inside an async function with `await` operator.
|
|
674
723
|
|
|
675
724
|
```js
|
|
676
725
|
const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
@@ -678,8 +727,12 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
678
727
|
|
|
679
728
|
#### Parameters
|
|
680
729
|
|
|
681
|
-
- `locator`
|
|
682
|
-
- `cssProperty`
|
|
730
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
731
|
+
- `cssProperty` [string][10] CSS property name.
|
|
732
|
+
|
|
733
|
+
Returns [Promise][14]<[string][10]> CSS value
|
|
734
|
+
|
|
735
|
+
|
|
683
736
|
|
|
684
737
|
### grabCurrentUrl
|
|
685
738
|
|
|
@@ -691,10 +744,14 @@ let url = await I.grabCurrentUrl();
|
|
|
691
744
|
console.log(`Current URL is [${url}]`);
|
|
692
745
|
```
|
|
693
746
|
|
|
747
|
+
Returns [Promise][14]<[string][10]> current URL
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
694
751
|
### grabHTMLFrom
|
|
695
752
|
|
|
696
753
|
Retrieves the innerHTML from an element located by CSS or XPath and returns it to test.
|
|
697
|
-
Resumes test execution, so
|
|
754
|
+
Resumes test execution, so should be used inside async function with `await` operator.
|
|
698
755
|
If more than one element is found - an array of HTMLs returned.
|
|
699
756
|
|
|
700
757
|
```js
|
|
@@ -704,36 +761,43 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
704
761
|
#### Parameters
|
|
705
762
|
|
|
706
763
|
- `locator` element located by CSS|XPath|strict locator.
|
|
707
|
-
|
|
764
|
+
|
|
765
|
+
Returns [Promise][14]<[string][10]> HTML code for an element
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
Appium: support only web testing
|
|
708
769
|
|
|
709
770
|
### grabNumberOfOpenTabs
|
|
710
771
|
|
|
711
772
|
Grab number of open tabs.
|
|
712
773
|
|
|
713
774
|
```js
|
|
714
|
-
I.grabNumberOfOpenTabs();
|
|
775
|
+
let tabs = await I.grabNumberOfOpenTabs();
|
|
715
776
|
```
|
|
716
777
|
|
|
778
|
+
Returns [Promise][14]<[number][15]> number of open tabs
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
|
|
717
782
|
### grabNumberOfVisibleElements
|
|
718
783
|
|
|
719
784
|
Grab number of visible elements by locator.
|
|
720
785
|
|
|
721
786
|
```js
|
|
722
|
-
I.grabNumberOfVisibleElements('p');
|
|
787
|
+
let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
723
788
|
```
|
|
724
789
|
|
|
725
790
|
#### Parameters
|
|
726
791
|
|
|
727
|
-
- `locator`
|
|
792
|
+
- `locator` ([string][10] \| [object][11]) located by CSS|XPath|strict locator.
|
|
728
793
|
|
|
729
|
-
|
|
794
|
+
Returns [Promise][14]<[number][15]> number of visible elements
|
|
730
795
|
|
|
731
|
-
Retrieves a page scroll position and returns it to test.
|
|
732
|
-
Resumes test execution, so **should be used inside an async function with `await`** operator.
|
|
733
796
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
797
|
+
|
|
798
|
+
### grabPageScrollPosition
|
|
799
|
+
|
|
800
|
+
{{> grabPageScrollPosition}}
|
|
737
801
|
|
|
738
802
|
### grabPopupText
|
|
739
803
|
|
|
@@ -752,12 +816,15 @@ Resumes test execution, so should be used inside an async function.
|
|
|
752
816
|
let pageSource = await I.grabSource();
|
|
753
817
|
```
|
|
754
818
|
|
|
819
|
+
Returns [Promise][14]<[string][10]> source code
|
|
820
|
+
|
|
821
|
+
|
|
755
822
|
Appium: support
|
|
756
823
|
|
|
757
824
|
### grabTextFrom
|
|
758
825
|
|
|
759
826
|
Retrieves a text from an element located by CSS or XPath and returns it to test.
|
|
760
|
-
Resumes test execution, so
|
|
827
|
+
Resumes test execution, so should be used inside async with `await` operator.
|
|
761
828
|
|
|
762
829
|
```js
|
|
763
830
|
let pin = await I.grabTextFrom('#pin');
|
|
@@ -768,23 +835,30 @@ If multiple elements found returns an array of texts.
|
|
|
768
835
|
#### Parameters
|
|
769
836
|
|
|
770
837
|
- `locator` element located by CSS|XPath|strict locator.
|
|
771
|
-
|
|
838
|
+
|
|
839
|
+
Returns [Promise][14]<[string][10]> attribute value
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
Appium: support
|
|
772
843
|
|
|
773
844
|
### grabTitle
|
|
774
845
|
|
|
775
846
|
Retrieves a page title and returns it to test.
|
|
776
|
-
Resumes test execution, so
|
|
847
|
+
Resumes test execution, so should be used inside async with `await` operator.
|
|
777
848
|
|
|
778
849
|
```js
|
|
779
850
|
let title = await I.grabTitle();
|
|
780
851
|
```
|
|
781
852
|
|
|
853
|
+
Returns [Promise][14]<[string][10]> title
|
|
854
|
+
|
|
855
|
+
|
|
782
856
|
Appium: support only web testing
|
|
783
857
|
|
|
784
858
|
### grabValueFrom
|
|
785
859
|
|
|
786
860
|
Retrieves a value from a form element located by CSS or XPath and returns it to test.
|
|
787
|
-
Resumes test execution, so
|
|
861
|
+
Resumes test execution, so should be used inside async function with `await` operator.
|
|
788
862
|
|
|
789
863
|
```js
|
|
790
864
|
let email = await I.grabValueFrom('input[name=email]');
|
|
@@ -792,25 +866,23 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
792
866
|
|
|
793
867
|
#### Parameters
|
|
794
868
|
|
|
795
|
-
- `locator`
|
|
796
|
-
Appium: support only web testing
|
|
869
|
+
- `locator` ([string][10] \| [object][11]) field located by label|name|CSS|XPath|strict locator.
|
|
797
870
|
|
|
798
|
-
|
|
871
|
+
Returns [Promise][14]<[string][10]> attribute value
|
|
799
872
|
|
|
800
|
-
Moves cursor to element matched by locator.
|
|
801
|
-
Extra shift can be set with offsetX and offsetY options.
|
|
802
873
|
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
874
|
+
Appium: support only web testing
|
|
875
|
+
|
|
876
|
+
### moveCursorTo
|
|
877
|
+
|
|
878
|
+
{{> moveCursorTo}}
|
|
879
|
+
Appium: support only web testing
|
|
807
880
|
|
|
808
881
|
#### Parameters
|
|
809
882
|
|
|
810
|
-
- `locator`
|
|
811
|
-
- `offsetX`
|
|
812
|
-
- `offsetY`
|
|
813
|
-
Appium: support only web testing
|
|
883
|
+
- `locator`
|
|
884
|
+
- `offsetX`
|
|
885
|
+
- `offsetY`
|
|
814
886
|
|
|
815
887
|
### openNewTab
|
|
816
888
|
|
|
@@ -823,7 +895,7 @@ I.openNewTab();
|
|
|
823
895
|
### pressKey
|
|
824
896
|
|
|
825
897
|
Presses a key on a focused element.
|
|
826
|
-
Special keys like 'Enter', 'Control', [etc][
|
|
898
|
+
Special keys like 'Enter', 'Control', [etc][16]
|
|
827
899
|
will be replaced with corresponding unicode.
|
|
828
900
|
If modifier key is used (Control, Command, Alt, Shift) in array, it will be released afterwards.
|
|
829
901
|
|
|
@@ -834,36 +906,10 @@ I.pressKey(['Control','a']);
|
|
|
834
906
|
|
|
835
907
|
#### Parameters
|
|
836
908
|
|
|
837
|
-
- `key`
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
- `'ArrowLeft'` or `'Left arrow'`,
|
|
842
|
-
- `'ArrowRight'` or `'Right arrow'`,
|
|
843
|
-
- `'ArrowUp'` or `'Up arrow'`,
|
|
844
|
-
- `'Backspace'`,
|
|
845
|
-
- `'Command'`,
|
|
846
|
-
- `'Control'`,
|
|
847
|
-
- `'Del'`,
|
|
848
|
-
- `'Divide'`,
|
|
849
|
-
- `'End'`,
|
|
850
|
-
- `'Enter'`,
|
|
851
|
-
- `'Equals'`,
|
|
852
|
-
- `'Escape'`,
|
|
853
|
-
- `'F1 to F12'`,
|
|
854
|
-
- `'Home'`,
|
|
855
|
-
- `'Insert'`,
|
|
856
|
-
- `'Meta'`,
|
|
857
|
-
- `'Multiply'`,
|
|
858
|
-
- `'Numpad 0'` to `'Numpad 9'`,
|
|
859
|
-
- `'Pagedown'` or `'PageDown'`,
|
|
860
|
-
- `'Pageup'` or `'PageUp'`,
|
|
861
|
-
- `'Pause'`,
|
|
862
|
-
- `'Semicolon'`,
|
|
863
|
-
- `'Shift'`,
|
|
864
|
-
- `'Space'`,
|
|
865
|
-
- `'Subtract'`,
|
|
866
|
-
- `'Tab'`.To make combinations with modifier and mouse clicks (like Ctrl+Click) press a modifier, click, then release it.
|
|
909
|
+
- `key` ([string][10] \| [array][17]) key or array of keys to press.
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
{{> \_keys }}To make combinations with modifier and mouse clicks (like Ctrl+Click) press a modifier, click, then release it.
|
|
867
913
|
Appium: support, but clear field before pressing in apps:```js
|
|
868
914
|
I.pressKey('Control');
|
|
869
915
|
I.click('#someelement');
|
|
@@ -878,6 +924,9 @@ Reload the current page.
|
|
|
878
924
|
I.refreshPage();
|
|
879
925
|
```
|
|
880
926
|
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
|
|
881
930
|
### resizeWindow
|
|
882
931
|
|
|
883
932
|
Resize the current window to provided width and height.
|
|
@@ -885,8 +934,10 @@ First parameter can be set to `maximize`.
|
|
|
885
934
|
|
|
886
935
|
#### Parameters
|
|
887
936
|
|
|
888
|
-
- `width`
|
|
889
|
-
- `height`
|
|
937
|
+
- `width` [number][15] width in pixels or `maximize`.
|
|
938
|
+
- `height` [number][15] height in pixels.
|
|
939
|
+
|
|
940
|
+
|
|
890
941
|
Appium: not tested in web, in apps doesn't work
|
|
891
942
|
|
|
892
943
|
### rightClick
|
|
@@ -904,8 +955,11 @@ I.rightClick('Click me', '.context');
|
|
|
904
955
|
|
|
905
956
|
#### Parameters
|
|
906
957
|
|
|
907
|
-
- `locator`
|
|
908
|
-
- `context`
|
|
958
|
+
- `locator` ([string][10] \| [object][11]) clickable element located by CSS|XPath|strict locator.
|
|
959
|
+
- `context` ([string][10] \| [object][11]) (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
Appium: support, but in apps works as usual click
|
|
909
963
|
|
|
910
964
|
### runInWeb
|
|
911
965
|
|
|
@@ -935,20 +989,13 @@ Placeholder for ~ locator only test case write once run on both Appium and WebDr
|
|
|
935
989
|
|
|
936
990
|
### saveScreenshot
|
|
937
991
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
Optionally resize the window to the full available page `scrollHeight` and `scrollWidth` to capture the entire page by passing `true` in as the second argument.
|
|
941
|
-
|
|
942
|
-
```js
|
|
943
|
-
I.saveScreenshot('debug.png');
|
|
944
|
-
I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scrollWidth before taking screenshot
|
|
945
|
-
```
|
|
992
|
+
{{> saveScreenshot}}
|
|
993
|
+
Appium: support
|
|
946
994
|
|
|
947
995
|
#### Parameters
|
|
948
996
|
|
|
949
|
-
- `fileName`
|
|
950
|
-
- `fullPage`
|
|
951
|
-
Appium: support
|
|
997
|
+
- `fileName`
|
|
998
|
+
- `fullPage`
|
|
952
999
|
|
|
953
1000
|
### scrollPageToBottom
|
|
954
1001
|
|
|
@@ -958,6 +1005,9 @@ Scroll page to the bottom.
|
|
|
958
1005
|
I.scrollPageToBottom();
|
|
959
1006
|
```
|
|
960
1007
|
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
|
|
961
1011
|
### scrollPageToTop
|
|
962
1012
|
|
|
963
1013
|
Scroll page to the top.
|
|
@@ -966,6 +1016,9 @@ Scroll page to the top.
|
|
|
966
1016
|
I.scrollPageToTop();
|
|
967
1017
|
```
|
|
968
1018
|
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
|
|
969
1022
|
### scrollTo
|
|
970
1023
|
|
|
971
1024
|
Scrolls to element matched by locator.
|
|
@@ -994,10 +1047,12 @@ I.scrollTo('#submit', 5, 5);
|
|
|
994
1047
|
|
|
995
1048
|
#### Parameters
|
|
996
1049
|
|
|
997
|
-
- `locator`
|
|
998
|
-
- `offsetX`
|
|
999
|
-
- `offsetY`
|
|
1000
|
-
|
|
1050
|
+
- `locator` ([string][10] \| [object][11]) located by CSS|XPath|strict locator.
|
|
1051
|
+
- `offsetX` [number][15] (optional, `0` by default) X-axis offset.
|
|
1052
|
+
- `offsetY` [number][15] (optional, `0` by default) Y-axis offset.
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
Appium: support only web testing
|
|
1001
1056
|
|
|
1002
1057
|
### see
|
|
1003
1058
|
|
|
@@ -1012,22 +1067,26 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1012
1067
|
|
|
1013
1068
|
#### Parameters
|
|
1014
1069
|
|
|
1015
|
-
- `text`
|
|
1016
|
-
- `context`
|
|
1017
|
-
|
|
1070
|
+
- `text` [string][10] expected on page.
|
|
1071
|
+
- `context` ([string][10] \| [object][11]) (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
Appium: support with context in apps
|
|
1018
1075
|
|
|
1019
1076
|
### seeAttributesOnElements
|
|
1020
1077
|
|
|
1021
1078
|
Checks that all elements with given locator have given attributes.
|
|
1022
1079
|
|
|
1023
1080
|
```js
|
|
1024
|
-
I.seeAttributesOnElements('//form', {
|
|
1081
|
+
I.seeAttributesOnElements('//form', { method: "post"});
|
|
1025
1082
|
```
|
|
1026
1083
|
|
|
1027
1084
|
#### Parameters
|
|
1028
1085
|
|
|
1029
|
-
- `locator`
|
|
1030
|
-
- `attributes`
|
|
1086
|
+
- `locator` ([string][10] \| [object][11]) located by CSS|XPath|strict locator.
|
|
1087
|
+
- `attributes` [object][11] attributes and their values to check.
|
|
1088
|
+
|
|
1089
|
+
|
|
1031
1090
|
|
|
1032
1091
|
### seeCheckboxIsChecked
|
|
1033
1092
|
|
|
@@ -1041,21 +1100,19 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1041
1100
|
|
|
1042
1101
|
#### Parameters
|
|
1043
1102
|
|
|
1044
|
-
- `field`
|
|
1103
|
+
- `field` ([string][10] \| [object][11]) located by label|name|CSS|XPath|strict locator.
|
|
1104
|
+
|
|
1105
|
+
|
|
1045
1106
|
Appium: not tested
|
|
1046
1107
|
|
|
1047
1108
|
### seeCookie
|
|
1048
1109
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
```js
|
|
1052
|
-
I.seeCookie('Auth');
|
|
1053
|
-
```
|
|
1110
|
+
{{> seeCookie}}
|
|
1111
|
+
Appium: support only web testing
|
|
1054
1112
|
|
|
1055
1113
|
#### Parameters
|
|
1056
1114
|
|
|
1057
|
-
- `name`
|
|
1058
|
-
Appium: support only web testing
|
|
1115
|
+
- `name`
|
|
1059
1116
|
|
|
1060
1117
|
### seeCssPropertiesOnElements
|
|
1061
1118
|
|
|
@@ -1067,8 +1124,10 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1067
1124
|
|
|
1068
1125
|
#### Parameters
|
|
1069
1126
|
|
|
1070
|
-
- `locator`
|
|
1071
|
-
- `cssProperties`
|
|
1127
|
+
- `locator` ([string][10] \| [object][11]) located by CSS|XPath|strict locator.
|
|
1128
|
+
- `cssProperties` [object][11] object with CSS properties and their values to check.
|
|
1129
|
+
|
|
1130
|
+
|
|
1072
1131
|
|
|
1073
1132
|
### seeCurrentUrlEquals
|
|
1074
1133
|
|
|
@@ -1083,7 +1142,9 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1083
1142
|
|
|
1084
1143
|
#### Parameters
|
|
1085
1144
|
|
|
1086
|
-
- `url`
|
|
1145
|
+
- `url` [string][10] value to check.
|
|
1146
|
+
|
|
1147
|
+
|
|
1087
1148
|
Appium: support only web testing
|
|
1088
1149
|
|
|
1089
1150
|
### seeElement
|
|
@@ -1097,7 +1158,9 @@ I.seeElement('#modal');
|
|
|
1097
1158
|
|
|
1098
1159
|
#### Parameters
|
|
1099
1160
|
|
|
1100
|
-
- `locator`
|
|
1161
|
+
- `locator` ([string][10] \| [object][11]) located by CSS|XPath|strict locator.
|
|
1162
|
+
|
|
1163
|
+
|
|
1101
1164
|
Appium: support
|
|
1102
1165
|
|
|
1103
1166
|
### seeElementInDOM
|
|
@@ -1111,7 +1174,9 @@ I.seeElementInDOM('#modal');
|
|
|
1111
1174
|
|
|
1112
1175
|
#### Parameters
|
|
1113
1176
|
|
|
1114
|
-
- `locator`
|
|
1177
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
1178
|
+
|
|
1179
|
+
|
|
1115
1180
|
Appium: support
|
|
1116
1181
|
|
|
1117
1182
|
### seeInCurrentUrl
|
|
@@ -1124,7 +1189,9 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1124
1189
|
|
|
1125
1190
|
#### Parameters
|
|
1126
1191
|
|
|
1127
|
-
- `url`
|
|
1192
|
+
- `url` [string][10] a fragment to check
|
|
1193
|
+
|
|
1194
|
+
|
|
1128
1195
|
Appium: support only web testing
|
|
1129
1196
|
|
|
1130
1197
|
### seeInField
|
|
@@ -1141,8 +1208,10 @@ I.seeInField('#searchform input','Search');
|
|
|
1141
1208
|
|
|
1142
1209
|
#### Parameters
|
|
1143
1210
|
|
|
1144
|
-
- `field`
|
|
1145
|
-
- `value`
|
|
1211
|
+
- `field` ([string][10] \| [object][11]) located by label|name|CSS|XPath|strict locator.
|
|
1212
|
+
- `value` [string][10] value to check.
|
|
1213
|
+
|
|
1214
|
+
|
|
1146
1215
|
Appium: support only web testing
|
|
1147
1216
|
|
|
1148
1217
|
### seeInPopup
|
|
@@ -1164,16 +1233,24 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1164
1233
|
|
|
1165
1234
|
#### Parameters
|
|
1166
1235
|
|
|
1167
|
-
- `text`
|
|
1236
|
+
- `text` [string][10] value to check.
|
|
1237
|
+
|
|
1238
|
+
|
|
1168
1239
|
Appium: support
|
|
1169
1240
|
|
|
1170
1241
|
### seeInTitle
|
|
1171
1242
|
|
|
1172
1243
|
Checks that title contains text.
|
|
1173
1244
|
|
|
1245
|
+
```js
|
|
1246
|
+
I.seeInTitle('Home Page');
|
|
1247
|
+
```
|
|
1248
|
+
|
|
1174
1249
|
#### Parameters
|
|
1175
1250
|
|
|
1176
|
-
- `text`
|
|
1251
|
+
- `text` [string][10] text value to check.
|
|
1252
|
+
|
|
1253
|
+
|
|
1177
1254
|
Appium: support only web testing
|
|
1178
1255
|
|
|
1179
1256
|
### seeNumberOfElements
|
|
@@ -1202,8 +1279,10 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1202
1279
|
|
|
1203
1280
|
#### Parameters
|
|
1204
1281
|
|
|
1205
|
-
- `locator`
|
|
1206
|
-
- `num`
|
|
1282
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
1283
|
+
- `num` [number][15] number of elements.
|
|
1284
|
+
|
|
1285
|
+
|
|
1207
1286
|
|
|
1208
1287
|
### seeTextEquals
|
|
1209
1288
|
|
|
@@ -1232,51 +1311,39 @@ I.seeTitleEquals('Test title.');
|
|
|
1232
1311
|
|
|
1233
1312
|
### selectOption
|
|
1234
1313
|
|
|
1235
|
-
|
|
1236
|
-
Field is searched by label | name | CSS | XPath.
|
|
1237
|
-
Option is selected by visible text or by value.
|
|
1238
|
-
|
|
1239
|
-
```js
|
|
1240
|
-
I.selectOption('Choose Plan', 'Monthly'); // select by label
|
|
1241
|
-
I.selectOption('subscription', 'Monthly'); // match option by text
|
|
1242
|
-
I.selectOption('subscription', '0'); // or by value
|
|
1243
|
-
I.selectOption('//form/select[@name=account]','Premium');
|
|
1244
|
-
I.selectOption('form select[name=account]', 'Premium');
|
|
1245
|
-
I.selectOption({css: 'form select[name=account]'}, 'Premium');
|
|
1246
|
-
```
|
|
1247
|
-
|
|
1248
|
-
Provide an array for the second argument to select multiple options.
|
|
1249
|
-
|
|
1250
|
-
```js
|
|
1251
|
-
I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
1252
|
-
```
|
|
1314
|
+
{{> selectOption}}
|
|
1253
1315
|
|
|
1254
1316
|
#### Parameters
|
|
1255
1317
|
|
|
1256
|
-
- `select`
|
|
1257
|
-
- `option`
|
|
1318
|
+
- `select`
|
|
1319
|
+
- `option`
|
|
1258
1320
|
|
|
1259
1321
|
### setCookie
|
|
1260
1322
|
|
|
1261
|
-
|
|
1323
|
+
{{> setCookie}}
|
|
1324
|
+
Appium: support only web testing
|
|
1262
1325
|
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
```
|
|
1326
|
+
Uses Selenium's JSON [cookie
|
|
1327
|
+
format][18].
|
|
1266
1328
|
|
|
1267
1329
|
#### Parameters
|
|
1268
1330
|
|
|
1269
|
-
- `cookie`
|
|
1270
|
-
Appium: support only web testingUses Selenium's JSON [cookie
|
|
1271
|
-
format][13].
|
|
1331
|
+
- `cookie`
|
|
1272
1332
|
|
|
1273
1333
|
### switchTo
|
|
1274
1334
|
|
|
1275
1335
|
Switches frame or in case of null locator reverts to parent.
|
|
1276
1336
|
|
|
1337
|
+
```js
|
|
1338
|
+
I.switchTo('iframe'); // switch to first iframe
|
|
1339
|
+
I.switchTo(); // switch back to main page
|
|
1340
|
+
```
|
|
1341
|
+
|
|
1277
1342
|
#### Parameters
|
|
1278
1343
|
|
|
1279
|
-
- `locator`
|
|
1344
|
+
- `locator` ([string][10] \| [object][11]) (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1345
|
+
|
|
1346
|
+
|
|
1280
1347
|
Appium: support only web testing
|
|
1281
1348
|
|
|
1282
1349
|
### switchToNextTab
|
|
@@ -1322,9 +1389,11 @@ I.uncheckOption('agree', '//form');
|
|
|
1322
1389
|
|
|
1323
1390
|
#### Parameters
|
|
1324
1391
|
|
|
1325
|
-
- `field`
|
|
1326
|
-
- `context`
|
|
1327
|
-
|
|
1392
|
+
- `field` ([string][10] \| [object][11]) checkbox located by label | name | CSS | XPath | strict locator.
|
|
1393
|
+
- `context` [string][10] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
Appium: not tested
|
|
1328
1397
|
|
|
1329
1398
|
### wait
|
|
1330
1399
|
|
|
@@ -1336,7 +1405,9 @@ I.wait(2); // wait 2 secs
|
|
|
1336
1405
|
|
|
1337
1406
|
#### Parameters
|
|
1338
1407
|
|
|
1339
|
-
- `sec`
|
|
1408
|
+
- `sec` [number][15] number of second to wait.
|
|
1409
|
+
|
|
1410
|
+
|
|
1340
1411
|
Appium: support
|
|
1341
1412
|
|
|
1342
1413
|
### waitForDetached
|
|
@@ -1344,13 +1415,17 @@ I.wait(2); // wait 2 secs
|
|
|
1344
1415
|
Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
|
|
1345
1416
|
Element can be located by CSS or XPath.
|
|
1346
1417
|
|
|
1347
|
-
|
|
1418
|
+
```js
|
|
1419
|
+
I.waitForDetached('#popup');
|
|
1420
|
+
```
|
|
1348
1421
|
|
|
1349
1422
|
#### Parameters
|
|
1350
1423
|
|
|
1351
|
-
- `locator`
|
|
1352
|
-
- `sec`
|
|
1353
|
-
|
|
1424
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
1425
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
Appium: support
|
|
1354
1429
|
|
|
1355
1430
|
### waitForElement
|
|
1356
1431
|
|
|
@@ -1364,9 +1439,11 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1364
1439
|
|
|
1365
1440
|
#### Parameters
|
|
1366
1441
|
|
|
1367
|
-
- `locator`
|
|
1368
|
-
- `sec`
|
|
1369
|
-
|
|
1442
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
1443
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1444
|
+
|
|
1445
|
+
|
|
1446
|
+
Appium: support
|
|
1370
1447
|
|
|
1371
1448
|
### waitForEnabled
|
|
1372
1449
|
|
|
@@ -1375,8 +1452,10 @@ Element can be located by CSS or XPath.
|
|
|
1375
1452
|
|
|
1376
1453
|
#### Parameters
|
|
1377
1454
|
|
|
1378
|
-
- `locator`
|
|
1455
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
1379
1456
|
- `sec` (optional) time in seconds to wait, 1 by default.
|
|
1457
|
+
|
|
1458
|
+
|
|
1380
1459
|
Appium: support
|
|
1381
1460
|
|
|
1382
1461
|
### waitForFunction
|
|
@@ -1396,23 +1475,29 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1396
1475
|
|
|
1397
1476
|
#### Parameters
|
|
1398
1477
|
|
|
1399
|
-
- `fn`
|
|
1400
|
-
- `argsOrSec`
|
|
1401
|
-
- `sec`
|
|
1402
|
-
|
|
1478
|
+
- `fn` ([string][10] \| [function][13]) to be executed in browser context.
|
|
1479
|
+
- `argsOrSec` ([array][17] \| [number][15]) (optional, `1` by default) arguments for function or seconds.
|
|
1480
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1481
|
+
|
|
1482
|
+
|
|
1483
|
+
Appium: support
|
|
1403
1484
|
|
|
1404
1485
|
### waitForInvisible
|
|
1405
1486
|
|
|
1406
1487
|
Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
|
|
1407
1488
|
Element can be located by CSS or XPath.
|
|
1408
1489
|
|
|
1409
|
-
|
|
1490
|
+
```js
|
|
1491
|
+
I.waitForInvisible('#popup');
|
|
1492
|
+
```
|
|
1410
1493
|
|
|
1411
1494
|
#### Parameters
|
|
1412
1495
|
|
|
1413
|
-
- `locator`
|
|
1414
|
-
- `sec`
|
|
1415
|
-
|
|
1496
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
1497
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1498
|
+
|
|
1499
|
+
|
|
1500
|
+
Appium: support
|
|
1416
1501
|
|
|
1417
1502
|
### waitForText
|
|
1418
1503
|
|
|
@@ -1427,10 +1512,12 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1427
1512
|
|
|
1428
1513
|
#### Parameters
|
|
1429
1514
|
|
|
1430
|
-
- `text`
|
|
1431
|
-
- `sec`
|
|
1432
|
-
- `context`
|
|
1433
|
-
|
|
1515
|
+
- `text` [string][10] to wait for.
|
|
1516
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1517
|
+
- `context` ([string][10] \| [object][11]) (optional) element located by CSS|XPath|strict locator.
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
Appium: support
|
|
1434
1521
|
|
|
1435
1522
|
### waitForValue
|
|
1436
1523
|
|
|
@@ -1442,22 +1529,28 @@ I.waitForValue('//input', "GoodValue");
|
|
|
1442
1529
|
|
|
1443
1530
|
#### Parameters
|
|
1444
1531
|
|
|
1445
|
-
- `field`
|
|
1446
|
-
- `value`
|
|
1447
|
-
- `sec`
|
|
1532
|
+
- `field` ([string][10] \| [object][11]) input field.
|
|
1533
|
+
- `value` [string][10] expected value.
|
|
1534
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1535
|
+
|
|
1536
|
+
|
|
1448
1537
|
|
|
1449
1538
|
### waitForVisible
|
|
1450
1539
|
|
|
1451
1540
|
Waits for an element to become visible on a page (by default waits for 1sec).
|
|
1452
1541
|
Element can be located by CSS or XPath.
|
|
1453
1542
|
|
|
1454
|
-
|
|
1543
|
+
```js
|
|
1544
|
+
I.waitForVisible('#popup');
|
|
1545
|
+
```
|
|
1455
1546
|
|
|
1456
1547
|
#### Parameters
|
|
1457
1548
|
|
|
1458
|
-
- `locator`
|
|
1459
|
-
- `sec`
|
|
1460
|
-
|
|
1549
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
1550
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1551
|
+
|
|
1552
|
+
|
|
1553
|
+
Appium: support
|
|
1461
1554
|
|
|
1462
1555
|
### waitInUrl
|
|
1463
1556
|
|
|
@@ -1469,8 +1562,10 @@ I.waitInUrl('/info', 2);
|
|
|
1469
1562
|
|
|
1470
1563
|
#### Parameters
|
|
1471
1564
|
|
|
1472
|
-
- `urlPart`
|
|
1473
|
-
- `sec`
|
|
1565
|
+
- `urlPart` [string][10] value to check.
|
|
1566
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1567
|
+
|
|
1568
|
+
|
|
1474
1569
|
|
|
1475
1570
|
### waitNumberOfVisibleElements
|
|
1476
1571
|
|
|
@@ -1482,22 +1577,28 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
1482
1577
|
|
|
1483
1578
|
#### Parameters
|
|
1484
1579
|
|
|
1485
|
-
- `locator`
|
|
1486
|
-
- `num`
|
|
1487
|
-
- `sec`
|
|
1580
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
1581
|
+
- `num` [number][15] number of elements.
|
|
1582
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1583
|
+
|
|
1584
|
+
|
|
1488
1585
|
|
|
1489
1586
|
### waitToHide
|
|
1490
1587
|
|
|
1491
1588
|
Waits for an element to hide (by default waits for 1sec).
|
|
1492
1589
|
Element can be located by CSS or XPath.
|
|
1493
1590
|
|
|
1494
|
-
|
|
1591
|
+
```js
|
|
1592
|
+
I.waitToHide('#popup');
|
|
1593
|
+
```
|
|
1495
1594
|
|
|
1496
1595
|
#### Parameters
|
|
1497
1596
|
|
|
1498
|
-
- `locator`
|
|
1499
|
-
- `sec`
|
|
1500
|
-
|
|
1597
|
+
- `locator` ([string][10] \| [object][11]) element located by CSS|XPath|strict locator.
|
|
1598
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1599
|
+
|
|
1600
|
+
|
|
1601
|
+
Appium: support
|
|
1501
1602
|
|
|
1502
1603
|
### waitUntil
|
|
1503
1604
|
|
|
@@ -1510,9 +1611,11 @@ I.waitUntil(() => window.requests == 0, 5);
|
|
|
1510
1611
|
|
|
1511
1612
|
#### Parameters
|
|
1512
1613
|
|
|
1513
|
-
- `fn`
|
|
1514
|
-
- `sec`
|
|
1515
|
-
- `timeoutMsg`
|
|
1614
|
+
- `fn` ([function][13] \| [string][10]) function which is executed in browser context.
|
|
1615
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1616
|
+
- `timeoutMsg` [string][10] message to show in case of timeout fail.
|
|
1617
|
+
|
|
1618
|
+
|
|
1516
1619
|
- `interval` (optional) time in seconds between condition checks.- _Appium_: supported
|
|
1517
1620
|
|
|
1518
1621
|
### waitUrlEquals
|
|
@@ -1526,8 +1629,10 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
1526
1629
|
|
|
1527
1630
|
#### Parameters
|
|
1528
1631
|
|
|
1529
|
-
- `urlPart`
|
|
1530
|
-
- `sec`
|
|
1632
|
+
- `urlPart` [string][10] value to check.
|
|
1633
|
+
- `sec` [number][15] (optional, `1` by default) time in seconds to wait
|
|
1634
|
+
|
|
1635
|
+
|
|
1531
1636
|
|
|
1532
1637
|
[1]: http://webdriver.io/
|
|
1533
1638
|
|
|
@@ -1547,10 +1652,20 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
1547
1652
|
|
|
1548
1653
|
[9]: http://jster.net/category/windows-modals-popups
|
|
1549
1654
|
|
|
1550
|
-
[10]: https://
|
|
1655
|
+
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1656
|
+
|
|
1657
|
+
[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1658
|
+
|
|
1659
|
+
[12]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
1660
|
+
|
|
1661
|
+
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1662
|
+
|
|
1663
|
+
[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1664
|
+
|
|
1665
|
+
[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1551
1666
|
|
|
1552
|
-
[
|
|
1667
|
+
[16]: https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value
|
|
1553
1668
|
|
|
1554
|
-
[
|
|
1669
|
+
[17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1555
1670
|
|
|
1556
|
-
[
|
|
1671
|
+
[18]: https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object
|