From 2ef894859c9f534a4d44daaac200823977e8d95b Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Wed, 4 Mar 2026 17:38:13 +0100 Subject: [PATCH 1/5] feat(webapi): saveScreenshotToPath --- .gitignore | 3 +- docs/helpers/Playwright.md | 1250 ++++++++++----------- docs/helpers/Puppeteer.md | 1130 +++++++++---------- docs/helpers/TestCafe.md | 515 +++++---- docs/helpers/WebDriver.md | 992 ++++++++-------- docs/webapi/saveScreenshot.mustache | 1 + docs/webapi/saveScreenshotToPath.mustache | 13 + lib/helper/Playwright.js | 13 +- lib/helper/Puppeteer.js | 13 +- lib/helper/WebDriver.js | 13 +- lib/utils.js | 6 +- runok.js | 4 +- test/helper/webapi.js | 16 + test/unit/utils_test.js | 15 +- 14 files changed, 1936 insertions(+), 2048 deletions(-) create mode 100644 docs/webapi/saveScreenshotToPath.mustache diff --git a/.gitignore b/.gitignore index 4afed9191..6a1286357 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ website .idea docs/build test/data/output +test/data/custom test/acceptance/output test/bdd/output examples/output @@ -26,4 +27,4 @@ package-lock.json yarn.lock /.vs typings/types.d.ts -typings/promiseBasedTypes.d.ts \ No newline at end of file +typings/promiseBasedTypes.d.ts diff --git a/docs/helpers/Playwright.md b/docs/helpers/Playwright.md index 340981b7f..7fc43e31e 100644 --- a/docs/helpers/Playwright.md +++ b/docs/helpers/Playwright.md @@ -13,9 +13,9 @@ title: Playwright Uses [Playwright][1] library to run tests inside: -* Chromium -* Firefox -* Webkit (Safari) +- Chromium +- Firefox +- Webkit (Safari) This helper works with a browser out of the box with no additional tools required to install. @@ -33,8 +33,6 @@ Run `npx playwright install` to download browsers after `npm install`. Using playwright-core package, will prevent the download of browser binaries and allow connecting to an existing browser installation or for connecting to a remote one. - - ## Configuration This helper should be configured in codecept.conf.(js|ts) @@ -43,53 +41,51 @@ Type: [object][6] ### Properties -* `url` **[string][9]?** base url of website to be tested -* `browser` **(`"chromium"` | `"firefox"` | `"webkit"` | `"electron"`)?** a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium. -* `show` **[boolean][26]?** show browser window. -* `restart` **([string][9] | [boolean][26])?** restart strategy between tests. Possible values:* 'context' or **false** - restarts [browser context][44] but keeps running browser. Recommended by Playwright team to keep tests isolated. - * 'browser' or **true** - closes browser and opens it again between tests. - * 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with `keepCookies` and `keepBrowserState` options. This behavior was default before CodeceptJS 3.1 -* `timeout` **[number][20]?** * [timeout][45] in ms of all Playwright actions . -* `disableScreenshots` **[boolean][26]?** don't save screenshot on failure. -* `emulate` **any?** browser in device emulation mode. -* `video` **[boolean][26]?** enables video recording for failed tests; videos are saved into `output/videos` folder -* `keepVideoForPassedTests` **[boolean][26]?** save videos for passed tests; videos are saved into `output/videos` folder -* `trace` **[boolean][26]?** record [tracing information][46] with screenshots and snapshots. -* `keepTraceForPassedTests` **[boolean][26]?** save trace for passed tests. -* `fullPageScreenshots` **[boolean][26]?** make full page screenshots on failure. -* `uniqueScreenshotNames` **[boolean][26]?** option to prevent screenshot override if you have scenarios with the same name in different suites. -* `keepBrowserState` **[boolean][26]?** keep browser state between tests when `restart` is set to 'session'. -* `keepCookies` **[boolean][26]?** keep cookies between tests when `restart` is set to 'session'. -* `waitForAction` **[number][20]?** how long to wait after click, doubleClick or PressKey actions in ms. Default: 100. -* `waitForNavigation` **(`"load"` | `"domcontentloaded"` | `"commit"`)?** When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `commit`. Choose one of those options is possible. See [Playwright API][42]. -* `pressKeyDelay` **[number][20]?** Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField -* `getPageTimeout` **[number][20]?** config option to set maximum navigation time in milliseconds. -* `waitForTimeout` **[number][20]?** default wait* timeout in ms. Default: 1000. -* `basicAuth` **[object][6]?** the basic authentication to pass to base url. Example: {username: 'username', password: 'password'} -* `windowSize` **[string][9]?** default window size. Set a dimension like `640x480`. -* `colorScheme` **(`"dark"` | `"light"` | `"no-preference"`)?** default color scheme. Possible values: `dark` | `light` | `no-preference`. -* `userAgent` **[string][9]?** user-agent string. -* `locale` **[string][9]?** locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ... -* `manualStart` **[boolean][26]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`. -* `chromium` **[object][6]?** pass additional chromium options -* `firefox` **[object][6]?** pass additional firefox options -* `electron` **[object][6]?** (pass additional electron options -* `channel` **any?** (While Playwright can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will support Stable and Beta channels of these browsers. See [Google Chrome & Microsoft Edge][47]. -* `ignoreLog` **[Array][10]<[string][9]>?** An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values][48]. -* `ignoreHTTPSErrors` **[boolean][26]?** Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false` -* `bypassCSP` **[boolean][26]?** bypass Content Security Policy or CSP -* `highlightElement` **[boolean][26]?** highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose). -* `recordHar` **[object][6]?** record HAR and will be saved to `output/har`. See more of [HAR options][3]. -* `testIdAttribute` **[string][9]?** locate elements based on the testIdAttribute. See more of [locate by test id][49]. -* `customLocatorStrategies` **[object][6]?** custom locator strategies. An object with keys as strategy names and values as JavaScript functions. Example: `{ byRole: (selector, root) => { return root.querySelector(`[role="${selector}"]`) } }` -* `storageState` **([string][9] | [object][6])?** Playwright storage state (path to JSON file or object) - passed directly to `browser.newContext`. - If a Scenario is declared with a `cookies` option (e.g. `Scenario('name', { cookies: [...] }, fn)`), - those cookies are used instead and the configured `storageState` is ignored (no merge). - May include session cookies, auth tokens, localStorage and (if captured with - `grabStorageState({ indexedDB: true })`) IndexedDB data; treat as sensitive and do not commit. - - +- `url` **[string][9]?** base url of website to be tested +- `browser` **(`"chromium"` | `"firefox"` | `"webkit"` | `"electron"`)?** a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium. +- `show` **[boolean][26]?** show browser window. +- `restart` **([string][9] | [boolean][26])?** restart strategy between tests. Possible values:\* 'context' or **false** - restarts [browser context][44] but keeps running browser. Recommended by Playwright team to keep tests isolated. + - 'browser' or **true** - closes browser and opens it again between tests. + - 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with `keepCookies` and `keepBrowserState` options. This behavior was default before CodeceptJS 3.1 +- `timeout` **[number][20]?** \* [timeout][45] in ms of all Playwright actions . +- `disableScreenshots` **[boolean][26]?** don't save screenshot on failure. +- `emulate` **any?** browser in device emulation mode. +- `video` **[boolean][26]?** enables video recording for failed tests; videos are saved into `output/videos` folder +- `keepVideoForPassedTests` **[boolean][26]?** save videos for passed tests; videos are saved into `output/videos` folder +- `trace` **[boolean][26]?** record [tracing information][46] with screenshots and snapshots. +- `keepTraceForPassedTests` **[boolean][26]?** save trace for passed tests. +- `fullPageScreenshots` **[boolean][26]?** make full page screenshots on failure. +- `uniqueScreenshotNames` **[boolean][26]?** option to prevent screenshot override if you have scenarios with the same name in different suites. +- `keepBrowserState` **[boolean][26]?** keep browser state between tests when `restart` is set to 'session'. +- `keepCookies` **[boolean][26]?** keep cookies between tests when `restart` is set to 'session'. +- `waitForAction` **[number][20]?** how long to wait after click, doubleClick or PressKey actions in ms. Default: 100. +- `waitForNavigation` **(`"load"` | `"domcontentloaded"` | `"commit"`)?** When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `commit`. Choose one of those options is possible. See [Playwright API][42]. +- `pressKeyDelay` **[number][20]?** Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField +- `getPageTimeout` **[number][20]?** config option to set maximum navigation time in milliseconds. +- `waitForTimeout` **[number][20]?** default wait\* timeout in ms. Default: 1000. +- `basicAuth` **[object][6]?** the basic authentication to pass to base url. Example: {username: 'username', password: 'password'} +- `windowSize` **[string][9]?** default window size. Set a dimension like `640x480`. +- `colorScheme` **(`"dark"` | `"light"` | `"no-preference"`)?** default color scheme. Possible values: `dark` | `light` | `no-preference`. +- `userAgent` **[string][9]?** user-agent string. +- `locale` **[string][9]?** locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ... +- `manualStart` **[boolean][26]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`. +- `chromium` **[object][6]?** pass additional chromium options +- `firefox` **[object][6]?** pass additional firefox options +- `electron` **[object][6]?** (pass additional electron options +- `channel` **any?** (While Playwright can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will support Stable and Beta channels of these browsers. See [Google Chrome & Microsoft Edge][47]. +- `ignoreLog` **[Array][10]<[string][9]>?** An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values][48]. +- `ignoreHTTPSErrors` **[boolean][26]?** Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false` +- `bypassCSP` **[boolean][26]?** bypass Content Security Policy or CSP +- `highlightElement` **[boolean][26]?** highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose). +- `recordHar` **[object][6]?** record HAR and will be saved to `output/har`. See more of [HAR options][3]. +- `testIdAttribute` **[string][9]?** locate elements based on the testIdAttribute. See more of [locate by test id][49]. +- `customLocatorStrategies` **[object][6]?** custom locator strategies. An object with keys as strategy names and values as JavaScript functions. Example: `{ byRole: (selector, root) => { return root.querySelector(`[role="${selector}"]`) } }` +- `storageState` **([string][9] | [object][6])?** Playwright storage state (path to JSON file or object) + passed directly to `browser.newContext`. + If a Scenario is declared with a `cookies` option (e.g. `Scenario('name', { cookies: [...] }, fn)`), + those cookies are used instead and the configured `storageState` is ignored (no merge). + May include session cookies, auth tokens, localStorage and (if captured with + `grabStorageState({ indexedDB: true })`) IndexedDB data; treat as sensitive and do not commit. #### Video Recording Customization @@ -97,16 +93,16 @@ By default, video is saved to `output/video` dir. You can customize this path by `video`: enables video recording for failed tests; videos are saved into `output/videos` folder -* `keepVideoForPassedTests`: - save videos for passed tests -* `recordVideo`: [additional options for videos customization][2] +- `keepVideoForPassedTests`: - save videos for passed tests +- `recordVideo`: [additional options for videos customization][2] #### Trace Recording Customization Trace recording provides complete information on test execution and includes DOM snapshots, screenshots, and network requests logged during run. Traces will be saved to `output/trace` -* `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder -* `keepTraceForPassedTests`: - save trace for passed tests +- `trace`: enables trace recording for failed tests; trace are saved into `output/trace` folder +- `keepTraceForPassedTests`: - save trace for passed tests #### HAR Recording Customization @@ -231,7 +227,7 @@ const { devices } = require('playwright'); } ``` -* #### Example #8: Launch test with a specific color scheme +- #### Example #8: Launch test with a specific color scheme ```js { @@ -244,7 +240,7 @@ const { devices } = require('playwright'); } ``` -* #### Example #9: Launch electron test +- #### Example #9: Launch electron test ```js { @@ -267,64 +263,64 @@ Note: When connecting to remote browser `show` and specific `chrome` options (e. Receive Playwright client from a custom helper by accessing `browser` for the Browser object or `page` for the current Page object: ```js -const { browser } = this.helpers.Playwright; -await browser.pages(); // List of pages in the browser +const { browser } = this.helpers.Playwright +await browser.pages() // List of pages in the browser // get current page -const { page } = this.helpers.Playwright; -await page.url(); // Get the url of the current page +const { page } = this.helpers.Playwright +await page.url() // Get the url of the current page -const { browserContext } = this.helpers.Playwright; -await browserContext.cookies(); // get current browser context +const { browserContext } = this.helpers.Playwright +await browserContext.cookies() // get current browser context ``` ### Parameters -* `config` +- `config` -### _addPopupListener +### \_addPopupListener Add the 'dialog' event listener to a page #### Parameters -* `page` +- `page` -### _contextLocator +### \_contextLocator Grab Locator if called within Context #### Parameters -* `locator` **any** +- `locator` **any** -### _createContextPage +### \_createContextPage -Create a new browser context with a page. +Create a new browser context with a page. Usually it should be run from a custom helper after call of `_startBrowser()` #### Parameters -* `contextOptions` **[object][6]?** See [https://playwright.dev/docs/api/class-browser#browser-new-context][7] +- `contextOptions` **[object][6]?** See [https://playwright.dev/docs/api/class-browser#browser-new-context][7] -### _getPageUrl +### \_getPageUrl Gets page URL including hash. -### _locate +### \_locate Get elements by different locator types, including strict locator Should be used in custom helpers: ```js -const elements = await this.helpers['Playwright']._locate({name: 'password'}); +const elements = await this.helpers['Playwright']._locate({ name: 'password' }) ``` #### Parameters -* `locator` +- `locator` -### _locateCheckable +### \_locateCheckable Find a checkbox by providing human-readable text: NOTE: Assumes the checkable element exists @@ -335,10 +331,10 @@ this.helpers['Playwright']._locateCheckable('I agree with terms and conditions') #### Parameters -* `locator` -* `providedContext` +- `locator` +- `providedContext` -### _locateClickable +### \_locateClickable Find a clickable element by providing human-readable text: @@ -348,22 +344,22 @@ this.helpers['Playwright']._locateClickable('Next page').then // ... #### Parameters -* `locator` +- `locator` -### _locateElement +### \_locateElement Get the first element by different locator types, including strict locator Should be used in custom helpers: ```js -const element = await this.helpers['Playwright']._locateElement({name: 'password'}); +const element = await this.helpers['Playwright']._locateElement({ name: 'password' }) ``` #### Parameters -* `locator` +- `locator` -### _locateFields +### \_locateFields Find field elements by providing human-readable text: @@ -373,15 +369,15 @@ this.helpers['Playwright']._locateFields('Your email').then // ... #### Parameters -* `locator` +- `locator` -### _setPage +### \_setPage Set current page #### Parameters -* `page` **[object][6]** page to set +- `page` **[object][6]** page to set ### acceptPopup @@ -395,9 +391,9 @@ Set the automatic popup response to Accept. This must be set before a popup is triggered. ```js -I.amAcceptingPopups(); -I.click('#triggerPopup'); -I.acceptPopup(); +I.amAcceptingPopups() +I.click('#triggerPopup') +I.acceptPopup() ``` ### amCancellingPopups @@ -406,9 +402,9 @@ Set the automatic popup response to Cancel/Dismiss. This must be set before a popup is triggered. ```js -I.amCancellingPopups(); -I.click('#triggerPopup'); -I.cancelPopup(); +I.amCancellingPopups() +I.click('#triggerPopup') +I.cancelPopup() ``` ### amOnPage @@ -417,14 +413,14 @@ Opens a web page in a browser. Requires relative or absolute url. If url starts with `/`, opens a web page of a site defined in `url` config parameter. ```js -I.amOnPage('/'); // opens main page of website -I.amOnPage('https://github.com'); // opens github -I.amOnPage('/login'); // opens a login page +I.amOnPage('/') // opens main page of website +I.amOnPage('https://github.com') // opens github +I.amOnPage('/login') // opens a login page ``` #### Parameters -* `url` **[string][9]** url path or global url. +- `url` **[string][9]** url path or global url. Returns **void** automatically synchronized promise through #recorder @@ -434,15 +430,15 @@ Appends text to a input field or textarea. Field is located by name, label, CSS or XPath ```js -I.appendField('#myTextField', 'appended'); +I.appendField('#myTextField', 'appended') // typing secret -I.appendField('password', secret('123456')); +I.appendField('password', secret('123456')) ``` #### Parameters -* `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator -* `value` **[string][9]** text value to append. +- `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator +- `value` **[string][9]** text value to append. Returns **void** automatically synchronized promise through #recorder @@ -453,14 +449,14 @@ Path to file is relative current codecept directory (where codecept.conf.ts or c File will be uploaded to remote system (if tests are running remotely). ```js -I.attachFile('Avatar', 'data/avatar.jpg'); -I.attachFile('form input[name=avatar]', 'data/avatar.jpg'); +I.attachFile('Avatar', 'data/avatar.jpg') +I.attachFile('form input[name=avatar]', 'data/avatar.jpg') ``` #### Parameters -* `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator. -* `pathToFile` **[string][9]** local file path relative to codecept.conf.ts or codecept.conf.js config file. +- `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator. +- `pathToFile` **[string][9]** local file path relative to codecept.conf.ts or codecept.conf.js config file. Returns **void** automatically synchronized promise through #recorder @@ -471,19 +467,19 @@ Blocks traffic of a given URL or a list of URLs. Examples: ```js -I.blockTraffic('http://example.com/css/style.css'); -I.blockTraffic('http://example.com/css/*.css'); -I.blockTraffic('http://example.com/**'); -I.blockTraffic(/.css$/); +I.blockTraffic('http://example.com/css/style.css') +I.blockTraffic('http://example.com/css/*.css') +I.blockTraffic('http://example.com/**') +I.blockTraffic(/.css$/) ``` ```js -I.blockTraffic(['http://example.com/css/style.css', 'http://example.com/css/*.css']); +I.blockTraffic(['http://example.com/css/style.css', 'http://example.com/css/*.css']) ``` #### Parameters -* `urls` **([string][9] | [Array][10] | [RegExp][11])** URL or a list of URLs to block . URL can contain * for wildcards. Example: [https://www.example.com][12]** to block all traffic for that domain. Regexp are also supported. +- `urls` **([string][9] | [Array][10] | [RegExp][11])** URL or a list of URLs to block . URL can contain \* for wildcards. Example: [https://www.example.com][12]\*\* to block all traffic for that domain. Regexp are also supported. ### blur @@ -498,15 +494,15 @@ I.blur('.text-area') ```js //element `#product-tile` is focused -I.see('#add-to-cart-btn'); +I.see('#add-to-cart-btn') I.blur('#product-tile') -I.dontSee('#add-to-cart-btn'); +I.dontSee('#add-to-cart-btn') ``` #### Parameters -* `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator. -* `options` **any?** Playwright only: [Additional options][14] for available options object as 2nd argument. +- `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator. +- `options` **any?** Playwright only: [Additional options][14] for available options object as 2nd argument. Returns **void** automatically synchronized promise through #recorder @@ -533,16 +529,16 @@ Element is located by label or name or CSS or XPath. The second parameter is a context (CSS or XPath locator) to narrow the search. ```js -I.checkOption('#agree'); -I.checkOption('I Agree to Terms and Conditions'); -I.checkOption('agree', '//form'); +I.checkOption('#agree') +I.checkOption('I Agree to Terms and Conditions') +I.checkOption('agree', '//form') ``` #### Parameters -* `field` **([string][9] | [object][6])** checkbox located by label | name | CSS | XPath | strict locator. -* `context` **([string][9]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator. -* `options` +- `field` **([string][9] | [object][6])** checkbox located by label | name | CSS | XPath | strict locator. +- `context` **([string][9]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator. +- `options` Returns **void** automatically synchronized promise through #recorder @@ -552,14 +548,14 @@ Clears a cookie by name, if none provided clears all cookies. ```js -I.clearCookie(); -I.clearCookie('test'); +I.clearCookie() +I.clearCookie('test') ``` #### Parameters -* `cookieName` -* `cookie` **[string][9]?** (optional, `null` by default) cookie name +- `cookieName` +- `cookie` **[string][9]?** (optional, `null` by default) cookie name ### clearField @@ -578,8 +574,8 @@ Use `force` to bypass the [actionability][16] checks. #### Parameters -* `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator. -* `options` **any?** [Additional options][17] for available options object as 2nd argument. +- `locator` **([string][9] | [object][6])** field located by label|name|CSS|XPath|strict locator. +- `options` **any?** [Additional options][17] for available options object as 2nd argument. ### click @@ -592,29 +588,29 @@ The second parameter is a context (CSS or XPath locator) to narrow the search. ```js // simple link -I.click('Logout'); +I.click('Logout') // button of form -I.click('Submit'); +I.click('Submit') // CSS button -I.click('#form input[type=submit]'); +I.click('#form input[type=submit]') // XPath -I.click('//form/*[@type=submit]'); +I.click('//form/*[@type=submit]') // link in context -I.click('Logout', '#nav'); +I.click('Logout', '#nav') // using strict locator -I.click({css: 'nav a.login'}); +I.click({ css: 'nav a.login' }) ``` #### Parameters -* `locator` **([string][9] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator. -* `context` **([string][9]? | [object][6] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. -* `options` **any?** [Additional options][18] for click available as 3rd argument. +- `locator` **([string][9] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator. +- `context` **([string][9]? | [object][6] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. +- `options` **any?** [Additional options][18] for click available as 3rd argument. #### Examples ````javascript -```js +;```js // click on element at position I.click('canvas', '.model', { position: { x: 20, y: 40 } }) @@ -631,15 +627,15 @@ Clicks link and waits for navigation (deprecated) #### Parameters -* `locator` -* `context` +- `locator` +- `context` ### closeCurrentTab Close current tab and switches to previous. ```js -I.closeCurrentTab(); +I.closeCurrentTab() ``` ### closeOtherTabs @@ -647,7 +643,7 @@ I.closeCurrentTab(); Close all tabs except for the current one. ```js -I.closeOtherTabs(); +I.closeOtherTabs() ``` ### dontSee @@ -656,14 +652,14 @@ Opposite to `see`. Checks that a text is not present on a page. Use context parameter to narrow down the search. ```js -I.dontSee('Login'); // assume we are already logged in. -I.dontSee('Login', '.nav'); // no login inside .nav element +I.dontSee('Login') // assume we are already logged in. +I.dontSee('Login', '.nav') // no login inside .nav element ``` #### Parameters -* `text` **[string][9]** which is not present. -* `context` **([string][9] | [object][6])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. +- `text` **[string][9]** which is not present. +- `context` **([string][9] | [object][6])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. Returns **void** automatically synchronized promise through #recorder @@ -672,14 +668,14 @@ Returns **void** automatically synchronized promise through #recorder Verifies that the specified checkbox is not checked. ```js -I.dontSeeCheckboxIsChecked('#agree'); // located by ID -I.dontSeeCheckboxIsChecked('I agree to terms'); // located by label -I.dontSeeCheckboxIsChecked('agree'); // located by name +I.dontSeeCheckboxIsChecked('#agree') // located by ID +I.dontSeeCheckboxIsChecked('I agree to terms') // located by label +I.dontSeeCheckboxIsChecked('agree') // located by name ``` #### Parameters -* `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator. +- `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator. Returns **void** automatically synchronized promise through #recorder @@ -688,12 +684,12 @@ Returns **void** automatically synchronized promise through #recorder Checks that cookie with given name does not exist. ```js -I.dontSeeCookie('auth'); // no auth cookie +I.dontSeeCookie('auth') // no auth cookie ``` #### Parameters -* `name` **[string][9]** cookie name. +- `name` **[string][9]** cookie name. Returns **void** automatically synchronized promise through #recorder @@ -703,13 +699,13 @@ Checks that current url is not equal to provided one. If a relative url provided, a configured url will be prepended to it. ```js -I.dontSeeCurrentUrlEquals('/login'); // relative url are ok -I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also ok +I.dontSeeCurrentUrlEquals('/login') // relative url are ok +I.dontSeeCurrentUrlEquals('http://mysite.com/login') // absolute urls are also ok ``` #### Parameters -* `url` **[string][9]** value to check. +- `url` **[string][9]** value to check. Returns **void** automatically synchronized promise through #recorder @@ -718,12 +714,12 @@ Returns **void** automatically synchronized promise through #recorder Opposite to `seeElement`. Checks that element is not visible (or in DOM) ```js -I.dontSeeElement('.modal'); // modal is not shown +I.dontSeeElement('.modal') // modal is not shown ``` #### Parameters -* `locator` **([string][9] | [object][6])** located by CSS|XPath|Strict locator. +- `locator` **([string][9] | [object][6])** located by CSS|XPath|Strict locator. Returns **void** automatically synchronized promise through #recorder @@ -732,12 +728,12 @@ Returns **void** automatically synchronized promise through #recorder Opposite to `seeElementInDOM`. Checks that element is not on page. ```js -I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not +I.dontSeeElementInDOM('.nav') // checks that element is not on page visible or not ``` #### Parameters -* `locator` **([string][9] | [object][6])** located by CSS|XPath|Strict locator. +- `locator` **([string][9] | [object][6])** located by CSS|XPath|Strict locator. Returns **void** automatically synchronized promise through #recorder @@ -747,7 +743,7 @@ Checks that current url does not contain a provided fragment. #### Parameters -* `url` **[string][9]** value to check. +- `url` **[string][9]** value to check. Returns **void** automatically synchronized promise through #recorder @@ -757,14 +753,14 @@ Checks that value of input field or textarea doesn't equal to given value Opposite to `seeInField`. ```js -I.dontSeeInField('email', 'user@user.com'); // field by name -I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS +I.dontSeeInField('email', 'user@user.com') // field by name +I.dontSeeInField({ css: 'form input.email' }, 'user@user.com') // field by CSS ``` #### Parameters -* `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator. -* `value` **([string][9] | [object][6])** value to check. +- `field` **([string][9] | [object][6])** located by label|name|CSS|XPath|strict locator. +- `value` **([string][9] | [object][6])** value to check. Returns **void** automatically synchronized promise through #recorder @@ -773,13 +769,13 @@ Returns **void** automatically synchronized promise through #recorder Checks that the current page does not contains the given string in its raw source code. ```js -I.dontSeeInSource('