From ef4f5be44c24aa7ea38a4a249bf93909379a0cbc Mon Sep 17 00:00:00 2001
From: shadowusr <58862284+shadowusr@users.noreply.github.com>
Date: Wed, 17 Jul 2024 02:13:48 +0300
Subject: [PATCH] docs: add en versions of browser commands (#17)
* docs: add en versions of browser commands
---
docs/quickstart/index.mdx | 2 -
.../current/commands/browser/$$.mdx | 96 +++++++++
.../current/commands/browser/$.mdx | 119 +++++++++++
.../current/commands/browser/action.mdx | 165 +++++++++++++++
.../current/commands/browser/actions.mdx | 32 +++
.../current/commands/browser/addCommand.mdx | 69 +++++++
.../current/commands/browser/assertView.mdx | 190 ++++++++++++++++++
.../current/commands/browser/call.mdx | 59 ++++++
.../current/commands/browser/debug.mdx | 31 +++
.../commands/browser/deleteCookies.mdx | 69 +++++++
.../current/commands/browser/execute.mdx | 59 ++++++
.../current/commands/browser/executeAsync.mdx | 63 ++++++
.../commands/browser/executionContext.mdx | 42 ++++
.../current/commands/browser/getConfig.mdx | 27 +++
.../current/commands/browser/getCookies.mdx | 60 ++++++
.../current/commands/browser/getMeta.mdx | 65 ++++++
.../current/commands/browser/getPuppeteer.mdx | 51 +++++
.../commands/browser/getWindowSize.mdx | 29 +++
.../current/commands/browser/keys.mdx | 53 +++++
.../current/commands/browser/mock.mdx | 139 +++++++++++++
.../current/commands/browser/mockClearAll.mdx | 44 ++++
.../commands/browser/mockRestoreAll.mdx | 41 ++++
.../current/commands/browser/newWindow.mdx | 63 ++++++
.../current/commands/browser/openAndWait.mdx | 72 +++++++
.../commands/browser/overwriteCommand.mdx | 61 ++++++
.../current/commands/browser/pause.mdx | 49 +++++
.../current/commands/browser/reactDollar.mdx | 80 ++++++++
.../commands/browser/reactDollarDollar.mdx | 61 ++++++
.../commands/browser/reloadSession.mdx | 29 +++
.../current/commands/browser/savePDF.mdx | 63 ++++++
.../commands/browser/saveRecordingScreen.mdx | 52 +++++
.../commands/browser/saveScreenshot.mdx | 46 +++++
.../current/commands/browser/scroll.mdx | 44 ++++
.../current/commands/browser/setCookies.mdx | 97 +++++++++
.../current/commands/browser/setMeta.mdx | 57 ++++++
.../current/commands/browser/setTimeout.mdx | 49 +++++
.../commands/browser/setWindowSize.mdx | 32 +++
.../current/commands/browser/switchWindow.mdx | 45 +++++
.../current/commands/browser/throttle.mdx | 73 +++++++
.../current/commands/browser/touchAction.mdx | 90 +++++++++
.../current/commands/browser/uploadFile.mdx | 55 +++++
.../current/commands/browser/url.mdx | 63 ++++++
.../current/commands/browser/waitUntil.mdx | 61 ++++++
.../current/quickstart/index.mdx | 104 ++++++++++
44 files changed, 2849 insertions(+), 2 deletions(-)
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/$$.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/$.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/action.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/actions.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/addCommand.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/assertView.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/call.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/debug.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/deleteCookies.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/execute.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/executeAsync.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/executionContext.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/getConfig.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/getCookies.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/getMeta.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/getPuppeteer.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/getWindowSize.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/keys.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/mock.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/mockClearAll.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/mockRestoreAll.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/newWindow.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/openAndWait.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/overwriteCommand.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/pause.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/reactDollar.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/reactDollarDollar.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/reloadSession.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/savePDF.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/saveRecordingScreen.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/saveScreenshot.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/scroll.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/setCookies.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/setMeta.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/setTimeout.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/setWindowSize.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/switchWindow.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/throttle.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/touchAction.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/uploadFile.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/url.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/commands/browser/waitUntil.mdx
create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/quickstart/index.mdx
diff --git a/docs/quickstart/index.mdx b/docs/quickstart/index.mdx
index 956127b..a00aa62 100644
--- a/docs/quickstart/index.mdx
+++ b/docs/quickstart/index.mdx
@@ -3,8 +3,6 @@ import TabItem from "@theme/TabItem";
# Быстрый старт
-Прежде всего, убедитесь, что ваша система удовлетворяет нужным требованиям.
-
## Установка {#install}
Запустите установщик testplane с помощью `npm`.
diff --git a/i18n/en/docusaurus-plugin-content-docs/current/commands/browser/$$.mdx b/i18n/en/docusaurus-plugin-content-docs/current/commands/browser/$$.mdx
new file mode 100644
index 0000000..2b71523
--- /dev/null
+++ b/i18n/en/docusaurus-plugin-content-docs/current/commands/browser/$$.mdx
@@ -0,0 +1,96 @@
+---
+slug: _dollardollar
+sidebar_label: $$
+---
+
+import Admonition from "@theme/Admonition";
+
+# $$
+
+## Overview {#overview}
+
+Use the `$$` command instead of [findElements][find-elements] as a shorter command to get multiple elements on the page.
+
+The `$$` command returns an array with the desired elements, on each of which you can call action commands without passing the selector. However, if you do pass a selector, it will first find the corresponding element and then call the action for that element.
+
+You can chain `$` or `$$` together to traverse down the DOM tree.
+
+
**Name** | **Type** | **Description** |
selector | String or Function | Selector or JS function to get multiple elements. |
**Name** | **Type** | **Description** |
selector | String or Function or Matcher | Selector or JS function to get a specific element. |
**Name** | **Type** | **Description** |
name | String | Custom command name. |
callback | Function | Command implementation function. |
elementScope | Boolean | If the value is _true_, add the command to the element instead of the browser. Default: _false_. |
**Name** | **Type** | **Description** |
[state](#state) | String | Required parameter. The name of the test state. It must be unique within a single test. |
[selector](#selector) | String or String[] | Required parameter. The DOM element selector to capture. |
[options](#options) | Object | Settings for the _assertView_ command. |
**Option** | +**Type** | +**Description** | +
ignoreElements | +Array or String | ++ Elements (specified as selectors) that will be ignored when comparing screenshots. + Ignoring is implemented by painting the listed elements black. For a single element, + the parameter can be set as a string. + | +
tolerance | +Number | ++ Sensitivity to color differences. The value overrides + [browsers.tolerance][browsers-tolerance]. + | +
antialiasingTolerance | +Number | ++ Sensitivity to anti-aliasing. The value overrides + [browsers.antialiasingTolerance][browsers-antialiasing-tolerance]. + | +
allowViewportOverflow | +Boolean | ++ By default, Testplane throws an error if the element is outside the viewport + boundaries. This parameter disables boundary checks, allowing screenshots of + elements that don't fully fit in the viewport. On the screenshot, only the parts of + the element that fit into the viewport will be visible. However, if _compositeImage_ + is set to _true_, the parts of the element that are below the viewport boundary will + also be visible in the screenshot. Similarly, if _captureElementFromTop_ is set to + _true_, the parts of the element that are above the viewport boundary will also be + captured in the screenshot. + | +
captureElementFromTop | +Boolean | ++ Capture the screenshot of the element from the very top. If the element is outside + the viewport, it will be scrolled into view. + | +
compositeImage | +Boolean | ++ If the element does not fit into the viewport, multiple screenshots of different + parts of the element will be taken sequentially, and then stitched together into one + to display the entire element. + | +
screenshotDelay | +Number | ++ Delay in milliseconds before taking a screenshot. Useful when there are elements + with animations on the page, or a scrollbar that does not disappear immediately and + appears in the resulting screenshot. + | +
selectorToScroll | +String | ++ Selector to scroll. Useful when you need to take a screenshot of a modal window that + doesn’t fit on the screen. Otherwise, without specifying a selector, the scroll will + be applied to the _window_ object, scrolling the background while keeping the popup + window in place. + | +
disableAnimation | +Boolean | ++ Disable animations and transitions when taking a screenshot. Default is `true` + starting from version `8.0.0`. + | +
ignoreDiffPixelCount | +`` `${number}%` `` or Number | ++ The percentage of pixels to ignore during the diff. Useful to ignore very small + differences. Default is `0`. Available starting from version `8.2.0`. + | +
**Name** | **Type** | **Description** |
callback | Function | The function to call. |
**Name** | **Type** | **Description** |
names | String or String[] | Optional parameter. The cookie name or list of cookie names to delete. If the parameter is missing, all cookies for the current page will be deleted. |
**Name** | **Type** | **Description** |
script | String or Function | The script to be executed. |
arguments | Any | Optional parameter. Arguments for the script. |
**Name** | **Type** | **Description** |
script | String or Function | The script to be executed. |
arguments | Any | Arguments for the script. The last argument must be a callback function, which will be called once the script has been executed. |
**Name** | **Type** | **Description** |
names | String or String[] | Optional parameter. The name of the cookie or list of cookie names to get. If the parameter is missing, all cookies for the current page will be returned. |
**Name** | **Type** | **Description** |
key | String | Optional parameter. The key whose value needs to be retrieved from the test metadata. |
**Name** | +**Type** | +**Description** | +
value | +String or String[] | +The sequence of keys to type. | +
**Name** | **Type** | **Description** |
url | String | The URL of the request to mock. |
method | String or Function | The HTTP method to filter the resource. |
headers | Object or Function | The request headers to filter the resource. |
responseHeaders | Object or Function | The response headers to filter the resource. |
postData | String or Function | The request postData to filter the resource. |
statusCode | Number or Function | The status code to filter the resource. |
**Name** | **Type** | **Description** |
url | String | The URL of the website to open. |
windowName | String | The name of the new window. |
windowFeatures | String | Settings for the new window, such as size, position, scrollbars, etc. |
**Name** | **Type** | **Description** |
url | String | The page URL. |
WaitOpts | Object | Page waiting parameters. Optional, as are all its fields. |
**Name** | **Type** | **Description** |
selector | String\|String[] | Selector(s) of element(s) that must exist on the loaded page. |
predicate | () => Promise<bool> \| bool | Predicate that returns `true` if the page is loaded. Executed in the browser context: [waitUntil](https://webdriver.io/docs/api/element/waitUntil). |
waitNetworkIdle | Boolean | If `true`, waits for the completion of all network requests. Default is `true`. Only works in CDP browsers; ignored for others. |
waitNetworkIdleTimeout | Number | Time (in milliseconds) after the completion of all network requests to consider the network idle. Default is 500. |
failOnNetworkError | Boolean | Whether to throw an error on network errors. Default is `true`. Only works in CDP browsers; ignored for others. |
shouldThrowError | (match) => Boolean | Predicate that should return `true` by [Match](https://webdriver.io/docs/api/mock#match) if the network error is considered critical for proper page loading. By default, returns `true` for images, styles, and fonts. |
ignoreNetworkErrorsPatterns | Array<String \| RegExp> | Patterns of resource URLs for which load success checks are ignored. Takes precedence over `shouldThrowError`. |
timeout | Number | Page load timeout. By default, the `pageLoadTimeout` value is used. An exception is thrown if selectors still do not exist or the predicate still resolves to `false` after the time has elapsed. |
**Name** | **Type** | **Description** |
name | String | The name of the custom command. |
callback | Function | The function implementation of the command. |
elementScope | Boolean | If the value is _true_, add the command to the element instead of the browser. Default: _false_. |
**Name** | **Type** | **Description** |
milliseconds | Number | Time in milliseconds. |
**Name** | **Type** | **Description** |
reactComponentSelector | String | The React component selector. |
props | Object | React properties the component should have. |
state | Any or Any[] | React state the component should be in. |
**Name** | **Type** | **Description** |
reactComponentSelector | String | The React component selector. |
props | Object | React properties the component should have. |
state | Any or Any[] | React state the component should be in. |
**Name** | **Type** | **Description** |
filepath | String | Path to the PDF file relative to the execution directory (the _.pdf_ extension is mandatory). |
orientation | String | Orientation of the PDF page. |
scale | Number | Scale of the PDF page. |
background | Boolean | Include the background in the PDF. |
width | Number | Width of the PDF page. |
height | Number | Height of the PDF page. |
top | Number | Top margin of the PDF page. |
bottom | Number | Bottom margin of the PDF page. |
left | Number | Left margin of the PDF page. |
right | Number | Right margin of the PDF page. |
shrinkToFit | Number | Shrink the page to fit the PDF page size. |
pageRanges | Object[] | Range of pages to include in the PDF. |
**Name** | **Type** | **Description** |
filepath | String | Full or relative path to the video file from the execution directory. |
**Name** | **Type** | **Description** |
filepath | String | The path to the screenshot relative to the execution directory (the _.png_ extension is mandatory). |
**Name** | **Type** | **Description** |
x | Number | Optional parameter. The x-coordinate to scroll to. Default: _0_. |
y | Number | Optional parameter. The y-coordinate to scroll to. Default: _0_. |
**Name** | **Type** | **Description** |
cookies | WebDriver.Cookie or WebDriver.Cookie[] | A cookie object or an array of cookie objects. |
**Name** | **Type** | **Default** | **Description** |
name | String | _N/A_ | The name of the cookie. |
value | String | _N/A_ | The value of the cookie. |
path | String | "/" | The path of the cookie. |
domain | String | _see description_ | The domain the cookie is visible to. If omitted, defaults to the domain of the current document's URL in the browser context. |
secure | Boolean | false | The secure flag of the cookie. |
httpOnly | Boolean | false | The HTTP-only flag of the cookie. |
expiry | Number | _not set_ | The expiry date of the cookie as the number of seconds since the Unix epoch. |
sameSite | String | "None" | The SameSite attribute of the cookie. Valid values are _"Lax"_ or _"Strict"_. |
**Name** | **Type** | **Description** |
key | String | The key whose value needs to be written in the test's metadata. |
value | String | The value to be saved in the test's metadata. |
**Name** | **Type** | **Description** |
implicit | Number | Time in milliseconds for retrying element location when searching for an element. |
pageLoad | Number | Time to wait for the document to load, in milliseconds. |
script | Number | Timeout for scripts run using [execute][execute] or [executeAsync][execute-async], in milliseconds. |
**Name** | **Type** | **Description** |
width | Number | The width of the browser window to set. |
height | Number | The height of the browser window to set. |
**Name** | **Type** | **Description** |
urlOrTitleToMatch | String or RegExp | A string or regular expression matching the page's title or URL. |
**Name** | **Type** | **Description** |
offline | Boolean | Enable emulation of a loss of connection. |
latency | Number | Minimum latency from the sent request to received response headers, in milliseconds. |
downloadThroughput | Number | Maximum total download throughput (bytes/sec). _-1_ disables download throttling. |
uploadThroughput | Number | Maximum total upload throughput (bytes/sec). _-1_ disables upload throttling. |
**Name** | **Type** | **Description** |
action | Object | The action to perform. |
**Name** | **Type** | **Description** |
localPath | String | The path to the local file. |
**Name** | **Type** | **Description** |
url | String | The URL to open. |
**Name** | **Type** | **Default** | **Description** |
condition | Function | _N/A_ | The condition to wait for. |
timeout | Number | 5000 | Timeout in milliseconds. |
timeoutMsg | String | _N/A_ | Error message to throw when the timeout is reached. |
interval | Number | 500 | Interval in milliseconds between condition checks. |