askui 0.18.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/annotation/annotation-writer.js.map +1 -0
- package/dist/cjs/core/annotation/annotation.js.map +1 -0
- package/dist/cjs/core/inference-response/inference-response.js.map +1 -0
- package/dist/cjs/core/inference-response/invalid-model-type-error.js.map +1 -0
- package/dist/cjs/core/inference-response/model-type.js.map +1 -0
- package/dist/cjs/core/model/annotation-result/annotation-interface.js.map +1 -0
- package/dist/cjs/core/model/annotation-result/boundary-box.js.map +1 -0
- package/dist/cjs/core/model/annotation-result/detected-element.js.map +1 -0
- package/dist/cjs/core/model/custom-element-json.d.ts +32 -15
- package/dist/cjs/core/model/custom-element-json.js.map +1 -0
- package/dist/cjs/core/model/custom-element.d.ts +3 -2
- package/dist/cjs/core/model/custom-element.js +4 -2
- package/dist/cjs/core/model/custom-element.js.map +1 -0
- package/dist/cjs/core/reporting/default-step.js.map +1 -0
- package/dist/cjs/core/reporting/index.js.map +1 -0
- package/dist/cjs/core/reporting/instruction.js.map +1 -0
- package/dist/cjs/core/reporting/reporter-config.js.map +1 -0
- package/dist/cjs/core/reporting/reporter.js.map +1 -0
- package/dist/cjs/core/reporting/snapshot-detail-level.js.map +1 -0
- package/dist/cjs/core/reporting/snapshot.js.map +1 -0
- package/dist/cjs/core/reporting/step-reporter.js +15 -6
- package/dist/cjs/core/reporting/step-reporter.js.map +1 -0
- package/dist/cjs/core/reporting/step-run.js.map +1 -0
- package/dist/cjs/core/reporting/step-status-end.js.map +1 -0
- package/dist/cjs/core/reporting/step-status.js.map +1 -0
- package/dist/cjs/core/reporting/step.js.map +1 -0
- package/dist/cjs/core/runner-protocol/index.js.map +1 -0
- package/dist/cjs/core/runner-protocol/request/capture-screenshot-request.js.map +1 -0
- package/dist/cjs/core/runner-protocol/request/control-request.js.map +1 -0
- package/dist/cjs/core/runner-protocol/request/get-server-process-pid.js.map +1 -0
- package/dist/cjs/core/runner-protocol/request/index.js.map +1 -0
- package/dist/cjs/core/runner-protocol/request/interactive-annotation-request.js.map +1 -0
- package/dist/cjs/core/runner-protocol/request/read-recording-request.js.map +1 -0
- package/dist/cjs/core/runner-protocol/request/runner-protocol-request.js.map +1 -0
- package/dist/cjs/core/runner-protocol/request/start-recording-request.js.map +1 -0
- package/dist/cjs/core/runner-protocol/request/stop-recording-request.js.map +1 -0
- package/dist/cjs/core/runner-protocol/response/index.js.map +1 -0
- package/dist/cjs/core/ui-control-commands/action.js.map +1 -0
- package/dist/cjs/core/ui-control-commands/control-command-code.js.map +1 -0
- package/dist/cjs/core/ui-control-commands/control-command.js.map +1 -0
- package/dist/cjs/core/ui-control-commands/index.js.map +1 -0
- package/dist/cjs/core/ui-control-commands/input-event.js.map +1 -0
- package/dist/cjs/execution/config-error.js.map +1 -0
- package/dist/cjs/execution/control-command-error.js.map +1 -0
- package/dist/cjs/execution/credentials-args.js.map +1 -0
- package/dist/cjs/execution/dsl.d.ts +361 -96
- package/dist/cjs/execution/dsl.js +361 -96
- package/dist/cjs/execution/dsl.js.map +1 -0
- package/dist/cjs/execution/execution-runtime.js.map +1 -0
- package/dist/cjs/execution/index.js.map +1 -0
- package/dist/cjs/execution/inference-client.js +9 -4
- package/dist/cjs/execution/inference-client.js.map +1 -0
- package/dist/cjs/execution/inference-response-error.js.map +1 -0
- package/dist/cjs/execution/is-image-required-interface.js.map +1 -0
- package/dist/cjs/execution/misc.js.map +1 -0
- package/dist/cjs/execution/model-composition-branch.js.map +1 -0
- package/dist/cjs/execution/read-environment-credentials.js.map +1 -0
- package/dist/cjs/execution/read-recording-response-stream-handler.js.map +1 -0
- package/dist/cjs/execution/repeat-error.js.map +1 -0
- package/dist/cjs/execution/ui-control-client-dependency-builder.js +3 -3
- package/dist/cjs/execution/ui-control-client-dependency-builder.js.map +1 -0
- package/dist/cjs/execution/ui-control-client.js.map +1 -0
- package/dist/cjs/execution/ui-controller-client-connection-state.js.map +1 -0
- package/dist/cjs/execution/ui-controller-client-error.js.map +1 -0
- package/dist/cjs/execution/ui-controller-client-interface.d.ts +2 -0
- package/dist/cjs/execution/ui-controller-client-interface.js.map +1 -0
- package/dist/cjs/execution/ui-controller-client.d.ts +1 -0
- package/dist/cjs/execution/ui-controller-client.js +11 -1
- package/dist/cjs/execution/ui-controller-client.js.map +1 -0
- package/dist/cjs/execution/ui-controller-not-connected-error.d.ts +4 -0
- package/dist/cjs/execution/ui-controller-not-connected-error.js +12 -0
- package/dist/cjs/lib/download-binaries.js.map +1 -0
- package/dist/cjs/lib/index.js.map +1 -0
- package/dist/cjs/lib/interactive_cli/add-script-package-json.d.ts +1 -0
- package/dist/cjs/lib/interactive_cli/add-script-package-json.js +39 -0
- package/dist/cjs/lib/interactive_cli/add-script-package-json.js.map +1 -0
- package/dist/cjs/lib/interactive_cli/cli-options-interface.js.map +1 -0
- package/dist/cjs/lib/interactive_cli/cli.js.map +1 -0
- package/dist/cjs/lib/interactive_cli/create-example-project.js.map +1 -0
- package/dist/cjs/lib/interactive_cli/index.js.map +1 -0
- package/dist/cjs/lib/libfuse-error.js.map +1 -0
- package/dist/cjs/lib/logger.js.map +1 -0
- package/dist/cjs/lib/timeout-error.js.map +1 -0
- package/dist/cjs/lib/ui-controller-args.js.map +1 -0
- package/dist/cjs/lib/ui-controller-darwin.js.map +1 -0
- package/dist/cjs/lib/ui-controller-facade.js.map +1 -0
- package/dist/cjs/lib/ui-controller-linux.js.map +1 -0
- package/dist/cjs/lib/ui-controller-win32.js.map +1 -0
- package/dist/cjs/lib/ui-controller.js.map +1 -0
- package/dist/cjs/lib/unkown-error.js.map +1 -0
- package/dist/cjs/lib/wayland-error.js.map +1 -0
- package/dist/cjs/main.js.map +1 -0
- package/dist/cjs/shared/index.js.map +1 -0
- package/dist/cjs/shared/log-levels.js.map +1 -0
- package/dist/cjs/shared/proxy-agent-args.js.map +1 -0
- package/dist/cjs/utils/analytics/analytics-interface.js.map +1 -0
- package/dist/cjs/utils/analytics/analytics.d.ts +2 -0
- package/dist/cjs/utils/analytics/analytics.js +5 -0
- package/dist/cjs/utils/analytics/analytics.js.map +1 -0
- package/dist/cjs/utils/analytics/index.js.map +1 -0
- package/dist/cjs/utils/analytics/installation-timestamp-create-error.js.map +1 -0
- package/dist/cjs/utils/analytics/installation-timestamp-get-error.js.map +1 -0
- package/dist/cjs/utils/analytics/installation-timestamp.js.map +1 -0
- package/dist/cjs/utils/analytics/user-identifier-interface.js.map +1 -0
- package/dist/cjs/utils/analytics/user-identifier.js.map +1 -0
- package/dist/cjs/utils/base_64_image/base-64-image-error.js.map +1 -0
- package/dist/cjs/utils/base_64_image/base-64-image-string-error.js.map +1 -0
- package/dist/cjs/utils/base_64_image/base-64-image.js.map +1 -0
- package/dist/cjs/utils/base_64_image/sharp.js.map +1 -0
- package/dist/cjs/utils/http/credentials.js.map +1 -0
- package/dist/cjs/utils/http/custom-errors/authentication-http-client-error.js.map +1 -0
- package/dist/cjs/utils/http/custom-errors/client-http-client-error.js.map +1 -0
- package/dist/cjs/utils/http/custom-errors/general-http-client-error.js.map +1 -0
- package/dist/cjs/utils/http/custom-errors/http-client-error.js.map +1 -0
- package/dist/cjs/utils/http/custom-errors/index.js +1 -1
- package/dist/cjs/utils/http/custom-errors/index.js.map +1 -0
- package/dist/cjs/utils/http/custom-errors/server-http-client-error.js.map +1 -0
- package/dist/cjs/utils/http/custom-errors/unkown-http-client-error.js.map +1 -0
- package/dist/cjs/utils/http/http-client-got.js +46 -20
- package/dist/cjs/utils/http/http-client-got.js.map +1 -0
- package/dist/cjs/utils/http/index.js.map +1 -0
- package/dist/cjs/utils/image-resize-errors/image-resizing-base-error.js.map +1 -0
- package/dist/cjs/utils/image-resize-errors/index.js.map +1 -0
- package/dist/cjs/utils/path.js.map +1 -0
- package/dist/cjs/utils/proxy/proxy-builder.js.map +1 -0
- package/dist/cjs/utils/resized-image-interface.js.map +1 -0
- package/dist/cjs/utils/transformations.js.map +1 -0
- package/dist/esm/core/annotation/annotation-writer.js.map +1 -0
- package/dist/esm/core/annotation/annotation.js.map +1 -0
- package/dist/esm/core/inference-response/inference-response.js.map +1 -0
- package/dist/esm/core/inference-response/invalid-model-type-error.js.map +1 -0
- package/dist/esm/core/inference-response/model-type.js.map +1 -0
- package/dist/esm/core/model/annotation-result/annotation-interface.js.map +1 -0
- package/dist/esm/core/model/annotation-result/boundary-box.js.map +1 -0
- package/dist/esm/core/model/annotation-result/detected-element.js.map +1 -0
- package/dist/esm/core/model/custom-element-json.d.ts +32 -15
- package/dist/esm/core/model/custom-element-json.js.map +1 -0
- package/dist/esm/core/model/custom-element.d.ts +3 -2
- package/dist/esm/core/model/custom-element.js +4 -2
- package/dist/esm/core/model/custom-element.js.map +1 -0
- package/dist/esm/core/reporting/default-step.js.map +1 -0
- package/dist/esm/core/reporting/index.js.map +1 -0
- package/dist/esm/core/reporting/instruction.js.map +1 -0
- package/dist/esm/core/reporting/reporter-config.js.map +1 -0
- package/dist/esm/core/reporting/reporter.js.map +1 -0
- package/dist/esm/core/reporting/snapshot-detail-level.js.map +1 -0
- package/dist/esm/core/reporting/snapshot.js.map +1 -0
- package/dist/esm/core/reporting/step-reporter.js +15 -6
- package/dist/esm/core/reporting/step-reporter.js.map +1 -0
- package/dist/esm/core/reporting/step-run.js.map +1 -0
- package/dist/esm/core/reporting/step-status-end.js.map +1 -0
- package/dist/esm/core/reporting/step-status.js.map +1 -0
- package/dist/esm/core/reporting/step.js.map +1 -0
- package/dist/esm/core/runner-protocol/index.js.map +1 -0
- package/dist/esm/core/runner-protocol/request/capture-screenshot-request.js.map +1 -0
- package/dist/esm/core/runner-protocol/request/control-request.js.map +1 -0
- package/dist/esm/core/runner-protocol/request/get-server-process-pid.js.map +1 -0
- package/dist/esm/core/runner-protocol/request/index.js.map +1 -0
- package/dist/esm/core/runner-protocol/request/interactive-annotation-request.js.map +1 -0
- package/dist/esm/core/runner-protocol/request/read-recording-request.js.map +1 -0
- package/dist/esm/core/runner-protocol/request/runner-protocol-request.js.map +1 -0
- package/dist/esm/core/runner-protocol/request/start-recording-request.js.map +1 -0
- package/dist/esm/core/runner-protocol/request/stop-recording-request.js.map +1 -0
- package/dist/esm/core/runner-protocol/response/index.js.map +1 -0
- package/dist/esm/core/ui-control-commands/action.js.map +1 -0
- package/dist/esm/core/ui-control-commands/control-command-code.js.map +1 -0
- package/dist/esm/core/ui-control-commands/control-command.js.map +1 -0
- package/dist/esm/core/ui-control-commands/index.js.map +1 -0
- package/dist/esm/core/ui-control-commands/input-event.js.map +1 -0
- package/dist/esm/execution/config-error.js.map +1 -0
- package/dist/esm/execution/control-command-error.js.map +1 -0
- package/dist/esm/execution/credentials-args.js.map +1 -0
- package/dist/esm/execution/dsl.d.ts +361 -96
- package/dist/esm/execution/dsl.js +361 -96
- package/dist/esm/execution/dsl.js.map +1 -0
- package/dist/esm/execution/execution-runtime.js.map +1 -0
- package/dist/esm/execution/index.js.map +1 -0
- package/dist/esm/execution/inference-client.js +9 -4
- package/dist/esm/execution/inference-client.js.map +1 -0
- package/dist/esm/execution/inference-response-error.js.map +1 -0
- package/dist/esm/execution/is-image-required-interface.js.map +1 -0
- package/dist/esm/execution/misc.js.map +1 -0
- package/dist/esm/execution/model-composition-branch.js.map +1 -0
- package/dist/esm/execution/read-environment-credentials.js.map +1 -0
- package/dist/esm/execution/read-recording-response-stream-handler.js.map +1 -0
- package/dist/esm/execution/repeat-error.js.map +1 -0
- package/dist/esm/execution/ui-control-client-dependency-builder.js +3 -3
- package/dist/esm/execution/ui-control-client-dependency-builder.js.map +1 -0
- package/dist/esm/execution/ui-control-client.js.map +1 -0
- package/dist/esm/execution/ui-controller-client-connection-state.js.map +1 -0
- package/dist/esm/execution/ui-controller-client-error.js.map +1 -0
- package/dist/esm/execution/ui-controller-client-interface.d.ts +2 -0
- package/dist/esm/execution/ui-controller-client-interface.js.map +1 -0
- package/dist/esm/execution/ui-controller-client.d.ts +1 -0
- package/dist/esm/execution/ui-controller-client.js +11 -1
- package/dist/esm/execution/ui-controller-client.js.map +1 -0
- package/dist/esm/execution/ui-controller-not-connected-error.d.ts +4 -0
- package/dist/esm/execution/ui-controller-not-connected-error.js +8 -0
- package/dist/esm/lib/download-binaries.js.map +1 -0
- package/dist/esm/lib/index.js.map +1 -0
- package/dist/esm/lib/interactive_cli/add-script-package-json.d.ts +1 -0
- package/dist/esm/lib/interactive_cli/add-script-package-json.js +32 -0
- package/dist/esm/lib/interactive_cli/add-script-package-json.js.map +1 -0
- package/dist/esm/lib/interactive_cli/cli-options-interface.js.map +1 -0
- package/dist/esm/lib/interactive_cli/cli.js.map +1 -0
- package/dist/esm/lib/interactive_cli/create-example-project.js.map +1 -0
- package/dist/esm/lib/interactive_cli/index.js.map +1 -0
- package/dist/esm/lib/libfuse-error.js.map +1 -0
- package/dist/esm/lib/logger.js.map +1 -0
- package/dist/esm/lib/timeout-error.js.map +1 -0
- package/dist/esm/lib/ui-controller-args.js.map +1 -0
- package/dist/esm/lib/ui-controller-darwin.js.map +1 -0
- package/dist/esm/lib/ui-controller-facade.js.map +1 -0
- package/dist/esm/lib/ui-controller-linux.js.map +1 -0
- package/dist/esm/lib/ui-controller-win32.js.map +1 -0
- package/dist/esm/lib/ui-controller.js.map +1 -0
- package/dist/esm/lib/unkown-error.js.map +1 -0
- package/dist/esm/lib/wayland-error.js.map +1 -0
- package/dist/esm/main.js.map +1 -0
- package/dist/esm/shared/index.js.map +1 -0
- package/dist/esm/shared/log-levels.js.map +1 -0
- package/dist/esm/shared/proxy-agent-args.js.map +1 -0
- package/dist/esm/utils/analytics/analytics-interface.js.map +1 -0
- package/dist/esm/utils/analytics/analytics.d.ts +2 -0
- package/dist/esm/utils/analytics/analytics.js +5 -0
- package/dist/esm/utils/analytics/analytics.js.map +1 -0
- package/dist/esm/utils/analytics/index.js.map +1 -0
- package/dist/esm/utils/analytics/installation-timestamp-create-error.js.map +1 -0
- package/dist/esm/utils/analytics/installation-timestamp-get-error.js.map +1 -0
- package/dist/esm/utils/analytics/installation-timestamp.js.map +1 -0
- package/dist/esm/utils/analytics/user-identifier-interface.js.map +1 -0
- package/dist/esm/utils/analytics/user-identifier.js.map +1 -0
- package/dist/esm/utils/base_64_image/base-64-image-error.js.map +1 -0
- package/dist/esm/utils/base_64_image/base-64-image-string-error.js.map +1 -0
- package/dist/esm/utils/base_64_image/base-64-image.js.map +1 -0
- package/dist/esm/utils/base_64_image/sharp.js.map +1 -0
- package/dist/esm/utils/http/credentials.js.map +1 -0
- package/dist/esm/utils/http/custom-errors/authentication-http-client-error.js.map +1 -0
- package/dist/esm/utils/http/custom-errors/client-http-client-error.js.map +1 -0
- package/dist/esm/utils/http/custom-errors/general-http-client-error.js.map +1 -0
- package/dist/esm/utils/http/custom-errors/http-client-error.js.map +1 -0
- package/dist/esm/utils/http/custom-errors/index.js +1 -1
- package/dist/esm/utils/http/custom-errors/index.js.map +1 -0
- package/dist/esm/utils/http/custom-errors/server-http-client-error.js.map +1 -0
- package/dist/esm/utils/http/custom-errors/unkown-http-client-error.js.map +1 -0
- package/dist/esm/utils/http/http-client-got.js +46 -20
- package/dist/esm/utils/http/http-client-got.js.map +1 -0
- package/dist/esm/utils/http/index.js.map +1 -0
- package/dist/esm/utils/image-resize-errors/image-resizing-base-error.js.map +1 -0
- package/dist/esm/utils/image-resize-errors/index.js.map +1 -0
- package/dist/esm/utils/path.js.map +1 -0
- package/dist/esm/utils/proxy/proxy-builder.js.map +1 -0
- package/dist/esm/utils/resized-image-interface.js.map +1 -0
- package/dist/esm/utils/transformations.js.map +1 -0
- package/dist/example_projects_templates/configs/jasmine.config.json +12 -0
- package/package.json +1 -1
|
@@ -147,9 +147,11 @@ class FluentFilters extends FluentBase {
|
|
|
147
147
|
*
|
|
148
148
|
* **Examples:**
|
|
149
149
|
* ```typescript
|
|
150
|
-
* await aui.
|
|
150
|
+
* await aui.click().button().contains().text().withText('Google Search').exec()
|
|
151
151
|
* ```
|
|
152
152
|
*
|
|
153
|
+
* 
|
|
154
|
+
*
|
|
153
155
|
* @return {FluentFiltersOrRelations}
|
|
154
156
|
*/
|
|
155
157
|
button() {
|
|
@@ -209,13 +211,20 @@ class FluentFilters extends FluentBase {
|
|
|
209
211
|
/**
|
|
210
212
|
* Filters for an UI element 'text'.
|
|
211
213
|
*
|
|
212
|
-
*
|
|
214
|
+
* Takes an optional parameter to filter for a specific text.
|
|
215
|
+
* See the examples below.
|
|
216
|
+
*
|
|
213
217
|
* See also the filters `withTextRegex()` and `withExactText()`
|
|
214
218
|
*
|
|
215
219
|
* **Examples:**
|
|
216
220
|
* ```typescript
|
|
217
|
-
* await aui.click().text().
|
|
221
|
+
* await aui.click().text().exec();
|
|
222
|
+
* await aui.click().text('Username').exec();
|
|
223
|
+
*
|
|
224
|
+
* // Matching with an exact text
|
|
218
225
|
* await aui.click().text().withExactText('Username').exec();
|
|
226
|
+
*
|
|
227
|
+
* // Matching with a regex
|
|
219
228
|
* await aui.click().text().withTextRegex('\b[Ss]\w+').exec();
|
|
220
229
|
* ```
|
|
221
230
|
*
|
|
@@ -239,6 +248,8 @@ class FluentFilters extends FluentBase {
|
|
|
239
248
|
* icon().withText('plus')
|
|
240
249
|
* ```
|
|
241
250
|
*
|
|
251
|
+
* 
|
|
252
|
+
*
|
|
242
253
|
* **Note:** This is an alpha feature. The prediction of the icon name is sometimes unstable. Use custom elements as an alternative.
|
|
243
254
|
*
|
|
244
255
|
* @return {FluentFiltersOrRelations}
|
|
@@ -249,7 +260,9 @@ class FluentFilters extends FluentBase {
|
|
|
249
260
|
return new FluentFiltersOrRelations(this);
|
|
250
261
|
}
|
|
251
262
|
/**
|
|
252
|
-
* Filters for a 'custom element', that is a UI element which is defined by providing an image and other parameters such as degree of rotation. It allows filtering for a UI element
|
|
263
|
+
* Filters for a 'custom element', that is a UI element which is defined by providing an image and other parameters such as degree of rotation. It allows filtering for a UI element based on an image instead of using text or element descriptions like `button().withText('Submit')` in `await aui.click().button().withText('Submit').exec()`.
|
|
264
|
+
*
|
|
265
|
+
* See the tutorial - [Custom Element](https://docs.askui.com/docs/general/Tutorials/custom-element) for more detail.
|
|
253
266
|
*
|
|
254
267
|
* **Example**
|
|
255
268
|
* ```typescript
|
|
@@ -259,6 +272,7 @@ class FluentFilters extends FluentBase {
|
|
|
259
272
|
* customImage: './logo.png', // required
|
|
260
273
|
* name: 'myLogo', // optional
|
|
261
274
|
* threshold: 0.9, // optional, defaults to 0.9
|
|
275
|
+
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
262
276
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
263
277
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
264
278
|
* // mask:{x:0, y:0}[] // optional, a polygon to match only a certain area of the custom element
|
|
@@ -273,12 +287,13 @@ class FluentFilters extends FluentBase {
|
|
|
273
287
|
* - **name** (*`string`, optional*):
|
|
274
288
|
* - A unique name that can be used for filtering for the custom element. If not given, any text inside the custom image will be detected via OCR.
|
|
275
289
|
* - **threshold** (*`number`, optional*):
|
|
276
|
-
* - A threshold for how much a UI element needs to be similar to the custom element as defined. Takes values between `0.0` (== all elements are recognized as the custom element which is probably not what you want) and `1.0` (== elements need to look exactly like the `customImage` which is unlikely to be achieved as even minor differences count). Defaults to `0.9`.
|
|
290
|
+
* - A threshold for how much a UI element needs to be similar to the custom element as defined by the image. Takes values between `0.0` (== all elements are recognized as the custom element which is probably not what you want) and `1.0` (== elements need to look exactly like the `customImage` which is unlikely to be achieved as even minor differences count). Defaults to `0.9`.
|
|
291
|
+
* - **stopThreshold** (*`number`, optional*):
|
|
292
|
+
* - A threshold for when to stop searching for UI elements similar to the custom element. As soon as UI elements have been found that are at least as similar as the `stopThreshold`, the search is going to stop. After that elements are filtered using the `threshold`. Because of that the `stopThreshold` should be greater than or equal to `threshold`. It is primarily to be used as a speed improvement (by lowering the value). Takes values between `0.0` and `1.0`. Defaults to `0.9`.
|
|
277
293
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
278
294
|
* - Step size in rotation degree. Rotates the custom image by this step size until 360° is exceeded. The range is from `0` to `360`. Defaults to `0`.
|
|
279
|
-
* - **imageCompareFormat** (*`'RGB' | 'grayscale'`, optional*):
|
|
280
|
-
* - The color compare style. 'greyscale' compares the brightness of each pixel whereas 'RGB' compares all three
|
|
281
|
-
* of the given custom image.
|
|
295
|
+
* - **imageCompareFormat** (*`'RGB' | 'grayscale' | 'edges'`, optional*):
|
|
296
|
+
* - The color compare style. 'edges' compares only edges, 'greyscale' compares the brightness of each pixel whereas 'RGB' compares all three colors (red, green, blue). Defaults to 'grayscale'.
|
|
282
297
|
*
|
|
283
298
|
*
|
|
284
299
|
* @param {CustomElementJson} customElement - The custom element to filter for.
|
|
@@ -301,10 +316,14 @@ class FluentFilters extends FluentBase {
|
|
|
301
316
|
* await aui.click().image().exec();
|
|
302
317
|
*
|
|
303
318
|
* // Works if you have an image with
|
|
304
|
-
* // a
|
|
305
|
-
* await aui.click().image().above().text().withText('
|
|
319
|
+
* // a text below
|
|
320
|
+
* await aui.click().image().above().text().withText('Automating WebGL').exec();
|
|
306
321
|
* ```
|
|
307
322
|
*
|
|
323
|
+
* 
|
|
324
|
+
*
|
|
325
|
+
*
|
|
326
|
+
*
|
|
308
327
|
* @return {FluentFiltersOrRelations}
|
|
309
328
|
*/
|
|
310
329
|
image() {
|
|
@@ -325,6 +344,10 @@ class FluentFilters extends FluentBase {
|
|
|
325
344
|
* await aui.typeIn('Oh yeah').textfield().below().text().withText('E-Mail Address').exec();
|
|
326
345
|
* ```
|
|
327
346
|
*
|
|
347
|
+
* 
|
|
348
|
+
*
|
|
349
|
+
*
|
|
350
|
+
*
|
|
328
351
|
* @return {FluentFiltersOrRelations}
|
|
329
352
|
*/
|
|
330
353
|
textfield() {
|
|
@@ -333,7 +356,13 @@ class FluentFilters extends FluentBase {
|
|
|
333
356
|
return new FluentFiltersOrRelations(this);
|
|
334
357
|
}
|
|
335
358
|
/**
|
|
336
|
-
* Filters for similar
|
|
359
|
+
* Filters for similar -- meaning >70% similar -- text.
|
|
360
|
+
*
|
|
361
|
+
* Takes an optional parameter to specify the similarity. Usually you need the optional parameter for long texts you want to match precisely.
|
|
362
|
+
*
|
|
363
|
+
* _We use [RapidFuzz](https://maxbachmann.github.io/RapidFuzz/Usage/fuzz.html#ratio) which calculates the similarity like this:_
|
|
364
|
+
*
|
|
365
|
+
* `1 - (distance / (lengthString1 + lengthString2))`
|
|
337
366
|
*
|
|
338
367
|
* **Examples:**
|
|
339
368
|
* ```typescript
|
|
@@ -348,6 +377,11 @@ class FluentFilters extends FluentBase {
|
|
|
348
377
|
* // usually false
|
|
349
378
|
* 'atebxtc' === withText('text') => false
|
|
350
379
|
* 'other' === withText('text') => false
|
|
380
|
+
*
|
|
381
|
+
* // optional parameter: similarity_score
|
|
382
|
+
* '978-0-201-00650-6' == withText('978-0-201-00') => true with 82.76 similarity
|
|
383
|
+
* '978-0-201-00650-6' == withText('978-0-201-00', 90) => false with 82.76 < 90 similarity
|
|
384
|
+
* '978-0-201-00650-6' == withText('978-0-201-00', 90) => true with 93.75 < 90 similarity
|
|
351
385
|
* ```
|
|
352
386
|
* 
|
|
353
387
|
*
|
|
@@ -378,6 +412,10 @@ class FluentFilters extends FluentBase {
|
|
|
378
412
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
379
413
|
* ```
|
|
380
414
|
*
|
|
415
|
+
* 
|
|
416
|
+
*
|
|
417
|
+
*
|
|
418
|
+
*
|
|
381
419
|
* @param {string} regex_pattern - A regex pattern
|
|
382
420
|
*
|
|
383
421
|
* @return {FluentFiltersOrRelations}
|
|
@@ -406,6 +444,10 @@ class FluentFilters extends FluentBase {
|
|
|
406
444
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
407
445
|
* ```
|
|
408
446
|
*
|
|
447
|
+
* 
|
|
448
|
+
*
|
|
449
|
+
*
|
|
450
|
+
*
|
|
409
451
|
* @param {string} text - A text to be matched.
|
|
410
452
|
*
|
|
411
453
|
* @return {FluentFiltersOrRelations}
|
|
@@ -442,12 +484,13 @@ class FluentFilters extends FluentBase {
|
|
|
442
484
|
/**
|
|
443
485
|
* Filters elements based on a textual description.
|
|
444
486
|
*
|
|
445
|
-
*
|
|
487
|
+
* **What Should I Write as Matching Text**
|
|
488
|
+
*
|
|
446
489
|
* The text description inside the `matching()` should describe the element visually.
|
|
447
490
|
* It understands color, some famous company/product names, general descriptions.
|
|
448
491
|
*
|
|
449
|
-
* It sometimes requires a bit of playing to find a matching description:
|
|
450
|
-
* E.g. `puzzle piece` can fail
|
|
492
|
+
* It sometimes requires a bit of playing around to find a matching description:
|
|
493
|
+
* E.g. `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
451
494
|
* Generally the more detail the better.
|
|
452
495
|
*
|
|
453
496
|
* **Examples:**
|
|
@@ -611,14 +654,19 @@ class FluentFiltersOrRelations extends FluentFilters {
|
|
|
611
654
|
/**
|
|
612
655
|
* Filters for an element right of another element.
|
|
613
656
|
*
|
|
657
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
658
|
+
*
|
|
614
659
|
* **Examples:**
|
|
615
660
|
* ```typescript
|
|
616
|
-
* -------------- --------------
|
|
617
|
-
* | leftEl | |
|
|
618
|
-
* -------------- --------------
|
|
661
|
+
* -------------- -------------- --------------
|
|
662
|
+
* | leftEl | | rightEl0 | | rightEl1 |
|
|
663
|
+
* -------------- -------------- --------------
|
|
619
664
|
*
|
|
620
|
-
* // Returns
|
|
665
|
+
* // Returns rightEl0 because rightEl0 is the first element right of leftEl
|
|
621
666
|
* ...rightEl().rightOf().leftEl()
|
|
667
|
+
* ...rightEl().rightOf(0).leftEl()
|
|
668
|
+
* // Returns rightEl1 because rightEl1 is the second element right of leftEl
|
|
669
|
+
* ...rightEl().rightOf(1).leftEl()
|
|
622
670
|
* // Returns no element because leftEl is left of rightEl
|
|
623
671
|
* ...leftEl().rightOf().rightEl()
|
|
624
672
|
* ```
|
|
@@ -638,14 +686,19 @@ class FluentFiltersOrRelations extends FluentFilters {
|
|
|
638
686
|
/**
|
|
639
687
|
* Filters for an element left of another element.
|
|
640
688
|
*
|
|
689
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
690
|
+
*
|
|
641
691
|
* **Examples:**
|
|
642
692
|
* ```typescript
|
|
643
|
-
* -------------- --------------
|
|
644
|
-
* |
|
|
645
|
-
* -------------- --------------
|
|
693
|
+
* -------------- -------------- --------------
|
|
694
|
+
* | leftEl1 | | leftEl0 | | rightEl |
|
|
695
|
+
* -------------- -------------- --------------
|
|
646
696
|
*
|
|
647
|
-
* // Returns
|
|
697
|
+
* // Returns leftEl0 because leftEl0 is the first element left of rightEl
|
|
648
698
|
* ...leftEl().leftOf().rightEl()
|
|
699
|
+
* ...leftEl().leftOf(0).rightEl()
|
|
700
|
+
* // Returns leftEl1 because leftEl1 is the second element left of rightEl
|
|
701
|
+
* ...leftEl().leftOf(1).rightEl()
|
|
649
702
|
* // Returns no element because rightEl is left of leftEl
|
|
650
703
|
* ...rightEl().leftOf().leftEl()
|
|
651
704
|
* ```
|
|
@@ -665,17 +718,25 @@ class FluentFiltersOrRelations extends FluentFilters {
|
|
|
665
718
|
/**
|
|
666
719
|
* Filters for an element below another element.
|
|
667
720
|
*
|
|
721
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
722
|
+
*
|
|
668
723
|
* **Examples:**
|
|
669
724
|
* ```typescript
|
|
670
725
|
* --------------
|
|
671
726
|
* | text |
|
|
672
727
|
* --------------
|
|
673
728
|
* --------------
|
|
674
|
-
* |
|
|
729
|
+
* | button0 |
|
|
730
|
+
* --------------
|
|
731
|
+
* --------------
|
|
732
|
+
* | button1 |
|
|
675
733
|
* --------------
|
|
676
734
|
*
|
|
677
|
-
* // Returns
|
|
735
|
+
* // Returns button0 because button0 is the first button below text
|
|
678
736
|
* ...button().below().text()
|
|
737
|
+
* ...button().below(0).text()
|
|
738
|
+
* // Returns button1 because button1 is the second button below text
|
|
739
|
+
* ...button().below(1).text()
|
|
679
740
|
* // Returns no element because text is above button
|
|
680
741
|
* ...text().below().button()
|
|
681
742
|
* ```
|
|
@@ -694,17 +755,25 @@ class FluentFiltersOrRelations extends FluentFilters {
|
|
|
694
755
|
/**
|
|
695
756
|
* Filters for an element above another element.
|
|
696
757
|
*
|
|
758
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
759
|
+
*
|
|
697
760
|
* **Examples:**
|
|
698
761
|
* ```typescript
|
|
699
762
|
* --------------
|
|
700
|
-
* |
|
|
763
|
+
* | text1 |
|
|
764
|
+
* --------------
|
|
765
|
+
* --------------
|
|
766
|
+
* | text0 |
|
|
701
767
|
* --------------
|
|
702
768
|
* --------------
|
|
703
769
|
* | button |
|
|
704
770
|
* --------------
|
|
705
771
|
*
|
|
706
|
-
* // Returns
|
|
772
|
+
* // Returns text0 because text0 is the first element above button
|
|
707
773
|
* ...text().above().button()
|
|
774
|
+
* ...text().above(0).button()
|
|
775
|
+
* // Returns text1 because text1 is the second element above button
|
|
776
|
+
* ...text().above(1).button()
|
|
708
777
|
* // Returns no element because button is below text
|
|
709
778
|
* ...button().above().text()
|
|
710
779
|
* ```
|
|
@@ -870,9 +939,11 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
870
939
|
*
|
|
871
940
|
* **Examples:**
|
|
872
941
|
* ```typescript
|
|
873
|
-
* await aui.
|
|
942
|
+
* await aui.click().button().contains().text().withText('Google Search').exec()
|
|
874
943
|
* ```
|
|
875
944
|
*
|
|
945
|
+
* 
|
|
946
|
+
*
|
|
876
947
|
* @return {FluentFiltersOrRelationsCondition}
|
|
877
948
|
*/
|
|
878
949
|
button() {
|
|
@@ -932,13 +1003,20 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
932
1003
|
/**
|
|
933
1004
|
* Filters for an UI element 'text'.
|
|
934
1005
|
*
|
|
935
|
-
*
|
|
1006
|
+
* Takes an optional parameter to filter for a specific text.
|
|
1007
|
+
* See the examples below.
|
|
1008
|
+
*
|
|
936
1009
|
* See also the filters `withTextRegex()` and `withExactText()`
|
|
937
1010
|
*
|
|
938
1011
|
* **Examples:**
|
|
939
1012
|
* ```typescript
|
|
940
|
-
* await aui.click().text().
|
|
1013
|
+
* await aui.click().text().exec();
|
|
1014
|
+
* await aui.click().text('Username').exec();
|
|
1015
|
+
*
|
|
1016
|
+
* // Matching with an exact text
|
|
941
1017
|
* await aui.click().text().withExactText('Username').exec();
|
|
1018
|
+
*
|
|
1019
|
+
* // Matching with a regex
|
|
942
1020
|
* await aui.click().text().withTextRegex('\b[Ss]\w+').exec();
|
|
943
1021
|
* ```
|
|
944
1022
|
*
|
|
@@ -962,6 +1040,8 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
962
1040
|
* icon().withText('plus')
|
|
963
1041
|
* ```
|
|
964
1042
|
*
|
|
1043
|
+
* 
|
|
1044
|
+
*
|
|
965
1045
|
* **Note:** This is an alpha feature. The prediction of the icon name is sometimes unstable. Use custom elements as an alternative.
|
|
966
1046
|
*
|
|
967
1047
|
* @return {FluentFiltersOrRelationsCondition}
|
|
@@ -972,7 +1052,9 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
972
1052
|
return new FluentFiltersOrRelationsCondition(this);
|
|
973
1053
|
}
|
|
974
1054
|
/**
|
|
975
|
-
* Filters for a 'custom element', that is a UI element which is defined by providing an image and other parameters such as degree of rotation. It allows filtering for a UI element
|
|
1055
|
+
* Filters for a 'custom element', that is a UI element which is defined by providing an image and other parameters such as degree of rotation. It allows filtering for a UI element based on an image instead of using text or element descriptions like `button().withText('Submit')` in `await aui.click().button().withText('Submit').exec()`.
|
|
1056
|
+
*
|
|
1057
|
+
* See the tutorial - [Custom Element](https://docs.askui.com/docs/general/Tutorials/custom-element) for more detail.
|
|
976
1058
|
*
|
|
977
1059
|
* **Example**
|
|
978
1060
|
* ```typescript
|
|
@@ -982,6 +1064,7 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
982
1064
|
* customImage: './logo.png', // required
|
|
983
1065
|
* name: 'myLogo', // optional
|
|
984
1066
|
* threshold: 0.9, // optional, defaults to 0.9
|
|
1067
|
+
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
985
1068
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
986
1069
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
987
1070
|
* // mask:{x:0, y:0}[] // optional, a polygon to match only a certain area of the custom element
|
|
@@ -996,12 +1079,13 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
996
1079
|
* - **name** (*`string`, optional*):
|
|
997
1080
|
* - A unique name that can be used for filtering for the custom element. If not given, any text inside the custom image will be detected via OCR.
|
|
998
1081
|
* - **threshold** (*`number`, optional*):
|
|
999
|
-
* - A threshold for how much a UI element needs to be similar to the custom element as defined. Takes values between `0.0` (== all elements are recognized as the custom element which is probably not what you want) and `1.0` (== elements need to look exactly like the `customImage` which is unlikely to be achieved as even minor differences count). Defaults to `0.9`.
|
|
1082
|
+
* - A threshold for how much a UI element needs to be similar to the custom element as defined by the image. Takes values between `0.0` (== all elements are recognized as the custom element which is probably not what you want) and `1.0` (== elements need to look exactly like the `customImage` which is unlikely to be achieved as even minor differences count). Defaults to `0.9`.
|
|
1083
|
+
* - **stopThreshold** (*`number`, optional*):
|
|
1084
|
+
* - A threshold for when to stop searching for UI elements similar to the custom element. As soon as UI elements have been found that are at least as similar as the `stopThreshold`, the search is going to stop. After that elements are filtered using the `threshold`. Because of that the `stopThreshold` should be greater than or equal to `threshold`. It is primarily to be used as a speed improvement (by lowering the value). Takes values between `0.0` and `1.0`. Defaults to `0.9`.
|
|
1000
1085
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
1001
1086
|
* - Step size in rotation degree. Rotates the custom image by this step size until 360° is exceeded. The range is from `0` to `360`. Defaults to `0`.
|
|
1002
|
-
* - **imageCompareFormat** (*`'RGB' | 'grayscale'`, optional*):
|
|
1003
|
-
* - The color compare style. 'greyscale' compares the brightness of each pixel whereas 'RGB' compares all three
|
|
1004
|
-
* of the given custom image.
|
|
1087
|
+
* - **imageCompareFormat** (*`'RGB' | 'grayscale' | 'edges'`, optional*):
|
|
1088
|
+
* - The color compare style. 'edges' compares only edges, 'greyscale' compares the brightness of each pixel whereas 'RGB' compares all three colors (red, green, blue). Defaults to 'grayscale'.
|
|
1005
1089
|
*
|
|
1006
1090
|
*
|
|
1007
1091
|
* @param {CustomElementJson} customElement - The custom element to filter for.
|
|
@@ -1024,10 +1108,14 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1024
1108
|
* await aui.click().image().exec();
|
|
1025
1109
|
*
|
|
1026
1110
|
* // Works if you have an image with
|
|
1027
|
-
* // a
|
|
1028
|
-
* await aui.click().image().above().text().withText('
|
|
1111
|
+
* // a text below
|
|
1112
|
+
* await aui.click().image().above().text().withText('Automating WebGL').exec();
|
|
1029
1113
|
* ```
|
|
1030
1114
|
*
|
|
1115
|
+
* 
|
|
1116
|
+
*
|
|
1117
|
+
*
|
|
1118
|
+
*
|
|
1031
1119
|
* @return {FluentFiltersOrRelationsCondition}
|
|
1032
1120
|
*/
|
|
1033
1121
|
image() {
|
|
@@ -1048,6 +1136,10 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1048
1136
|
* await aui.typeIn('Oh yeah').textfield().below().text().withText('E-Mail Address').exec();
|
|
1049
1137
|
* ```
|
|
1050
1138
|
*
|
|
1139
|
+
* 
|
|
1140
|
+
*
|
|
1141
|
+
*
|
|
1142
|
+
*
|
|
1051
1143
|
* @return {FluentFiltersOrRelationsCondition}
|
|
1052
1144
|
*/
|
|
1053
1145
|
textfield() {
|
|
@@ -1056,7 +1148,13 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1056
1148
|
return new FluentFiltersOrRelationsCondition(this);
|
|
1057
1149
|
}
|
|
1058
1150
|
/**
|
|
1059
|
-
* Filters for similar
|
|
1151
|
+
* Filters for similar -- meaning >70% similar -- text.
|
|
1152
|
+
*
|
|
1153
|
+
* Takes an optional parameter to specify the similarity. Usually you need the optional parameter for long texts you want to match precisely.
|
|
1154
|
+
*
|
|
1155
|
+
* _We use [RapidFuzz](https://maxbachmann.github.io/RapidFuzz/Usage/fuzz.html#ratio) which calculates the similarity like this:_
|
|
1156
|
+
*
|
|
1157
|
+
* `1 - (distance / (lengthString1 + lengthString2))`
|
|
1060
1158
|
*
|
|
1061
1159
|
* **Examples:**
|
|
1062
1160
|
* ```typescript
|
|
@@ -1071,6 +1169,11 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1071
1169
|
* // usually false
|
|
1072
1170
|
* 'atebxtc' === withText('text') => false
|
|
1073
1171
|
* 'other' === withText('text') => false
|
|
1172
|
+
*
|
|
1173
|
+
* // optional parameter: similarity_score
|
|
1174
|
+
* '978-0-201-00650-6' == withText('978-0-201-00') => true with 82.76 similarity
|
|
1175
|
+
* '978-0-201-00650-6' == withText('978-0-201-00', 90) => false with 82.76 < 90 similarity
|
|
1176
|
+
* '978-0-201-00650-6' == withText('978-0-201-00', 90) => true with 93.75 < 90 similarity
|
|
1074
1177
|
* ```
|
|
1075
1178
|
* 
|
|
1076
1179
|
*
|
|
@@ -1101,6 +1204,10 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1101
1204
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
1102
1205
|
* ```
|
|
1103
1206
|
*
|
|
1207
|
+
* 
|
|
1208
|
+
*
|
|
1209
|
+
*
|
|
1210
|
+
*
|
|
1104
1211
|
* @param {string} regex_pattern - A regex pattern
|
|
1105
1212
|
*
|
|
1106
1213
|
* @return {FluentFiltersOrRelationsCondition}
|
|
@@ -1129,6 +1236,10 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1129
1236
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
1130
1237
|
* ```
|
|
1131
1238
|
*
|
|
1239
|
+
* 
|
|
1240
|
+
*
|
|
1241
|
+
*
|
|
1242
|
+
*
|
|
1132
1243
|
* @param {string} text - A text to be matched.
|
|
1133
1244
|
*
|
|
1134
1245
|
* @return {FluentFiltersOrRelationsCondition}
|
|
@@ -1165,12 +1276,13 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1165
1276
|
/**
|
|
1166
1277
|
* Filters elements based on a textual description.
|
|
1167
1278
|
*
|
|
1168
|
-
*
|
|
1279
|
+
* **What Should I Write as Matching Text**
|
|
1280
|
+
*
|
|
1169
1281
|
* The text description inside the `matching()` should describe the element visually.
|
|
1170
1282
|
* It understands color, some famous company/product names, general descriptions.
|
|
1171
1283
|
*
|
|
1172
|
-
* It sometimes requires a bit of playing to find a matching description:
|
|
1173
|
-
* E.g. `puzzle piece` can fail
|
|
1284
|
+
* It sometimes requires a bit of playing around to find a matching description:
|
|
1285
|
+
* E.g. `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
1174
1286
|
* Generally the more detail the better.
|
|
1175
1287
|
*
|
|
1176
1288
|
* **Examples:**
|
|
@@ -1334,14 +1446,19 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1334
1446
|
/**
|
|
1335
1447
|
* Filters for an element right of another element.
|
|
1336
1448
|
*
|
|
1449
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
1450
|
+
*
|
|
1337
1451
|
* **Examples:**
|
|
1338
1452
|
* ```typescript
|
|
1339
|
-
* -------------- --------------
|
|
1340
|
-
* | leftEl | |
|
|
1341
|
-
* -------------- --------------
|
|
1453
|
+
* -------------- -------------- --------------
|
|
1454
|
+
* | leftEl | | rightEl0 | | rightEl1 |
|
|
1455
|
+
* -------------- -------------- --------------
|
|
1342
1456
|
*
|
|
1343
|
-
* // Returns
|
|
1457
|
+
* // Returns rightEl0 because rightEl0 is the first element right of leftEl
|
|
1344
1458
|
* ...rightEl().rightOf().leftEl()
|
|
1459
|
+
* ...rightEl().rightOf(0).leftEl()
|
|
1460
|
+
* // Returns rightEl1 because rightEl1 is the second element right of leftEl
|
|
1461
|
+
* ...rightEl().rightOf(1).leftEl()
|
|
1345
1462
|
* // Returns no element because leftEl is left of rightEl
|
|
1346
1463
|
* ...leftEl().rightOf().rightEl()
|
|
1347
1464
|
* ```
|
|
@@ -1361,14 +1478,19 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1361
1478
|
/**
|
|
1362
1479
|
* Filters for an element left of another element.
|
|
1363
1480
|
*
|
|
1481
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
1482
|
+
*
|
|
1364
1483
|
* **Examples:**
|
|
1365
1484
|
* ```typescript
|
|
1366
|
-
* -------------- --------------
|
|
1367
|
-
* |
|
|
1368
|
-
* -------------- --------------
|
|
1485
|
+
* -------------- -------------- --------------
|
|
1486
|
+
* | leftEl1 | | leftEl0 | | rightEl |
|
|
1487
|
+
* -------------- -------------- --------------
|
|
1369
1488
|
*
|
|
1370
|
-
* // Returns
|
|
1489
|
+
* // Returns leftEl0 because leftEl0 is the first element left of rightEl
|
|
1371
1490
|
* ...leftEl().leftOf().rightEl()
|
|
1491
|
+
* ...leftEl().leftOf(0).rightEl()
|
|
1492
|
+
* // Returns leftEl1 because leftEl1 is the second element left of rightEl
|
|
1493
|
+
* ...leftEl().leftOf(1).rightEl()
|
|
1372
1494
|
* // Returns no element because rightEl is left of leftEl
|
|
1373
1495
|
* ...rightEl().leftOf().leftEl()
|
|
1374
1496
|
* ```
|
|
@@ -1388,17 +1510,25 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1388
1510
|
/**
|
|
1389
1511
|
* Filters for an element below another element.
|
|
1390
1512
|
*
|
|
1513
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
1514
|
+
*
|
|
1391
1515
|
* **Examples:**
|
|
1392
1516
|
* ```typescript
|
|
1393
1517
|
* --------------
|
|
1394
1518
|
* | text |
|
|
1395
1519
|
* --------------
|
|
1396
1520
|
* --------------
|
|
1397
|
-
* |
|
|
1521
|
+
* | button0 |
|
|
1522
|
+
* --------------
|
|
1523
|
+
* --------------
|
|
1524
|
+
* | button1 |
|
|
1398
1525
|
* --------------
|
|
1399
1526
|
*
|
|
1400
|
-
* // Returns
|
|
1527
|
+
* // Returns button0 because button0 is the first button below text
|
|
1401
1528
|
* ...button().below().text()
|
|
1529
|
+
* ...button().below(0).text()
|
|
1530
|
+
* // Returns button1 because button1 is the second button below text
|
|
1531
|
+
* ...button().below(1).text()
|
|
1402
1532
|
* // Returns no element because text is above button
|
|
1403
1533
|
* ...text().below().button()
|
|
1404
1534
|
* ```
|
|
@@ -1417,17 +1547,25 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1417
1547
|
/**
|
|
1418
1548
|
* Filters for an element above another element.
|
|
1419
1549
|
*
|
|
1550
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
1551
|
+
*
|
|
1420
1552
|
* **Examples:**
|
|
1421
1553
|
* ```typescript
|
|
1422
1554
|
* --------------
|
|
1423
|
-
* |
|
|
1555
|
+
* | text1 |
|
|
1556
|
+
* --------------
|
|
1557
|
+
* --------------
|
|
1558
|
+
* | text0 |
|
|
1424
1559
|
* --------------
|
|
1425
1560
|
* --------------
|
|
1426
1561
|
* | button |
|
|
1427
1562
|
* --------------
|
|
1428
1563
|
*
|
|
1429
|
-
* // Returns
|
|
1564
|
+
* // Returns text0 because text0 is the first element above button
|
|
1430
1565
|
* ...text().above().button()
|
|
1566
|
+
* ...text().above(0).button()
|
|
1567
|
+
* // Returns text1 because text1 is the second element above button
|
|
1568
|
+
* ...text().above(1).button()
|
|
1431
1569
|
* // Returns no element because button is below text
|
|
1432
1570
|
* ...button().above().text()
|
|
1433
1571
|
* ```
|
|
@@ -1511,12 +1649,12 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1511
1649
|
* **Examples:**
|
|
1512
1650
|
* ```typescript
|
|
1513
1651
|
* // Stops execution at this point when the element does not exist.
|
|
1514
|
-
* await aui.expect().text(
|
|
1652
|
+
* await aui.expect().text('Login').exists().exec()
|
|
1515
1653
|
*
|
|
1516
1654
|
* // This will catch the error and log a message
|
|
1517
1655
|
* // But the execution will continue afterwards
|
|
1518
1656
|
* try {
|
|
1519
|
-
* await aui.expect().text(
|
|
1657
|
+
* await aui.expect().text('Login').exists().exec()
|
|
1520
1658
|
* } catch (error) {
|
|
1521
1659
|
* console.log('Too bad we could not find the element!');
|
|
1522
1660
|
* }
|
|
@@ -1539,12 +1677,12 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1539
1677
|
* **Examples:**
|
|
1540
1678
|
* ```typescript
|
|
1541
1679
|
* // Stops execution at this point when the element does exist.
|
|
1542
|
-
* await aui.expect().text(
|
|
1680
|
+
* await aui.expect().text('Login').notExists().exec()
|
|
1543
1681
|
*
|
|
1544
1682
|
* // This will catch the error and log a message
|
|
1545
1683
|
* // But the execution will continue afterwards
|
|
1546
1684
|
* try {
|
|
1547
|
-
* await aui.expect().text(
|
|
1685
|
+
* await aui.expect().text('Login').notExists().exec()
|
|
1548
1686
|
* } catch (error) {
|
|
1549
1687
|
* console.log('Too bad we could find the element!');
|
|
1550
1688
|
* }
|
|
@@ -1574,8 +1712,8 @@ class FluentCommand extends FluentBase {
|
|
|
1574
1712
|
*
|
|
1575
1713
|
* **Examples:**
|
|
1576
1714
|
* ```typescript
|
|
1577
|
-
* await aui.expect().text(
|
|
1578
|
-
* await aui.expect().text(
|
|
1715
|
+
* await aui.expect().text('Login').exists().exec()
|
|
1716
|
+
* await aui.expect().text('Login').notExists().exec()
|
|
1579
1717
|
* ```
|
|
1580
1718
|
*
|
|
1581
1719
|
* @return {FluentFiltersCondition}
|
|
@@ -1592,9 +1730,13 @@ class FluentCommand extends FluentBase {
|
|
|
1592
1730
|
*
|
|
1593
1731
|
* **Example:**
|
|
1594
1732
|
* ```typescript
|
|
1595
|
-
* await aui.click().button().withText('
|
|
1733
|
+
* await aui.click().button().withText('Google Search').exec();
|
|
1596
1734
|
* ```
|
|
1597
1735
|
*
|
|
1736
|
+
* 
|
|
1737
|
+
*
|
|
1738
|
+
*
|
|
1739
|
+
*
|
|
1598
1740
|
* @return {FluentFilters}
|
|
1599
1741
|
*/
|
|
1600
1742
|
click() {
|
|
@@ -1608,9 +1750,13 @@ class FluentCommand extends FluentBase {
|
|
|
1608
1750
|
*
|
|
1609
1751
|
* **Example:**
|
|
1610
1752
|
* ```typescript
|
|
1611
|
-
* await aui.moveMouseTo().
|
|
1753
|
+
* await aui.moveMouseTo().text().withText('Grinning_Face').exec()
|
|
1612
1754
|
* ```
|
|
1613
1755
|
*
|
|
1756
|
+
* 
|
|
1757
|
+
*
|
|
1758
|
+
*
|
|
1759
|
+
*
|
|
1614
1760
|
* @return {FluentFilters}
|
|
1615
1761
|
*/
|
|
1616
1762
|
moveMouseTo() {
|
|
@@ -1652,9 +1798,11 @@ class FluentCommand extends FluentBase {
|
|
|
1652
1798
|
*
|
|
1653
1799
|
* **Example:**
|
|
1654
1800
|
* ```typescript
|
|
1655
|
-
* await aui.
|
|
1801
|
+
* await aui.scrollInside(0,-500).text().withText('Bottom sheet').exec();
|
|
1656
1802
|
* ```
|
|
1657
1803
|
*
|
|
1804
|
+
* 
|
|
1805
|
+
*
|
|
1658
1806
|
* @param {number} x_offset - A (positive/negative) x direction.
|
|
1659
1807
|
* @param {number} y_offset - A (positive/negative) y direction.
|
|
1660
1808
|
*
|
|
@@ -1731,12 +1879,14 @@ class FluentCommand extends FluentBase {
|
|
|
1731
1879
|
*
|
|
1732
1880
|
* **Examples:**
|
|
1733
1881
|
* ```typescript
|
|
1734
|
-
* await aui.type('
|
|
1882
|
+
* await aui.type('askui@askui.com').exec()
|
|
1735
1883
|
*
|
|
1736
1884
|
* // mask the text so it is not send to the askui-inference server
|
|
1737
1885
|
* await aui.type('Type some text', { isSecret: true, secretMask: '**' }).exec()
|
|
1738
1886
|
* ```
|
|
1739
1887
|
*
|
|
1888
|
+
* 
|
|
1889
|
+
*
|
|
1740
1890
|
* @param {string} text - A text to type
|
|
1741
1891
|
*
|
|
1742
1892
|
* @return {Exec}
|
|
@@ -1752,9 +1902,11 @@ class FluentCommand extends FluentBase {
|
|
|
1752
1902
|
*
|
|
1753
1903
|
* **Example:**
|
|
1754
1904
|
* ```typescript
|
|
1755
|
-
* await aui.moveMouseRelatively(
|
|
1905
|
+
* await aui.moveMouseRelatively(0, 50).exec();
|
|
1756
1906
|
* ```
|
|
1757
1907
|
*
|
|
1908
|
+
* 
|
|
1909
|
+
*
|
|
1758
1910
|
* @param {number} x_offset - A (positive/negative) x direction.
|
|
1759
1911
|
* @param {number} y_offset - A (positive/negative) y direction.
|
|
1760
1912
|
*
|
|
@@ -1784,6 +1936,8 @@ class FluentCommand extends FluentBase {
|
|
|
1784
1936
|
* await aui.moveMouse(500, 500).exec();
|
|
1785
1937
|
* ```
|
|
1786
1938
|
*
|
|
1939
|
+
* 
|
|
1940
|
+
*
|
|
1787
1941
|
* @param {number} x_coordinate - A (positive/negative) x coordinate.
|
|
1788
1942
|
* @param {number} y_coordinate - A (positive/negative) y coordinate.
|
|
1789
1943
|
*
|
|
@@ -1809,10 +1963,12 @@ class FluentCommand extends FluentBase {
|
|
|
1809
1963
|
*
|
|
1810
1964
|
* **Example:**
|
|
1811
1965
|
* ```typescript
|
|
1812
|
-
* // Scroll
|
|
1813
|
-
* await aui.scroll(0,
|
|
1966
|
+
* // Scroll 500 pixels down in y direction
|
|
1967
|
+
* await aui.scroll(0, -500).exec()
|
|
1814
1968
|
* ```
|
|
1815
1969
|
*
|
|
1970
|
+
* 
|
|
1971
|
+
*
|
|
1816
1972
|
* @param {number} x_offset - A (positive/negative) x direction.
|
|
1817
1973
|
* @param {number} y_offset - A (positive/negative) y direction.
|
|
1818
1974
|
*
|
|
@@ -1930,6 +2086,8 @@ class FluentCommand extends FluentBase {
|
|
|
1930
2086
|
* await aui.mouseDoubleLeftClick().exec();
|
|
1931
2087
|
* ```
|
|
1932
2088
|
*
|
|
2089
|
+
* 
|
|
2090
|
+
*
|
|
1933
2091
|
* @return {Exec}
|
|
1934
2092
|
*/
|
|
1935
2093
|
mouseDoubleLeftClick() {
|
|
@@ -1980,11 +2138,17 @@ class FluentCommand extends FluentBase {
|
|
|
1980
2138
|
/**
|
|
1981
2139
|
* Toggles mouse down (Left mouse key/tap).
|
|
1982
2140
|
*
|
|
2141
|
+
* This is the equivalent to **mouse-left-press-and-hold**. It holds the mouse button until the `mouseToogleUp()` is called. Often combined with `mouseToggleUP` to automate **drag-and-drop**.
|
|
2142
|
+
*
|
|
1983
2143
|
* **Example:**
|
|
1984
2144
|
* ```typescript
|
|
1985
2145
|
* await aui.mouseToggleDown().exec();
|
|
2146
|
+
* await aui.moveMouseRelatively(-400,0).exec();
|
|
2147
|
+
* await aui.mouseToggleUp().exec();
|
|
1986
2148
|
* ```
|
|
1987
2149
|
*
|
|
2150
|
+
* 
|
|
2151
|
+
*
|
|
1988
2152
|
* @return {Exec}
|
|
1989
2153
|
*/
|
|
1990
2154
|
mouseToggleDown() {
|
|
@@ -1995,11 +2159,17 @@ class FluentCommand extends FluentBase {
|
|
|
1995
2159
|
/**
|
|
1996
2160
|
* Toggles mouse up (Left mouse key/tap).
|
|
1997
2161
|
*
|
|
2162
|
+
* This is the equivalent to releasing the pressing mouse left button. Often combined with `mouseToggleDown()` to automate **drag-and-drop**.
|
|
2163
|
+
*
|
|
1998
2164
|
* **Example:**
|
|
1999
2165
|
* ```typescript
|
|
2166
|
+
* await aui.mouseToggleDown().exec();
|
|
2167
|
+
* await aui.moveMouseRelatively(-400,0).exec();
|
|
2000
2168
|
* await aui.mouseToggleUp().exec();
|
|
2001
2169
|
* ```
|
|
2002
2170
|
*
|
|
2171
|
+
* 
|
|
2172
|
+
*
|
|
2003
2173
|
* @return {Exec}
|
|
2004
2174
|
*/
|
|
2005
2175
|
mouseToggleUp() {
|
|
@@ -2012,8 +2182,13 @@ class FluentCommand extends FluentBase {
|
|
|
2012
2182
|
*
|
|
2013
2183
|
* **Operating system specific mappings:**
|
|
2014
2184
|
* 1. Windows: `command`-key maps to `windows`-key
|
|
2015
|
-
* ---
|
|
2016
2185
|
*
|
|
2186
|
+
* **Examples:**
|
|
2187
|
+
* ```typescript
|
|
2188
|
+
* await aui.pressThreeKeys('control', 'command' 'space').exec();
|
|
2189
|
+
* ```
|
|
2190
|
+
*
|
|
2191
|
+
* 
|
|
2017
2192
|
*
|
|
2018
2193
|
* @param {MODIFIER_KEY} first_key - A modifier key
|
|
2019
2194
|
* @param {MODIFIER_KEY} second_key - A modifier key
|
|
@@ -2056,8 +2231,13 @@ class FluentCommand extends FluentBase {
|
|
|
2056
2231
|
*
|
|
2057
2232
|
* **Operating system specific mappings:**
|
|
2058
2233
|
* 1. Windows: `command`-key maps to `windows`-key
|
|
2059
|
-
* ---
|
|
2060
2234
|
*
|
|
2235
|
+
* **Examples:**
|
|
2236
|
+
* ```typescript
|
|
2237
|
+
* await aui.pressKey('tab').exec();
|
|
2238
|
+
* ```
|
|
2239
|
+
*
|
|
2240
|
+
* 
|
|
2061
2241
|
*
|
|
2062
2242
|
* @param {PC_AND_MODIFIER_KEY} key - A key
|
|
2063
2243
|
*
|
|
@@ -2090,7 +2270,15 @@ class FluentCommand extends FluentBase {
|
|
|
2090
2270
|
return new Exec(this);
|
|
2091
2271
|
}
|
|
2092
2272
|
/**
|
|
2093
|
-
* Press two Android keys like `
|
|
2273
|
+
* Press two Android keys like `volume_down+power`
|
|
2274
|
+
* See [API docs](https://docs.askui.com/docs/api/Actions/pressandroidtwokey) for available keys.
|
|
2275
|
+
*
|
|
2276
|
+
* **Examples:**
|
|
2277
|
+
* ```typescript
|
|
2278
|
+
* await aui.pressAndroidTwoKey('volume_down', 'power').exec();
|
|
2279
|
+
* ```
|
|
2280
|
+
*
|
|
2281
|
+
* 
|
|
2094
2282
|
*
|
|
2095
2283
|
* @param {ANDROID_KEY} first_key - A Android key
|
|
2096
2284
|
* @param {ANDROID_KEY} second_key - A Android key
|
|
@@ -2107,7 +2295,15 @@ class FluentCommand extends FluentBase {
|
|
|
2107
2295
|
return new Exec(this);
|
|
2108
2296
|
}
|
|
2109
2297
|
/**
|
|
2110
|
-
* Press one Android key like `
|
|
2298
|
+
* Press one Android key like `del`
|
|
2299
|
+
* See [API docs](https://docs.askui.com/docs/api/Actions/pressandroidtwokey) for available keys.
|
|
2300
|
+
*
|
|
2301
|
+
* **Examples:**
|
|
2302
|
+
* ```typescript
|
|
2303
|
+
* await aui.pressAndroidKey('notification').exec();
|
|
2304
|
+
* ```
|
|
2305
|
+
*
|
|
2306
|
+
* 
|
|
2111
2307
|
*
|
|
2112
2308
|
* @param {ANDROID_KEY} key - A Android key
|
|
2113
2309
|
*
|
|
@@ -2216,9 +2412,11 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2216
2412
|
*
|
|
2217
2413
|
* **Examples:**
|
|
2218
2414
|
* ```typescript
|
|
2219
|
-
* await aui.
|
|
2415
|
+
* await aui.click().button().contains().text().withText('Google Search').exec()
|
|
2220
2416
|
* ```
|
|
2221
2417
|
*
|
|
2418
|
+
* 
|
|
2419
|
+
*
|
|
2222
2420
|
* @return {FluentFiltersOrRelationsGetter}
|
|
2223
2421
|
*/
|
|
2224
2422
|
button() {
|
|
@@ -2278,13 +2476,20 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2278
2476
|
/**
|
|
2279
2477
|
* Filters for an UI element 'text'.
|
|
2280
2478
|
*
|
|
2281
|
-
*
|
|
2479
|
+
* Takes an optional parameter to filter for a specific text.
|
|
2480
|
+
* See the examples below.
|
|
2481
|
+
*
|
|
2282
2482
|
* See also the filters `withTextRegex()` and `withExactText()`
|
|
2283
2483
|
*
|
|
2284
2484
|
* **Examples:**
|
|
2285
2485
|
* ```typescript
|
|
2286
|
-
* await aui.click().text().
|
|
2486
|
+
* await aui.click().text().exec();
|
|
2487
|
+
* await aui.click().text('Username').exec();
|
|
2488
|
+
*
|
|
2489
|
+
* // Matching with an exact text
|
|
2287
2490
|
* await aui.click().text().withExactText('Username').exec();
|
|
2491
|
+
*
|
|
2492
|
+
* // Matching with a regex
|
|
2288
2493
|
* await aui.click().text().withTextRegex('\b[Ss]\w+').exec();
|
|
2289
2494
|
* ```
|
|
2290
2495
|
*
|
|
@@ -2308,6 +2513,8 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2308
2513
|
* icon().withText('plus')
|
|
2309
2514
|
* ```
|
|
2310
2515
|
*
|
|
2516
|
+
* 
|
|
2517
|
+
*
|
|
2311
2518
|
* **Note:** This is an alpha feature. The prediction of the icon name is sometimes unstable. Use custom elements as an alternative.
|
|
2312
2519
|
*
|
|
2313
2520
|
* @return {FluentFiltersOrRelationsGetter}
|
|
@@ -2318,7 +2525,9 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2318
2525
|
return new FluentFiltersOrRelationsGetter(this);
|
|
2319
2526
|
}
|
|
2320
2527
|
/**
|
|
2321
|
-
* Filters for a 'custom element', that is a UI element which is defined by providing an image and other parameters such as degree of rotation. It allows filtering for a UI element
|
|
2528
|
+
* Filters for a 'custom element', that is a UI element which is defined by providing an image and other parameters such as degree of rotation. It allows filtering for a UI element based on an image instead of using text or element descriptions like `button().withText('Submit')` in `await aui.click().button().withText('Submit').exec()`.
|
|
2529
|
+
*
|
|
2530
|
+
* See the tutorial - [Custom Element](https://docs.askui.com/docs/general/Tutorials/custom-element) for more detail.
|
|
2322
2531
|
*
|
|
2323
2532
|
* **Example**
|
|
2324
2533
|
* ```typescript
|
|
@@ -2328,6 +2537,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2328
2537
|
* customImage: './logo.png', // required
|
|
2329
2538
|
* name: 'myLogo', // optional
|
|
2330
2539
|
* threshold: 0.9, // optional, defaults to 0.9
|
|
2540
|
+
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
2331
2541
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
2332
2542
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
2333
2543
|
* // mask:{x:0, y:0}[] // optional, a polygon to match only a certain area of the custom element
|
|
@@ -2342,12 +2552,13 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2342
2552
|
* - **name** (*`string`, optional*):
|
|
2343
2553
|
* - A unique name that can be used for filtering for the custom element. If not given, any text inside the custom image will be detected via OCR.
|
|
2344
2554
|
* - **threshold** (*`number`, optional*):
|
|
2345
|
-
* - A threshold for how much a UI element needs to be similar to the custom element as defined. Takes values between `0.0` (== all elements are recognized as the custom element which is probably not what you want) and `1.0` (== elements need to look exactly like the `customImage` which is unlikely to be achieved as even minor differences count). Defaults to `0.9`.
|
|
2555
|
+
* - A threshold for how much a UI element needs to be similar to the custom element as defined by the image. Takes values between `0.0` (== all elements are recognized as the custom element which is probably not what you want) and `1.0` (== elements need to look exactly like the `customImage` which is unlikely to be achieved as even minor differences count). Defaults to `0.9`.
|
|
2556
|
+
* - **stopThreshold** (*`number`, optional*):
|
|
2557
|
+
* - A threshold for when to stop searching for UI elements similar to the custom element. As soon as UI elements have been found that are at least as similar as the `stopThreshold`, the search is going to stop. After that elements are filtered using the `threshold`. Because of that the `stopThreshold` should be greater than or equal to `threshold`. It is primarily to be used as a speed improvement (by lowering the value). Takes values between `0.0` and `1.0`. Defaults to `0.9`.
|
|
2346
2558
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
2347
2559
|
* - Step size in rotation degree. Rotates the custom image by this step size until 360° is exceeded. The range is from `0` to `360`. Defaults to `0`.
|
|
2348
|
-
* - **imageCompareFormat** (*`'RGB' | 'grayscale'`, optional*):
|
|
2349
|
-
* - The color compare style. 'greyscale' compares the brightness of each pixel whereas 'RGB' compares all three
|
|
2350
|
-
* of the given custom image.
|
|
2560
|
+
* - **imageCompareFormat** (*`'RGB' | 'grayscale' | 'edges'`, optional*):
|
|
2561
|
+
* - The color compare style. 'edges' compares only edges, 'greyscale' compares the brightness of each pixel whereas 'RGB' compares all three colors (red, green, blue). Defaults to 'grayscale'.
|
|
2351
2562
|
*
|
|
2352
2563
|
*
|
|
2353
2564
|
* @param {CustomElementJson} customElement - The custom element to filter for.
|
|
@@ -2370,10 +2581,14 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2370
2581
|
* await aui.click().image().exec();
|
|
2371
2582
|
*
|
|
2372
2583
|
* // Works if you have an image with
|
|
2373
|
-
* // a
|
|
2374
|
-
* await aui.click().image().above().text().withText('
|
|
2584
|
+
* // a text below
|
|
2585
|
+
* await aui.click().image().above().text().withText('Automating WebGL').exec();
|
|
2375
2586
|
* ```
|
|
2376
2587
|
*
|
|
2588
|
+
* 
|
|
2589
|
+
*
|
|
2590
|
+
*
|
|
2591
|
+
*
|
|
2377
2592
|
* @return {FluentFiltersOrRelationsGetter}
|
|
2378
2593
|
*/
|
|
2379
2594
|
image() {
|
|
@@ -2394,6 +2609,10 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2394
2609
|
* await aui.typeIn('Oh yeah').textfield().below().text().withText('E-Mail Address').exec();
|
|
2395
2610
|
* ```
|
|
2396
2611
|
*
|
|
2612
|
+
* 
|
|
2613
|
+
*
|
|
2614
|
+
*
|
|
2615
|
+
*
|
|
2397
2616
|
* @return {FluentFiltersOrRelationsGetter}
|
|
2398
2617
|
*/
|
|
2399
2618
|
textfield() {
|
|
@@ -2402,7 +2621,13 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2402
2621
|
return new FluentFiltersOrRelationsGetter(this);
|
|
2403
2622
|
}
|
|
2404
2623
|
/**
|
|
2405
|
-
* Filters for similar
|
|
2624
|
+
* Filters for similar -- meaning >70% similar -- text.
|
|
2625
|
+
*
|
|
2626
|
+
* Takes an optional parameter to specify the similarity. Usually you need the optional parameter for long texts you want to match precisely.
|
|
2627
|
+
*
|
|
2628
|
+
* _We use [RapidFuzz](https://maxbachmann.github.io/RapidFuzz/Usage/fuzz.html#ratio) which calculates the similarity like this:_
|
|
2629
|
+
*
|
|
2630
|
+
* `1 - (distance / (lengthString1 + lengthString2))`
|
|
2406
2631
|
*
|
|
2407
2632
|
* **Examples:**
|
|
2408
2633
|
* ```typescript
|
|
@@ -2417,6 +2642,11 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2417
2642
|
* // usually false
|
|
2418
2643
|
* 'atebxtc' === withText('text') => false
|
|
2419
2644
|
* 'other' === withText('text') => false
|
|
2645
|
+
*
|
|
2646
|
+
* // optional parameter: similarity_score
|
|
2647
|
+
* '978-0-201-00650-6' == withText('978-0-201-00') => true with 82.76 similarity
|
|
2648
|
+
* '978-0-201-00650-6' == withText('978-0-201-00', 90) => false with 82.76 < 90 similarity
|
|
2649
|
+
* '978-0-201-00650-6' == withText('978-0-201-00', 90) => true with 93.75 < 90 similarity
|
|
2420
2650
|
* ```
|
|
2421
2651
|
* 
|
|
2422
2652
|
*
|
|
@@ -2447,6 +2677,10 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2447
2677
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
2448
2678
|
* ```
|
|
2449
2679
|
*
|
|
2680
|
+
* 
|
|
2681
|
+
*
|
|
2682
|
+
*
|
|
2683
|
+
*
|
|
2450
2684
|
* @param {string} regex_pattern - A regex pattern
|
|
2451
2685
|
*
|
|
2452
2686
|
* @return {FluentFiltersOrRelationsGetter}
|
|
@@ -2475,6 +2709,10 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2475
2709
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
2476
2710
|
* ```
|
|
2477
2711
|
*
|
|
2712
|
+
* 
|
|
2713
|
+
*
|
|
2714
|
+
*
|
|
2715
|
+
*
|
|
2478
2716
|
* @param {string} text - A text to be matched.
|
|
2479
2717
|
*
|
|
2480
2718
|
* @return {FluentFiltersOrRelationsGetter}
|
|
@@ -2511,12 +2749,13 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2511
2749
|
/**
|
|
2512
2750
|
* Filters elements based on a textual description.
|
|
2513
2751
|
*
|
|
2514
|
-
*
|
|
2752
|
+
* **What Should I Write as Matching Text**
|
|
2753
|
+
*
|
|
2515
2754
|
* The text description inside the `matching()` should describe the element visually.
|
|
2516
2755
|
* It understands color, some famous company/product names, general descriptions.
|
|
2517
2756
|
*
|
|
2518
|
-
* It sometimes requires a bit of playing to find a matching description:
|
|
2519
|
-
* E.g. `puzzle piece` can fail
|
|
2757
|
+
* It sometimes requires a bit of playing around to find a matching description:
|
|
2758
|
+
* E.g. `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
2520
2759
|
* Generally the more detail the better.
|
|
2521
2760
|
*
|
|
2522
2761
|
* **Examples:**
|
|
@@ -2680,14 +2919,19 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
2680
2919
|
/**
|
|
2681
2920
|
* Filters for an element right of another element.
|
|
2682
2921
|
*
|
|
2922
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
2923
|
+
*
|
|
2683
2924
|
* **Examples:**
|
|
2684
2925
|
* ```typescript
|
|
2685
|
-
* -------------- --------------
|
|
2686
|
-
* | leftEl | |
|
|
2687
|
-
* -------------- --------------
|
|
2926
|
+
* -------------- -------------- --------------
|
|
2927
|
+
* | leftEl | | rightEl0 | | rightEl1 |
|
|
2928
|
+
* -------------- -------------- --------------
|
|
2688
2929
|
*
|
|
2689
|
-
* // Returns
|
|
2930
|
+
* // Returns rightEl0 because rightEl0 is the first element right of leftEl
|
|
2690
2931
|
* ...rightEl().rightOf().leftEl()
|
|
2932
|
+
* ...rightEl().rightOf(0).leftEl()
|
|
2933
|
+
* // Returns rightEl1 because rightEl1 is the second element right of leftEl
|
|
2934
|
+
* ...rightEl().rightOf(1).leftEl()
|
|
2691
2935
|
* // Returns no element because leftEl is left of rightEl
|
|
2692
2936
|
* ...leftEl().rightOf().rightEl()
|
|
2693
2937
|
* ```
|
|
@@ -2707,14 +2951,19 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
2707
2951
|
/**
|
|
2708
2952
|
* Filters for an element left of another element.
|
|
2709
2953
|
*
|
|
2954
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
2955
|
+
*
|
|
2710
2956
|
* **Examples:**
|
|
2711
2957
|
* ```typescript
|
|
2712
|
-
* -------------- --------------
|
|
2713
|
-
* |
|
|
2714
|
-
* -------------- --------------
|
|
2958
|
+
* -------------- -------------- --------------
|
|
2959
|
+
* | leftEl1 | | leftEl0 | | rightEl |
|
|
2960
|
+
* -------------- -------------- --------------
|
|
2715
2961
|
*
|
|
2716
|
-
* // Returns
|
|
2962
|
+
* // Returns leftEl0 because leftEl0 is the first element left of rightEl
|
|
2717
2963
|
* ...leftEl().leftOf().rightEl()
|
|
2964
|
+
* ...leftEl().leftOf(0).rightEl()
|
|
2965
|
+
* // Returns leftEl1 because leftEl1 is the second element left of rightEl
|
|
2966
|
+
* ...leftEl().leftOf(1).rightEl()
|
|
2718
2967
|
* // Returns no element because rightEl is left of leftEl
|
|
2719
2968
|
* ...rightEl().leftOf().leftEl()
|
|
2720
2969
|
* ```
|
|
@@ -2734,17 +2983,25 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
2734
2983
|
/**
|
|
2735
2984
|
* Filters for an element below another element.
|
|
2736
2985
|
*
|
|
2986
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
2987
|
+
*
|
|
2737
2988
|
* **Examples:**
|
|
2738
2989
|
* ```typescript
|
|
2739
2990
|
* --------------
|
|
2740
2991
|
* | text |
|
|
2741
2992
|
* --------------
|
|
2742
2993
|
* --------------
|
|
2743
|
-
* |
|
|
2994
|
+
* | button0 |
|
|
2995
|
+
* --------------
|
|
2996
|
+
* --------------
|
|
2997
|
+
* | button1 |
|
|
2744
2998
|
* --------------
|
|
2745
2999
|
*
|
|
2746
|
-
* // Returns
|
|
3000
|
+
* // Returns button0 because button0 is the first button below text
|
|
2747
3001
|
* ...button().below().text()
|
|
3002
|
+
* ...button().below(0).text()
|
|
3003
|
+
* // Returns button1 because button1 is the second button below text
|
|
3004
|
+
* ...button().below(1).text()
|
|
2748
3005
|
* // Returns no element because text is above button
|
|
2749
3006
|
* ...text().below().button()
|
|
2750
3007
|
* ```
|
|
@@ -2763,17 +3020,25 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
2763
3020
|
/**
|
|
2764
3021
|
* Filters for an element above another element.
|
|
2765
3022
|
*
|
|
3023
|
+
* Takes an optional parameter `index` to select the `nth` element (starting with 0)
|
|
3024
|
+
*
|
|
2766
3025
|
* **Examples:**
|
|
2767
3026
|
* ```typescript
|
|
2768
3027
|
* --------------
|
|
2769
|
-
* |
|
|
3028
|
+
* | text1 |
|
|
3029
|
+
* --------------
|
|
3030
|
+
* --------------
|
|
3031
|
+
* | text0 |
|
|
2770
3032
|
* --------------
|
|
2771
3033
|
* --------------
|
|
2772
3034
|
* | button |
|
|
2773
3035
|
* --------------
|
|
2774
3036
|
*
|
|
2775
|
-
* // Returns
|
|
3037
|
+
* // Returns text0 because text0 is the first element above button
|
|
2776
3038
|
* ...text().above().button()
|
|
3039
|
+
* ...text().above(0).button()
|
|
3040
|
+
* // Returns text1 because text1 is the second element above button
|
|
3041
|
+
* ...text().above(1).button()
|
|
2777
3042
|
* // Returns no element because button is below text
|
|
2778
3043
|
* ...button().above().text()
|
|
2779
3044
|
* ```
|
|
@@ -2868,7 +3133,7 @@ class Getter extends FluentCommand {
|
|
|
2868
3133
|
*
|
|
2869
3134
|
* **Examples:**
|
|
2870
3135
|
* ```typescript
|
|
2871
|
-
* const text = await aui.get().text(
|
|
3136
|
+
* const text = await aui.get().text('Sign').exec();
|
|
2872
3137
|
* console.log(text);
|
|
2873
3138
|
* ```
|
|
2874
3139
|
* ```text
|