diff --git a/Bunoshfile.js b/Bunoshfile.js index 3fb4274c6..d4ed19ba0 100644 --- a/Bunoshfile.js +++ b/Bunoshfile.js @@ -7,6 +7,7 @@ const { say, yell } = global.bunosh const documentjsCliArgs = '-f md --shallow --markdown-toc=false --sort-order=alpha' +const helperSlug = name => name.replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2').replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase() const helperMarkDownFile = name => `docs/helpers/${name}.md` const pluginMarkDownFile = name => `docs/plugins/${name}.md` @@ -128,7 +129,7 @@ export async function docsExternalHelpers() { await shell`npx documentation build node_modules/@codeceptjs/detox-helper/${helper}.js -o ${helperMarkDownFile(helper)} ${documentjsCliArgs}` await writeToFile(helperMarkDownFile(helper), line => { - line`---\npermalink: /helpers/${helper}\nsidebar: auto\ntitle: ${helper}\n---\n\n# ${helper}\n\n` + line`---\npermalink: /helpers/${helperSlug(helper)}\nsidebar: auto\ntitle: ${helper}\n---\n\n# ${helper}\n\n` line.fromFile(helperMarkDownFile(helper)) }) @@ -146,7 +147,7 @@ export async function docsExternalHelpers() { await shell`npx documentation build node_modules/@codeceptjs/mock-request/index.js -o ${helperMarkDownFile(helper)} ${documentjsCliArgs}` await writeToFile(helperMarkDownFile(helper), line => { - line`---\npermalink: /helpers/${helper}\nsidebar: auto\ntitle: ${helper}\n---\n\n# ${helper}\n\n` + line`---\npermalink: /helpers/${helperSlug(helper)}\nsidebar: auto\ntitle: ${helper}\n---\n\n# ${helper}\n\n` line.fromFile(helperMarkDownFile(helper)) }) @@ -321,7 +322,7 @@ export async function docsHelpers() { await writeToFile(helperMarkDownFile(name), line => { line`--- -permalink: /helpers/${name} +permalink: /helpers/${helperSlug(name)} editLink: false sidebar: auto title: ${name} diff --git a/README.md b/README.md index 0db16aae0..fcea5ca75 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,9 @@ CodeceptJS uses **Helper** modules to provide actions to `I` object. Currently, - [**Playwright**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Playwright.md) - is a Node library to automate the Chromium, WebKit and Firefox browsers with a single API. - [**Puppeteer**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Puppeteer.md) - uses Google Chrome's Puppeteer for fast headless testing. - [**WebDriver**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/WebDriver.md) - uses [webdriverio](http://webdriver.io/) to run tests via WebDriver or Devtools protocol. -- [**Obscura**](https://codecept.io/helpers/Obscura) - drives the lightweight Obscura browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers). -- [**Lightpanda**](https://codecept.io/helpers/Lightpanda) - drives the Lightpanda headless browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers). -- [**Moli**](https://codecept.io/helpers/Moli) - drives the Moli headless browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers). +- [**Obscura**](https://codecept.io/helpers/obscura) - drives the lightweight Obscura browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers). +- [**Lightpanda**](https://codecept.io/helpers/lightpanda) - drives the Lightpanda headless browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers). +- [**Moli**](https://codecept.io/helpers/moli) - drives the Moli headless browser through Chrome DevTools Protocol. See [Alternative Browser Engines](https://codecept.io/alternative-browsers). - [**Appium**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Appium.md) - for **mobile testing** with Appium - [**Detox**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Detox.md) - This is a wrapper on top of Detox library, aimed to unify testing experience for CodeceptJS framework. Detox provides a grey box testing for mobile applications, playing especially well for React Native apps. @@ -208,7 +208,7 @@ Feature('CodeceptJS Demonstration') Scenario('test page title', async ({ I }) => { I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation') const title = await I.grabTitle() - I.expectEqual(title, 'Example application with SimpleForm and Twitter Bootstrap') // Avaiable with Expect helper. -> https://codecept.io/helpers/Expect/ + I.expectEqual(title, 'Example application with SimpleForm and Twitter Bootstrap') // Avaiable with Expect helper. -> https://codecept.io/helpers/expect/ }) ``` diff --git a/docs/ai.md b/docs/ai.md index 140685869..05577b707 100644 --- a/docs/ai.md +++ b/docs/ai.md @@ -341,7 +341,7 @@ npx codeceptjs run --ai ## Decision Assertions -Some checks are hard to express with locators: "checkout form has all required fields", "success message is shown". The [Decision helper](/helpers/Decision) asserts them in plain language: +Some checks are hard to express with locators: "checkout form has all required fields", "success message is shown". The [Decision helper](/helpers/decision) asserts them in plain language: ```js I.decide([ diff --git a/docs/alternative-browsers.md b/docs/alternative-browsers.md index f903f7d5f..b285955f9 100644 --- a/docs/alternative-browsers.md +++ b/docs/alternative-browsers.md @@ -82,7 +82,7 @@ Obscura: { } ``` -All options: [Obscura helper reference](/helpers/Obscura). +All options: [Obscura helper reference](/helpers/obscura). ## Lightpanda @@ -141,7 +141,7 @@ Lightpanda: { } ``` -All options: [Lightpanda helper reference](/helpers/Lightpanda). +All options: [Lightpanda helper reference](/helpers/lightpanda). ## Moli @@ -196,7 +196,7 @@ Moli: { } ``` -All options: [Moli helper reference](/helpers/Moli). +All options: [Moli helper reference](/helpers/moli). ## Kitesurf @@ -237,4 +237,4 @@ Every worker opens its own cloud session: npx codeceptjs run-workers 16 ``` -All options: [Kitesurf helper reference](/helpers/Kitesurf). +All options: [Kitesurf helper reference](/helpers/kitesurf). diff --git a/docs/api.md b/docs/api.md index cc99b93ff..e99684521 100644 --- a/docs/api.md +++ b/docs/api.md @@ -82,9 +82,9 @@ Ensure that inside `codecept.conf.js` in helpers section `REST` or `GraphQL` hel Originally, REST and GraphQL helpers were not designed for API testing. They were used to perform API requests for browser tests. As so, they lack assertion methods to API responses. -[`JSONResponse`](/helpers/JSONResponse/) helper adds response assertions. +[`JSONResponse`](/helpers/json-response/) helper adds response assertions. -> 💡 In CodeceptJS assertions start with `see` prefix. Learn more about assertions by [opening reference for JSONResponse](/helpers/JSONResponse/) helper. +> 💡 In CodeceptJS assertions start with `see` prefix. Learn more about assertions by [opening reference for JSONResponse](/helpers/json-response/) helper. Generate TypeScript definitions to get auto-completions for JSONResponse: @@ -98,7 +98,7 @@ After helpers were configured and typings were generated, you can start writing ## Requests -[REST](/helpers/REST/) or [GraphQL](/helpers/GraphQL/) helpers implement methods for making API requests. +[REST](/helpers/rest/) or [GraphQL](/helpers/graph-ql/) helpers implement methods for making API requests. Both helpers send requests via HTTP protocol from CodeceptJS process. For most cases, you will need to have authentication. It can be passed via headers, which can be added to helper's configuration in `codecept.conf.js`. @@ -143,15 +143,15 @@ export const config = { REST helper can send GET/POST/PATCH/etc requests to REST API endpoint: -* [`I.sendGetRequest()`](/helpers/REST#sendGetRequest) -* [`I.sendPostRequest()`](/helpers/REST#sendPostRequest) -* [`I.sendPutRequest()`](/helpers/REST#sendPutRequest) -* [`I.sendPatchRequest()`](/helpers/REST#sendPatchRequest) -* [`I.sendDeleteRequest()`](/helpers/REST#sendDeleteRequest) -* [`I.sendDeleteRequestWithPayload()`](/helpers/REST#sendDeleteRequestWithPayload) +* [`I.sendGetRequest()`](/helpers/rest#sendgetrequest) +* [`I.sendPostRequest()`](/helpers/rest#sendpostrequest) +* [`I.sendPutRequest()`](/helpers/rest#sendputrequest) +* [`I.sendPatchRequest()`](/helpers/rest#sendpatchrequest) +* [`I.sendDeleteRequest()`](/helpers/rest#senddeleterequest) +* [`I.sendDeleteRequestWithPayload()`](/helpers/rest#senddeleterequestwithpayload) * ... -Authentication headers can be set in [helper's config](https://codecept.io/helpers/REST/#configuration) or per test with headers or special methods like `I.amBearerAuthenticated`. +Authentication headers can be set in [helper's config](https://codecept.io/helpers/rest/#configuration) or per test with headers or special methods like `I.amBearerAuthenticated`. Example: @@ -209,8 +209,8 @@ Scenario('get user by query', ({ I }) => { GraphQL helper has two methods available: -* [`I.sendQuery()`](/helpers/GraphQL#sendQuery) -* [`I.sendMutation()`](/helpers/GraphQL#sendMutation) +* [`I.sendQuery()`](/helpers/graph-ql#sendquery) +* [`I.sendMutation()`](/helpers/graph-ql#sendmutation) ## Assertions @@ -257,7 +257,7 @@ I.seeResponseCodeIsServerError(); ### Structure -The most basic thing to check in response is existence of keys in JSON object. Use [`I.seeResponseContainsKeys()`](/helpers/JSONResponse#seeResponseContainsKeys) method for it: +The most basic thing to check in response is existence of keys in JSON object. Use [`I.seeResponseContainsKeys()`](/helpers/json-response#seeresponsecontainskeys) method for it: ```js // response is { "name": "joe", "email": "joe@joe.com" } diff --git a/docs/assertions.md b/docs/assertions.md index 5707fb09d..a116df0e7 100644 --- a/docs/assertions.md +++ b/docs/assertions.md @@ -10,7 +10,7 @@ CodeceptJS ships with **browser assertions built into the `I` object** — `I.se When the built-ins are not enough — sort order, business math, JSON shapes, domain rules — you have three ways to assert, in order of preference: 1. **Reusable custom assertions** in a helper: `I.seeTableIsOrdered('Price', 'desc')` -2. **Quick assertions with [ExpectHelper](/helpers/ExpectHelper)** on grabbed data: `I.expectDeepEqualExcluding(order, expected, ['id'])` +2. **Quick assertions with [ExpectHelper](/helpers/expect-helper)** on grabbed data: `I.expectDeepEqualExcluding(order, expected, ['id'])` 3. **Bring your own library** — `chai`, `jest`, or Node's `assert` This page also covers [element assertions via WebElement](/WebElement), [soft assertions](#soft-assertions) for running many checks in one scenario, and [masking secrets](#masking-secrets) in assertion logs. @@ -84,7 +84,7 @@ Four options, from least setup to most: ### Quick Assertions with Expect Helper -[`ExpectHelper`](/helpers/ExpectHelper) exposes chai's assertions as methods on the `I` object. Use it for one-off checks on data you have already grabbed — no helper class, no boilerplate. +[`ExpectHelper`](/helpers/expect-helper) exposes chai's assertions as methods on the `I` object. Use it for one-off checks on data you have already grabbed — no helper class, no boilerplate. **Install separately:** @@ -145,7 +145,7 @@ Common methods: | `expectHasProperty` / `expectEmpty` | Object shape | | `expectJsonSchema` / `expectJsonSchemaUsingAJV` | Full schema validation | -ExpectHelper calls appear in the step log next to browser steps, so failures read in order with the rest of the scenario. See the [full reference](/helpers/ExpectHelper). +ExpectHelper calls appear in the step log next to browser steps, so failures read in order with the rest of the scenario. See the [full reference](/helpers/expect-helper). ### Built-in Assertion Library @@ -399,7 +399,7 @@ expected soft assertions '[expected web application to include "You must accept ## Decision Assertions -Some checks are hard to express with locators: "checkout form has all required fields", "success message is shown", "sidebar is shown". The [Decision helper](/helpers/Decision) asserts such statements in plain language with a decision model. +Some checks are hard to express with locators: "checkout form has all required fields", "success message is shown", "sidebar is shown". The [Decision helper](/helpers/decision) asserts such statements in plain language with a decision model. A [decision model](https://openrouter.ai/models?output_modalities=decisions), like [Jev](https://openrouter.ai/typesafe/jev-1.13), does not generate text. It reads the page and returns the probability that a statement is true. This makes it a good fit for assertions: @@ -479,7 +479,7 @@ Use decision assertions for what a page means, and built-in assertions for exact | A form field's current value | `I.seeInField` / `I.seeCheckboxIsChecked` | | URL or page title | `I.seeInCurrentUrl` / `I.seeInTitle` | | A count of matching elements | `I.seeNumberOfElements` | -| Business logic / JSON shape on grabbed data | [ExpectHelper](/helpers/ExpectHelper) — `expectEqual`, `expectDeepEqualExcluding`, `expectJsonSchema` | +| Business logic / JSON shape on grabbed data | [ExpectHelper](/helpers/expect-helper) — `expectEqual`, `expectDeepEqualExcluding`, `expectJsonSchema` | | A lightweight, dependency-free assertion in a scenario | `equals`, `includes`, `empty`, `truth` from `codeceptjs/assertions` | | Per-element state in a loop | `grabWebElements` + [WebElement API](/WebElement) | | A matcher the above do not cover | `grab*` + `chai` / `jest` / `node:assert` | diff --git a/docs/bootstrap.md b/docs/bootstrap.md index 3f08aaede..7723bd951 100644 --- a/docs/bootstrap.md +++ b/docs/bootstrap.md @@ -55,7 +55,7 @@ First, `bootstrapAll` is called. Then two `bootstrap` runs in each of workers. T The `bootstrapAll` and `teardownAll` hooks are preferred to use for setting up common logic of tested project: to start the application server or database or to start webdriver's grid. -The `bootstrap` and `teardown` hooks are used for setting up each testing browser: to create unique [cloud testing server](/helpers/WebDriver#cloud-providers) connection or to create specific browser-related test data in database (like users with names with browsername in it). +The `bootstrap` and `teardown` hooks are used for setting up each testing browser: to create unique [cloud testing server](/helpers/web-driver#cloud-providers) connection or to create specific browser-related test data in database (like users with names with browsername in it). ### Example: BootstrapAll & TeardownAll Inside Config diff --git a/docs/data.md b/docs/data.md index 7a57c7cff..1a6d53fa9 100644 --- a/docs/data.md +++ b/docs/data.md @@ -109,7 +109,7 @@ Data Objects can use any helper methods available via `I`, including `sendGetReq ## REST -[REST helper](https://codecept.io/helpers/REST/) allows sending raw HTTP requests to application. +[REST helper](https://codecept.io/helpers/rest/) allows sending raw HTTP requests to application. This is a tool to make shortcuts and create your data pragmatically via API. However, it doesn't provide tools for testing APIs, so it should be paired with Playwright or WebDriver helper for browser testing. Enable REST helper in the config. It is recommended to set `endpoint`, a base URL for all API requests. If you need some authorization you can optionally set default headers too. @@ -175,11 +175,11 @@ This can also be used to emulate Ajax requests: I.sendPostRequest('/update-status', {}, { http_x_requested_with: 'xmlhttprequest' }) ``` -> See complete reference on [REST](https://codecept.io/helpers/REST) helper +> See complete reference on [REST](https://codecept.io/helpers/rest) helper ## GraphQL -[GraphQL helper](https://codecept.io/helpers/GraphQL/) allows sending GraphQL queries and mutations to application, over Http. +[GraphQL helper](https://codecept.io/helpers/graph-ql/) allows sending GraphQL queries and mutations to application, over Http. This tool allows you to create shortcuts and manage your data pragmatically via a GraphQL endpoint. However, it does not include tools for testing the endpoint, so it should be used in conjunction with WebDriver helpers for browser testing. @@ -243,14 +243,14 @@ After(({ I }) => { }) ``` -> See complete reference on [GraphQL](https://codecept.io/helpers/GraphQL) helper +> See complete reference on [GraphQL](https://codecept.io/helpers/graph-ql) helper ## Data Generation with Factories This concept is extended by: -- [ApiDataFactory](https://codecept.io/helpers/ApiDataFactory/) helper, and, -- [GraphQLDataFactory](https://codecept.io/helpers/GraphQLDataFactory/) helper. +- [ApiDataFactory](https://codecept.io/helpers/api-data-factory/) helper, and, +- [GraphQLDataFactory](https://codecept.io/helpers/graph-ql-data-factory/) helper. These helpers build data according to defined rules and use REST API or GraphQL mutations to store them and automatically clean them up after a test. @@ -320,7 +320,7 @@ At the end of a test ApiDataFactory will clean up created record for you. This i ids from crated records and running `DELETE /api/users/{id}` requests at the end of a test. This rules can be customized in helper configuration. -> See complete reference on [ApiDataFactory](https://codecept.io/helpers/ApiDataFactory) helper +> See complete reference on [ApiDataFactory](https://codecept.io/helpers/api-data-factory) helper ### GraphQL Data Factory @@ -383,7 +383,7 @@ data from crated records, creating deletion mutation objects by passing the data This behavior is according the `revert` function be customized in helper configuration. The revert function returns an object, that contains the query for deletion, and the variables object to go along with it. -> See complete reference on [GraphQLDataFactory](https://codecept.io/helpers/GraphQLDataFactory) helper +> See complete reference on [GraphQLDataFactory](https://codecept.io/helpers/graph-ql-data-factory) helper ## Requests Using Browser Session diff --git a/docs/helpers/ApiDataFactory.md b/docs/helpers/ApiDataFactory.md index 7642fd3d7..178a3dec4 100644 --- a/docs/helpers/ApiDataFactory.md +++ b/docs/helpers/ApiDataFactory.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/ApiDataFactory +permalink: /helpers/api-data-factory editLink: false sidebar: auto title: ApiDataFactory @@ -260,7 +260,7 @@ Can be replaced from a custom helper. [2]: https://www.npmjs.com/package/faker -[3]: http://codecept.io/helpers/REST/ +[3]: http://codecept.io/helpers/rest/ [4]: https://github.com/axios/axios#request-config diff --git a/docs/helpers/Appium.md b/docs/helpers/Appium.md index 7f2887841..5a7cfe0b4 100644 --- a/docs/helpers/Appium.md +++ b/docs/helpers/Appium.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/Appium +permalink: /helpers/appium editLink: false sidebar: auto title: Appium @@ -2315,7 +2315,7 @@ Smart Wait to locate an element * `locator` **[object][6]** -[1]: http://codecept.io/helpers/WebDriver/ +[1]: http://codecept.io/helpers/web-driver/ [2]: https://appium.io/docs/en/2.1/ diff --git a/docs/helpers/Decision.md b/docs/helpers/Decision.md index 7d202371c..9d0d0a73e 100644 --- a/docs/helpers/Decision.md +++ b/docs/helpers/Decision.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/Decision +permalink: /helpers/decision editLink: false sidebar: auto title: Decision diff --git a/docs/helpers/Detox.md b/docs/helpers/Detox.md index 4d5c46204..fc5c0ef89 100644 --- a/docs/helpers/Detox.md +++ b/docs/helpers/Detox.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/Detox +permalink: /helpers/detox sidebar: auto title: Detox --- diff --git a/docs/helpers/ExpectHelper.md b/docs/helpers/ExpectHelper.md index 3a437f48e..ebb84c29c 100644 --- a/docs/helpers/ExpectHelper.md +++ b/docs/helpers/ExpectHelper.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/ExpectHelper +permalink: /helpers/expect-helper editLink: false sidebar: auto title: ExpectHelper diff --git a/docs/helpers/FileSystem.md b/docs/helpers/FileSystem.md index cd3d1351a..19616314d 100644 --- a/docs/helpers/FileSystem.md +++ b/docs/helpers/FileSystem.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/FileSystem +permalink: /helpers/file-system editLink: false sidebar: auto title: FileSystem diff --git a/docs/helpers/GraphQL.md b/docs/helpers/GraphQL.md index 7ee14f3f3..da369a109 100644 --- a/docs/helpers/GraphQL.md +++ b/docs/helpers/GraphQL.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/GraphQL +permalink: /helpers/graph-ql editLink: false sidebar: auto title: GraphQL diff --git a/docs/helpers/GraphQLDataFactory.md b/docs/helpers/GraphQLDataFactory.md index 9df472d61..3838b04f1 100644 --- a/docs/helpers/GraphQLDataFactory.md +++ b/docs/helpers/GraphQLDataFactory.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/GraphQLDataFactory +permalink: /helpers/graph-ql-data-factory editLink: false sidebar: auto title: GraphQLDataFactory @@ -219,7 +219,7 @@ Can be replaced from a custom helper. [2]: https://www.npmjs.com/package/faker -[3]: http://codecept.io/helpers/GraphQL/ +[3]: http://codecept.io/helpers/graph-ql/ [4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/docs/helpers/JSONResponse.md b/docs/helpers/JSONResponse.md index 59399f362..e4325c8b3 100644 --- a/docs/helpers/JSONResponse.md +++ b/docs/helpers/JSONResponse.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/JSONResponse +permalink: /helpers/json-response editLink: false sidebar: auto title: JSONResponse diff --git a/docs/helpers/Kitesurf.md b/docs/helpers/Kitesurf.md index 3869830d7..b9588dca7 100644 --- a/docs/helpers/Kitesurf.md +++ b/docs/helpers/Kitesurf.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/Kitesurf +permalink: /helpers/kitesurf editLink: false sidebar: auto title: Kitesurf diff --git a/docs/helpers/Lightpanda.md b/docs/helpers/Lightpanda.md index bde92b064..09586626b 100644 --- a/docs/helpers/Lightpanda.md +++ b/docs/helpers/Lightpanda.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/Lightpanda +permalink: /helpers/lightpanda editLink: false sidebar: auto title: Lightpanda diff --git a/docs/helpers/MockRequest.md b/docs/helpers/MockRequest.md index 3fd179964..3b3bba472 100644 --- a/docs/helpers/MockRequest.md +++ b/docs/helpers/MockRequest.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/MockRequest +permalink: /helpers/mock-request sidebar: auto title: MockRequest --- diff --git a/docs/helpers/Moli.md b/docs/helpers/Moli.md index d52849a8e..08f4f193f 100644 --- a/docs/helpers/Moli.md +++ b/docs/helpers/Moli.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/Moli +permalink: /helpers/moli editLink: false sidebar: auto title: Moli diff --git a/docs/helpers/Obscura.md b/docs/helpers/Obscura.md index bd87f27cd..83781ddff 100644 --- a/docs/helpers/Obscura.md +++ b/docs/helpers/Obscura.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/Obscura +permalink: /helpers/obscura editLink: false sidebar: auto title: Obscura diff --git a/docs/helpers/Playwright.md b/docs/helpers/Playwright.md index 974f7c534..7a1420acf 100644 --- a/docs/helpers/Playwright.md +++ b/docs/helpers/Playwright.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/Playwright +permalink: /helpers/playwright editLink: false sidebar: auto title: Playwright @@ -2992,7 +2992,7 @@ Set current page [27]: https://playwright.dev/docs/api/class-locator#locator-is-disabled -[28]: https://codecept.io/helpers/FileSystem +[28]: https://codecept.io/helpers/file-system [29]: https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get diff --git a/docs/helpers/Puppeteer.md b/docs/helpers/Puppeteer.md index 0f4572d75..53214e257 100644 --- a/docs/helpers/Puppeteer.md +++ b/docs/helpers/Puppeteer.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/Puppeteer +permalink: /helpers/puppeteer editLink: false sidebar: auto title: Puppeteer @@ -2606,7 +2606,7 @@ Set current page [1]: https://github.com/puppeteer/puppeteer -[2]: https://codecept.io/helpers/Puppeteer-firefox +[2]: https://codecept.io/helpers/puppeteer-firefox [3]: https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target @@ -2642,7 +2642,7 @@ Set current page [19]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined -[20]: https://codecept.io/helpers/FileSystem +[20]: https://codecept.io/helpers/file-system [21]: https://pptr.dev/guides/network-interception diff --git a/docs/helpers/REST.md b/docs/helpers/REST.md index 54cd2fc21..f40338f66 100644 --- a/docs/helpers/REST.md +++ b/docs/helpers/REST.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/REST +permalink: /helpers/rest editLink: false sidebar: auto title: REST diff --git a/docs/helpers/WebDriver.md b/docs/helpers/WebDriver.md index e26c5ee86..82ceae475 100644 --- a/docs/helpers/WebDriver.md +++ b/docs/helpers/WebDriver.md @@ -1,5 +1,5 @@ --- -permalink: /helpers/WebDriver +permalink: /helpers/web-driver editLink: false sidebar: auto title: WebDriver diff --git a/docs/installation.md b/docs/installation.md index 1c905c33d..0bd47506e 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -97,7 +97,7 @@ export const config = { } ``` -See [Alternative Browser Engines](/alternative-browsers) for connection modes and limitations, and the [Obscura helper reference](/helpers/Obscura) for every option. +See [Alternative Browser Engines](/alternative-browsers) for connection modes and limitations, and the [Obscura helper reference](/helpers/obscura) for every option. ## Lightpanda (experimental) diff --git a/docs/mobile.md b/docs/mobile.md index 6b894a526..ee3fa7d5d 100644 --- a/docs/mobile.md +++ b/docs/mobile.md @@ -114,7 +114,7 @@ Initialize CodeceptJS with `init` command: npx codeceptjs init ``` -Select [Appium helper](https://codecept.io/helpers/Appium/) when asked. +Select [Appium helper](https://codecept.io/helpers/appium/) when asked. ```sh ? What helpers do you want to use? @@ -207,7 +207,7 @@ There are mobile-only methods like: * `hideDeviceKeyboard`, * `seeAppIsInstalled`, `installApp`, `removeApp`, `seeAppIsNotInstalled` - Android only -and [others](https://codecept.io/helpers/Appium/). +and [others](https://codecept.io/helpers/appium/). ## Locating Elements diff --git a/docs/parallel.md b/docs/parallel.md index ed1187f10..11f967397 100644 --- a/docs/parallel.md +++ b/docs/parallel.md @@ -225,7 +225,7 @@ share({ tmpFile: '/tmp/run-1' }, { local: true }) ## Scaling beyond one machine Worker threads split the suite, but every Playwright worker still runs a full local browser. -With the [Kitesurf helper](/helpers/Kitesurf) each worker drives a cloud browser on Cloudflare +With the [Kitesurf helper](/helpers/kitesurf) each worker drives a cloud browser on Cloudflare instead — `run-workers 16` means sixteen browsers spawned in about a second, none of them competing for your runner's CPU. See [Alternative Browser Engines](/alternative-browsers) for the full setup. diff --git a/docs/playwright.md b/docs/playwright.md index 7dc93e107..4826776e1 100644 --- a/docs/playwright.md +++ b/docs/playwright.md @@ -104,7 +104,7 @@ When to consider navigation succeeded, defaults to `load`. Given an array of eve When a test runs faster than application it is recommended to increase `waitForAction` config value. It will wait for a small amount of time (100ms) by default after each user action is taken. -> ▶ More options are listed in [helper reference](https://codecept.io/helpers/Playwright/). +> ▶ More options are listed in [helper reference](https://codecept.io/helpers/playwright/). ## Writing Tests @@ -129,7 +129,7 @@ Tests consist with a scenario of user's action taken on a page. The most widely - `see`, `dontSee` - to check for a text on a page - `seeElement`, `dontSeeElement` - to check for elements on a page -> ℹ All actions are listed in [Playwright helper reference](https://codecept.io/helpers/Playwright/).\* +> ℹ All actions are listed in [Playwright helper reference](https://codecept.io/helpers/playwright/).\* All actions which interact with elements can use **[CSS or XPath locators](https://codecept.io/locators/#css-and-xpath)**. Actions like `click` or `fillField` can locate elements by their name or value on a page: @@ -377,15 +377,15 @@ Scenario('website looks nice on iPhone', () => { ## API Requests -CodeceptJS has [REST](/helpers/REST) and [GraphQL](<(/helpers/GraphQL)>) helpers to perform requests to external APIs. This may be helpful to implement [data management](https://codecept.io/data/) strategy. +CodeceptJS has [REST](/helpers/rest) and [GraphQL](/helpers/graph-ql) helpers to perform requests to external APIs. This may be helpful to implement [data management](https://codecept.io/data/) strategy. -However, Playwright since 1.18 has its own [API for making request](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get). It uses cookies from browser session to authenticate requests. So you can use it via [`makeApiRequest`](/helpers/Playwright#makeApiRequest) method: +However, Playwright since 1.18 has its own [API for making request](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get). It uses cookies from browser session to authenticate requests. So you can use it via [`makeApiRequest`](/helpers/playwright#makeapirequest) method: ```js I.makeApiRequest('GET', '/users') ``` -It is also possible to test JSON responses by adding [`JSONResponse`](/helpers/JSONResponse) and connecting it to Playwright: +It is also possible to test JSON responses by adding [`JSONResponse`](/helpers/json-response) and connecting it to Playwright: ```js // inside codecept.conf.js diff --git a/docs/puppeteer.md b/docs/puppeteer.md index e2272badf..38a06ad7b 100644 --- a/docs/puppeteer.md +++ b/docs/puppeteer.md @@ -43,7 +43,7 @@ npx codeceptjs init You will be asked for a Helper to use, you should select Puppeteer and provide url of a website you are testing. -> Puppeteer can also work with Firefox. [Learn how to set it up](/helpers/Puppeteer-firefox) +> Puppeteer can also work with Firefox. [Learn how to set it up](/helpers/puppeteer-firefox) ## Configuring @@ -80,7 +80,7 @@ By default it is set to `domcontentloaded` which waits for `DOMContentLoaded` ev When a test runs faster than application it is recommended to increase `waitForAction` config value. It will wait for a small amount of time (100ms) by default after each user action is taken. -> ▶ More options are listed in [helper reference](https://codecept.io/helpers/Puppeteer/). +> ▶ More options are listed in [helper reference](https://codecept.io/helpers/puppeteer/). ## Writing Tests @@ -105,7 +105,7 @@ Tests consist with a scenario of user's action taken on a page. The most widely - `see`, `dontSee` - to check for a text on a page - `seeElement`, `dontSeeElement` - to check for elements on a page -> ℹ All actions are listed in [Puppeteer helper reference](https://codecept.io/helpers/Puppeteer/).\* +> ℹ All actions are listed in [Puppeteer helper reference](https://codecept.io/helpers/puppeteer/).\* All actions which interact with elements **support CSS and XPath locators**. Actions like `click` or `fillField` by locate elements by their name or value on a page: @@ -241,7 +241,7 @@ To master request intercepting [use `HTTPRequest` object](https://pptr.dev/next/ ## Accessing Puppeteer API -To get Puppeteer API inside a test use [`I.usePupepteerTo`](/helpers/Puppeteer/#usepuppeteerto) method with a callback. +To get Puppeteer API inside a test use [`I.usePupepteerTo`](/helpers/puppeteer/#usepuppeteerto) method with a callback. To keep test readable provide a description of a callback inside the first parameter. ```js diff --git a/docs/timeouts.md b/docs/timeouts.md index ed40cb3a4..b23b08dda 100644 --- a/docs/timeouts.md +++ b/docs/timeouts.md @@ -85,11 +85,11 @@ Each helper (Playwright, Puppeteer, WebDriver, Appium, REST) has its own timeout Refer to helper-specific documentation for timeout configuration: -- [Playwright Helper](/helpers/Playwright) — `timeout`, `waitForTimeout`, `getPageTimeout` -- [Puppeteer Helper](/helpers/Puppeteer) — `waitForTimeout`, `getPageTimeout` -- [WebDriver Helper](/helpers/WebDriver) — `waitForTimeout`, `smartWait`, `timeouts` object -- [Appium Helper](/helpers/Appium) — `timeouts` object -- [REST Helper](/helpers/REST) — `timeout` +- [Playwright Helper](/helpers/playwright) — `timeout`, `waitForTimeout`, `getPageTimeout` +- [Puppeteer Helper](/helpers/puppeteer) — `waitForTimeout`, `getPageTimeout` +- [WebDriver Helper](/helpers/web-driver) — `waitForTimeout`, `smartWait`, `timeouts` object +- [Appium Helper](/helpers/appium) — `timeouts` object +- [REST Helper](/helpers/rest) — `timeout` ## stepTimeout Plugin diff --git a/docs/webdriver.md b/docs/webdriver.md index b56d56a95..f85d3920c 100644 --- a/docs/webdriver.md +++ b/docs/webdriver.md @@ -91,7 +91,7 @@ keepBrowserState: true, keepCookies: true, ``` -> ▶ More config options available on [WebDriver helper reference](/helpers/WebDriver#configuration) +> ▶ More config options available on [WebDriver helper reference](/helpers/web-driver#configuration) ### Headless Mode @@ -138,7 +138,7 @@ desiredCapabilities: { ### Cloud Providers -By default, WebdriverIO starts a local driver automatically, so no connection parameters are needed. To run tests via [Cloud Providers](/helpers/WebDriver#cloud-providers) instead, specify `host`, `port`, `protocol`, and `path` parameters pointing to the service. You may also need `user` and `key` parameters to authenticate on the cloud service. +By default, WebdriverIO starts a local driver automatically, so no connection parameters are needed. To run tests via [Cloud Providers](/helpers/web-driver#cloud-providers) instead, specify `host`, `port`, `protocol`, and `path` parameters pointing to the service. You may also need `user` and `key` parameters to authenticate on the cloud service. There are also [browser and platform specific capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities). Services like SauceLabs, BrowserStack or browser vendors can provide their own specific capabilities for more tuning. @@ -208,7 +208,7 @@ Tests consist with a scenario of user's action taken on a page. The most widely * `see`, `dontSee` - to check for a text on a page * `seeElement`, `dontSeeElement` - to check for elements on a page -> ℹ All actions are listed in [WebDriver helper reference](https://codecept.io/helpers/WebDriver/).* +> ℹ All actions are listed in [WebDriver helper reference](https://codecept.io/helpers/web-driver/).* All actions which interact with elements **support CSS and XPath locators**. Actions like `click` or `fillField` by locate elements by their name or value on a page: @@ -252,7 +252,7 @@ npx codeceptjs run --steps After a page is opened a full control of a browser is given to a terminal. Type in different commands such as `click`, `see`, `fillField` to write the test. A successful commands will be saved to `./output/cli-history` file and can be copied into a test. -> ℹ All actions are listed in [WebDriver helper reference](/helpers/WebDriver). +> ℹ All actions are listed in [WebDriver helper reference](/helpers/web-driver). An interactive shell output may look like this: @@ -420,7 +420,7 @@ There are following options available: * Use headless Chrome or Firefox. * Use [Selenoid](/plugins/selenoid) to run browsers inside Docker containers. -* Use paid [cloud services (SauceLabs, BrowserStack, TestingBot)](/helpers/WebDriver#cloud-providers). +* Use paid [cloud services (SauceLabs, BrowserStack, TestingBot)](/helpers/web-driver#cloud-providers). ## Video Recording @@ -494,7 +494,7 @@ This is useful when you want to isolate application testing from a backend. For > **WebDriver has limited ability to mock requests**, so you can only mock only requests performed after page is loaded. This means that you can't block Google Analytics, or CDN calls, but you can mock API requests performed on user action. -To mock requests enable additional helper [MockRequest](/helpers/MockRequest) (which is based on Polly.js). +To mock requests enable additional helper [MockRequest](/helpers/mock-request) (which is based on Polly.js). ```js helpers: { @@ -529,7 +529,7 @@ I.click('Go to Next Page'); // in WebDriver as we can't detect that the page was reloaded, so no mocking :( ``` -> See [`mockRequest` API](/helpers/MockRequest#mockrequest) +> See [`mockRequest` API](/helpers/mock-request#mockrequest) To see `mockRequest` method in intellisense auto completion don't forget to run `codeceptjs def` command: @@ -542,7 +542,7 @@ Mocking rules will be kept while a test is running. To stop mocking use `I.stopM ## Accessing webdriverio API -To get [webdriverio browser API](https://webdriver.io/docs/api.html) inside a test use [`I.useWebDriverTo`](/helpers/WebDriver/#usewebdriverto) method with a callback. +To get [webdriverio browser API](https://webdriver.io/docs/api.html) inside a test use [`I.useWebDriverTo`](/helpers/web-driver/#usewebdriverto) method with a callback. To keep test readable provide a description of a callback inside the first parameter. ```js diff --git a/lib/helper/ApiDataFactory.js b/lib/helper/ApiDataFactory.js index a46c309f1..9d5c3e1c1 100644 --- a/lib/helper/ApiDataFactory.js +++ b/lib/helper/ApiDataFactory.js @@ -99,7 +99,7 @@ import { resolveImportModulePath } from '../utils.js' * It is required to set REST API `endpoint` which is the baseURL for all API requests. * Factory file is expected to be passed via `factory` option. * - * This Helper uses [REST](http://codecept.io/helpers/REST/) helper and accepts its configuration in "REST" section. + * This Helper uses [REST](http://codecept.io/helpers/rest/) helper and accepts its configuration in "REST" section. * For instance, to set timeout you should add: * * ```js diff --git a/lib/helper/Appium.js b/lib/helper/Appium.js index 46dbdd81e..fd569f2ec 100644 --- a/lib/helper/Appium.js +++ b/lib/helper/Appium.js @@ -24,7 +24,7 @@ const vendorPrefix = { } /** - * Appium helper extends [Webdriver](http://codecept.io/helpers/WebDriver/) helper. + * Appium helper extends [Webdriver](http://codecept.io/helpers/web-driver/) 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. * diff --git a/lib/helper/GraphQLDataFactory.js b/lib/helper/GraphQLDataFactory.js index 2195a7130..cfc79b8d3 100644 --- a/lib/helper/GraphQLDataFactory.js +++ b/lib/helper/GraphQLDataFactory.js @@ -100,7 +100,7 @@ import store from '../store.js' * It is required to set GraphQL `endpoint` which is the URL to which all the queries go to. * Factory file is expected to be passed via `factory` option. * - * This Helper uses [GraphQL](http://codecept.io/helpers/GraphQL/) helper and accepts its configuration in "GraphQL" section. + * This Helper uses [GraphQL](http://codecept.io/helpers/graph-ql/) helper and accepts its configuration in "GraphQL" section. * For instance, to set timeout you should add: * * ```js diff --git a/lib/helper/Playwright.js b/lib/helper/Playwright.js index 617be92af..6cfcf420a 100644 --- a/lib/helper/Playwright.js +++ b/lib/helper/Playwright.js @@ -2054,7 +2054,7 @@ class Playwright extends Helper { * Handles a file download. A file name is required to save the file on disk. * Files are saved to "output" directory. * - * Should be used with [FileSystem helper](https://codecept.io/helpers/FileSystem) to check that file were downloaded correctly. + * Should be used with [FileSystem helper](https://codecept.io/helpers/file-system) to check that file were downloaded correctly. * * ```js * I.handleDownloads('downloads/avatar.jpg'); diff --git a/lib/helper/Puppeteer.js b/lib/helper/Puppeteer.js index 402d32a5c..7102f35da 100644 --- a/lib/helper/Puppeteer.js +++ b/lib/helper/Puppeteer.js @@ -94,7 +94,7 @@ const consoleLogStore = new Console() * @prop {string} [windowSize] - default window size. Set a dimension in format WIDTHxHEIGHT like `640x480`. * @prop {string} [userAgent] - user-agent string. * @prop {boolean} [manualStart=false] - do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`. - * @prop {string} [browser=chrome] - can be changed to `firefox` when using [puppeteer-firefox](https://codecept.io/helpers/Puppeteer-firefox). + * @prop {string} [browser=chrome] - can be changed to `firefox` when using [puppeteer-firefox](https://codecept.io/helpers/puppeteer-firefox). * @prop {object} [chrome] - pass additional [Puppeteer run options](https://github.com/puppeteer/puppeteer/blob/main/docs/api/puppeteer.launchoptions.md). * @prop {boolean} [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose). */ @@ -115,7 +115,7 @@ const config = {} * ``` * Using `puppeteer-core` package, will prevent the download of browser binaries and allow connecting to an existing browser installation or for connecting to a remote one. * - * > Experimental Firefox support [can be activated](https://codecept.io/helpers/Puppeteer-firefox). + * > Experimental Firefox support [can be activated](https://codecept.io/helpers/puppeteer-firefox). * * * @@ -1320,7 +1320,7 @@ class Puppeteer extends Helper { /** * Sets a directory to where save files. Allows to test file downloads. - * Should be used with [FileSystem helper](https://codecept.io/helpers/FileSystem) to check that file were downloaded correctly. + * Should be used with [FileSystem helper](https://codecept.io/helpers/file-system) to check that file were downloaded correctly. * * By default, files are saved to `output/downloads`. * This directory is cleaned on every `handleDownloads` call, to ensure no old files are kept.