From 099a6984653f1761cf3844d4f6ef60587d7034cd Mon Sep 17 00:00:00 2001 From: thomashohn Date: Thu, 14 Nov 2024 10:03:47 +0100 Subject: [PATCH 01/12] Bump apollo-server-express from 2.x to 3.x (#4579) * Bump apollo-server-express from 2.x to 3.x, fix command and remove from dependabot ignore * Adapt after review --- .github/dependabot.yml | 2 -- package.json | 2 +- test/data/graphql/index.js | 11 ++++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7d43abc66..439bc4811 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,8 +15,6 @@ updates: ignore: - dependency-name: "escape-string-regexp" versions: [">=5.0"] - - dependency-name: "apollo-server-express" - versions: [">=3.0"] - dependency-name: "eslint" versions: [ ">8.57.0" ] diff --git a/package.json b/package.json index 38316454c..87c122bf9 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "@wdio/selenium-standalone-service": "8.3.2", "@wdio/utils": "9.2.8", "@xmldom/xmldom": "0.9.4", - "apollo-server-express": "2.25.3", + "apollo-server-express": "3.13.0", "chai-as-promised": "7.1.2", "chai-subset": "1.6.0", "cheerio": "^1.0.0", diff --git a/test/data/graphql/index.js b/test/data/graphql/index.js index f3d372278..74ebac5a0 100644 --- a/test/data/graphql/index.js +++ b/test/data/graphql/index.js @@ -17,8 +17,9 @@ const server = new ApolloServer({ playground: true, }); -server.applyMiddleware({ app }); - -app.use(middleware); -app.use(router); -module.exports = app.listen(PORT, () => console.log(`test graphQL server listening on port ${PORT}...`)); +server.start().then(() => { + server.applyMiddleware({ app }); + app.use(middleware); + app.use(router); + module.exports = app.listen(PORT, () => console.log(`test graphQL server listening on port ${PORT}...`)); +}); From 39b0311d6aa07905192c24ec9d7e6e9616b79f56 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 14 Nov 2024 09:05:12 +0000 Subject: [PATCH 02/12] DOC: Update contributor faces --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e7d791e40..8d435b2d7 100644 --- a/README.md +++ b/README.md @@ -312,17 +312,17 @@ Thanks all to those who are and will have contributing to this awesome project! - - + + - + + - [//]: contributor-faces From 740506aadc4f64be6f0d641e98ede76c8e1c5afa Mon Sep 17 00:00:00 2001 From: thomashohn Date: Thu, 14 Nov 2024 10:06:10 +0100 Subject: [PATCH 03/12] Replace deprecated faker.name with faker.person (#4581) --- docs/data.md | 4 ++-- docs/helpers/ApiDataFactory.md | 2 +- docs/helpers/GraphQLDataFactory.md | 2 +- lib/helper/ApiDataFactory.js | 2 +- lib/helper/GraphQLDataFactory.js | 2 +- test/data/graphql/users_factory.js | 2 +- test/data/rest/posts_factory.js | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/data.md b/docs/data.md index da91d05c6..6c8bc4288 100644 --- a/docs/data.md +++ b/docs/data.md @@ -211,7 +211,7 @@ var Factory = require('rosie').Factory; var faker = require('@faker-js/faker'); module.exports = new Factory() - .attr('name', () => faker.name.findName()) + .attr('name', () => faker.person.findName()) .attr('email', () => faker.internet.email()); ``` @@ -271,7 +271,7 @@ module.exports = new Factory((buildObj) => { input: { ...buildObj }, } }) - .attr('name', () => faker.name.findName()) + .attr('name', () => faker.person.findName()) .attr('email', () => faker.internet.email()); ``` diff --git a/docs/helpers/ApiDataFactory.md b/docs/helpers/ApiDataFactory.md index 2e25d1636..0be0039a6 100644 --- a/docs/helpers/ApiDataFactory.md +++ b/docs/helpers/ApiDataFactory.md @@ -58,7 +58,7 @@ const { faker } = require('@faker-js/faker'); module.exports = new Factory() // no need to set id, it will be set by REST API - .attr('author', () => faker.name.findName()) + .attr('author', () => faker.person.findName()) .attr('title', () => faker.lorem.sentence()) .attr('body', () => faker.lorem.paragraph()); ``` diff --git a/docs/helpers/GraphQLDataFactory.md b/docs/helpers/GraphQLDataFactory.md index d7795e773..56ece1d92 100644 --- a/docs/helpers/GraphQLDataFactory.md +++ b/docs/helpers/GraphQLDataFactory.md @@ -62,7 +62,7 @@ module.exports = new Factory((buildObj) => ({ input: { ...buildObj }, })) // 'attr'-id can be left out depending on the GraphQl resolvers - .attr('name', () => faker.name.findName()) + .attr('name', () => faker.person.findName()) .attr('email', () => faker.interact.email()) ``` diff --git a/lib/helper/ApiDataFactory.js b/lib/helper/ApiDataFactory.js index ece565636..7026a6c62 100644 --- a/lib/helper/ApiDataFactory.js +++ b/lib/helper/ApiDataFactory.js @@ -51,7 +51,7 @@ const REST = require('./REST') * * module.exports = new Factory() * // no need to set id, it will be set by REST API - * .attr('author', () => faker.name.findName()) + * .attr('author', () => faker.person.findName()) * .attr('title', () => faker.lorem.sentence()) * .attr('body', () => faker.lorem.paragraph()); * ``` diff --git a/lib/helper/GraphQLDataFactory.js b/lib/helper/GraphQLDataFactory.js index e45f7fe19..d6453b7b3 100644 --- a/lib/helper/GraphQLDataFactory.js +++ b/lib/helper/GraphQLDataFactory.js @@ -55,7 +55,7 @@ const GraphQL = require('./GraphQL') * input: { ...buildObj }, * })) * // 'attr'-id can be left out depending on the GraphQl resolvers - * .attr('name', () => faker.name.findName()) + * .attr('name', () => faker.person.findName()) * .attr('email', () => faker.interact.email()) * ``` * For more options see [rosie documentation](https://github.com/rosiejs/rosie). diff --git a/test/data/graphql/users_factory.js b/test/data/graphql/users_factory.js index 95292e9f6..9b57de272 100644 --- a/test/data/graphql/users_factory.js +++ b/test/data/graphql/users_factory.js @@ -4,5 +4,5 @@ const { faker } = require('@faker-js/faker'); module.exports = new Factory(function (buildObject) { this.input = { ...buildObject }; }) - .attr('name', () => faker.name.fullName()) + .attr('name', () => faker.person.fullName()) .attr('email', () => faker.internet.email()); diff --git a/test/data/rest/posts_factory.js b/test/data/rest/posts_factory.js index f0e676e44..a731dafb8 100644 --- a/test/data/rest/posts_factory.js +++ b/test/data/rest/posts_factory.js @@ -2,6 +2,6 @@ const { Factory } = require('rosie'); const { faker } = require('@faker-js/faker'); module.exports = new Factory() - .attr('author', () => faker.name.fullName()) + .attr('author', () => faker.person.fullName()) .attr('title', () => faker.lorem.sentence()) .attr('body', () => faker.lorem.paragraph()); From 18d7de3a3fdaa92ab17049ab660c2955c2b7b18e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:25:40 +0100 Subject: [PATCH 04/12] chore(deps): bump @cucumber/gherkin from 29.0.0 to 30.0.1 (#4582) Bumps [@cucumber/gherkin](https://github.com/cucumber/gherkin) from 29.0.0 to 30.0.1. - [Release notes](https://github.com/cucumber/gherkin/releases) - [Changelog](https://github.com/cucumber/gherkin/blob/main/CHANGELOG.md) - [Commits](https://github.com/cucumber/gherkin/compare/v29.0.0...v30.0.1) --- updated-dependencies: - dependency-name: "@cucumber/gherkin" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 87c122bf9..334dfc199 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@codeceptjs/configure": "1.0.1", "@codeceptjs/helper": "2.0.4", "@cucumber/cucumber-expressions": "17", - "@cucumber/gherkin": "29", + "@cucumber/gherkin": "30", "@cucumber/messages": "27.0.0", "@xmldom/xmldom": "0.9.4", "acorn": "8.14.0", From 26508534594b7442ef5d18252f1538ad14aee413 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 14 Nov 2024 09:27:08 +0000 Subject: [PATCH 05/12] DOC: Update contributor faces --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8d435b2d7..8a55d3526 100644 --- a/README.md +++ b/README.md @@ -313,12 +313,12 @@ Thanks all to those who are and will have contributing to this awesome project! - - + - + + From 2df3f1617f03f76789b506595302cb7f0e5a0c6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:59:09 +0100 Subject: [PATCH 06/12] chore(deps): bump @cucumber/cucumber-expressions from 17.1.0 to 18.0.1 (#4583) Bumps [@cucumber/cucumber-expressions](https://github.com/cucumber/cucumber-expressions) from 17.1.0 to 18.0.1. - [Release notes](https://github.com/cucumber/cucumber-expressions/releases) - [Changelog](https://github.com/cucumber/cucumber-expressions/blob/main/CHANGELOG.md) - [Commits](https://github.com/cucumber/cucumber-expressions/compare/v17.1.0...v18.0.1) --- updated-dependencies: - dependency-name: "@cucumber/cucumber-expressions" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 334dfc199..e3505c2d2 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "dependencies": { "@codeceptjs/configure": "1.0.1", "@codeceptjs/helper": "2.0.4", - "@cucumber/cucumber-expressions": "17", + "@cucumber/cucumber-expressions": "18", "@cucumber/gherkin": "30", "@cucumber/messages": "27.0.0", "@xmldom/xmldom": "0.9.4", From 199437ff8e95c0eff1223fe0a2b38eaef0fa1c9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:59:23 +0100 Subject: [PATCH 07/12] chore(deps-dev): bump jsdoc from 4.0.3 to 4.0.4 (#4586) Bumps [jsdoc](https://github.com/jsdoc/jsdoc) from 4.0.3 to 4.0.4. - [Release notes](https://github.com/jsdoc/jsdoc/releases) - [Changelog](https://github.com/jsdoc/jsdoc/blob/4.0.4/CHANGES.md) - [Commits](https://github.com/jsdoc/jsdoc/compare/4.0.3...4.0.4) --- updated-dependencies: - dependency-name: jsdoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e3505c2d2..aa62688a9 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "graphql": "16.9.0", "husky": "9.1.6", "inquirer-test": "2.0.1", - "jsdoc": "4.0.3", + "jsdoc": "4.0.4", "jsdoc-typeof-plugin": "1.0.0", "json-server": "0.10.1", "playwright": "1.48.2", From 5967783695ad9c709cba37ab45cf92e397611f08 Mon Sep 17 00:00:00 2001 From: kobenguyent <7845001+kobenguyent@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:09:54 +0100 Subject: [PATCH 08/12] Bump documentation (#4587) * bump documenation lib * bump documenation lib --- package.json | 2 +- runok.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index aa62688a9..020e8b05d 100644 --- a/package.json +++ b/package.json @@ -133,7 +133,7 @@ "chai-subset": "1.6.0", "cheerio": "^1.0.0", "contributor-faces": "1.1.0", - "documentation": "12.3.0", + "documentation": "14.0.3", "electron": "33.2.0", "eslint": "8.57.0", "eslint-config-airbnb-base": "15.0.0", diff --git a/runok.js b/runok.js index 6e9f09989..ca24886f6 100755 --- a/runok.js +++ b/runok.js @@ -2,7 +2,7 @@ const fs = require('fs') const path = require('path') const axios = require('axios') -const documentation = require('documentation') + const { stopOnFail, chdir, @@ -13,6 +13,10 @@ const contributors = require('contributor-faces') const { execSync } = require('node:child_process') const semver = require('semver') +let documentation + +import('documentation').then((mod) => (documentation = mod)) + const helperMarkDownFile = function (name) { return `docs/helpers/${name}.md` } From ccec354c0ebbb3daba8fd2f6dcabf8feb40da5ee Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 14 Nov 2024 13:12:03 +0000 Subject: [PATCH 09/12] DOC: Autogenerate and update documentation --- docs/helpers/AI.md | 26 +- docs/helpers/ApiDataFactory.md | 53 +-- docs/helpers/Appium.md | 338 +++++++-------- docs/helpers/Detox.md | 136 +++--- docs/helpers/ExpectHelper.md | 178 ++++---- docs/helpers/FileSystem.md | 36 +- docs/helpers/GraphQL.md | 37 +- docs/helpers/GraphQLDataFactory.md | 44 +- docs/helpers/JSONResponse.md | 26 +- docs/helpers/MockRequest.md | 42 +- docs/helpers/Nightmare.md | 279 ++++++------ docs/helpers/Playwright.md | 670 +++++++++++++++-------------- docs/helpers/Protractor.md | 364 ++++++++-------- docs/helpers/Puppeteer.md | 561 ++++++++++++------------ docs/helpers/REST.md | 81 ++-- docs/helpers/SoftExpectHelper.md | 178 ++++---- docs/helpers/TestCafe.md | 256 +++++------ docs/helpers/WebDriver.md | 536 +++++++++++------------ 18 files changed, 1928 insertions(+), 1913 deletions(-) diff --git a/docs/helpers/AI.md b/docs/helpers/AI.md index a3b6082ea..96e0dc607 100644 --- a/docs/helpers/AI.md +++ b/docs/helpers/AI.md @@ -22,11 +22,11 @@ Use it only in development mode. It is recommended to run it only inside pause() This helper should be configured in codecept.conf.{js|ts} -- `chunkSize`: - The maximum number of characters to send to the AI API at once. We split HTML fragments by 8000 chars to not exceed token limit. Increase this value if you use GPT-4. +* `chunkSize`: - The maximum number of characters to send to the AI API at once. We split HTML fragments by 8000 chars to not exceed token limit. Increase this value if you use GPT-4. ### Parameters -- `config` +* `config` ### askForPageObject @@ -50,11 +50,11 @@ Asks for a page object based on the provided page name, locator, and extra promp #### Parameters -- `pageName` **[string][1]** The name of the page to retrieve the object for. -- `extraPrompt` **([string][1] | null)** An optional extra prompt for additional context or information. -- `locator` **([string][1] | null)** An optional locator to find a specific element on the page. +* `pageName` **[string][1]** The name of the page to retrieve the object for. +* `extraPrompt` **([string][1] | null)** An optional extra prompt for additional context or information. +* `locator` **([string][1] | null)** An optional locator to find a specific element on the page. -Returns **[Promise][2]<[Object][3]>** A promise that resolves to the requested page object. +Returns **[Promise][2]<[Object][3]>** A promise that resolves to the requested page object. ### askGptGeneralPrompt @@ -62,9 +62,9 @@ Send a general request to AI and return response. #### Parameters -- `prompt` **[string][1]** +* `prompt` **[string][1]** -Returns **[Promise][2]<[string][1]>** A Promise that resolves to the generated response from the GPT model. +Returns **[Promise][2]<[string][1]>** A Promise that resolves to the generated response from the GPT model. ### askGptOnPage @@ -76,9 +76,9 @@ I.askGptOnPage('what does this page do?'); #### Parameters -- `prompt` **[string][1]** The question or prompt to ask the GPT model. +* `prompt` **[string][1]** The question or prompt to ask the GPT model. -Returns **[Promise][2]<[string][1]>** A Promise that resolves to the generated responses from the GPT model, joined by newlines. +Returns **[Promise][2]<[string][1]>** A Promise that resolves to the generated responses from the GPT model, joined by newlines. ### askGptOnPageFragment @@ -90,10 +90,10 @@ I.askGptOnPageFragment('describe features of this screen', '.screen'); #### Parameters -- `prompt` **[string][1]** The question or prompt to ask the GPT-3.5 model. -- `locator` **[string][1]** The locator or selector used to identify the HTML fragment on the page. +* `prompt` **[string][1]** The question or prompt to ask the GPT-3.5 model. +* `locator` **[string][1]** The locator or selector used to identify the HTML fragment on the page. -Returns **[Promise][2]<[string][1]>** A Promise that resolves to the generated response from the GPT model. +Returns **[Promise][2]<[string][1]>** A Promise that resolves to the generated response from the GPT model. [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/docs/helpers/ApiDataFactory.md b/docs/helpers/ApiDataFactory.md index 0be0039a6..d76af53e0 100644 --- a/docs/helpers/ApiDataFactory.md +++ b/docs/helpers/ApiDataFactory.md @@ -71,12 +71,12 @@ Then configure ApiDataHelper to match factories and REST API: ApiDataFactory has following config options: -- `endpoint`: base URL for the API to send requests to. -- `cleanup` (default: true): should inserted records be deleted up after tests -- `factories`: list of defined factories -- `returnId` (default: false): return id instead of a complete response when creating items. -- `headers`: list of headers -- `REST`: configuration for REST requests +* `endpoint`: base URL for the API to send requests to. +* `cleanup` (default: true): should inserted records be deleted up after tests +* `factories`: list of defined factories +* `returnId` (default: false): return id instead of a complete response when creating items. +* `headers`: list of headers +* `REST`: configuration for REST requests See the example: @@ -121,25 +121,26 @@ For instance, to set timeout you should add: By default to create a record ApiDataFactory will use endpoint and plural factory name: -- create: `POST {endpoint}/{resource} data` -- delete: `DELETE {endpoint}/{resource}/id` +* create: `POST {endpoint}/{resource} data` +* delete: `DELETE {endpoint}/{resource}/id` Example (`endpoint`: `http://app.com/api`): -- create: POST request to `http://app.com/api/users` -- delete: DELETE request to `http://app.com/api/users/1` +* create: POST request to `http://app.com/api/users` +* delete: DELETE request to `http://app.com/api/users/1` This behavior can be configured with following options: -- `uri`: set different resource uri. Example: `uri: account` => `http://app.com/api/account`. -- `create`: override create options. Expected format: `{ method: uri }`. Example: `{ "post": "/users/create" }` -- `delete`: override delete options. Expected format: `{ method: uri }`. Example: `{ "post": "/users/delete/{id}" }` +* `uri`: set different resource uri. Example: `uri: account` => `http://app.com/api/account`. +* `create`: override create options. Expected format: `{ method: uri }`. Example: `{ "post": "/users/create" }` +* `delete`: override delete options. Expected format: `{ method: uri }`. Example: `{ "post": "/users/delete/{id}" }` Requests can also be overridden with a function which returns [axois request config][4]. ```js create: (data) => ({ method: 'post', url: '/posts', data }), delete: (id) => ({ method: 'delete', url: '/posts', data: { id } }) + ``` Requests can be updated on the fly by using `onRequest` function. For instance, you can pass in current session from a cookie. @@ -189,7 +190,7 @@ By default `id` property of response is taken. This behavior can be changed by s ### Parameters -- `config` +* `config` ### _requestCreate @@ -198,8 +199,8 @@ Can be replaced from a in custom helper. #### Parameters -- `factory` **any** -- `data` **any** +* `factory` **any** +* `data` **any** ### _requestDelete @@ -208,8 +209,8 @@ Can be replaced from a custom helper. #### Parameters -- `factory` **any** -- `id` **any** +* `factory` **any** +* `id` **any** ### have @@ -227,11 +228,11 @@ I.have('user', { }, { age: 33, height: 55 }) #### Parameters -- `factory` **any** factory to use -- `params` **any?** predefined parameters -- `options` **any?** options for programmatically generate the attributes +* `factory` **any** factory to use +* `params` **any?** predefined parameters +* `options` **any?** options for programmatically generate the attributes -Returns **[Promise][5]<any>** +Returns **[Promise][5]** ### haveMultiple @@ -250,10 +251,10 @@ I.haveMultiple('post', 3, { author: 'davert' }, { publish_date: '01.01.1997' }); #### Parameters -- `factory` **any** -- `times` **any** -- `params` **any?** -- `options` **any?** +* `factory` **any** +* `times` **any** +* `params` **any?** +* `options` **any?** [1]: https://github.com/rosiejs/rosie diff --git a/docs/helpers/Appium.md b/docs/helpers/Appium.md index ab0a870a2..ab3773a2e 100644 --- a/docs/helpers/Appium.md +++ b/docs/helpers/Appium.md @@ -12,8 +12,8 @@ title: Appium **Extends Webdriver** Appium helper extends [Webdriver][1] helper. - It supports all browser methods and also includes special methods for mobile apps testing. - You can use this helper to test Web on desktop and mobile devices and mobile apps. +It supports all browser methods and also includes special methods for mobile apps testing. +You can use this helper to test Web on desktop and mobile devices and mobile apps. ## Appium Installation @@ -32,20 +32,20 @@ Launch the daemon: `appium` This helper should be configured in codecept.conf.ts or codecept.conf.js -- `appiumV2`: set this to true if you want to run tests with AppiumV2. See more how to setup [here][3] -- `app`: Application path. Local path or remote URL to an .ipa or .apk file, or a .zip containing one of these. Alias to desiredCapabilities.appPackage -- `host`: (default: 'localhost') Appium host -- `port`: (default: '4723') Appium port -- `platform`: (Android or IOS), which mobile OS to use; alias to desiredCapabilities.platformName -- `restart`: restart browser or app between tests (default: true), if set to false cookies will be cleaned but browser window will be kept and for apps nothing will be changed. -- `desiredCapabilities`: \[], Appium capabilities, see below - - `platformName` - Which mobile OS platform to use - - `appPackage` - Java package of the Android app you want to run - - `appActivity` - Activity name for the Android activity you want to launch from your package. - - `deviceName`: The kind of mobile device or emulator to use - - `platformVersion`: Mobile OS version - - `app` - The absolute local path or remote http URL to an .ipa or .apk file, or a .zip containing one of these. Appium will attempt to install this app binary on the appropriate device first. - - `browserName`: Name of mobile web browser to automate. Should be an empty string if automating an app instead. +* `appiumV2`: set this to true if you want to run tests with AppiumV2. See more how to setup [here][3] +* `app`: Application path. Local path or remote URL to an .ipa or .apk file, or a .zip containing one of these. Alias to desiredCapabilities.appPackage +* `host`: (default: 'localhost') Appium host +* `port`: (default: '4723') Appium port +* `platform`: (Android or IOS), which mobile OS to use; alias to desiredCapabilities.platformName +* `restart`: restart browser or app between tests (default: true), if set to false cookies will be cleaned but browser window will be kept and for apps nothing will be changed. +* `desiredCapabilities`: \[], Appium capabilities, see below + * `platformName` - Which mobile OS platform to use + * `appPackage` - Java package of the Android app you want to run + * `appActivity` - Activity name for the Android activity you want to launch from your package. + * `deviceName`: The kind of mobile device or emulator to use + * `platformVersion`: Mobile OS version + * `app` - The absolute local path or remote http URL to an .ipa or .apk file, or a .zip containing one of these. Appium will attempt to install this app binary on the appropriate device first. + * `browserName`: Name of mobile web browser to automate. Should be an empty string if automating an app instead. Example Android App: @@ -157,7 +157,7 @@ let browser = this.helpers['Appium'].browser ### Parameters -- `config` +* `config` ### runOnIOS @@ -192,8 +192,8 @@ I.runOnAndroid((caps) => { #### Parameters -- `caps` **any** -- `fn` **any** +* `caps` **any** +* `fn` **any** ### runOnAndroid @@ -228,8 +228,8 @@ I.runOnAndroid((caps) => { #### Parameters -- `caps` **any** -- `fn` **any** +* `caps` **any** +* `fn` **any** ### runInWeb @@ -244,7 +244,7 @@ I.runInWeb(() => { #### Parameters -- `fn` **any** +* `fn` **any** ### checkIfAppIsInstalled @@ -256,9 +256,9 @@ I.checkIfAppIsInstalled("com.example.android.apis"); #### Parameters -- `bundleId` **[string][5]** String ID of bundled app +* `bundleId` **[string][5]** String ID of bundled app -Returns **[Promise][6]<[boolean][7]>** Appium: support only Android +Returns **[Promise][6]<[boolean][7]>** Appium: support only Android ### seeAppIsInstalled @@ -270,9 +270,9 @@ I.seeAppIsInstalled("com.example.android.apis"); #### Parameters -- `bundleId` **[string][5]** String ID of bundled app +* `bundleId` **[string][5]** String ID of bundled app -Returns **[Promise][6]<void>** Appium: support only Android +Returns **[Promise][6]\** Appium: support only Android ### seeAppIsNotInstalled @@ -284,9 +284,9 @@ I.seeAppIsNotInstalled("com.example.android.apis"); #### Parameters -- `bundleId` **[string][5]** String ID of bundled app +* `bundleId` **[string][5]** String ID of bundled app -Returns **[Promise][6]<void>** Appium: support only Android +Returns **[Promise][6]\** Appium: support only Android ### installApp @@ -298,9 +298,9 @@ I.installApp('/path/to/file.apk'); #### Parameters -- `path` **[string][5]** path to apk file +* `path` **[string][5]** path to apk file -Returns **[Promise][6]<void>** Appium: support only Android +Returns **[Promise][6]\** Appium: support only Android ### removeApp @@ -314,8 +314,8 @@ Appium: support only Android #### Parameters -- `appId` **[string][5]** -- `bundleId` **[string][5]?** ID of bundle +* `appId` **[string][5]** +* `bundleId` **[string][5]?** ID of bundle ### resetApp @@ -335,9 +335,9 @@ I.seeCurrentActivityIs(".HomeScreenActivity") #### Parameters -- `currentActivity` **[string][5]** +* `currentActivity` **[string][5]** -Returns **[Promise][6]<void>** Appium: support only Android +Returns **[Promise][6]\** Appium: support only Android ### seeDeviceIsLocked @@ -347,7 +347,7 @@ Check whether the device is locked. I.seeDeviceIsLocked(); ``` -Returns **[Promise][6]<void>** Appium: support only Android +Returns **[Promise][6]\** Appium: support only Android ### seeDeviceIsUnlocked @@ -357,7 +357,7 @@ Check whether the device is not locked. I.seeDeviceIsUnlocked(); ``` -Returns **[Promise][6]<void>** Appium: support only Android +Returns **[Promise][6]\** Appium: support only Android ### seeOrientationIs @@ -370,9 +370,9 @@ I.seeOrientationIs('LANDSCAPE') #### Parameters -- `orientation` **(`"LANDSCAPE"` \| `"PORTRAIT"`)** LANDSCAPE or PORTRAITAppium: support Android and iOS +* `orientation` **(`"LANDSCAPE"` | `"PORTRAIT"`)** LANDSCAPE or PORTRAITAppium: support Android and iOS -Returns **[Promise][6]<void>** +Returns **[Promise][6]\** ### setOrientation @@ -385,7 +385,7 @@ I.setOrientation('LANDSCAPE') #### Parameters -- `orientation` **(`"LANDSCAPE"` \| `"PORTRAIT"`)** LANDSCAPE or PORTRAITAppium: support Android and iOS +* `orientation` **(`"LANDSCAPE"` | `"PORTRAIT"`)** LANDSCAPE or PORTRAITAppium: support Android and iOS ### grabAllContexts @@ -393,7 +393,7 @@ Get list of all available contexts let contexts = await I.grabAllContexts(); -Returns **[Promise][6]<[Array][8]<[string][5]>>** Appium: support Android and iOS +Returns **[Promise][6]<[Array][8]<[string][5]>>** Appium: support Android and iOS ### grabContext @@ -403,7 +403,7 @@ Retrieve current context let context = await I.grabContext(); ``` -Returns **[Promise][6]<([string][5] | null)>** Appium: support Android and iOS +Returns **[Promise][6]<([string][5] | null)>** Appium: support Android and iOS ### grabCurrentActivity @@ -413,7 +413,7 @@ Get current device activity. let activity = await I.grabCurrentActivity(); ``` -Returns **[Promise][6]<[string][5]>** Appium: support only Android +Returns **[Promise][6]<[string][5]>** Appium: support only Android ### grabNetworkConnection @@ -425,7 +425,7 @@ properties to the response object to allow easier assertions. let con = await I.grabNetworkConnection(); ``` -Returns **[Promise][6]<{}>** Appium: support only Android +Returns **[Promise][6]<{}>** Appium: support only Android ### grabOrientation @@ -435,7 +435,7 @@ Get current orientation. let orientation = await I.grabOrientation(); ``` -Returns **[Promise][6]<[string][5]>** Appium: support Android and iOS +Returns **[Promise][6]<[string][5]>** Appium: support Android and iOS ### grabSettings @@ -445,7 +445,7 @@ Get all the currently specified settings. let settings = await I.grabSettings(); ``` -Returns **[Promise][6]<[string][5]>** Appium: support Android and iOS +Returns **[Promise][6]<[string][5]>** Appium: support Android and iOS ### switchToContext @@ -453,7 +453,7 @@ Switch to the specified context. #### Parameters -- `context` **any** the context to switch to +* `context` **any** the context to switch to ### switchToWeb @@ -470,14 +470,14 @@ I.switchToWeb('WEBVIEW_io.selendroid.testapp'); #### Parameters -- `context` **[string][5]?** +* `context` **[string][5]?** -Returns **[Promise][6]<void>** +Returns **[Promise][6]\** ### switchToNative Switches to native context. -By default switches to NATIVE_APP context unless other specified. +By default switches to NATIVE\_APP context unless other specified. ```js I.switchToNative(); @@ -488,9 +488,9 @@ I.switchToNative('SOME_OTHER_CONTEXT'); #### Parameters -- `context` **any?** (optional, default `null`) +* `context` **any?** (optional, default `null`) -Returns **[Promise][6]<void>** +Returns **[Promise][6]\** ### startActivity @@ -504,18 +504,18 @@ Appium: support only Android #### Parameters -- `appPackage` **[string][5]** -- `appActivity` **[string][5]** +* `appPackage` **[string][5]** +* `appActivity` **[string][5]** -Returns **[Promise][6]<void>** +Returns **[Promise][6]\** ### setNetworkConnection Set network connection mode. -- airplane mode -- wifi mode -- data data +* airplane mode +* wifi mode +* data data ```js I.setNetworkConnection(0) // airplane mode off, wifi off, data off @@ -531,9 +531,9 @@ Appium: support only Android #### Parameters -- `value` **[number][10]** The network connection mode bitmask +* `value` **[number][10]** The network connection mode bitmask -Returns **[Promise][6]<[number][10]>** +Returns **[Promise][6]<[number][10]>** ### setSettings @@ -545,7 +545,7 @@ I.setSettings({cyberdelia: 'open'}); #### Parameters -- `settings` **[object][11]** objectAppium: support Android and iOS +* `settings` **[object][11]** objectAppium: support Android and iOS ### hideDeviceKeyboard @@ -564,8 +564,8 @@ Appium: support Android and iOS #### Parameters -- `strategy` **(`"tapOutside"` \| `"pressKey"`)?** Desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’) -- `key` **[string][5]?** Optional key +* `strategy` **(`"tapOutside"` | `"pressKey"`)?** Desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’) +* `key` **[string][5]?** Optional key ### sendDeviceKeyEvent @@ -578,9 +578,9 @@ I.sendDeviceKeyEvent(3); #### Parameters -- `keyValue` **[number][10]** Device specific key value +* `keyValue` **[number][10]** Device specific key value -Returns **[Promise][6]<void>** Appium: support only Android +Returns **[Promise][6]\** Appium: support only Android ### openNotifications @@ -590,7 +590,7 @@ Open the notifications panel on the device. I.openNotifications(); ``` -Returns **[Promise][6]<void>** Appium: support only Android +Returns **[Promise][6]\** Appium: support only Android ### makeTouchAction @@ -606,10 +606,10 @@ I.makeTouchAction("~buttonStartWebviewCD", 'tap'); #### Parameters -- `locator` -- `action` +* `locator` +* `action` -Returns **[Promise][6]<void>** Appium: support Android and iOS +Returns **[Promise][6]\** Appium: support Android and iOS ### tap @@ -623,9 +623,9 @@ Shortcut for `makeTouchAction` #### Parameters -- `locator` **any** +* `locator` **any** -Returns **[Promise][6]<void>** +Returns **[Promise][6]\** ### swipe @@ -640,12 +640,12 @@ I.swipe(locator, 800, 1200, 1000); #### Parameters -- `locator` **([string][5] \| [object][11])** -- `xoffset` **[number][10]** -- `yoffset` **[number][10]** -- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`) +* `locator` **([string][5] | [object][11])** +* `xoffset` **[number][10]** +* `yoffset` **[number][10]** +* `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`) -Returns **[Promise][6]<void>** Appium: support Android and iOS +Returns **[Promise][6]\** Appium: support Android and iOS ### performSwipe @@ -657,8 +657,8 @@ I.performSwipe({ x: 300, y: 100 }, { x: 200, y: 100 }); #### Parameters -- `from` **[object][11]** -- `to` **[object][11]** Appium: support Android and iOS +* `from` **[object][11]** +* `to` **[object][11]** Appium: support Android and iOS ### swipeDown @@ -673,11 +673,11 @@ I.swipeDown(locator, 1200, 1000); // set offset and speed #### Parameters -- `locator` **([string][5] \| [object][11])** -- `yoffset` **[number][10]?** (optional) (optional, default `1000`) -- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`) +* `locator` **([string][5] | [object][11])** +* `yoffset` **[number][10]?** (optional) (optional, default `1000`) +* `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`) -Returns **[Promise][6]<void>** Appium: support Android and iOS +Returns **[Promise][6]\** Appium: support Android and iOS ### swipeLeft @@ -692,11 +692,11 @@ I.swipeLeft(locator, 1200, 1000); // set offset and speed #### Parameters -- `locator` **([string][5] \| [object][11])** -- `xoffset` **[number][10]?** (optional) (optional, default `1000`) -- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`) +* `locator` **([string][5] | [object][11])** +* `xoffset` **[number][10]?** (optional) (optional, default `1000`) +* `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`) -Returns **[Promise][6]<void>** Appium: support Android and iOS +Returns **[Promise][6]\** Appium: support Android and iOS ### swipeRight @@ -711,11 +711,11 @@ I.swipeRight(locator, 1200, 1000); // set offset and speed #### Parameters -- `locator` **([string][5] \| [object][11])** -- `xoffset` **[number][10]?** (optional) (optional, default `1000`) -- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`) +* `locator` **([string][5] | [object][11])** +* `xoffset` **[number][10]?** (optional) (optional, default `1000`) +* `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`) -Returns **[Promise][6]<void>** Appium: support Android and iOS +Returns **[Promise][6]\** Appium: support Android and iOS ### swipeUp @@ -730,11 +730,11 @@ I.swipeUp(locator, 1200, 1000); // set offset and speed #### Parameters -- `locator` **([string][5] \| [object][11])** -- `yoffset` **[number][10]?** (optional) (optional, default `1000`) -- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`) +* `locator` **([string][5] | [object][11])** +* `yoffset` **[number][10]?** (optional) (optional, default `1000`) +* `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`) -Returns **[Promise][6]<void>** Appium: support Android and iOS +Returns **[Promise][6]\** Appium: support Android and iOS ### swipeTo @@ -752,14 +752,14 @@ I.swipeTo( #### Parameters -- `searchableLocator` **[string][5]** -- `scrollLocator` **[string][5]** -- `direction` **[string][5]** -- `timeout` **[number][10]** -- `offset` **[number][10]** -- `speed` **[number][10]** +* `searchableLocator` **[string][5]** +* `scrollLocator` **[string][5]** +* `direction` **[string][5]** +* `timeout` **[number][10]** +* `offset` **[number][10]** +* `speed` **[number][10]** -Returns **[Promise][6]<void>** Appium: support Android and iOS +Returns **[Promise][6]\** Appium: support Android and iOS ### touchPerform @@ -790,7 +790,7 @@ Appium: support Android and iOS #### Parameters -- `actions` **[Array][8]** Array of touch actions +* `actions` **[Array][8]** Array of touch actions ### pullFile @@ -804,10 +804,10 @@ I.pullFile('/storage/emulated/0/DCIM/logo.png', output_dir); #### Parameters -- `path` **[string][5]** -- `dest` **[string][5]** +* `path` **[string][5]** +* `dest` **[string][5]** -Returns **[Promise][6]<[string][5]>** Appium: support Android and iOS +Returns **[Promise][6]<[string][5]>** Appium: support Android and iOS ### shakeDevice @@ -817,7 +817,7 @@ Perform a shake action on the device. I.shakeDevice(); ``` -Returns **[Promise][6]<void>** Appium: support only iOS +Returns **[Promise][6]\** Appium: support only iOS ### rotate @@ -831,14 +831,14 @@ See corresponding [webdriverio reference][15]. #### Parameters -- `x` -- `y` -- `duration` -- `radius` -- `rotation` -- `touchCount` +* `x` +* `y` +* `duration` +* `radius` +* `rotation` +* `touchCount` -Returns **[Promise][6]<void>** Appium: support only iOS +Returns **[Promise][6]\** Appium: support only iOS ### setImmediateValue @@ -848,10 +848,10 @@ See corresponding [webdriverio reference][16]. #### Parameters -- `id` -- `value` +* `id` +* `value` -Returns **[Promise][6]<void>** Appium: support only iOS +Returns **[Promise][6]\** Appium: support only iOS ### simulateTouchId @@ -865,9 +865,9 @@ I.touchId(false); // simulates invalid fingerprint #### Parameters -- `match` +* `match` -Returns **[Promise][6]<void>** Appium: support only iOS +Returns **[Promise][6]\** Appium: support only iOS TODO: not tested ### closeApp @@ -878,7 +878,7 @@ Close the given application. I.closeApp(); ``` -Returns **[Promise][6]<void>** Appium: support both Android and iOS +Returns **[Promise][6]\** Appium: support both Android and iOS ### appendField @@ -893,8 +893,8 @@ I.appendField('password', secret('123456')); #### Parameters -- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator -- `value` **[string][5]** text value to append. +* `field` **([string][5] | [object][11])** located by label|name|CSS|XPath|strict locator +* `value` **[string][5]** text value to append. Returns **void** automatically synchronized promise through #recorder @@ -913,8 +913,8 @@ I.checkOption('agree', '//form'); #### Parameters -- `field` **([string][5] \| [object][11])** checkbox located by label | name | CSS | XPath | strict locator. -- `context` **([string][5]? | [object][11])** (optional, `null` by default) element located by CSS | XPath | strict locator. (optional, default `null`) +* `field` **([string][5] | [object][11])** checkbox located by label | name | CSS | XPath | strict locator. +* `context` **([string][5]? | [object][11])** (optional, `null` by default) element located by CSS | XPath | strict locator. (optional, default `null`) Returns **void** automatically synchronized promise through #recorder @@ -944,8 +944,8 @@ I.click({css: 'nav a.login'}); #### Parameters -- `locator` **([string][5] \| [object][11])** clickable link or button located by text, or any element located by CSS|XPath|strict locator. -- `context` **([string][5]? | [object][11] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. (optional, default `null`) +* `locator` **([string][5] | [object][11])** clickable link or button located by text, or any element located by CSS|XPath|strict locator. +* `context` **([string][5]? | [object][11] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. (optional, default `null`) Returns **void** automatically synchronized promise through #recorder @@ -961,7 +961,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name #### Parameters -- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator. +* `field` **([string][5] | [object][11])** located by label|name|CSS|XPath|strict locator. Returns **void** automatically synchronized promise through #recorder @@ -975,7 +975,7 @@ I.dontSeeElement('.modal'); // modal is not shown #### Parameters -- `locator` **([string][5] \| [object][11])** located by CSS|XPath|Strict locator. +* `locator` **([string][5] | [object][11])** located by CSS|XPath|Strict locator. Returns **void** automatically synchronized promise through #recorder @@ -991,8 +991,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS #### Parameters -- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator. -- `value` **([string][5] \| [object][11])** value to check. +* `field` **([string][5] | [object][11])** located by label|name|CSS|XPath|strict locator. +* `value` **([string][5] | [object][11])** value to check. Returns **void** automatically synchronized promise through #recorder @@ -1008,8 +1008,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element #### Parameters -- `text` **[string][5]** which is not present. -- `context` **([string][5] \| [object][11])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. (optional, default `null`) +* `text` **[string][5]** which is not present. +* `context` **([string][5] | [object][11])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. (optional, default `null`) Returns **void** automatically synchronized promise through #recorder @@ -1031,8 +1031,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John'); #### Parameters -- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator. -- `value` **([string][5] \| [object][11])** text value to fill. +* `field` **([string][5] | [object][11])** located by label|name|CSS|XPath|strict locator. +* `value` **([string][5] | [object][11])** text value to fill. Returns **void** automatically synchronized promise through #recorder @@ -1047,9 +1047,9 @@ let pins = await I.grabTextFromAll('#pin li'); #### Parameters -- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator. +* `locator` **([string][5] | [object][11])** element located by CSS|XPath|strict locator. -Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value +Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value ### grabTextFrom @@ -1064,9 +1064,9 @@ If multiple elements found returns first element. #### Parameters -- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator. +* `locator` **([string][5] | [object][11])** element located by CSS|XPath|strict locator. -Returns **[Promise][6]<[string][5]>** attribute value +Returns **[Promise][6]<[string][5]>** attribute value ### grabNumberOfVisibleElements @@ -1079,9 +1079,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p'); #### Parameters -- `locator` **([string][5] \| [object][11])** located by CSS|XPath|strict locator. +* `locator` **([string][5] | [object][11])** located by CSS|XPath|strict locator. -Returns **[Promise][6]<[number][10]>** number of visible elements +Returns **[Promise][6]<[number][10]>** number of visible elements ### grabAttributeFrom @@ -1097,10 +1097,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title'); #### Parameters -- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator. -- `attr` **[string][5]** attribute name. +* `locator` **([string][5] | [object][11])** element located by CSS|XPath|strict locator. +* `attr` **[string][5]** attribute name. -Returns **[Promise][6]<[string][5]>** attribute value +Returns **[Promise][6]<[string][5]>** attribute value ### grabAttributeFromAll @@ -1114,10 +1114,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title'); #### Parameters -- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator. -- `attr` **[string][5]** attribute name. +* `locator` **([string][5] | [object][11])** element located by CSS|XPath|strict locator. +* `attr` **[string][5]** attribute name. -Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value +Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value ### grabValueFromAll @@ -1130,9 +1130,9 @@ let inputs = await I.grabValueFromAll('//form/input'); #### Parameters -- `locator` **([string][5] \| [object][11])** field located by label|name|CSS|XPath|strict locator. +* `locator` **([string][5] | [object][11])** field located by label|name|CSS|XPath|strict locator. -Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value +Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value ### grabValueFrom @@ -1146,9 +1146,9 @@ let email = await I.grabValueFrom('input[name=email]'); #### Parameters -- `locator` **([string][5] \| [object][11])** field located by label|name|CSS|XPath|strict locator. +* `locator` **([string][5] | [object][11])** field located by label|name|CSS|XPath|strict locator. -Returns **[Promise][6]<[string][5]>** attribute value +Returns **[Promise][6]<[string][5]>** attribute value ### saveScreenshot @@ -1161,9 +1161,9 @@ I.saveScreenshot('debug.png'); #### Parameters -- `fileName` **[string][5]** file name to save. +* `fileName` **[string][5]** file name to save. -Returns **[Promise][6]<void>** +Returns **[Promise][6]\** ### scrollIntoView @@ -1177,8 +1177,8 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent #### Parameters -- `locator` **([string][5] \| [object][11])** located by CSS|XPath|strict locator. -- `scrollIntoViewOptions` **(ScrollIntoViewOptions | [boolean][7])** either alignToTop=true|false or scrollIntoViewOptions. See [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][17]. +* `locator` **([string][5] | [object][11])** located by CSS|XPath|strict locator. +* `scrollIntoViewOptions` **(ScrollIntoViewOptions | [boolean][7])** either alignToTop=true|false or scrollIntoViewOptions. See [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][17]. Returns **void** automatically synchronized promise through #recorderSupported only for web testing @@ -1194,7 +1194,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'}); #### Parameters -- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator. +* `field` **([string][5] | [object][11])** located by label|name|CSS|XPath|strict locator. Returns **void** automatically synchronized promise through #recorder @@ -1209,7 +1209,7 @@ I.seeElement('#modal'); #### Parameters -- `locator` **([string][5] \| [object][11])** located by CSS|XPath|strict locator. +* `locator` **([string][5] | [object][11])** located by CSS|XPath|strict locator. Returns **void** automatically synchronized promise through #recorder @@ -1227,8 +1227,8 @@ I.seeInField('#searchform input','Search'); #### Parameters -- `field` **([string][5] \| [object][11])** located by label|name|CSS|XPath|strict locator. -- `value` **([string][5] \| [object][11])** value to check. +* `field` **([string][5] | [object][11])** located by label|name|CSS|XPath|strict locator. +* `value` **([string][5] | [object][11])** value to check. Returns **void** automatically synchronized promise through #recorder @@ -1245,8 +1245,8 @@ I.see('Register', {css: 'form.register'}); // use strict locator #### Parameters -- `text` **[string][5]** expected on page. -- `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`) +* `text` **[string][5]** expected on page. +* `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`) Returns **void** automatically synchronized promise through #recorder @@ -1273,8 +1273,8 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']); #### Parameters -- `select` **([string][5] \| [object][11])** field located by label|name|CSS|XPath|strict locator. -- `option` **([string][5] \| [Array][8]<any>)** visible text or value of option. +* `select` **([string][5] | [object][11])** field located by label|name|CSS|XPath|strict locator. +* `option` **([string][5] | [Array][8]\)** visible text or value of option. Returns **void** automatically synchronized promise through #recorderSupported only for web testing @@ -1290,8 +1290,8 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs #### Parameters -- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator. -- `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait (optional, default `null`) +* `locator` **([string][5] | [object][11])** element located by CSS|XPath|strict locator. +* `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait (optional, default `null`) Returns **void** automatically synchronized promise through #recorder @@ -1306,8 +1306,8 @@ I.waitForVisible('#popup'); #### Parameters -- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator. -- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`) +* `locator` **([string][5] | [object][11])** element located by CSS|XPath|strict locator. +* `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`) Returns **void** automatically synchronized promise through #recorder @@ -1322,8 +1322,8 @@ I.waitForInvisible('#popup'); #### Parameters -- `locator` **([string][5] \| [object][11])** element located by CSS|XPath|strict locator. -- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`) +* `locator` **([string][5] | [object][11])** element located by CSS|XPath|strict locator. +* `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`) Returns **void** automatically synchronized promise through #recorder @@ -1340,9 +1340,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal'); #### Parameters -- `text` **[string][5]** to wait for. -- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`) -- `context` **([string][5] \| [object][11])?** (optional) element located by CSS|XPath|strict locator. (optional, default `null`) +* `text` **[string][5]** to wait for. +* `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`) +* `context` **([string][5] | [object][11])?** (optional) element located by CSS|XPath|strict locator. (optional, default `null`) Returns **void** automatically synchronized promise through #recorder diff --git a/docs/helpers/Detox.md b/docs/helpers/Detox.md index 45401848e..4d5c46204 100644 --- a/docs/helpers/Detox.md +++ b/docs/helpers/Detox.md @@ -27,6 +27,7 @@ Comparing to Appium, Detox runs faster and more stable but requires an additiona 2. [Build an application][3] using `detox build` command. 3. Install [CodeceptJS][4] and detox-helper: + npm i @codeceptjs/detox-helper --save @@ -73,21 +74,22 @@ helpers: { configuration: '', } } + ``` It's important to specify a package name under `require` section and current detox configuration taken from `package.json`. Options: -- `configuration` - a detox configuration name. Required. -- `reloadReactNative` - should be enabled for React Native applications. -- `reuse` - reuse application for tests. By default, Detox reinstalls and relaunches app. -- `registerGlobals` - (default: true) Register Detox helper functions `by`, `element`, `expect`, `waitFor` globally. -- `url` - URL to open via deep-link each time the app is launched (android) or immediately afterwards (iOS). Useful for opening a bundle URL at the beginning of tests when working with Expo. +* `configuration` - a detox configuration name. Required. +* `reloadReactNative` - should be enabled for React Native applications. +* `reuse` - reuse application for tests. By default, Detox reinstalls and relaunches app. +* `registerGlobals` - (default: true) Register Detox helper functions `by`, `element`, `expect`, `waitFor` globally. +* `url` - URL to open via deep-link each time the app is launched (android) or immediately afterwards (iOS). Useful for opening a bundle URL at the beginning of tests when working with Expo. ### Parameters -- `config` +* `config` ### appendField @@ -100,8 +102,8 @@ I.appendField('name', 'davert'); #### Parameters -- `field` **([string][5] \| [object][6])** -- `value` **[string][5]** +* `field` **([string][5] | [object][6])** +* `value` **[string][5]** ### checkIfElementExists @@ -114,8 +116,8 @@ I.checkIfElementExists('~edit', '#menu'); // element inside #menu #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `context` **([string][5] \| [object][6] | null)** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `context` **([string][5] | [object][6] | null)** context element (optional, default `null`) ### clearField @@ -128,7 +130,7 @@ I.clearField('~name'); #### Parameters -- `field` **([string][5] \| [object][6])** an input element to clear +* `field` **([string][5] | [object][6])** an input element to clear ### click @@ -149,8 +151,8 @@ I.click({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS an #### Parameters -- `locator` **([string][5] \| [object][6])** -- `context` **([string][5] \| [object][6] | null)** (optional, default `null`) +* `locator` **([string][5] | [object][6])** +* `context` **([string][5] | [object][6] | null)** (optional, default `null`) ### clickAtPoint @@ -164,9 +166,9 @@ I.clickAtPoint('~save', 10, 10); // locate by accessibility id #### Parameters -- `locator` **([string][5] \| [object][6])** -- `x` **[number][8]** horizontal offset (optional, default `0`) -- `y` **[number][8]** vertical offset (optional, default `0`) +* `locator` **([string][5] | [object][6])** +* `x` **[number][8]** horizontal offset (optional, default `0`) +* `y` **[number][8]** vertical offset (optional, default `0`) ### dontSee @@ -181,8 +183,8 @@ I.dontSee('Record deleted', '~message'); #### Parameters -- `text` **[string][5]** to check invisibility -- `context` **([string][5] \| [object][6] | null)** element in which to search for text (optional, default `null`) +* `text` **[string][5]** to check invisibility +* `context` **([string][5] | [object][6] | null)** element in which to search for text (optional, default `null`) ### dontSeeElement @@ -196,8 +198,8 @@ I.dontSeeElement('~edit', '#menu'); // element inside #menu #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `context` **([string][5] \| [object][6] | null)** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `context` **([string][5] | [object][6] | null)** context element (optional, default `null`) ### dontSeeElementExists @@ -211,8 +213,8 @@ I.dontSeeElementExist('~edit', '#menu'); // element inside #menu #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `context` **([string][5] \| [object][6])** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `context` **([string][5] | [object][6])** context element (optional, default `null`) ### fillField @@ -227,8 +229,8 @@ I.fillField({ android: 'NAME', ios: 'name' }, 'davert'); #### Parameters -- `field` **([string][5] \| [object][6])** an input element to fill in -- `value` **[string][5]** value to fill +* `field` **([string][5] | [object][6])** an input element to fill in +* `value` **[string][5]** value to fill ### goBack @@ -275,9 +277,9 @@ I.longPress('Update', 2, '#menu'); // locate by text inside #menu, hold for 2 se #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `sec` **[number][8]** number of seconds to hold tap -- `context` **([string][5] \| [object][6] | null)** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `sec` **[number][8]** number of seconds to hold tap +* `context` **([string][5] | [object][6] | null)** context element (optional, default `null`) ### multiTap @@ -296,9 +298,9 @@ I.multiTap('Update', 2, '#menu'); // locate by id #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `num` **[number][8]** number of taps -- `context` **([string][5] \| [object][6] | null)** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `num` **[number][8]** number of taps +* `context` **([string][5] | [object][6] | null)** context element (optional, default `null`) ### relaunchApp @@ -321,7 +323,7 @@ I.runOnAndroid(() => { #### Parameters -- `fn` **[Function][10]** a function which will be executed on android +* `fn` **[Function][10]** a function which will be executed on android ### runOnIOS @@ -336,7 +338,7 @@ I.runOnIOS(() => { #### Parameters -- `fn` **[Function][10]** a function which will be executed on iOS +* `fn` **[Function][10]** a function which will be executed on iOS ### saveScreenshot @@ -348,7 +350,7 @@ I.saveScreenshot('main-window.png'); #### Parameters -- `name` **[string][5]** +* `name` **[string][5]** ### scrollDown @@ -360,7 +362,7 @@ I.scrollDown('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** +* `locator` **([string][5] | [object][6])** ### scrollLeft @@ -372,7 +374,7 @@ I.scrollLeft('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** +* `locator` **([string][5] | [object][6])** ### scrollRight @@ -384,7 +386,7 @@ I.scrollRight('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** +* `locator` **([string][5] | [object][6])** ### scrollToElement @@ -392,10 +394,10 @@ Scrolls within a scrollable container to an element. #### Parameters -- `targetLocator` **([string][5] \| [object][6])** Locator of the element to scroll to -- `containerLocator` **([string][5] \| [object][6])** Locator of the scrollable container -- `direction` **[string][5]** 'up' or 'down' (optional, default `'down'`) -- `offset` **[number][8]** Offset for scroll, can be adjusted based on need (optional, default `100`) +* `targetLocator` **([string][5] | [object][6])** Locator of the element to scroll to +* `containerLocator` **([string][5] | [object][6])** Locator of the scrollable container +* `direction` **[string][5]** 'up' or 'down' (optional, default `'down'`) +* `offset` **[number][8]** Offset for scroll, can be adjusted based on need (optional, default `100`) ### scrollUp @@ -407,7 +409,7 @@ I.scrollUp('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** +* `locator` **([string][5] | [object][6])** ### see @@ -422,8 +424,8 @@ I.see('Record deleted', '~message'); #### Parameters -- `text` **[string][5]** to check visibility -- `context` **([string][5] \| [object][6] | null)** element inside which to search for text (optional, default `null`) +* `text` **[string][5]** to check visibility +* `context` **([string][5] | [object][6] | null)** element inside which to search for text (optional, default `null`) ### seeElement @@ -437,8 +439,8 @@ I.seeElement('~edit', '#menu'); // element inside #menu #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `context` **([string][5] \| [object][6] | null)** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `context` **([string][5] | [object][6] | null)** context element (optional, default `null`) ### seeElementExists @@ -452,8 +454,8 @@ I.seeElementExists('~edit', '#menu'); // element inside #menu #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `context` **([string][5] \| [object][6])** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `context` **([string][5] | [object][6])** context element (optional, default `null`) ### setLandscapeOrientation @@ -490,8 +492,8 @@ I.swipeUp('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** an element on which to perform swipe -- `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) +* `locator` **([string][5] | [object][6])** an element on which to perform swipe +* `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) ### swipeLeft @@ -504,8 +506,8 @@ I.swipeUp('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** an element on which to perform swipe -- `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) +* `locator` **([string][5] | [object][6])** an element on which to perform swipe +* `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) ### swipeRight @@ -518,8 +520,8 @@ I.swipeUp('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** an element on which to perform swipe -- `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) +* `locator` **([string][5] | [object][6])** an element on which to perform swipe +* `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) ### swipeUp @@ -532,8 +534,8 @@ I.swipeUp('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** an element on which to perform swipe -- `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) +* `locator` **([string][5] | [object][6])** an element on which to perform swipe +* `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) ### tap @@ -554,8 +556,8 @@ I.tap({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS and #### Parameters -- `locator` **([string][5] \| [object][6])** -- `context` **([string][5] \| [object][6] | null)** (optional, default `null`) +* `locator` **([string][5] | [object][6])** +* `context` **([string][5] | [object][6] | null)** (optional, default `null`) ### tapByLabel @@ -571,8 +573,8 @@ I.tapByLabel('Login', '#nav'); // locate by text inside #nav #### Parameters -- `locator` **([string][5] \| [object][6])** -- `context` **([string][5] \| [object][6] | null)** (optional, default `null`) +* `locator` **([string][5] | [object][6])** +* `context` **([string][5] | [object][6] | null)** (optional, default `null`) ### tapReturnKey @@ -587,7 +589,7 @@ I.tapReturnKey({ android: 'NAME', ios: 'name' }); #### Parameters -- `field` **([string][5] \| [object][6])** an input element to fill in +* `field` **([string][5] | [object][6])** an input element to fill in ### wait @@ -599,7 +601,7 @@ I.wait(2); // waits for 2 seconds #### Parameters -- `sec` **[number][8]** number of seconds to wait +* `sec` **[number][8]** number of seconds to wait ### waitForElement @@ -611,8 +613,8 @@ I.waitForElement('#message', 1); // wait for 1 second #### Parameters -- `locator` **([string][5] \| [object][6])** an element to wait for -- `sec` **[number][8]** number of seconds to wait, 5 by default (optional, default `5`) +* `locator` **([string][5] | [object][6])** an element to wait for +* `sec` **[number][8]** number of seconds to wait, 5 by default (optional, default `5`) ### waitForElementVisible @@ -624,8 +626,8 @@ I.waitForElementVisible('#message', 1); // wait for 1 second #### Parameters -- `locator` **([string][5] \| [object][6])** an element to wait for -- `sec` **[number][8]** number of seconds to wait (optional, default `5`) +* `locator` **([string][5] | [object][6])** an element to wait for +* `sec` **[number][8]** number of seconds to wait (optional, default `5`) ### waitToHide @@ -637,8 +639,8 @@ I.waitToHide('#message', 2); // wait for 2 seconds #### Parameters -- `locator` **([string][5] \| [object][6])** an element to wait for -- `sec` **[number][8]** number of seconds to wait (optional, default `5`) +* `locator` **([string][5] | [object][6])** an element to wait for +* `sec` **[number][8]** number of seconds to wait (optional, default `5`) [1]: https://github.com/wix/Detox diff --git a/docs/helpers/ExpectHelper.md b/docs/helpers/ExpectHelper.md index 7ffe415ab..3a0659b29 100644 --- a/docs/helpers/ExpectHelper.md +++ b/docs/helpers/ExpectHelper.md @@ -31,33 +31,33 @@ Zero-configuration when paired with other helpers like REST, Playwright: #### Parameters -- `targetData` **any** -- `aboveThan` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `aboveThan` **any** +* `customErrorMsg` **any?** ### expectBelow #### Parameters -- `targetData` **any** -- `belowThan` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `belowThan` **any** +* `customErrorMsg` **any?** ### expectContain #### Parameters -- `actualValue` **any** -- `expectedValueToContain` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToContain` **any** +* `customErrorMsg` **any?** ### expectDeepEqual #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectDeepEqualExcluding @@ -65,10 +65,10 @@ expects members of two JSON objects are deeply equal excluding some properties #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `fieldsToExclude` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `fieldsToExclude` **any** +* `customErrorMsg` **any?** ### expectDeepIncludeMembers @@ -76,9 +76,9 @@ expects an array to be a superset of another array #### Parameters -- `superset` **any** -- `set` **any** -- `customErrorMsg` **any?** +* `superset` **any** +* `set` **any** +* `customErrorMsg` **any?** ### expectDeepMembers @@ -86,104 +86,104 @@ expects members of two arrays are deeply equal #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectEmpty #### Parameters -- `targetData` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `customErrorMsg` **any?** ### expectEndsWith #### Parameters -- `actualValue` **any** -- `expectedValueToEndWith` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToEndWith` **any** +* `customErrorMsg` **any?** ### expectEqual #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectEqualIgnoreCase #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectFalse #### Parameters -- `targetData` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `customErrorMsg` **any?** ### expectHasAProperty #### Parameters -- `targetData` **any** -- `propertyName` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `propertyName` **any** +* `customErrorMsg` **any?** ### expectHasProperty #### Parameters -- `targetData` **any** -- `propertyName` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `propertyName` **any** +* `customErrorMsg` **any?** ### expectJsonSchema #### Parameters -- `targetData` **any** -- `jsonSchema` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `jsonSchema` **any** +* `customErrorMsg` **any?** ### expectJsonSchemaUsingAJV #### Parameters -- `targetData` **any** -- `jsonSchema` **any** -- `customErrorMsg` **any?** -- `ajvOptions` **any?** Pass AJV options +* `targetData` **any** +* `jsonSchema` **any** +* `customErrorMsg` **any?** +* `ajvOptions` **any?** Pass AJV options ### expectLengthAboveThan #### Parameters -- `targetData` **any** -- `lengthAboveThan` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `lengthAboveThan` **any** +* `customErrorMsg` **any?** ### expectLengthBelowThan #### Parameters -- `targetData` **any** -- `lengthBelowThan` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `lengthBelowThan` **any** +* `customErrorMsg` **any?** ### expectLengthOf #### Parameters -- `targetData` **any** -- `length` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `length` **any** +* `customErrorMsg` **any?** ### expectMatchesPattern @@ -191,85 +191,85 @@ expects a JSON object matches a provided pattern #### Parameters -- `actualValue` **any** -- `expectedPattern` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedPattern` **any** +* `customErrorMsg` **any?** ### expectMatchRegex #### Parameters -- `targetData` **any** -- `regex` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `regex` **any** +* `customErrorMsg` **any?** ### expectNotContain #### Parameters -- `actualValue` **any** -- `expectedValueToNotContain` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToNotContain` **any** +* `customErrorMsg` **any?** ### expectNotDeepEqual #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectNotEndsWith #### Parameters -- `actualValue` **any** -- `expectedValueToNotEndWith` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToNotEndWith` **any** +* `customErrorMsg` **any?** ### expectNotEqual #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectNotStartsWith #### Parameters -- `actualValue` **any** -- `expectedValueToNotStartWith` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToNotStartWith` **any** +* `customErrorMsg` **any?** ### expectStartsWith #### Parameters -- `actualValue` **any** -- `expectedValueToStartWith` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToStartWith` **any** +* `customErrorMsg` **any?** ### expectToBeA #### Parameters -- `targetData` **any** -- `type` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `type` **any** +* `customErrorMsg` **any?** ### expectToBeAn #### Parameters -- `targetData` **any** -- `type` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `type` **any** +* `customErrorMsg` **any?** ### expectTrue #### Parameters -- `targetData` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `customErrorMsg` **any?** diff --git a/docs/helpers/FileSystem.md b/docs/helpers/FileSystem.md index 0af9843db..cd3d1351a 100644 --- a/docs/helpers/FileSystem.md +++ b/docs/helpers/FileSystem.md @@ -40,7 +40,7 @@ Starts from a current directory #### Parameters -- `openPath` **[string][1]** +* `openPath` **[string][1]** ### dontSeeFileContentsEqual @@ -48,8 +48,8 @@ Checks that contents of file found by `seeFile` doesn't equal to text. #### Parameters -- `text` **[string][1]** -- `encoding` **[string][1]** +* `text` **[string][1]** +* `encoding` **[string][1]** ### dontSeeInThisFile @@ -57,8 +57,8 @@ Checks that file found by `seeFile` doesn't include text. #### Parameters -- `text` **[string][1]** -- `encoding` **[string][1]** +* `text` **[string][1]** +* `encoding` **[string][1]** ### grabFileNames @@ -77,7 +77,7 @@ Checks that file exists #### Parameters -- `name` **[string][1]** +* `name` **[string][1]** ### seeFileContentsEqual @@ -85,8 +85,8 @@ Checks that contents of file found by `seeFile` equal to text. #### Parameters -- `text` **[string][1]** -- `encoding` **[string][1]** +* `text` **[string][1]** +* `encoding` **[string][1]** ### seeFileContentsEqualReferenceFile @@ -94,9 +94,9 @@ Checks that contents of the file found by `seeFile` equal to contents of the fil #### Parameters -- `pathToReferenceFile` **[string][1]** -- `encoding` **[string][1]** -- `encodingReference` **[string][1]** +* `pathToReferenceFile` **[string][1]** +* `encoding` **[string][1]** +* `encodingReference` **[string][1]** ### seeFileNameMatching @@ -111,7 +111,7 @@ I.seeFileNameMatching('.pdf'); #### Parameters -- `text` **[string][1]** +* `text` **[string][1]** ### seeInThisFile @@ -119,8 +119,8 @@ Checks that file found by `seeFile` includes a text. #### Parameters -- `text` **[string][1]** -- `encoding` **[string][1]** +* `text` **[string][1]** +* `encoding` **[string][1]** ### waitForFile @@ -135,8 +135,8 @@ I.waitForFile('largeFilesName.txt', 10); // wait 10 seconds for file #### Parameters -- `name` **[string][1]** -- `sec` **[number][2]** seconds to wait +* `name` **[string][1]** +* `sec` **[number][2]** seconds to wait ### writeToFile @@ -144,8 +144,8 @@ Writes text to file #### Parameters -- `name` **[string][1]** -- `text` **[string][1]** +* `name` **[string][1]** +* `text` **[string][1]** [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/docs/helpers/GraphQL.md b/docs/helpers/GraphQL.md index 82d7bbfa5..7aa35c637 100644 --- a/docs/helpers/GraphQL.md +++ b/docs/helpers/GraphQL.md @@ -16,10 +16,10 @@ GraphQL helper allows to send additional requests to a GraphQl endpoint during a ## Configuration -- endpoint: GraphQL base URL -- timeout: timeout for requests in milliseconds. 10000ms by default -- defaultHeaders: a list of default headers -- onRequest: a async function which can update request object. +* endpoint: GraphQL base URL +* timeout: timeout for requests in milliseconds. 10000ms by default +* defaultHeaders: a list of default headers +* onRequest: a async function which can update request object. ## Example @@ -47,7 +47,7 @@ this.helpers['GraphQL']._executeQuery({ ### Parameters -- `config` +* `config` ### _executeQuery @@ -55,7 +55,7 @@ Executes query via axios call #### Parameters -- `request` **[object][2]** +* `request` **[object][2]** ### _prepareGraphQLRequest @@ -63,8 +63,8 @@ Prepares request for axios call #### Parameters -- `operation` **[object][2]** -- `headers` **[object][2]** +* `operation` **[object][2]** +* `headers` **[object][2]** Returns **[object][2]** graphQLRequest @@ -79,7 +79,7 @@ I.amBearerAuthenticated(secret('heregoestoken')) #### Parameters -- `accessToken` **([string][3] | CodeceptJS.Secret)** Bearer access token +* `accessToken` **([string][3] | CodeceptJS.Secret)** Bearer access token ### haveRequestHeaders @@ -87,7 +87,7 @@ Sets request headers for all requests of this test #### Parameters -- `headers` **[object][2]** headers list +* `headers` **[object][2]** headers list ### sendMutation @@ -113,10 +113,10 @@ I.sendMutation(` #### Parameters -- `mutation` **[String][3]** -- `variables` **[object][2]?** that may go along with the mutation -- `options` **[object][2]?** are additional query options -- `headers` **[object][2]?** +* `mutation` **[String][3]** +* `variables` **[object][2]?** that may go along with the mutation +* `options` **[object][2]?** are additional query options +* `headers` **[object][2]?** Returns **any** Promise @@ -126,6 +126,7 @@ Send query to GraphQL endpoint over http. Returns a response as a promise. ```js + const response = await I.sendQuery('{ users { name email }}'); // with variables const response = await I.sendQuery( @@ -137,10 +138,10 @@ const user = response.data.data; #### Parameters -- `query` **[String][3]** -- `variables` **[object][2]?** that may go along with the query -- `options` **[object][2]?** are additional query options -- `headers` **[object][2]?** +* `query` **[String][3]** +* `variables` **[object][2]?** that may go along with the query +* `options` **[object][2]?** are additional query options +* `headers` **[object][2]?** Returns **any** Promise diff --git a/docs/helpers/GraphQLDataFactory.md b/docs/helpers/GraphQLDataFactory.md index 56ece1d92..277cf2cd6 100644 --- a/docs/helpers/GraphQLDataFactory.md +++ b/docs/helpers/GraphQLDataFactory.md @@ -74,11 +74,11 @@ Then configure GraphQLDataHelper to match factories and GraphQL schema: GraphQLDataFactory has following config options: -- `endpoint`: URL for the GraphQL server. -- `cleanup` (default: true): should inserted records be deleted up after tests -- `factories`: list of defined factories -- `headers`: list of headers -- `GraphQL`: configuration for GraphQL requests. +* `endpoint`: URL for the GraphQL server. +* `cleanup` (default: true): should inserted records be deleted up after tests +* `factories`: list of defined factories +* `headers`: list of headers +* `GraphQL`: configuration for GraphQL requests. See the example: @@ -121,16 +121,16 @@ For instance, to set timeout you should add: Factory contains operations - -- `operation`: The operation/mutation that needs to be performed for creating a record in the backend. +* `operation`: The operation/mutation that needs to be performed for creating a record in the backend. Each operation must have the following: -- `query`: The mutation(query) string. It is expected to use variables to send data with the query. -- `factory`: The path to factory file. The object built by the factory in this file will be passed - as the 'variables' object to go along with the mutation. -- `revert`: A function called with the data returned when an item is created. The object returned by - this function is will be used to later delete the items created. So, make sure RELEVANT DATA IS RETURNED - when a record is created by a mutation. +* `query`: The mutation(query) string. It is expected to use variables to send data with the query. +* `factory`: The path to factory file. The object built by the factory in this file will be passed + as the 'variables' object to go along with the mutation. +* `revert`: A function called with the data returned when an item is created. The object returned by + this function is will be used to later delete the items created. So, make sure RELEVANT DATA IS RETURNED + when a record is created by a mutation. ### Requests @@ -158,7 +158,7 @@ Data of created records are collected and used in the end of a test for the clea ### Parameters -- `config` +* `config` ### _requestCreate @@ -167,8 +167,8 @@ Can be replaced from a custom helper. #### Parameters -- `operation` **[string][4]** -- `variables` **any** to be sent along with the query +* `operation` **[string][4]** +* `variables` **any** to be sent along with the query ### _requestDelete @@ -177,8 +177,8 @@ Can be replaced from a custom helper. #### Parameters -- `operation` **[string][4]** -- `data` **any** of the record to be deleted. +* `operation` **[string][4]** +* `data` **any** of the record to be deleted. ### mutateData @@ -194,8 +194,8 @@ const user = await I.mutateData('createUser', { email: 'user@user.com'}); #### Parameters -- `operation` **[string][4]** to be performed -- `params` **any** predefined parameters +* `operation` **[string][4]** to be performed +* `params` **any** predefined parameters ### mutateMultiple @@ -211,9 +211,9 @@ I.mutateMultiple('createUser', 3, { age: 25 }); #### Parameters -- `operation` **[string][4]** -- `times` **[number][5]** -- `params` **any** +* `operation` **[string][4]** +* `times` **[number][5]** +* `params` **any** [1]: https://github.com/rosiejs/rosie diff --git a/docs/helpers/JSONResponse.md b/docs/helpers/JSONResponse.md index 1126ce146..8cc350f6a 100644 --- a/docs/helpers/JSONResponse.md +++ b/docs/helpers/JSONResponse.md @@ -13,15 +13,15 @@ title: JSONResponse This helper allows performing assertions on JSON responses paired with following helpers: -- REST -- GraphQL -- Playwright +* REST +* GraphQL +* Playwright It can check status codes, response data, response structure. ## Configuration -- `requestHelper` - a helper which will perform requests. `REST` by default, also `Playwright` or `GraphQL` can be used. Custom helpers must have `onResponse` hook in their config, which will be executed when request is performed. +* `requestHelper` - a helper which will perform requests. `REST` by default, also `Playwright` or `GraphQL` can be used. Custom helpers must have `onResponse` hook in their config, which will be executed when request is performed. ### Examples @@ -68,7 +68,7 @@ const response = this.helpers.JSONResponse.response; ### Parameters -- `config` +* `config` ### dontSeeResponseCodeIs @@ -80,7 +80,7 @@ I.dontSeeResponseCodeIs(500); #### Parameters -- `code` **[number][1]** +* `code` **[number][1]** ### dontSeeResponseContainsJson @@ -102,7 +102,7 @@ I.dontSeeResponseContainsJson({ user: 2 }); #### Parameters -- `json` **[object][2]** +* `json` **[object][2]** ### seeResponseCodeIs @@ -114,7 +114,7 @@ I.seeResponseCodeIs(200); #### Parameters -- `code` **[number][1]** +* `code` **[number][1]** ### seeResponseCodeIsClientError @@ -157,7 +157,7 @@ I.seeResponseContainsJson({ user: { email: 'jon@doe.com' } }); #### Parameters -- `json` **[object][2]** +* `json` **[object][2]** ### seeResponseContainsKeys @@ -179,7 +179,7 @@ I.seeResponseContainsKeys(['user']); #### Parameters -- `keys` **[array][3]** +* `keys` **[array][3]** ### seeResponseEquals @@ -193,7 +193,7 @@ I.seeResponseEquals({ error: 'Not allowed' }) #### Parameters -- `resp` **[object][2]** +* `resp` **[object][2]** ### seeResponseMatchesJsonSchema @@ -223,7 +223,7 @@ I.seeResponseMatchesJsonSchema(joi.object({ #### Parameters -- `fnOrSchema` **any** +* `fnOrSchema` **any** ### seeResponseValidByCallback @@ -239,7 +239,7 @@ I.seeResponseValidByCallback(({ data, status, expect }) => { #### Parameters -- `fn` **[function][6]** +* `fn` **[function][6]** [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number diff --git a/docs/helpers/MockRequest.md b/docs/helpers/MockRequest.md index 9ca18d101..3fd179964 100644 --- a/docs/helpers/MockRequest.md +++ b/docs/helpers/MockRequest.md @@ -17,11 +17,11 @@ Another way of using is to emulate requests from server by passing prepared data MockRequest helper works in these [modes][1]: -- passthrough (default) - mock prefefined HTTP requests -- record - record all requests into a file -- replay - replay all recorded requests from a file +* passthrough (default) - mock prefefined HTTP requests +* record - record all requests into a file +* replay - replay all recorded requests from a file -Combining record/replay modes allows testing websites with large datasets. +Combining record/replay modes allows testing websites with large datasets. To use in passthrough mode set rules to mock requests and they will be automatically intercepted and replaced: @@ -83,9 +83,9 @@ helpers: { } ``` -* * * +*** -**TROUBLESHOOTING**: Puppeteer does not mock requests in headless mode: +**TROUBLESHOOTING**: Puppeteer does not mock requests in headless mode: Problem: request mocking does not work and in debug mode you see this in output: @@ -104,7 +104,7 @@ Solution: update Puppeteer config to include `--disable-web-security` arguments: }, ``` -* * * +*** #### With WebDriver @@ -129,10 +129,10 @@ helpers: { To intercept API requests and mock them use following API -- [startMocking()][4] - to enable request interception -- [mockRequest()][5] - to define mock in a simple way -- [mockServer()][6] - to use PollyJS server API to define complex mocks -- [stopMocking()][7] - to stop intercepting requests and disable mocks. +* [startMocking()][4] - to enable request interception +* [mockRequest()][5] - to define mock in a simple way +* [mockServer()][6] - to use PollyJS server API to define complex mocks +* [stopMocking()][7] - to stop intercepting requests and disable mocks. Calling `mockRequest` or `mockServer` will start mocking, if it was not enabled yet. @@ -156,7 +156,7 @@ I.stopMocking(); > At this moment works only with Puppeteer Record & Replay mode allows you to record all xhr & fetch requests and save them to file. -On next runs those requests can be replayed. +On next runs those requests can be replayed. By default, it stores all passed requests, but this behavior can be customized with `I.mockServer` Set mode via enironment variable, `replay` mode by default: @@ -195,7 +195,7 @@ I.mockServer((server) => { To stop request recording/replaying use `I.stopMocking()`. -🎥 To record HTTP interactions execute tests with MOCK_MODE environment variable set as "record": +🎥 To record HTTP interactions execute tests with MOCK\_MODE environment variable set as "record": MOCK_MODE=record npx codeceptjs run --debug @@ -205,7 +205,7 @@ To stop request recording/replaying use `I.stopMocking()`. ### Parameters -- `config` +* `config` ### flushMocking @@ -234,10 +234,10 @@ I.mockRequest('GET', ['/secrets', '/v2/secrets'], 403); #### Parameters -- `method` **[string][8]** request method. Can be `GET`, `POST`, `PUT`, etc or `ANY`. -- `oneOrMoreUrls` **([string][8] \| [Array][9]<[string][8]>)** url(s) to mock. Can be exact URL, a pattern, or an array of URLs. -- `dataOrStatusCode` **([number][10] \| [string][8] \| [object][11])** status code when number provided. A response body otherwise -- `additionalData` **([string][8] \| [object][11])** response body when a status code is set by previous parameter. (optional, default `null`) +* `method` **[string][8]** request method. Can be `GET`, `POST`, `PUT`, etc or `ANY`. +* `oneOrMoreUrls` **([string][8] | [Array][9]<[string][8]>)** url(s) to mock. Can be exact URL, a pattern, or an array of URLs. +* `dataOrStatusCode` **([number][10] | [string][8] | [object][11])** status code when number provided. A response body otherwise +* `additionalData` **([string][8] | [object][11])** response body when a status code is set by previous parameter. (optional, default `null`) ### mockServer @@ -274,7 +274,7 @@ I.mockServer((server) => { #### Parameters -- `configFn` +* `configFn` ### passthroughMocking @@ -336,8 +336,8 @@ I.startMocking('users-loaded', { #### Parameters -- `title` **any** (optional, default `'Test'`) -- `config` (optional, default `{}`) +* `title` **any** (optional, default `'Test'`) +* `config` (optional, default `{}`) ### stopMocking diff --git a/docs/helpers/Nightmare.md b/docs/helpers/Nightmare.md index 0a6e8a3d0..ce1deb302 100644 --- a/docs/helpers/Nightmare.md +++ b/docs/helpers/Nightmare.md @@ -22,25 +22,26 @@ Requires `nightmare` package to be installed. This helper should be configured in codecept.conf.ts or codecept.conf.js -- `url` - base url of website to be tested -- `restart` - restart browser between tests. -- `disableScreenshots` - don't save screenshot on failure. -- `uniqueScreenshotNames` - option to prevent screenshot override if you have scenarios with the same name in different suites. -- `fullPageScreenshots` - make full page screenshots on failure. -- `keepBrowserState` - keep browser state between tests when `restart` set to false. -- `keepCookies` - keep cookies between tests when `restart` set to false. -- `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 500. -- `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000. -- `windowSize`: (optional) default window size. Set a dimension like `640x480`. +* `url` - base url of website to be tested +* `restart` - restart browser between tests. +* `disableScreenshots` - don't save screenshot on failure. +* `uniqueScreenshotNames` - option to prevent screenshot override if you have scenarios with the same name in different suites. +* `fullPageScreenshots` - make full page screenshots on failure. +* `keepBrowserState` - keep browser state between tests when `restart` set to false. +* `keepCookies` - keep cookies between tests when `restart` set to false. +* `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 500. +* `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000. +* `windowSize`: (optional) default window size. Set a dimension like `640x480`. + -- options from [Nightmare configuration][2] +* options from [Nightmare configuration][2] ## Methods ### Parameters -- `config` +* `config` ### _locate @@ -64,7 +65,7 @@ let value = this.helpers['Nightmare']._locate({name: 'password'}).then(function( #### Parameters -- `locator` +* `locator` ### amOnPage @@ -79,8 +80,8 @@ I.amOnPage('/login'); // opens a login page #### Parameters -- `url` **[string][3]** url path or global url. -- `headers` **[object][4]?** list of request headers can be passed +* `url` **[string][3]** url path or global url. +* `headers` **[object][4]?** list of request headers can be passed Returns **void** automatically synchronized promise through #recorder @@ -97,8 +98,8 @@ I.appendField('password', secret('123456')); #### Parameters -- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator -- `value` **[string][3]** text value to append. +* `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator +* `value` **[string][3]** text value to append. Returns **void** automatically synchronized promise through #recorder @@ -115,8 +116,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg'); #### Parameters -- `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator. -- `pathToFile` **[string][3]** local file path relative to codecept.conf.ts or codecept.conf.js config file. +* `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator. +* `pathToFile` **[string][3]** local file path relative to codecept.conf.ts or codecept.conf.js config file. Returns **void** automatically synchronized promise through #recorderDoesn't work if the Chromium DevTools panel is open (as Chromium allows only one attachment to the debugger at a time. [See more][5]) @@ -135,8 +136,8 @@ I.checkOption('agree', '//form'); #### Parameters -- `field` **([string][3] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator. -- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator. +* `field` **([string][3] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator. +* `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator. Returns **void** automatically synchronized promise through #recorder @@ -152,7 +153,7 @@ I.clearCookie('test'); // Playwright currently doesn't support clear a particula #### Parameters -- `cookie` **[string][3]?** (optional, `null` by default) cookie name +* `cookie` **[string][3]?** (optional, `null` by default) cookie name ### clearField @@ -166,8 +167,8 @@ I.clearField('#email'); #### Parameters -- `field` -- `editable` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator. +* `field` +* `editable` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator. Returns **void** automatically synchronized promise through #recorder. @@ -197,8 +198,8 @@ I.click({css: 'nav a.login'}); #### Parameters -- `locator` **([string][3] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator. -- `context` **([string][3]? | [object][4] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. +* `locator` **([string][3] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator. +* `context` **([string][3]? | [object][4] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. Returns **void** automatically synchronized promise through #recorder @@ -214,8 +215,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element #### Parameters -- `text` **[string][3]** which is not present. -- `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. +* `text` **[string][3]** which is not present. +* `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. Returns **void** automatically synchronized promise through #recorder @@ -231,7 +232,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name #### Parameters -- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator. +* `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator. Returns **void** automatically synchronized promise through #recorder @@ -245,7 +246,7 @@ I.dontSeeCookie('auth'); // no auth cookie #### Parameters -- `name` **[string][3]** cookie name. +* `name` **[string][3]** cookie name. Returns **void** automatically synchronized promise through #recorder @@ -261,7 +262,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also #### Parameters -- `url` **[string][3]** value to check. +* `url` **[string][3]** value to check. Returns **void** automatically synchronized promise through #recorder @@ -275,7 +276,7 @@ I.dontSeeElement('.modal'); // modal is not shown #### Parameters -- `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator. +* `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator. Returns **void** automatically synchronized promise through #recorder @@ -289,7 +290,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or #### Parameters -- `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator. +* `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator. Returns **void** automatically synchronized promise through #recorder @@ -299,7 +300,7 @@ Checks that current url does not contain a provided fragment. #### Parameters -- `url` **[string][3]** value to check. +* `url` **[string][3]** value to check. Returns **void** automatically synchronized promise through #recorder @@ -315,8 +316,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS #### Parameters -- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator. -- `value` **([string][3] | [object][4])** value to check. +* `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator. +* `value` **([string][3] | [object][4])** value to check. Returns **void** automatically synchronized promise through #recorder @@ -330,8 +331,8 @@ I.dontSeeInSource(' npm i @codeceptjs/detox-helper --save @@ -73,21 +74,22 @@ helpers: { configuration: '', } } + ``` It's important to specify a package name under `require` section and current detox configuration taken from `package.json`. Options: -- `configuration` - a detox configuration name. Required. -- `reloadReactNative` - should be enabled for React Native applications. -- `reuse` - reuse application for tests. By default, Detox reinstalls and relaunches app. -- `registerGlobals` - (default: true) Register Detox helper functions `by`, `element`, `expect`, `waitFor` globally. -- `url` - URL to open via deep-link each time the app is launched (android) or immediately afterwards (iOS). Useful for opening a bundle URL at the beginning of tests when working with Expo. +* `configuration` - a detox configuration name. Required. +* `reloadReactNative` - should be enabled for React Native applications. +* `reuse` - reuse application for tests. By default, Detox reinstalls and relaunches app. +* `registerGlobals` - (default: true) Register Detox helper functions `by`, `element`, `expect`, `waitFor` globally. +* `url` - URL to open via deep-link each time the app is launched (android) or immediately afterwards (iOS). Useful for opening a bundle URL at the beginning of tests when working with Expo. ### Parameters -- `config` +* `config` ### appendField @@ -100,8 +102,8 @@ I.appendField('name', 'davert'); #### Parameters -- `field` **([string][5] \| [object][6])** -- `value` **[string][5]** +* `field` **([string][5] | [object][6])** +* `value` **[string][5]** ### checkIfElementExists @@ -114,8 +116,8 @@ I.checkIfElementExists('~edit', '#menu'); // element inside #menu #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `context` **([string][5] \| [object][6] | null)** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `context` **([string][5] | [object][6] | null)** context element (optional, default `null`) ### clearField @@ -128,7 +130,7 @@ I.clearField('~name'); #### Parameters -- `field` **([string][5] \| [object][6])** an input element to clear +* `field` **([string][5] | [object][6])** an input element to clear ### click @@ -149,8 +151,8 @@ I.click({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS an #### Parameters -- `locator` **([string][5] \| [object][6])** -- `context` **([string][5] \| [object][6] | null)** (optional, default `null`) +* `locator` **([string][5] | [object][6])** +* `context` **([string][5] | [object][6] | null)** (optional, default `null`) ### clickAtPoint @@ -164,9 +166,9 @@ I.clickAtPoint('~save', 10, 10); // locate by accessibility id #### Parameters -- `locator` **([string][5] \| [object][6])** -- `x` **[number][8]** horizontal offset (optional, default `0`) -- `y` **[number][8]** vertical offset (optional, default `0`) +* `locator` **([string][5] | [object][6])** +* `x` **[number][8]** horizontal offset (optional, default `0`) +* `y` **[number][8]** vertical offset (optional, default `0`) ### dontSee @@ -181,8 +183,8 @@ I.dontSee('Record deleted', '~message'); #### Parameters -- `text` **[string][5]** to check invisibility -- `context` **([string][5] \| [object][6] | null)** element in which to search for text (optional, default `null`) +* `text` **[string][5]** to check invisibility +* `context` **([string][5] | [object][6] | null)** element in which to search for text (optional, default `null`) ### dontSeeElement @@ -196,8 +198,8 @@ I.dontSeeElement('~edit', '#menu'); // element inside #menu #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `context` **([string][5] \| [object][6] | null)** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `context` **([string][5] | [object][6] | null)** context element (optional, default `null`) ### dontSeeElementExists @@ -211,8 +213,8 @@ I.dontSeeElementExist('~edit', '#menu'); // element inside #menu #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `context` **([string][5] \| [object][6])** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `context` **([string][5] | [object][6])** context element (optional, default `null`) ### fillField @@ -227,8 +229,8 @@ I.fillField({ android: 'NAME', ios: 'name' }, 'davert'); #### Parameters -- `field` **([string][5] \| [object][6])** an input element to fill in -- `value` **[string][5]** value to fill +* `field` **([string][5] | [object][6])** an input element to fill in +* `value` **[string][5]** value to fill ### goBack @@ -275,9 +277,9 @@ I.longPress('Update', 2, '#menu'); // locate by text inside #menu, hold for 2 se #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `sec` **[number][8]** number of seconds to hold tap -- `context` **([string][5] \| [object][6] | null)** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `sec` **[number][8]** number of seconds to hold tap +* `context` **([string][5] | [object][6] | null)** context element (optional, default `null`) ### multiTap @@ -296,9 +298,9 @@ I.multiTap('Update', 2, '#menu'); // locate by id #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `num` **[number][8]** number of taps -- `context` **([string][5] \| [object][6] | null)** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `num` **[number][8]** number of taps +* `context` **([string][5] | [object][6] | null)** context element (optional, default `null`) ### relaunchApp @@ -321,7 +323,7 @@ I.runOnAndroid(() => { #### Parameters -- `fn` **[Function][10]** a function which will be executed on android +* `fn` **[Function][10]** a function which will be executed on android ### runOnIOS @@ -336,7 +338,7 @@ I.runOnIOS(() => { #### Parameters -- `fn` **[Function][10]** a function which will be executed on iOS +* `fn` **[Function][10]** a function which will be executed on iOS ### saveScreenshot @@ -348,7 +350,7 @@ I.saveScreenshot('main-window.png'); #### Parameters -- `name` **[string][5]** +* `name` **[string][5]** ### scrollDown @@ -360,7 +362,7 @@ I.scrollDown('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** +* `locator` **([string][5] | [object][6])** ### scrollLeft @@ -372,7 +374,7 @@ I.scrollLeft('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** +* `locator` **([string][5] | [object][6])** ### scrollRight @@ -384,7 +386,7 @@ I.scrollRight('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** +* `locator` **([string][5] | [object][6])** ### scrollToElement @@ -392,10 +394,10 @@ Scrolls within a scrollable container to an element. #### Parameters -- `targetLocator` **([string][5] \| [object][6])** Locator of the element to scroll to -- `containerLocator` **([string][5] \| [object][6])** Locator of the scrollable container -- `direction` **[string][5]** 'up' or 'down' (optional, default `'down'`) -- `offset` **[number][8]** Offset for scroll, can be adjusted based on need (optional, default `100`) +* `targetLocator` **([string][5] | [object][6])** Locator of the element to scroll to +* `containerLocator` **([string][5] | [object][6])** Locator of the scrollable container +* `direction` **[string][5]** 'up' or 'down' (optional, default `'down'`) +* `offset` **[number][8]** Offset for scroll, can be adjusted based on need (optional, default `100`) ### scrollUp @@ -407,7 +409,7 @@ I.scrollUp('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** +* `locator` **([string][5] | [object][6])** ### see @@ -422,8 +424,8 @@ I.see('Record deleted', '~message'); #### Parameters -- `text` **[string][5]** to check visibility -- `context` **([string][5] \| [object][6] | null)** element inside which to search for text (optional, default `null`) +* `text` **[string][5]** to check visibility +* `context` **([string][5] | [object][6] | null)** element inside which to search for text (optional, default `null`) ### seeElement @@ -437,8 +439,8 @@ I.seeElement('~edit', '#menu'); // element inside #menu #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `context` **([string][5] \| [object][6] | null)** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `context` **([string][5] | [object][6] | null)** context element (optional, default `null`) ### seeElementExists @@ -452,8 +454,8 @@ I.seeElementExists('~edit', '#menu'); // element inside #menu #### Parameters -- `locator` **([string][5] \| [object][6])** element to locate -- `context` **([string][5] \| [object][6])** context element (optional, default `null`) +* `locator` **([string][5] | [object][6])** element to locate +* `context` **([string][5] | [object][6])** context element (optional, default `null`) ### setLandscapeOrientation @@ -490,8 +492,8 @@ I.swipeUp('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** an element on which to perform swipe -- `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) +* `locator` **([string][5] | [object][6])** an element on which to perform swipe +* `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) ### swipeLeft @@ -504,8 +506,8 @@ I.swipeUp('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** an element on which to perform swipe -- `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) +* `locator` **([string][5] | [object][6])** an element on which to perform swipe +* `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) ### swipeRight @@ -518,8 +520,8 @@ I.swipeUp('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** an element on which to perform swipe -- `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) +* `locator` **([string][5] | [object][6])** an element on which to perform swipe +* `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) ### swipeUp @@ -532,8 +534,8 @@ I.swipeUp('#container'); #### Parameters -- `locator` **([string][5] \| [object][6])** an element on which to perform swipe -- `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) +* `locator` **([string][5] | [object][6])** an element on which to perform swipe +* `speed` **[string][5]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`) ### tap @@ -554,8 +556,8 @@ I.tap({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS and #### Parameters -- `locator` **([string][5] \| [object][6])** -- `context` **([string][5] \| [object][6] | null)** (optional, default `null`) +* `locator` **([string][5] | [object][6])** +* `context` **([string][5] | [object][6] | null)** (optional, default `null`) ### tapByLabel @@ -571,8 +573,8 @@ I.tapByLabel('Login', '#nav'); // locate by text inside #nav #### Parameters -- `locator` **([string][5] \| [object][6])** -- `context` **([string][5] \| [object][6] | null)** (optional, default `null`) +* `locator` **([string][5] | [object][6])** +* `context` **([string][5] | [object][6] | null)** (optional, default `null`) ### tapReturnKey @@ -587,7 +589,7 @@ I.tapReturnKey({ android: 'NAME', ios: 'name' }); #### Parameters -- `field` **([string][5] \| [object][6])** an input element to fill in +* `field` **([string][5] | [object][6])** an input element to fill in ### wait @@ -599,7 +601,7 @@ I.wait(2); // waits for 2 seconds #### Parameters -- `sec` **[number][8]** number of seconds to wait +* `sec` **[number][8]** number of seconds to wait ### waitForElement @@ -611,8 +613,8 @@ I.waitForElement('#message', 1); // wait for 1 second #### Parameters -- `locator` **([string][5] \| [object][6])** an element to wait for -- `sec` **[number][8]** number of seconds to wait, 5 by default (optional, default `5`) +* `locator` **([string][5] | [object][6])** an element to wait for +* `sec` **[number][8]** number of seconds to wait, 5 by default (optional, default `5`) ### waitForElementVisible @@ -624,8 +626,8 @@ I.waitForElementVisible('#message', 1); // wait for 1 second #### Parameters -- `locator` **([string][5] \| [object][6])** an element to wait for -- `sec` **[number][8]** number of seconds to wait (optional, default `5`) +* `locator` **([string][5] | [object][6])** an element to wait for +* `sec` **[number][8]** number of seconds to wait (optional, default `5`) ### waitToHide @@ -637,8 +639,8 @@ I.waitToHide('#message', 2); // wait for 2 seconds #### Parameters -- `locator` **([string][5] \| [object][6])** an element to wait for -- `sec` **[number][8]** number of seconds to wait (optional, default `5`) +* `locator` **([string][5] | [object][6])** an element to wait for +* `sec` **[number][8]** number of seconds to wait (optional, default `5`) [1]: https://github.com/wix/Detox diff --git a/docs/helpers/ExpectHelper.md b/docs/helpers/ExpectHelper.md index 7ffe415ab..3a0659b29 100644 --- a/docs/helpers/ExpectHelper.md +++ b/docs/helpers/ExpectHelper.md @@ -31,33 +31,33 @@ Zero-configuration when paired with other helpers like REST, Playwright: #### Parameters -- `targetData` **any** -- `aboveThan` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `aboveThan` **any** +* `customErrorMsg` **any?** ### expectBelow #### Parameters -- `targetData` **any** -- `belowThan` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `belowThan` **any** +* `customErrorMsg` **any?** ### expectContain #### Parameters -- `actualValue` **any** -- `expectedValueToContain` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToContain` **any** +* `customErrorMsg` **any?** ### expectDeepEqual #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectDeepEqualExcluding @@ -65,10 +65,10 @@ expects members of two JSON objects are deeply equal excluding some properties #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `fieldsToExclude` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `fieldsToExclude` **any** +* `customErrorMsg` **any?** ### expectDeepIncludeMembers @@ -76,9 +76,9 @@ expects an array to be a superset of another array #### Parameters -- `superset` **any** -- `set` **any** -- `customErrorMsg` **any?** +* `superset` **any** +* `set` **any** +* `customErrorMsg` **any?** ### expectDeepMembers @@ -86,104 +86,104 @@ expects members of two arrays are deeply equal #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectEmpty #### Parameters -- `targetData` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `customErrorMsg` **any?** ### expectEndsWith #### Parameters -- `actualValue` **any** -- `expectedValueToEndWith` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToEndWith` **any** +* `customErrorMsg` **any?** ### expectEqual #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectEqualIgnoreCase #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectFalse #### Parameters -- `targetData` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `customErrorMsg` **any?** ### expectHasAProperty #### Parameters -- `targetData` **any** -- `propertyName` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `propertyName` **any** +* `customErrorMsg` **any?** ### expectHasProperty #### Parameters -- `targetData` **any** -- `propertyName` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `propertyName` **any** +* `customErrorMsg` **any?** ### expectJsonSchema #### Parameters -- `targetData` **any** -- `jsonSchema` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `jsonSchema` **any** +* `customErrorMsg` **any?** ### expectJsonSchemaUsingAJV #### Parameters -- `targetData` **any** -- `jsonSchema` **any** -- `customErrorMsg` **any?** -- `ajvOptions` **any?** Pass AJV options +* `targetData` **any** +* `jsonSchema` **any** +* `customErrorMsg` **any?** +* `ajvOptions` **any?** Pass AJV options ### expectLengthAboveThan #### Parameters -- `targetData` **any** -- `lengthAboveThan` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `lengthAboveThan` **any** +* `customErrorMsg` **any?** ### expectLengthBelowThan #### Parameters -- `targetData` **any** -- `lengthBelowThan` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `lengthBelowThan` **any** +* `customErrorMsg` **any?** ### expectLengthOf #### Parameters -- `targetData` **any** -- `length` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `length` **any** +* `customErrorMsg` **any?** ### expectMatchesPattern @@ -191,85 +191,85 @@ expects a JSON object matches a provided pattern #### Parameters -- `actualValue` **any** -- `expectedPattern` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedPattern` **any** +* `customErrorMsg` **any?** ### expectMatchRegex #### Parameters -- `targetData` **any** -- `regex` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `regex` **any** +* `customErrorMsg` **any?** ### expectNotContain #### Parameters -- `actualValue` **any** -- `expectedValueToNotContain` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToNotContain` **any** +* `customErrorMsg` **any?** ### expectNotDeepEqual #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectNotEndsWith #### Parameters -- `actualValue` **any** -- `expectedValueToNotEndWith` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToNotEndWith` **any** +* `customErrorMsg` **any?** ### expectNotEqual #### Parameters -- `actualValue` **any** -- `expectedValue` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValue` **any** +* `customErrorMsg` **any?** ### expectNotStartsWith #### Parameters -- `actualValue` **any** -- `expectedValueToNotStartWith` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToNotStartWith` **any** +* `customErrorMsg` **any?** ### expectStartsWith #### Parameters -- `actualValue` **any** -- `expectedValueToStartWith` **any** -- `customErrorMsg` **any?** +* `actualValue` **any** +* `expectedValueToStartWith` **any** +* `customErrorMsg` **any?** ### expectToBeA #### Parameters -- `targetData` **any** -- `type` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `type` **any** +* `customErrorMsg` **any?** ### expectToBeAn #### Parameters -- `targetData` **any** -- `type` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `type` **any** +* `customErrorMsg` **any?** ### expectTrue #### Parameters -- `targetData` **any** -- `customErrorMsg` **any?** +* `targetData` **any** +* `customErrorMsg` **any?** diff --git a/docs/helpers/FileSystem.md b/docs/helpers/FileSystem.md index 0af9843db..cd3d1351a 100644 --- a/docs/helpers/FileSystem.md +++ b/docs/helpers/FileSystem.md @@ -40,7 +40,7 @@ Starts from a current directory #### Parameters -- `openPath` **[string][1]** +* `openPath` **[string][1]** ### dontSeeFileContentsEqual @@ -48,8 +48,8 @@ Checks that contents of file found by `seeFile` doesn't equal to text. #### Parameters -- `text` **[string][1]** -- `encoding` **[string][1]** +* `text` **[string][1]** +* `encoding` **[string][1]** ### dontSeeInThisFile @@ -57,8 +57,8 @@ Checks that file found by `seeFile` doesn't include text. #### Parameters -- `text` **[string][1]** -- `encoding` **[string][1]** +* `text` **[string][1]** +* `encoding` **[string][1]** ### grabFileNames @@ -77,7 +77,7 @@ Checks that file exists #### Parameters -- `name` **[string][1]** +* `name` **[string][1]** ### seeFileContentsEqual @@ -85,8 +85,8 @@ Checks that contents of file found by `seeFile` equal to text. #### Parameters -- `text` **[string][1]** -- `encoding` **[string][1]** +* `text` **[string][1]** +* `encoding` **[string][1]** ### seeFileContentsEqualReferenceFile @@ -94,9 +94,9 @@ Checks that contents of the file found by `seeFile` equal to contents of the fil #### Parameters -- `pathToReferenceFile` **[string][1]** -- `encoding` **[string][1]** -- `encodingReference` **[string][1]** +* `pathToReferenceFile` **[string][1]** +* `encoding` **[string][1]** +* `encodingReference` **[string][1]** ### seeFileNameMatching @@ -111,7 +111,7 @@ I.seeFileNameMatching('.pdf'); #### Parameters -- `text` **[string][1]** +* `text` **[string][1]** ### seeInThisFile @@ -119,8 +119,8 @@ Checks that file found by `seeFile` includes a text. #### Parameters -- `text` **[string][1]** -- `encoding` **[string][1]** +* `text` **[string][1]** +* `encoding` **[string][1]** ### waitForFile @@ -135,8 +135,8 @@ I.waitForFile('largeFilesName.txt', 10); // wait 10 seconds for file #### Parameters -- `name` **[string][1]** -- `sec` **[number][2]** seconds to wait +* `name` **[string][1]** +* `sec` **[number][2]** seconds to wait ### writeToFile @@ -144,8 +144,8 @@ Writes text to file #### Parameters -- `name` **[string][1]** -- `text` **[string][1]** +* `name` **[string][1]** +* `text` **[string][1]** [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/docs/helpers/GraphQL.md b/docs/helpers/GraphQL.md index 82d7bbfa5..7aa35c637 100644 --- a/docs/helpers/GraphQL.md +++ b/docs/helpers/GraphQL.md @@ -16,10 +16,10 @@ GraphQL helper allows to send additional requests to a GraphQl endpoint during a ## Configuration -- endpoint: GraphQL base URL -- timeout: timeout for requests in milliseconds. 10000ms by default -- defaultHeaders: a list of default headers -- onRequest: a async function which can update request object. +* endpoint: GraphQL base URL +* timeout: timeout for requests in milliseconds. 10000ms by default +* defaultHeaders: a list of default headers +* onRequest: a async function which can update request object. ## Example @@ -47,7 +47,7 @@ this.helpers['GraphQL']._executeQuery({ ### Parameters -- `config` +* `config` ### _executeQuery @@ -55,7 +55,7 @@ Executes query via axios call #### Parameters -- `request` **[object][2]** +* `request` **[object][2]** ### _prepareGraphQLRequest @@ -63,8 +63,8 @@ Prepares request for axios call #### Parameters -- `operation` **[object][2]** -- `headers` **[object][2]** +* `operation` **[object][2]** +* `headers` **[object][2]** Returns **[object][2]** graphQLRequest @@ -79,7 +79,7 @@ I.amBearerAuthenticated(secret('heregoestoken')) #### Parameters -- `accessToken` **([string][3] | CodeceptJS.Secret)** Bearer access token +* `accessToken` **([string][3] | CodeceptJS.Secret)** Bearer access token ### haveRequestHeaders @@ -87,7 +87,7 @@ Sets request headers for all requests of this test #### Parameters -- `headers` **[object][2]** headers list +* `headers` **[object][2]** headers list ### sendMutation @@ -113,10 +113,10 @@ I.sendMutation(` #### Parameters -- `mutation` **[String][3]** -- `variables` **[object][2]?** that may go along with the mutation -- `options` **[object][2]?** are additional query options -- `headers` **[object][2]?** +* `mutation` **[String][3]** +* `variables` **[object][2]?** that may go along with the mutation +* `options` **[object][2]?** are additional query options +* `headers` **[object][2]?** Returns **any** Promise @@ -126,6 +126,7 @@ Send query to GraphQL endpoint over http. Returns a response as a promise. ```js + const response = await I.sendQuery('{ users { name email }}'); // with variables const response = await I.sendQuery( @@ -137,10 +138,10 @@ const user = response.data.data; #### Parameters -- `query` **[String][3]** -- `variables` **[object][2]?** that may go along with the query -- `options` **[object][2]?** are additional query options -- `headers` **[object][2]?** +* `query` **[String][3]** +* `variables` **[object][2]?** that may go along with the query +* `options` **[object][2]?** are additional query options +* `headers` **[object][2]?** Returns **any** Promise diff --git a/docs/helpers/GraphQLDataFactory.md b/docs/helpers/GraphQLDataFactory.md index 56ece1d92..277cf2cd6 100644 --- a/docs/helpers/GraphQLDataFactory.md +++ b/docs/helpers/GraphQLDataFactory.md @@ -74,11 +74,11 @@ Then configure GraphQLDataHelper to match factories and GraphQL schema: GraphQLDataFactory has following config options: -- `endpoint`: URL for the GraphQL server. -- `cleanup` (default: true): should inserted records be deleted up after tests -- `factories`: list of defined factories -- `headers`: list of headers -- `GraphQL`: configuration for GraphQL requests. +* `endpoint`: URL for the GraphQL server. +* `cleanup` (default: true): should inserted records be deleted up after tests +* `factories`: list of defined factories +* `headers`: list of headers +* `GraphQL`: configuration for GraphQL requests. See the example: @@ -121,16 +121,16 @@ For instance, to set timeout you should add: Factory contains operations - -- `operation`: The operation/mutation that needs to be performed for creating a record in the backend. +* `operation`: The operation/mutation that needs to be performed for creating a record in the backend. Each operation must have the following: -- `query`: The mutation(query) string. It is expected to use variables to send data with the query. -- `factory`: The path to factory file. The object built by the factory in this file will be passed - as the 'variables' object to go along with the mutation. -- `revert`: A function called with the data returned when an item is created. The object returned by - this function is will be used to later delete the items created. So, make sure RELEVANT DATA IS RETURNED - when a record is created by a mutation. +* `query`: The mutation(query) string. It is expected to use variables to send data with the query. +* `factory`: The path to factory file. The object built by the factory in this file will be passed + as the 'variables' object to go along with the mutation. +* `revert`: A function called with the data returned when an item is created. The object returned by + this function is will be used to later delete the items created. So, make sure RELEVANT DATA IS RETURNED + when a record is created by a mutation. ### Requests @@ -158,7 +158,7 @@ Data of created records are collected and used in the end of a test for the clea ### Parameters -- `config` +* `config` ### _requestCreate @@ -167,8 +167,8 @@ Can be replaced from a custom helper. #### Parameters -- `operation` **[string][4]** -- `variables` **any** to be sent along with the query +* `operation` **[string][4]** +* `variables` **any** to be sent along with the query ### _requestDelete @@ -177,8 +177,8 @@ Can be replaced from a custom helper. #### Parameters -- `operation` **[string][4]** -- `data` **any** of the record to be deleted. +* `operation` **[string][4]** +* `data` **any** of the record to be deleted. ### mutateData @@ -194,8 +194,8 @@ const user = await I.mutateData('createUser', { email: 'user@user.com'}); #### Parameters -- `operation` **[string][4]** to be performed -- `params` **any** predefined parameters +* `operation` **[string][4]** to be performed +* `params` **any** predefined parameters ### mutateMultiple @@ -211,9 +211,9 @@ I.mutateMultiple('createUser', 3, { age: 25 }); #### Parameters -- `operation` **[string][4]** -- `times` **[number][5]** -- `params` **any** +* `operation` **[string][4]** +* `times` **[number][5]** +* `params` **any** [1]: https://github.com/rosiejs/rosie diff --git a/docs/helpers/JSONResponse.md b/docs/helpers/JSONResponse.md index 1126ce146..8cc350f6a 100644 --- a/docs/helpers/JSONResponse.md +++ b/docs/helpers/JSONResponse.md @@ -13,15 +13,15 @@ title: JSONResponse This helper allows performing assertions on JSON responses paired with following helpers: -- REST -- GraphQL -- Playwright +* REST +* GraphQL +* Playwright It can check status codes, response data, response structure. ## Configuration -- `requestHelper` - a helper which will perform requests. `REST` by default, also `Playwright` or `GraphQL` can be used. Custom helpers must have `onResponse` hook in their config, which will be executed when request is performed. +* `requestHelper` - a helper which will perform requests. `REST` by default, also `Playwright` or `GraphQL` can be used. Custom helpers must have `onResponse` hook in their config, which will be executed when request is performed. ### Examples @@ -68,7 +68,7 @@ const response = this.helpers.JSONResponse.response; ### Parameters -- `config` +* `config` ### dontSeeResponseCodeIs @@ -80,7 +80,7 @@ I.dontSeeResponseCodeIs(500); #### Parameters -- `code` **[number][1]** +* `code` **[number][1]** ### dontSeeResponseContainsJson @@ -102,7 +102,7 @@ I.dontSeeResponseContainsJson({ user: 2 }); #### Parameters -- `json` **[object][2]** +* `json` **[object][2]** ### seeResponseCodeIs @@ -114,7 +114,7 @@ I.seeResponseCodeIs(200); #### Parameters -- `code` **[number][1]** +* `code` **[number][1]** ### seeResponseCodeIsClientError @@ -157,7 +157,7 @@ I.seeResponseContainsJson({ user: { email: 'jon@doe.com' } }); #### Parameters -- `json` **[object][2]** +* `json` **[object][2]** ### seeResponseContainsKeys @@ -179,7 +179,7 @@ I.seeResponseContainsKeys(['user']); #### Parameters -- `keys` **[array][3]** +* `keys` **[array][3]** ### seeResponseEquals @@ -193,7 +193,7 @@ I.seeResponseEquals({ error: 'Not allowed' }) #### Parameters -- `resp` **[object][2]** +* `resp` **[object][2]** ### seeResponseMatchesJsonSchema @@ -223,7 +223,7 @@ I.seeResponseMatchesJsonSchema(joi.object({ #### Parameters -- `fnOrSchema` **any** +* `fnOrSchema` **any** ### seeResponseValidByCallback @@ -239,7 +239,7 @@ I.seeResponseValidByCallback(({ data, status, expect }) => { #### Parameters -- `fn` **[function][6]** +* `fn` **[function][6]** [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number diff --git a/docs/helpers/MockRequest.md b/docs/helpers/MockRequest.md index 9ca18d101..3fd179964 100644 --- a/docs/helpers/MockRequest.md +++ b/docs/helpers/MockRequest.md @@ -17,11 +17,11 @@ Another way of using is to emulate requests from server by passing prepared data MockRequest helper works in these [modes][1]: -- passthrough (default) - mock prefefined HTTP requests -- record - record all requests into a file -- replay - replay all recorded requests from a file +* passthrough (default) - mock prefefined HTTP requests +* record - record all requests into a file +* replay - replay all recorded requests from a file -Combining record/replay modes allows testing websites with large datasets. +Combining record/replay modes allows testing websites with large datasets. To use in passthrough mode set rules to mock requests and they will be automatically intercepted and replaced: @@ -83,9 +83,9 @@ helpers: { } ``` -* * * +*** -**TROUBLESHOOTING**: Puppeteer does not mock requests in headless mode: +**TROUBLESHOOTING**: Puppeteer does not mock requests in headless mode: Problem: request mocking does not work and in debug mode you see this in output: @@ -104,7 +104,7 @@ Solution: update Puppeteer config to include `--disable-web-security` arguments: }, ``` -* * * +*** #### With WebDriver @@ -129,10 +129,10 @@ helpers: { To intercept API requests and mock them use following API -- [startMocking()][4] - to enable request interception -- [mockRequest()][5] - to define mock in a simple way -- [mockServer()][6] - to use PollyJS server API to define complex mocks -- [stopMocking()][7] - to stop intercepting requests and disable mocks. +* [startMocking()][4] - to enable request interception +* [mockRequest()][5] - to define mock in a simple way +* [mockServer()][6] - to use PollyJS server API to define complex mocks +* [stopMocking()][7] - to stop intercepting requests and disable mocks. Calling `mockRequest` or `mockServer` will start mocking, if it was not enabled yet. @@ -156,7 +156,7 @@ I.stopMocking(); > At this moment works only with Puppeteer Record & Replay mode allows you to record all xhr & fetch requests and save them to file. -On next runs those requests can be replayed. +On next runs those requests can be replayed. By default, it stores all passed requests, but this behavior can be customized with `I.mockServer` Set mode via enironment variable, `replay` mode by default: @@ -195,7 +195,7 @@ I.mockServer((server) => { To stop request recording/replaying use `I.stopMocking()`. -🎥 To record HTTP interactions execute tests with MOCK_MODE environment variable set as "record": +🎥 To record HTTP interactions execute tests with MOCK\_MODE environment variable set as "record": MOCK_MODE=record npx codeceptjs run --debug @@ -205,7 +205,7 @@ To stop request recording/replaying use `I.stopMocking()`. ### Parameters -- `config` +* `config` ### flushMocking @@ -234,10 +234,10 @@ I.mockRequest('GET', ['/secrets', '/v2/secrets'], 403); #### Parameters -- `method` **[string][8]** request method. Can be `GET`, `POST`, `PUT`, etc or `ANY`. -- `oneOrMoreUrls` **([string][8] \| [Array][9]<[string][8]>)** url(s) to mock. Can be exact URL, a pattern, or an array of URLs. -- `dataOrStatusCode` **([number][10] \| [string][8] \| [object][11])** status code when number provided. A response body otherwise -- `additionalData` **([string][8] \| [object][11])** response body when a status code is set by previous parameter. (optional, default `null`) +* `method` **[string][8]** request method. Can be `GET`, `POST`, `PUT`, etc or `ANY`. +* `oneOrMoreUrls` **([string][8] | [Array][9]<[string][8]>)** url(s) to mock. Can be exact URL, a pattern, or an array of URLs. +* `dataOrStatusCode` **([number][10] | [string][8] | [object][11])** status code when number provided. A response body otherwise +* `additionalData` **([string][8] | [object][11])** response body when a status code is set by previous parameter. (optional, default `null`) ### mockServer @@ -274,7 +274,7 @@ I.mockServer((server) => { #### Parameters -- `configFn` +* `configFn` ### passthroughMocking @@ -336,8 +336,8 @@ I.startMocking('users-loaded', { #### Parameters -- `title` **any** (optional, default `'Test'`) -- `config` (optional, default `{}`) +* `title` **any** (optional, default `'Test'`) +* `config` (optional, default `{}`) ### stopMocking diff --git a/docs/helpers/Nightmare.md b/docs/helpers/Nightmare.md index 0a6e8a3d0..ce1deb302 100644 --- a/docs/helpers/Nightmare.md +++ b/docs/helpers/Nightmare.md @@ -22,25 +22,26 @@ Requires `nightmare` package to be installed. This helper should be configured in codecept.conf.ts or codecept.conf.js -- `url` - base url of website to be tested -- `restart` - restart browser between tests. -- `disableScreenshots` - don't save screenshot on failure. -- `uniqueScreenshotNames` - option to prevent screenshot override if you have scenarios with the same name in different suites. -- `fullPageScreenshots` - make full page screenshots on failure. -- `keepBrowserState` - keep browser state between tests when `restart` set to false. -- `keepCookies` - keep cookies between tests when `restart` set to false. -- `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 500. -- `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000. -- `windowSize`: (optional) default window size. Set a dimension like `640x480`. +* `url` - base url of website to be tested +* `restart` - restart browser between tests. +* `disableScreenshots` - don't save screenshot on failure. +* `uniqueScreenshotNames` - option to prevent screenshot override if you have scenarios with the same name in different suites. +* `fullPageScreenshots` - make full page screenshots on failure. +* `keepBrowserState` - keep browser state between tests when `restart` set to false. +* `keepCookies` - keep cookies between tests when `restart` set to false. +* `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 500. +* `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000. +* `windowSize`: (optional) default window size. Set a dimension like `640x480`. + -- options from [Nightmare configuration][2] +* options from [Nightmare configuration][2] ## Methods ### Parameters -- `config` +* `config` ### _locate @@ -64,7 +65,7 @@ let value = this.helpers['Nightmare']._locate({name: 'password'}).then(function( #### Parameters -- `locator` +* `locator` ### amOnPage @@ -79,8 +80,8 @@ I.amOnPage('/login'); // opens a login page #### Parameters -- `url` **[string][3]** url path or global url. -- `headers` **[object][4]?** list of request headers can be passed +* `url` **[string][3]** url path or global url. +* `headers` **[object][4]?** list of request headers can be passed Returns **void** automatically synchronized promise through #recorder @@ -97,8 +98,8 @@ I.appendField('password', secret('123456')); #### Parameters -- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator -- `value` **[string][3]** text value to append. +* `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator +* `value` **[string][3]** text value to append. Returns **void** automatically synchronized promise through #recorder @@ -115,8 +116,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg'); #### Parameters -- `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator. -- `pathToFile` **[string][3]** local file path relative to codecept.conf.ts or codecept.conf.js config file. +* `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator. +* `pathToFile` **[string][3]** local file path relative to codecept.conf.ts or codecept.conf.js config file. Returns **void** automatically synchronized promise through #recorderDoesn't work if the Chromium DevTools panel is open (as Chromium allows only one attachment to the debugger at a time. [See more][5]) @@ -135,8 +136,8 @@ I.checkOption('agree', '//form'); #### Parameters -- `field` **([string][3] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator. -- `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator. +* `field` **([string][3] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator. +* `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator. Returns **void** automatically synchronized promise through #recorder @@ -152,7 +153,7 @@ I.clearCookie('test'); // Playwright currently doesn't support clear a particula #### Parameters -- `cookie` **[string][3]?** (optional, `null` by default) cookie name +* `cookie` **[string][3]?** (optional, `null` by default) cookie name ### clearField @@ -166,8 +167,8 @@ I.clearField('#email'); #### Parameters -- `field` -- `editable` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator. +* `field` +* `editable` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator. Returns **void** automatically synchronized promise through #recorder. @@ -197,8 +198,8 @@ I.click({css: 'nav a.login'}); #### Parameters -- `locator` **([string][3] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator. -- `context` **([string][3]? | [object][4] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. +* `locator` **([string][3] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator. +* `context` **([string][3]? | [object][4] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator. Returns **void** automatically synchronized promise through #recorder @@ -214,8 +215,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element #### Parameters -- `text` **[string][3]** which is not present. -- `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. +* `text` **[string][3]** which is not present. +* `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. Returns **void** automatically synchronized promise through #recorder @@ -231,7 +232,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name #### Parameters -- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator. +* `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator. Returns **void** automatically synchronized promise through #recorder @@ -245,7 +246,7 @@ I.dontSeeCookie('auth'); // no auth cookie #### Parameters -- `name` **[string][3]** cookie name. +* `name` **[string][3]** cookie name. Returns **void** automatically synchronized promise through #recorder @@ -261,7 +262,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also #### Parameters -- `url` **[string][3]** value to check. +* `url` **[string][3]** value to check. Returns **void** automatically synchronized promise through #recorder @@ -275,7 +276,7 @@ I.dontSeeElement('.modal'); // modal is not shown #### Parameters -- `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator. +* `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator. Returns **void** automatically synchronized promise through #recorder @@ -289,7 +290,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or #### Parameters -- `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator. +* `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator. Returns **void** automatically synchronized promise through #recorder @@ -299,7 +300,7 @@ Checks that current url does not contain a provided fragment. #### Parameters -- `url` **[string][3]** value to check. +* `url` **[string][3]** value to check. Returns **void** automatically synchronized promise through #recorder @@ -315,8 +316,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS #### Parameters -- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator. -- `value` **([string][3] | [object][4])** value to check. +* `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator. +* `value` **([string][3] | [object][4])** value to check. Returns **void** automatically synchronized promise through #recorder @@ -330,8 +331,8 @@ I.dontSeeInSource('