askui 0.20.1 → 0.20.3
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/model/custom-element-json.d.ts +1 -1
- package/dist/cjs/execution/dsl.d.ts +711 -217
- package/dist/cjs/execution/dsl.js +763 -264
- package/dist/esm/core/model/custom-element-json.d.ts +1 -1
- package/dist/esm/execution/dsl.d.ts +711 -217
- package/dist/esm/execution/dsl.js +763 -264
- package/package.json +3 -3
- package/dist/cjs/core/annotation/annotation-writer.js.map +0 -1
- package/dist/cjs/core/annotation/annotation.js.map +0 -1
- package/dist/cjs/core/inference-response/inference-response.js.map +0 -1
- package/dist/cjs/core/inference-response/invalid-model-type-error.js.map +0 -1
- package/dist/cjs/core/inference-response/model-type.js.map +0 -1
- package/dist/cjs/core/model/annotation-result/annotation-interface.js.map +0 -1
- package/dist/cjs/core/model/annotation-result/boundary-box.js.map +0 -1
- package/dist/cjs/core/model/annotation-result/detected-element.js.map +0 -1
- package/dist/cjs/core/model/custom-element-json.js.map +0 -1
- package/dist/cjs/core/model/custom-element.js.map +0 -1
- package/dist/cjs/core/reporting/default-step.js.map +0 -1
- package/dist/cjs/core/reporting/index.js.map +0 -1
- package/dist/cjs/core/reporting/instruction.js.map +0 -1
- package/dist/cjs/core/reporting/reporter-config.js.map +0 -1
- package/dist/cjs/core/reporting/reporter.js.map +0 -1
- package/dist/cjs/core/reporting/snapshot-detail-level.js.map +0 -1
- package/dist/cjs/core/reporting/snapshot.js.map +0 -1
- package/dist/cjs/core/reporting/step-reporter.js.map +0 -1
- package/dist/cjs/core/reporting/step-run.js.map +0 -1
- package/dist/cjs/core/reporting/step-status-end.js.map +0 -1
- package/dist/cjs/core/reporting/step-status.js.map +0 -1
- package/dist/cjs/core/reporting/step.js.map +0 -1
- package/dist/cjs/core/runner-protocol/index.js.map +0 -1
- package/dist/cjs/core/runner-protocol/request/capture-screenshot-request.js.map +0 -1
- package/dist/cjs/core/runner-protocol/request/control-request.js.map +0 -1
- package/dist/cjs/core/runner-protocol/request/get-server-process-pid.js.map +0 -1
- package/dist/cjs/core/runner-protocol/request/index.js.map +0 -1
- package/dist/cjs/core/runner-protocol/request/interactive-annotation-request.js.map +0 -1
- package/dist/cjs/core/runner-protocol/request/read-recording-request.js.map +0 -1
- package/dist/cjs/core/runner-protocol/request/runner-protocol-request.js.map +0 -1
- package/dist/cjs/core/runner-protocol/request/start-recording-request.js.map +0 -1
- package/dist/cjs/core/runner-protocol/request/stop-recording-request.js.map +0 -1
- package/dist/cjs/core/runner-protocol/response/index.js.map +0 -1
- package/dist/cjs/core/ui-control-commands/action.js.map +0 -1
- package/dist/cjs/core/ui-control-commands/control-command-code.js.map +0 -1
- package/dist/cjs/core/ui-control-commands/control-command.js.map +0 -1
- package/dist/cjs/core/ui-control-commands/index.js.map +0 -1
- package/dist/cjs/core/ui-control-commands/input-event.js.map +0 -1
- package/dist/cjs/execution/config-error.js.map +0 -1
- package/dist/cjs/execution/control-command-error.js.map +0 -1
- package/dist/cjs/execution/credentials-args.js.map +0 -1
- package/dist/cjs/execution/dsl.js.map +0 -1
- package/dist/cjs/execution/execution-runtime.js.map +0 -1
- package/dist/cjs/execution/index.js.map +0 -1
- package/dist/cjs/execution/inference-client.js.map +0 -1
- package/dist/cjs/execution/inference-response-error.js.map +0 -1
- package/dist/cjs/execution/is-image-required-interface.js.map +0 -1
- package/dist/cjs/execution/misc.js.map +0 -1
- package/dist/cjs/execution/model-composition-branch.js.map +0 -1
- package/dist/cjs/execution/read-environment-credentials.js.map +0 -1
- package/dist/cjs/execution/read-recording-response-stream-handler.js.map +0 -1
- package/dist/cjs/execution/repeat-error.js.map +0 -1
- package/dist/cjs/execution/ui-control-client-dependency-builder.js.map +0 -1
- package/dist/cjs/execution/ui-control-client.js.map +0 -1
- package/dist/cjs/execution/ui-controller-client-connection-state.js.map +0 -1
- package/dist/cjs/execution/ui-controller-client-error.js.map +0 -1
- package/dist/cjs/execution/ui-controller-client-interface.js.map +0 -1
- package/dist/cjs/execution/ui-controller-client.js.map +0 -1
- package/dist/cjs/lib/download-binaries.js.map +0 -1
- package/dist/cjs/lib/index.js.map +0 -1
- package/dist/cjs/lib/interactive_cli/add-script-package-json.d.ts +0 -1
- package/dist/cjs/lib/interactive_cli/add-script-package-json.js +0 -39
- package/dist/cjs/lib/interactive_cli/add-script-package-json.js.map +0 -1
- package/dist/cjs/lib/interactive_cli/cli-options-interface.js.map +0 -1
- package/dist/cjs/lib/interactive_cli/cli.js.map +0 -1
- package/dist/cjs/lib/interactive_cli/create-example-project.js.map +0 -1
- package/dist/cjs/lib/interactive_cli/index.js.map +0 -1
- package/dist/cjs/lib/libfuse-error.js.map +0 -1
- package/dist/cjs/lib/logger.js.map +0 -1
- package/dist/cjs/lib/timeout-error.js.map +0 -1
- package/dist/cjs/lib/ui-controller-args.js.map +0 -1
- package/dist/cjs/lib/ui-controller-darwin.js.map +0 -1
- package/dist/cjs/lib/ui-controller-facade.js.map +0 -1
- package/dist/cjs/lib/ui-controller-linux.js.map +0 -1
- package/dist/cjs/lib/ui-controller-win32.js.map +0 -1
- package/dist/cjs/lib/ui-controller.js.map +0 -1
- package/dist/cjs/lib/unkown-error.js.map +0 -1
- package/dist/cjs/lib/wayland-error.js.map +0 -1
- package/dist/cjs/main.js.map +0 -1
- package/dist/cjs/shared/index.js.map +0 -1
- package/dist/cjs/shared/log-levels.js.map +0 -1
- package/dist/cjs/shared/proxy-agent-args.js.map +0 -1
- package/dist/cjs/utils/analytics/analytics-interface.js.map +0 -1
- package/dist/cjs/utils/analytics/analytics.js.map +0 -1
- package/dist/cjs/utils/analytics/index.js.map +0 -1
- package/dist/cjs/utils/analytics/installation-timestamp-create-error.js.map +0 -1
- package/dist/cjs/utils/analytics/installation-timestamp-get-error.js.map +0 -1
- package/dist/cjs/utils/analytics/installation-timestamp.js.map +0 -1
- package/dist/cjs/utils/analytics/user-identifier-interface.js.map +0 -1
- package/dist/cjs/utils/analytics/user-identifier.js.map +0 -1
- package/dist/cjs/utils/base_64_image/base-64-image-error.js.map +0 -1
- package/dist/cjs/utils/base_64_image/base-64-image-string-error.js.map +0 -1
- package/dist/cjs/utils/base_64_image/base-64-image.js.map +0 -1
- package/dist/cjs/utils/base_64_image/sharp.js.map +0 -1
- package/dist/cjs/utils/http/credentials.js.map +0 -1
- package/dist/cjs/utils/http/custom-errors/authentication-http-client-error.js.map +0 -1
- package/dist/cjs/utils/http/custom-errors/client-http-client-error.js.map +0 -1
- package/dist/cjs/utils/http/custom-errors/general-http-client-error.js.map +0 -1
- package/dist/cjs/utils/http/custom-errors/http-client-error.js.map +0 -1
- package/dist/cjs/utils/http/custom-errors/index.js.map +0 -1
- package/dist/cjs/utils/http/custom-errors/server-http-client-error.js.map +0 -1
- package/dist/cjs/utils/http/custom-errors/unkown-http-client-error.js.map +0 -1
- package/dist/cjs/utils/http/http-client-got.js.map +0 -1
- package/dist/cjs/utils/http/index.js.map +0 -1
- package/dist/cjs/utils/image-resize-errors/image-resizing-base-error.js.map +0 -1
- package/dist/cjs/utils/image-resize-errors/index.js.map +0 -1
- package/dist/cjs/utils/path.js.map +0 -1
- package/dist/cjs/utils/proxy/proxy-builder.js.map +0 -1
- package/dist/cjs/utils/resized-image-interface.js.map +0 -1
- package/dist/cjs/utils/transformations.js.map +0 -1
- package/dist/esm/core/annotation/annotation-writer.js.map +0 -1
- package/dist/esm/core/annotation/annotation.js.map +0 -1
- package/dist/esm/core/inference-response/inference-response.js.map +0 -1
- package/dist/esm/core/inference-response/invalid-model-type-error.js.map +0 -1
- package/dist/esm/core/inference-response/model-type.js.map +0 -1
- package/dist/esm/core/model/annotation-result/annotation-interface.js.map +0 -1
- package/dist/esm/core/model/annotation-result/boundary-box.js.map +0 -1
- package/dist/esm/core/model/annotation-result/detected-element.js.map +0 -1
- package/dist/esm/core/model/custom-element-json.js.map +0 -1
- package/dist/esm/core/model/custom-element.js.map +0 -1
- package/dist/esm/core/reporting/default-step.js.map +0 -1
- package/dist/esm/core/reporting/index.js.map +0 -1
- package/dist/esm/core/reporting/instruction.js.map +0 -1
- package/dist/esm/core/reporting/reporter-config.js.map +0 -1
- package/dist/esm/core/reporting/reporter.js.map +0 -1
- package/dist/esm/core/reporting/snapshot-detail-level.js.map +0 -1
- package/dist/esm/core/reporting/snapshot.js.map +0 -1
- package/dist/esm/core/reporting/step-reporter.js.map +0 -1
- package/dist/esm/core/reporting/step-run.js.map +0 -1
- package/dist/esm/core/reporting/step-status-end.js.map +0 -1
- package/dist/esm/core/reporting/step-status.js.map +0 -1
- package/dist/esm/core/reporting/step.js.map +0 -1
- package/dist/esm/core/runner-protocol/index.js.map +0 -1
- package/dist/esm/core/runner-protocol/request/capture-screenshot-request.js.map +0 -1
- package/dist/esm/core/runner-protocol/request/control-request.js.map +0 -1
- package/dist/esm/core/runner-protocol/request/get-server-process-pid.js.map +0 -1
- package/dist/esm/core/runner-protocol/request/index.js.map +0 -1
- package/dist/esm/core/runner-protocol/request/interactive-annotation-request.js.map +0 -1
- package/dist/esm/core/runner-protocol/request/read-recording-request.js.map +0 -1
- package/dist/esm/core/runner-protocol/request/runner-protocol-request.js.map +0 -1
- package/dist/esm/core/runner-protocol/request/start-recording-request.js.map +0 -1
- package/dist/esm/core/runner-protocol/request/stop-recording-request.js.map +0 -1
- package/dist/esm/core/runner-protocol/response/index.js.map +0 -1
- package/dist/esm/core/ui-control-commands/action.js.map +0 -1
- package/dist/esm/core/ui-control-commands/control-command-code.js.map +0 -1
- package/dist/esm/core/ui-control-commands/control-command.js.map +0 -1
- package/dist/esm/core/ui-control-commands/index.js.map +0 -1
- package/dist/esm/core/ui-control-commands/input-event.js.map +0 -1
- package/dist/esm/execution/config-error.js.map +0 -1
- package/dist/esm/execution/control-command-error.js.map +0 -1
- package/dist/esm/execution/credentials-args.js.map +0 -1
- package/dist/esm/execution/dsl.js.map +0 -1
- package/dist/esm/execution/execution-runtime.js.map +0 -1
- package/dist/esm/execution/index.js.map +0 -1
- package/dist/esm/execution/inference-client.js.map +0 -1
- package/dist/esm/execution/inference-response-error.js.map +0 -1
- package/dist/esm/execution/is-image-required-interface.js.map +0 -1
- package/dist/esm/execution/misc.js.map +0 -1
- package/dist/esm/execution/model-composition-branch.js.map +0 -1
- package/dist/esm/execution/read-environment-credentials.js.map +0 -1
- package/dist/esm/execution/read-recording-response-stream-handler.js.map +0 -1
- package/dist/esm/execution/repeat-error.js.map +0 -1
- package/dist/esm/execution/ui-control-client-dependency-builder.js.map +0 -1
- package/dist/esm/execution/ui-control-client.js.map +0 -1
- package/dist/esm/execution/ui-controller-client-connection-state.js.map +0 -1
- package/dist/esm/execution/ui-controller-client-error.js.map +0 -1
- package/dist/esm/execution/ui-controller-client-interface.js.map +0 -1
- package/dist/esm/execution/ui-controller-client.js.map +0 -1
- package/dist/esm/lib/download-binaries.js.map +0 -1
- package/dist/esm/lib/index.js.map +0 -1
- package/dist/esm/lib/interactive_cli/add-script-package-json.d.ts +0 -1
- package/dist/esm/lib/interactive_cli/add-script-package-json.js +0 -32
- package/dist/esm/lib/interactive_cli/add-script-package-json.js.map +0 -1
- package/dist/esm/lib/interactive_cli/cli-options-interface.js.map +0 -1
- package/dist/esm/lib/interactive_cli/cli.js.map +0 -1
- package/dist/esm/lib/interactive_cli/create-example-project.js.map +0 -1
- package/dist/esm/lib/interactive_cli/index.js.map +0 -1
- package/dist/esm/lib/libfuse-error.js.map +0 -1
- package/dist/esm/lib/logger.js.map +0 -1
- package/dist/esm/lib/timeout-error.js.map +0 -1
- package/dist/esm/lib/ui-controller-args.js.map +0 -1
- package/dist/esm/lib/ui-controller-darwin.js.map +0 -1
- package/dist/esm/lib/ui-controller-facade.js.map +0 -1
- package/dist/esm/lib/ui-controller-linux.js.map +0 -1
- package/dist/esm/lib/ui-controller-win32.js.map +0 -1
- package/dist/esm/lib/ui-controller.js.map +0 -1
- package/dist/esm/lib/unkown-error.js.map +0 -1
- package/dist/esm/lib/wayland-error.js.map +0 -1
- package/dist/esm/main.js.map +0 -1
- package/dist/esm/shared/index.js.map +0 -1
- package/dist/esm/shared/log-levels.js.map +0 -1
- package/dist/esm/shared/proxy-agent-args.js.map +0 -1
- package/dist/esm/utils/analytics/analytics-interface.js.map +0 -1
- package/dist/esm/utils/analytics/analytics.js.map +0 -1
- package/dist/esm/utils/analytics/index.js.map +0 -1
- package/dist/esm/utils/analytics/installation-timestamp-create-error.js.map +0 -1
- package/dist/esm/utils/analytics/installation-timestamp-get-error.js.map +0 -1
- package/dist/esm/utils/analytics/installation-timestamp.js.map +0 -1
- package/dist/esm/utils/analytics/user-identifier-interface.js.map +0 -1
- package/dist/esm/utils/analytics/user-identifier.js.map +0 -1
- package/dist/esm/utils/base_64_image/base-64-image-error.js.map +0 -1
- package/dist/esm/utils/base_64_image/base-64-image-string-error.js.map +0 -1
- package/dist/esm/utils/base_64_image/base-64-image.js.map +0 -1
- package/dist/esm/utils/base_64_image/sharp.js.map +0 -1
- package/dist/esm/utils/http/credentials.js.map +0 -1
- package/dist/esm/utils/http/custom-errors/authentication-http-client-error.js.map +0 -1
- package/dist/esm/utils/http/custom-errors/client-http-client-error.js.map +0 -1
- package/dist/esm/utils/http/custom-errors/general-http-client-error.js.map +0 -1
- package/dist/esm/utils/http/custom-errors/http-client-error.js.map +0 -1
- package/dist/esm/utils/http/custom-errors/index.js.map +0 -1
- package/dist/esm/utils/http/custom-errors/server-http-client-error.js.map +0 -1
- package/dist/esm/utils/http/custom-errors/unkown-http-client-error.js.map +0 -1
- package/dist/esm/utils/http/http-client-got.js.map +0 -1
- package/dist/esm/utils/http/index.js.map +0 -1
- package/dist/esm/utils/image-resize-errors/image-resizing-base-error.js.map +0 -1
- package/dist/esm/utils/image-resize-errors/index.js.map +0 -1
- package/dist/esm/utils/path.js.map +0 -1
- package/dist/esm/utils/proxy/proxy-builder.js.map +0 -1
- package/dist/esm/utils/resized-image-interface.js.map +0 -1
- package/dist/esm/utils/transformations.js.map +0 -1
- package/dist/example_projects_templates/configs/jasmine.config.json +0 -12
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
3
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
4
|
+
/* eslint-disable max-classes-per-file */
|
|
5
|
+
/* eslint-disable max-len */
|
|
6
|
+
// Autogenerated from typescript.template file
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.ApiCommands = exports.Getter = exports.FluentFiltersOrRelationsGetter = exports.FluentFiltersGetter = exports.ExecGetter = exports.FluentCommand = exports.FluentFiltersOrRelationsCondition = exports.FluentFiltersCondition = exports.FluentFiltersOrRelations = exports.FluentFilters = exports.Exec = exports.Separators = void 0;
|
|
4
9
|
var Separators;
|
|
@@ -215,6 +220,7 @@ class FluentFilters extends FluentBase {
|
|
|
215
220
|
return new FluentFiltersOrRelations(this);
|
|
216
221
|
}
|
|
217
222
|
/**
|
|
223
|
+
* Filters for a UI element 'table'.
|
|
218
224
|
*
|
|
219
225
|
* @return {FluentFiltersOrRelations}
|
|
220
226
|
*/
|
|
@@ -243,6 +249,8 @@ class FluentFilters extends FluentBase {
|
|
|
243
249
|
* await aui.click().text().withTextRegex('\b[Ss]\w+').exec();
|
|
244
250
|
* ```
|
|
245
251
|
*
|
|
252
|
+
* @param {string} [text] - A text to be matched.
|
|
253
|
+
*
|
|
246
254
|
* @return {FluentFiltersOrRelations}
|
|
247
255
|
*/
|
|
248
256
|
text(text) {
|
|
@@ -275,9 +283,9 @@ class FluentFilters extends FluentBase {
|
|
|
275
283
|
return new FluentFiltersOrRelations(this);
|
|
276
284
|
}
|
|
277
285
|
/**
|
|
278
|
-
* Filters for a 'custom element', that is a UI element
|
|
286
|
+
* Filters for a 'custom element', that is a UI element that 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()`.
|
|
279
287
|
*
|
|
280
|
-
* See the tutorial - [Custom Element](https://docs.askui.com/docs/general/
|
|
288
|
+
* See the tutorial - [Custom Element](https://docs.askui.com/docs/general/Element%20Selection/custom-elements) for more details.
|
|
281
289
|
*
|
|
282
290
|
* **Example**
|
|
283
291
|
* ```typescript
|
|
@@ -286,7 +294,7 @@ class FluentFilters extends FluentBase {
|
|
|
286
294
|
* .customElement({
|
|
287
295
|
* customImage: './logo.png', // required
|
|
288
296
|
* name: 'myLogo', // optional
|
|
289
|
-
* threshold: 0.
|
|
297
|
+
* threshold: 0.5, // optional, defaults to 0.5
|
|
290
298
|
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
291
299
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
292
300
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
@@ -302,13 +310,13 @@ class FluentFilters extends FluentBase {
|
|
|
302
310
|
* - **name** (*`string`, optional*):
|
|
303
311
|
* - 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.
|
|
304
312
|
* - **threshold** (*`number`, optional*):
|
|
305
|
-
* - 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.
|
|
313
|
+
* - 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.5`.
|
|
306
314
|
* - **stopThreshold** (*`number`, optional*):
|
|
307
315
|
* - 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`.
|
|
308
316
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
309
317
|
* - 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`.
|
|
310
318
|
* - **imageCompareFormat** (*`'RGB' | 'grayscale' | 'edges'`, optional*):
|
|
311
|
-
* - 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'
|
|
319
|
+
* - 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'`.
|
|
312
320
|
*
|
|
313
321
|
*
|
|
314
322
|
* @param {CustomElementJson} customElement - The custom element to filter for.
|
|
@@ -323,7 +331,13 @@ class FluentFilters extends FluentBase {
|
|
|
323
331
|
return new FluentFiltersOrRelations(this);
|
|
324
332
|
}
|
|
325
333
|
/**
|
|
326
|
-
* Detects an AI Element created with the workflow
|
|
334
|
+
* Detects an AI Element created with the [snipping workflow](https://docs.askui.com/docs/general/Components/aielement#snipping-workflow).
|
|
335
|
+
*
|
|
336
|
+
* **Examples:**
|
|
337
|
+
*
|
|
338
|
+
* ```typescript
|
|
339
|
+
* await aui.click().aiElement('askui-logo').exec();
|
|
340
|
+
* ```
|
|
327
341
|
*
|
|
328
342
|
* @param {string} aiElementName - Name of the AI Element.
|
|
329
343
|
*
|
|
@@ -411,12 +425,13 @@ class FluentFilters extends FluentBase {
|
|
|
411
425
|
* 'other' === withText('text') => false
|
|
412
426
|
*
|
|
413
427
|
* // optional parameter: similarity_score
|
|
414
|
-
* '978-0-201-00650-6' == withText(
|
|
415
|
-
* '978-0-201-00650-6' == withText(
|
|
428
|
+
* '978-0-201-00650-6' == withText("978-0-201-00", 90) => false with 82.76 < 90 similarity
|
|
429
|
+
* '978-0-201-00650-6' == withText("978-0-201-00650", 90) => true with 93.75 > 90 similarity
|
|
416
430
|
* ```
|
|
417
431
|
* 
|
|
418
432
|
*
|
|
419
433
|
* @param {string} text - A text to be matched.
|
|
434
|
+
* @param {number} [similarityScore=70] - Similarity score minimum value, it should be between `0` and `100`.
|
|
420
435
|
*
|
|
421
436
|
* @return {FluentFiltersOrRelations}
|
|
422
437
|
*/
|
|
@@ -443,7 +458,7 @@ class FluentFilters extends FluentBase {
|
|
|
443
458
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
444
459
|
* ```
|
|
445
460
|
*
|
|
446
|
-
* 
|
|
447
462
|
*
|
|
448
463
|
*
|
|
449
464
|
*
|
|
@@ -475,7 +490,7 @@ class FluentFilters extends FluentBase {
|
|
|
475
490
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
476
491
|
* ```
|
|
477
492
|
*
|
|
478
|
-
* 
|
|
479
494
|
*
|
|
480
495
|
*
|
|
481
496
|
*
|
|
@@ -523,10 +538,10 @@ class FluentFilters extends FluentBase {
|
|
|
523
538
|
* **Important: _Matching only returns the best matching element when you use it with `get()`_**
|
|
524
539
|
*
|
|
525
540
|
* A bit of playing around to find a matching description is sometimes needed:
|
|
526
|
-
*
|
|
541
|
+
* For example, `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
527
542
|
* Generally, the more detail the better.
|
|
528
543
|
*
|
|
529
|
-
* We also recommend to not restrict the type of element by using the
|
|
544
|
+
* We also recommend to not restrict the type of element by using the general selector `element()` as shown in the examples below.
|
|
530
545
|
*
|
|
531
546
|
* **Examples:**
|
|
532
547
|
* ```typescript
|
|
@@ -699,150 +714,304 @@ class FluentFiltersOrRelations extends FluentFilters {
|
|
|
699
714
|
/**
|
|
700
715
|
* Filters for an element right of another element.
|
|
701
716
|
*
|
|
702
|
-
* Takes an optional parameter `index` to select the
|
|
717
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
718
|
+
*
|
|
719
|
+
* Takes an optional parameter `intersection_area` to specify which elements right of the other element are filtered for based on their vertical position (y-coordinates of bounding box):
|
|
720
|
+
* - `"element_center_line"` - considered right of the other element if element's bounding box intersects with a horizontal line passing through the center of the other element
|
|
721
|
+
* - `"element_edge_area"` - considered right of the other element if element's bounding box intersects with an area between the top and the bottom edge of the other element
|
|
722
|
+
* - `"display_edge_area"` - considered right of the other element no matter where it is placed vertically on the screen (y-axis)
|
|
703
723
|
*
|
|
704
724
|
* **Examples:**
|
|
705
725
|
* ```typescript
|
|
706
|
-
*
|
|
707
|
-
* |
|
|
708
|
-
*
|
|
726
|
+
* ---------- --------- ---------
|
|
727
|
+
* | button | | text0 | | text3 |
|
|
728
|
+
* ---------- --------- --------- ---------
|
|
729
|
+
* | text1 | ---------
|
|
730
|
+
* --------- | text2 |
|
|
731
|
+
* ---------
|
|
732
|
+
*
|
|
733
|
+
* // General explanation for element_center_line
|
|
734
|
+
* // This will find text0 and text3
|
|
735
|
+
* ...text().rightOf(..., 'element_center_line').button()
|
|
736
|
+
*
|
|
737
|
+
* // General explanation for element_edge_area
|
|
738
|
+
* // This will find text0, text1 and text3
|
|
739
|
+
* ...text().rightOf(..., 'element_edge_area').button()
|
|
740
|
+
*
|
|
741
|
+
* // General explanation and display_edge_area
|
|
742
|
+
* // This will find text0, text1, text2 and text3
|
|
743
|
+
* ...text().rightOf(..., 'display_edge_area').button()
|
|
744
|
+
*
|
|
745
|
+
* // More examples:
|
|
746
|
+
* // Returns text0 because it is the first element rightOf button
|
|
747
|
+
* ...text().rightOf().button()
|
|
748
|
+
* ...text().rightOf(0).button()
|
|
749
|
+
* ...text().rightOf(0, 'element_edge_area').button()
|
|
709
750
|
*
|
|
710
|
-
* // Returns
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
*
|
|
715
|
-
* // Returns
|
|
716
|
-
*
|
|
751
|
+
* // Returns text3 because it is the second text touched by the
|
|
752
|
+
* // horizontal line from the center of button
|
|
753
|
+
* // Notice: text1 is not touched!
|
|
754
|
+
* ...text().rightOf(1, 'element_center_line').button()
|
|
755
|
+
*
|
|
756
|
+
* // Returns text3 because it is the third text touched by the
|
|
757
|
+
* // vertical area rightOf the y-axis of button
|
|
758
|
+
* // Notice: text2 is not touched!
|
|
759
|
+
* ...text().rightOf(2, 'element_edge_area').button()
|
|
760
|
+
*
|
|
761
|
+
* // Returns text2 because it is the third element rightOf button
|
|
762
|
+
* ...text().rightOf(2, 'display_edge_area').button()
|
|
763
|
+
*
|
|
764
|
+
* // Returns no element because button is rightOf the texts
|
|
765
|
+
* ...button().rightOf().text()
|
|
717
766
|
* ```
|
|
718
767
|
* 
|
|
719
768
|
*
|
|
769
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
770
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
771
|
+
*
|
|
720
772
|
* @return {FluentFilters}
|
|
721
773
|
*/
|
|
722
|
-
rightOf(
|
|
774
|
+
rightOf(index = 0, intersection_area = 'element_edge_area') {
|
|
723
775
|
this._textStr = '';
|
|
724
|
-
if (
|
|
725
|
-
this._textStr += `index ${
|
|
776
|
+
if (index !== undefined) {
|
|
777
|
+
this._textStr += `index ${index}`;
|
|
726
778
|
}
|
|
727
779
|
this._textStr += ' right';
|
|
728
780
|
this._textStr += ' of';
|
|
729
|
-
if (
|
|
730
|
-
this._textStr += `
|
|
781
|
+
if (intersection_area !== undefined) {
|
|
782
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
731
783
|
}
|
|
732
784
|
return new FluentFilters(this);
|
|
733
785
|
}
|
|
734
786
|
/**
|
|
735
787
|
* Filters for an element left of another element.
|
|
736
788
|
*
|
|
737
|
-
* Takes an optional parameter `index` to select the
|
|
789
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
790
|
+
*
|
|
791
|
+
* Takes an optional parameter `intersection_area` to specify which elements left of the other element are filtered for based on their vertical position (y-coordinates of bounding box):
|
|
792
|
+
* - `"element_center_line"` - considered left of the other element if element's bounding box intersects with a horizontal line passing through the center of the other element
|
|
793
|
+
* - `"element_edge_area"` - considered left of the other element if element's bounding box intersects with an area between the top and the bottom edge of the other element
|
|
794
|
+
* - `"display_edge_area"` - considered left of the other element no matter where it is placed vertically on the screen (y-axis)
|
|
738
795
|
*
|
|
739
796
|
* **Examples:**
|
|
740
797
|
* ```typescript
|
|
741
|
-
*
|
|
742
|
-
* |
|
|
743
|
-
*
|
|
798
|
+
* --------- --------- ----------
|
|
799
|
+
* | text3 | | text0 | | button |
|
|
800
|
+
* --------- --------- --------- ----------
|
|
801
|
+
* --------- | text1 |
|
|
802
|
+
* | text2 | ---------
|
|
803
|
+
* ---------
|
|
804
|
+
*
|
|
805
|
+
* // General explanation for element_center_line
|
|
806
|
+
* // This will find text0 and text3
|
|
807
|
+
* ...text().leftOf(..., 'element_center_line').button()
|
|
808
|
+
*
|
|
809
|
+
* // General explanation for element_edge_area
|
|
810
|
+
* // This will find text0, text1 and text3
|
|
811
|
+
* ...text().leftOf(..., 'element_edge_area').button()
|
|
812
|
+
*
|
|
813
|
+
* // General explanation and display_edge_area
|
|
814
|
+
* // This will find text0, text1, text2 and text3
|
|
815
|
+
* ...text().leftOf(..., 'display_edge_area').button()
|
|
816
|
+
*
|
|
817
|
+
* // More examples:
|
|
818
|
+
* // Returns text0 because it is the first element leftOf button
|
|
819
|
+
* ...text().leftOf().button()
|
|
820
|
+
* ...text().leftOf(0).button()
|
|
821
|
+
* ...text().leftOf(0, 'element_edge_area').button()
|
|
822
|
+
*
|
|
823
|
+
* // Returns text3 because it is the second text touched by the
|
|
824
|
+
* // horizontal line from the center of button
|
|
825
|
+
* // Notice: text1 is not touched!
|
|
826
|
+
* ...text().leftOf(1, 'element_center_line').button()
|
|
744
827
|
*
|
|
745
|
-
* // Returns
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
*
|
|
749
|
-
*
|
|
750
|
-
* // Returns
|
|
751
|
-
* ...
|
|
828
|
+
* // Returns text3 because it is the third text touched by the
|
|
829
|
+
* // vertical area leftOf the y-axis of button
|
|
830
|
+
* // Notice: text2 is not touched!
|
|
831
|
+
* ...text().leftOf(2, 'element_edge_area').button()
|
|
832
|
+
*
|
|
833
|
+
* // Returns text2 because it is the third element leftOf button
|
|
834
|
+
* ...text().leftOf(2, 'display_edge_area').button()
|
|
835
|
+
*
|
|
836
|
+
* // Returns no element because button is rightOf the texts
|
|
837
|
+
* ...button().leftOf().text()
|
|
752
838
|
* ```
|
|
753
839
|
* 
|
|
754
840
|
*
|
|
841
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
842
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
843
|
+
*
|
|
755
844
|
* @return {FluentFilters}
|
|
756
845
|
*/
|
|
757
|
-
leftOf(
|
|
846
|
+
leftOf(index = 0, intersection_area = 'element_edge_area') {
|
|
758
847
|
this._textStr = '';
|
|
759
|
-
if (
|
|
760
|
-
this._textStr += `index ${
|
|
848
|
+
if (index !== undefined) {
|
|
849
|
+
this._textStr += `index ${index}`;
|
|
761
850
|
}
|
|
762
851
|
this._textStr += ' left';
|
|
763
852
|
this._textStr += ' of';
|
|
764
|
-
if (
|
|
765
|
-
this._textStr += `
|
|
853
|
+
if (intersection_area !== undefined) {
|
|
854
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
766
855
|
}
|
|
767
856
|
return new FluentFilters(this);
|
|
768
857
|
}
|
|
769
858
|
/**
|
|
770
859
|
* Filters for an element below another element.
|
|
771
860
|
*
|
|
772
|
-
* Takes an optional parameter `index` to select the
|
|
861
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
862
|
+
*
|
|
863
|
+
* Takes an optional parameter `intersection_area` to specify which elements below of the other element are filtered for based on their horizontal position (y-coordinates of bounding box):
|
|
864
|
+
* - `"element_center_line"` - considered below of the other element if element's bounding box intersects with a vertical line passing through the center of the other element
|
|
865
|
+
* - `"element_edge_area"` - considered below of the other element if element's bounding box intersects with an area between the left and the right edge of the other element
|
|
866
|
+
* - `"display_edge_area"` - considered below of the other element no matter where it is placed horizontally on the screen (y-axis)
|
|
773
867
|
*
|
|
774
868
|
* **Examples:**
|
|
775
869
|
* ```typescript
|
|
776
|
-
*
|
|
777
|
-
* |
|
|
778
|
-
*
|
|
779
|
-
*
|
|
780
|
-
* |
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
*
|
|
784
|
-
*
|
|
870
|
+
* ------------
|
|
871
|
+
* | text |
|
|
872
|
+
* ------------
|
|
873
|
+
* ------------
|
|
874
|
+
* | button0 |
|
|
875
|
+
* ------------
|
|
876
|
+
* -----------
|
|
877
|
+
* | button1 |
|
|
878
|
+
* -----------
|
|
879
|
+
* -----------
|
|
880
|
+
* | button2 |
|
|
881
|
+
* -----------
|
|
882
|
+
* ------------
|
|
883
|
+
* | button3 |
|
|
884
|
+
* ------------
|
|
785
885
|
*
|
|
886
|
+
* // General explanation for element_center_line
|
|
887
|
+
* // This will find button0 and button3
|
|
888
|
+
* ...button().below(..., 'element_center_line').text()
|
|
889
|
+
*
|
|
890
|
+
* // General explanation for element_edge_area
|
|
891
|
+
* // This will find button0, button1 and button3
|
|
892
|
+
* ...button().below(..., 'element_edge_area').text()
|
|
893
|
+
*
|
|
894
|
+
* // General explanation and display_edge_area
|
|
895
|
+
* // This will find button0, button1, button2 and button3
|
|
896
|
+
* ...button().below(..., 'display_edge_area').text()
|
|
897
|
+
*
|
|
898
|
+
* // More examples:
|
|
786
899
|
* // Returns button0 because button0 is the first button below text
|
|
787
900
|
* ...button().below().text()
|
|
788
901
|
* ...button().below(0).text()
|
|
789
|
-
*
|
|
790
|
-
*
|
|
791
|
-
* // Returns
|
|
902
|
+
* ...button().below(0, 'element_edge_area').text()
|
|
903
|
+
*
|
|
904
|
+
* // Returns button3 because it is the second button touched by the
|
|
905
|
+
* // vertical line from the center of text
|
|
906
|
+
* // Notice: button1 is not touched
|
|
907
|
+
* ...button().below(1, 'element_center_line').text()
|
|
908
|
+
*
|
|
909
|
+
* // Returns button3 because it is the third button touched by the
|
|
910
|
+
* // vertical area below the x-axis of text
|
|
911
|
+
* // Notice: button2 is not touched!
|
|
912
|
+
* ...button().below(2, 'element_edge_area').text()
|
|
913
|
+
*
|
|
914
|
+
* // Returns button2 because it is the third element below text
|
|
915
|
+
* ...button().below(2, 'display_edge_area').text()
|
|
916
|
+
*
|
|
917
|
+
* // Returns no element because text is above the buttons
|
|
792
918
|
* ...text().below().button()
|
|
793
919
|
* ```
|
|
794
920
|
* 
|
|
795
921
|
*
|
|
922
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
923
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
924
|
+
*
|
|
796
925
|
* @return {FluentFilters}
|
|
797
926
|
*/
|
|
798
|
-
below(
|
|
927
|
+
below(index = 0, intersection_area = 'element_edge_area') {
|
|
799
928
|
this._textStr = '';
|
|
800
|
-
if (
|
|
801
|
-
this._textStr += `index ${
|
|
929
|
+
if (index !== undefined) {
|
|
930
|
+
this._textStr += `index ${index}`;
|
|
802
931
|
}
|
|
803
932
|
this._textStr += ' below';
|
|
804
|
-
if (
|
|
805
|
-
this._textStr += `
|
|
933
|
+
if (intersection_area !== undefined) {
|
|
934
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
806
935
|
}
|
|
807
936
|
return new FluentFilters(this);
|
|
808
937
|
}
|
|
809
938
|
/**
|
|
810
939
|
* Filters for an element above another element.
|
|
811
940
|
*
|
|
812
|
-
* Takes an optional parameter `index` to select the
|
|
813
|
-
*
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
*
|
|
817
|
-
*
|
|
818
|
-
*
|
|
819
|
-
*
|
|
820
|
-
*
|
|
821
|
-
*
|
|
822
|
-
*
|
|
823
|
-
*
|
|
824
|
-
*
|
|
825
|
-
*
|
|
826
|
-
*
|
|
941
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
942
|
+
*
|
|
943
|
+
* Takes an optional parameter `intersection_area` to specify which elements above of the other element are filtered for based on their horizontal position (y-coordinates of bounding box):
|
|
944
|
+
* - `"element_center_line"` - considered above of the other element if element's bounding box intersects with a vertical line passing through the center of the other element
|
|
945
|
+
* - `"element_edge_area"` - considered above of the other element if element's bounding box intersects with an area between the left and the right edge of the other element
|
|
946
|
+
* - `"display_edge_area"` - considered above of the other element no matter where it is placed horizontally on the screen (y-axis)
|
|
947
|
+
*
|
|
948
|
+
* **Examples:**
|
|
949
|
+
* ```typescript
|
|
950
|
+
* ------------
|
|
951
|
+
* | text3 |
|
|
952
|
+
* ------------
|
|
953
|
+
* ------------
|
|
954
|
+
* | text2 |
|
|
955
|
+
* ------------
|
|
956
|
+
* ------------
|
|
957
|
+
* | text1 |
|
|
958
|
+
* ------------
|
|
959
|
+
* ------------
|
|
960
|
+
* | text0 |
|
|
961
|
+
* ------------
|
|
962
|
+
* ------------
|
|
963
|
+
* | button |
|
|
964
|
+
* ------------
|
|
965
|
+
*
|
|
966
|
+
* // General explanation for element_center_line
|
|
967
|
+
* // This will find text0 and text3
|
|
968
|
+
* ...text().above(..., 'element_center_line').button()
|
|
969
|
+
*
|
|
970
|
+
* // General explanation for element_edge_area
|
|
971
|
+
* // This will find text0, text1 and text3
|
|
972
|
+
* ...text().above(..., 'element_edge_area').button()
|
|
973
|
+
*
|
|
974
|
+
* // General explanation and display_edge_area
|
|
975
|
+
* // This will find text0, text1, text2 and text3
|
|
976
|
+
* ...text().above(..., 'display_edge_area').button()
|
|
977
|
+
*
|
|
978
|
+
* // More examples:
|
|
979
|
+
* // Returns text0 because it is the first element above button
|
|
827
980
|
* ...text().above().button()
|
|
828
981
|
* ...text().above(0).button()
|
|
829
|
-
*
|
|
830
|
-
*
|
|
831
|
-
* // Returns
|
|
982
|
+
* ...text().above(0, 'element_edge_area').button()
|
|
983
|
+
*
|
|
984
|
+
* // Returns text3 because it is the second text touched by the
|
|
985
|
+
* // vertical line from the center of button
|
|
986
|
+
* // Notice: text1 is not touched!
|
|
987
|
+
* ...text().above(1, 'element_center_line').button()
|
|
988
|
+
*
|
|
989
|
+
* // Returns text3 because it is the third text touched by the
|
|
990
|
+
* // vertical area above the x-axis of button
|
|
991
|
+
* // Notice: text2 is not touched!
|
|
992
|
+
* ...text().above(2, 'element_edge_area').button()
|
|
993
|
+
*
|
|
994
|
+
* // Returns text2 because it is the third element above button
|
|
995
|
+
* ...text().above(2, 'display_edge_area').button()
|
|
996
|
+
*
|
|
997
|
+
* // Returns no element because button is below the texts
|
|
832
998
|
* ...button().above().text()
|
|
833
999
|
* ```
|
|
834
1000
|
* 
|
|
835
1001
|
*
|
|
1002
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
1003
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
1004
|
+
*
|
|
836
1005
|
* @return {FluentFilters}
|
|
837
1006
|
*/
|
|
838
|
-
above(
|
|
1007
|
+
above(index = 0, intersection_area = 'element_edge_area') {
|
|
839
1008
|
this._textStr = '';
|
|
840
|
-
if (
|
|
841
|
-
this._textStr += `index ${
|
|
1009
|
+
if (index !== undefined) {
|
|
1010
|
+
this._textStr += `index ${index}`;
|
|
842
1011
|
}
|
|
843
1012
|
this._textStr += ' above';
|
|
844
|
-
if (
|
|
845
|
-
this._textStr += `
|
|
1013
|
+
if (intersection_area !== undefined) {
|
|
1014
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
846
1015
|
}
|
|
847
1016
|
return new FluentFilters(this);
|
|
848
1017
|
}
|
|
@@ -1049,6 +1218,7 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1049
1218
|
return new FluentFiltersOrRelationsCondition(this);
|
|
1050
1219
|
}
|
|
1051
1220
|
/**
|
|
1221
|
+
* Filters for a UI element 'table'.
|
|
1052
1222
|
*
|
|
1053
1223
|
* @return {FluentFiltersOrRelationsCondition}
|
|
1054
1224
|
*/
|
|
@@ -1077,6 +1247,8 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1077
1247
|
* await aui.click().text().withTextRegex('\b[Ss]\w+').exec();
|
|
1078
1248
|
* ```
|
|
1079
1249
|
*
|
|
1250
|
+
* @param {string} [text] - A text to be matched.
|
|
1251
|
+
*
|
|
1080
1252
|
* @return {FluentFiltersOrRelationsCondition}
|
|
1081
1253
|
*/
|
|
1082
1254
|
text(text) {
|
|
@@ -1109,9 +1281,9 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1109
1281
|
return new FluentFiltersOrRelationsCondition(this);
|
|
1110
1282
|
}
|
|
1111
1283
|
/**
|
|
1112
|
-
* Filters for a 'custom element', that is a UI element
|
|
1284
|
+
* Filters for a 'custom element', that is a UI element that 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()`.
|
|
1113
1285
|
*
|
|
1114
|
-
* See the tutorial - [Custom Element](https://docs.askui.com/docs/general/
|
|
1286
|
+
* See the tutorial - [Custom Element](https://docs.askui.com/docs/general/Element%20Selection/custom-elements) for more details.
|
|
1115
1287
|
*
|
|
1116
1288
|
* **Example**
|
|
1117
1289
|
* ```typescript
|
|
@@ -1120,7 +1292,7 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1120
1292
|
* .customElement({
|
|
1121
1293
|
* customImage: './logo.png', // required
|
|
1122
1294
|
* name: 'myLogo', // optional
|
|
1123
|
-
* threshold: 0.
|
|
1295
|
+
* threshold: 0.5, // optional, defaults to 0.5
|
|
1124
1296
|
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
1125
1297
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
1126
1298
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
@@ -1136,13 +1308,13 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1136
1308
|
* - **name** (*`string`, optional*):
|
|
1137
1309
|
* - 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.
|
|
1138
1310
|
* - **threshold** (*`number`, optional*):
|
|
1139
|
-
* - 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.
|
|
1311
|
+
* - 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.5`.
|
|
1140
1312
|
* - **stopThreshold** (*`number`, optional*):
|
|
1141
1313
|
* - 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`.
|
|
1142
1314
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
1143
1315
|
* - 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`.
|
|
1144
1316
|
* - **imageCompareFormat** (*`'RGB' | 'grayscale' | 'edges'`, optional*):
|
|
1145
|
-
* - 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'
|
|
1317
|
+
* - 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'`.
|
|
1146
1318
|
*
|
|
1147
1319
|
*
|
|
1148
1320
|
* @param {CustomElementJson} customElement - The custom element to filter for.
|
|
@@ -1157,7 +1329,13 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1157
1329
|
return new FluentFiltersOrRelationsCondition(this);
|
|
1158
1330
|
}
|
|
1159
1331
|
/**
|
|
1160
|
-
* Detects an AI Element created with the workflow
|
|
1332
|
+
* Detects an AI Element created with the [snipping workflow](https://docs.askui.com/docs/general/Components/aielement#snipping-workflow).
|
|
1333
|
+
*
|
|
1334
|
+
* **Examples:**
|
|
1335
|
+
*
|
|
1336
|
+
* ```typescript
|
|
1337
|
+
* await aui.click().aiElement('askui-logo').exec();
|
|
1338
|
+
* ```
|
|
1161
1339
|
*
|
|
1162
1340
|
* @param {string} aiElementName - Name of the AI Element.
|
|
1163
1341
|
*
|
|
@@ -1245,12 +1423,13 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1245
1423
|
* 'other' === withText('text') => false
|
|
1246
1424
|
*
|
|
1247
1425
|
* // optional parameter: similarity_score
|
|
1248
|
-
* '978-0-201-00650-6' == withText(
|
|
1249
|
-
* '978-0-201-00650-6' == withText(
|
|
1426
|
+
* '978-0-201-00650-6' == withText("978-0-201-00", 90) => false with 82.76 < 90 similarity
|
|
1427
|
+
* '978-0-201-00650-6' == withText("978-0-201-00650", 90) => true with 93.75 > 90 similarity
|
|
1250
1428
|
* ```
|
|
1251
1429
|
* 
|
|
1252
1430
|
*
|
|
1253
1431
|
* @param {string} text - A text to be matched.
|
|
1432
|
+
* @param {number} [similarityScore=70] - Similarity score minimum value, it should be between `0` and `100`.
|
|
1254
1433
|
*
|
|
1255
1434
|
* @return {FluentFiltersOrRelationsCondition}
|
|
1256
1435
|
*/
|
|
@@ -1277,7 +1456,7 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1277
1456
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
1278
1457
|
* ```
|
|
1279
1458
|
*
|
|
1280
|
-
* 
|
|
1281
1460
|
*
|
|
1282
1461
|
*
|
|
1283
1462
|
*
|
|
@@ -1309,7 +1488,7 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1309
1488
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
1310
1489
|
* ```
|
|
1311
1490
|
*
|
|
1312
|
-
* 
|
|
1313
1492
|
*
|
|
1314
1493
|
*
|
|
1315
1494
|
*
|
|
@@ -1357,10 +1536,10 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1357
1536
|
* **Important: _Matching only returns the best matching element when you use it with `get()`_**
|
|
1358
1537
|
*
|
|
1359
1538
|
* A bit of playing around to find a matching description is sometimes needed:
|
|
1360
|
-
*
|
|
1539
|
+
* For example, `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
1361
1540
|
* Generally, the more detail the better.
|
|
1362
1541
|
*
|
|
1363
|
-
* We also recommend to not restrict the type of element by using the
|
|
1542
|
+
* We also recommend to not restrict the type of element by using the general selector `element()` as shown in the examples below.
|
|
1364
1543
|
*
|
|
1365
1544
|
* **Examples:**
|
|
1366
1545
|
* ```typescript
|
|
@@ -1533,150 +1712,304 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1533
1712
|
/**
|
|
1534
1713
|
* Filters for an element right of another element.
|
|
1535
1714
|
*
|
|
1536
|
-
* Takes an optional parameter `index` to select the
|
|
1715
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
1716
|
+
*
|
|
1717
|
+
* Takes an optional parameter `intersection_area` to specify which elements right of the other element are filtered for based on their vertical position (y-coordinates of bounding box):
|
|
1718
|
+
* - `"element_center_line"` - considered right of the other element if element's bounding box intersects with a horizontal line passing through the center of the other element
|
|
1719
|
+
* - `"element_edge_area"` - considered right of the other element if element's bounding box intersects with an area between the top and the bottom edge of the other element
|
|
1720
|
+
* - `"display_edge_area"` - considered right of the other element no matter where it is placed vertically on the screen (y-axis)
|
|
1537
1721
|
*
|
|
1538
1722
|
* **Examples:**
|
|
1539
1723
|
* ```typescript
|
|
1540
|
-
*
|
|
1541
|
-
* |
|
|
1542
|
-
*
|
|
1724
|
+
* ---------- --------- ---------
|
|
1725
|
+
* | button | | text0 | | text3 |
|
|
1726
|
+
* ---------- --------- --------- ---------
|
|
1727
|
+
* | text1 | ---------
|
|
1728
|
+
* --------- | text2 |
|
|
1729
|
+
* ---------
|
|
1730
|
+
*
|
|
1731
|
+
* // General explanation for element_center_line
|
|
1732
|
+
* // This will find text0 and text3
|
|
1733
|
+
* ...text().rightOf(..., 'element_center_line').button()
|
|
1543
1734
|
*
|
|
1544
|
-
* //
|
|
1545
|
-
*
|
|
1546
|
-
* ...
|
|
1547
|
-
*
|
|
1548
|
-
*
|
|
1549
|
-
* //
|
|
1550
|
-
* ...
|
|
1735
|
+
* // General explanation for element_edge_area
|
|
1736
|
+
* // This will find text0, text1 and text3
|
|
1737
|
+
* ...text().rightOf(..., 'element_edge_area').button()
|
|
1738
|
+
*
|
|
1739
|
+
* // General explanation and display_edge_area
|
|
1740
|
+
* // This will find text0, text1, text2 and text3
|
|
1741
|
+
* ...text().rightOf(..., 'display_edge_area').button()
|
|
1742
|
+
*
|
|
1743
|
+
* // More examples:
|
|
1744
|
+
* // Returns text0 because it is the first element rightOf button
|
|
1745
|
+
* ...text().rightOf().button()
|
|
1746
|
+
* ...text().rightOf(0).button()
|
|
1747
|
+
* ...text().rightOf(0, 'element_edge_area').button()
|
|
1748
|
+
*
|
|
1749
|
+
* // Returns text3 because it is the second text touched by the
|
|
1750
|
+
* // horizontal line from the center of button
|
|
1751
|
+
* // Notice: text1 is not touched!
|
|
1752
|
+
* ...text().rightOf(1, 'element_center_line').button()
|
|
1753
|
+
*
|
|
1754
|
+
* // Returns text3 because it is the third text touched by the
|
|
1755
|
+
* // vertical area rightOf the y-axis of button
|
|
1756
|
+
* // Notice: text2 is not touched!
|
|
1757
|
+
* ...text().rightOf(2, 'element_edge_area').button()
|
|
1758
|
+
*
|
|
1759
|
+
* // Returns text2 because it is the third element rightOf button
|
|
1760
|
+
* ...text().rightOf(2, 'display_edge_area').button()
|
|
1761
|
+
*
|
|
1762
|
+
* // Returns no element because button is rightOf the texts
|
|
1763
|
+
* ...button().rightOf().text()
|
|
1551
1764
|
* ```
|
|
1552
1765
|
* 
|
|
1553
1766
|
*
|
|
1767
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
1768
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
1769
|
+
*
|
|
1554
1770
|
* @return {FluentFiltersCondition}
|
|
1555
1771
|
*/
|
|
1556
|
-
rightOf(
|
|
1772
|
+
rightOf(index = 0, intersection_area = 'element_edge_area') {
|
|
1557
1773
|
this._textStr = '';
|
|
1558
|
-
if (
|
|
1559
|
-
this._textStr += `index ${
|
|
1774
|
+
if (index !== undefined) {
|
|
1775
|
+
this._textStr += `index ${index}`;
|
|
1560
1776
|
}
|
|
1561
1777
|
this._textStr += ' right';
|
|
1562
1778
|
this._textStr += ' of';
|
|
1563
|
-
if (
|
|
1564
|
-
this._textStr += `
|
|
1779
|
+
if (intersection_area !== undefined) {
|
|
1780
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
1565
1781
|
}
|
|
1566
1782
|
return new FluentFiltersCondition(this);
|
|
1567
1783
|
}
|
|
1568
1784
|
/**
|
|
1569
1785
|
* Filters for an element left of another element.
|
|
1570
1786
|
*
|
|
1571
|
-
* Takes an optional parameter `index` to select the
|
|
1787
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
1788
|
+
*
|
|
1789
|
+
* Takes an optional parameter `intersection_area` to specify which elements left of the other element are filtered for based on their vertical position (y-coordinates of bounding box):
|
|
1790
|
+
* - `"element_center_line"` - considered left of the other element if element's bounding box intersects with a horizontal line passing through the center of the other element
|
|
1791
|
+
* - `"element_edge_area"` - considered left of the other element if element's bounding box intersects with an area between the top and the bottom edge of the other element
|
|
1792
|
+
* - `"display_edge_area"` - considered left of the other element no matter where it is placed vertically on the screen (y-axis)
|
|
1572
1793
|
*
|
|
1573
1794
|
* **Examples:**
|
|
1574
1795
|
* ```typescript
|
|
1575
|
-
*
|
|
1576
|
-
* |
|
|
1577
|
-
*
|
|
1796
|
+
* --------- --------- ----------
|
|
1797
|
+
* | text3 | | text0 | | button |
|
|
1798
|
+
* --------- --------- --------- ----------
|
|
1799
|
+
* --------- | text1 |
|
|
1800
|
+
* | text2 | ---------
|
|
1801
|
+
* ---------
|
|
1802
|
+
*
|
|
1803
|
+
* // General explanation for element_center_line
|
|
1804
|
+
* // This will find text0 and text3
|
|
1805
|
+
* ...text().leftOf(..., 'element_center_line').button()
|
|
1806
|
+
*
|
|
1807
|
+
* // General explanation for element_edge_area
|
|
1808
|
+
* // This will find text0, text1 and text3
|
|
1809
|
+
* ...text().leftOf(..., 'element_edge_area').button()
|
|
1578
1810
|
*
|
|
1579
|
-
* //
|
|
1580
|
-
*
|
|
1581
|
-
* ...
|
|
1582
|
-
*
|
|
1583
|
-
*
|
|
1584
|
-
* // Returns
|
|
1585
|
-
* ...
|
|
1811
|
+
* // General explanation and display_edge_area
|
|
1812
|
+
* // This will find text0, text1, text2 and text3
|
|
1813
|
+
* ...text().leftOf(..., 'display_edge_area').button()
|
|
1814
|
+
*
|
|
1815
|
+
* // More examples:
|
|
1816
|
+
* // Returns text0 because it is the first element leftOf button
|
|
1817
|
+
* ...text().leftOf().button()
|
|
1818
|
+
* ...text().leftOf(0).button()
|
|
1819
|
+
* ...text().leftOf(0, 'element_edge_area').button()
|
|
1820
|
+
*
|
|
1821
|
+
* // Returns text3 because it is the second text touched by the
|
|
1822
|
+
* // horizontal line from the center of button
|
|
1823
|
+
* // Notice: text1 is not touched!
|
|
1824
|
+
* ...text().leftOf(1, 'element_center_line').button()
|
|
1825
|
+
*
|
|
1826
|
+
* // Returns text3 because it is the third text touched by the
|
|
1827
|
+
* // vertical area leftOf the y-axis of button
|
|
1828
|
+
* // Notice: text2 is not touched!
|
|
1829
|
+
* ...text().leftOf(2, 'element_edge_area').button()
|
|
1830
|
+
*
|
|
1831
|
+
* // Returns text2 because it is the third element leftOf button
|
|
1832
|
+
* ...text().leftOf(2, 'display_edge_area').button()
|
|
1833
|
+
*
|
|
1834
|
+
* // Returns no element because button is rightOf the texts
|
|
1835
|
+
* ...button().leftOf().text()
|
|
1586
1836
|
* ```
|
|
1587
1837
|
* 
|
|
1588
1838
|
*
|
|
1839
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
1840
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
1841
|
+
*
|
|
1589
1842
|
* @return {FluentFiltersCondition}
|
|
1590
1843
|
*/
|
|
1591
|
-
leftOf(
|
|
1844
|
+
leftOf(index = 0, intersection_area = 'element_edge_area') {
|
|
1592
1845
|
this._textStr = '';
|
|
1593
|
-
if (
|
|
1594
|
-
this._textStr += `index ${
|
|
1846
|
+
if (index !== undefined) {
|
|
1847
|
+
this._textStr += `index ${index}`;
|
|
1595
1848
|
}
|
|
1596
1849
|
this._textStr += ' left';
|
|
1597
1850
|
this._textStr += ' of';
|
|
1598
|
-
if (
|
|
1599
|
-
this._textStr += `
|
|
1851
|
+
if (intersection_area !== undefined) {
|
|
1852
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
1600
1853
|
}
|
|
1601
1854
|
return new FluentFiltersCondition(this);
|
|
1602
1855
|
}
|
|
1603
1856
|
/**
|
|
1604
1857
|
* Filters for an element below another element.
|
|
1605
1858
|
*
|
|
1606
|
-
* Takes an optional parameter `index` to select the
|
|
1859
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
1860
|
+
*
|
|
1861
|
+
* Takes an optional parameter `intersection_area` to specify which elements below of the other element are filtered for based on their horizontal position (y-coordinates of bounding box):
|
|
1862
|
+
* - `"element_center_line"` - considered below of the other element if element's bounding box intersects with a vertical line passing through the center of the other element
|
|
1863
|
+
* - `"element_edge_area"` - considered below of the other element if element's bounding box intersects with an area between the left and the right edge of the other element
|
|
1864
|
+
* - `"display_edge_area"` - considered below of the other element no matter where it is placed horizontally on the screen (y-axis)
|
|
1607
1865
|
*
|
|
1608
1866
|
* **Examples:**
|
|
1609
1867
|
* ```typescript
|
|
1610
|
-
*
|
|
1611
|
-
* |
|
|
1612
|
-
*
|
|
1613
|
-
*
|
|
1614
|
-
* |
|
|
1615
|
-
*
|
|
1616
|
-
*
|
|
1617
|
-
*
|
|
1618
|
-
*
|
|
1868
|
+
* ------------
|
|
1869
|
+
* | text |
|
|
1870
|
+
* ------------
|
|
1871
|
+
* ------------
|
|
1872
|
+
* | button0 |
|
|
1873
|
+
* ------------
|
|
1874
|
+
* -----------
|
|
1875
|
+
* | button1 |
|
|
1876
|
+
* -----------
|
|
1877
|
+
* -----------
|
|
1878
|
+
* | button2 |
|
|
1879
|
+
* -----------
|
|
1880
|
+
* ------------
|
|
1881
|
+
* | button3 |
|
|
1882
|
+
* ------------
|
|
1883
|
+
*
|
|
1884
|
+
* // General explanation for element_center_line
|
|
1885
|
+
* // This will find button0 and button3
|
|
1886
|
+
* ...button().below(..., 'element_center_line').text()
|
|
1887
|
+
*
|
|
1888
|
+
* // General explanation for element_edge_area
|
|
1889
|
+
* // This will find button0, button1 and button3
|
|
1890
|
+
* ...button().below(..., 'element_edge_area').text()
|
|
1891
|
+
*
|
|
1892
|
+
* // General explanation and display_edge_area
|
|
1893
|
+
* // This will find button0, button1, button2 and button3
|
|
1894
|
+
* ...button().below(..., 'display_edge_area').text()
|
|
1619
1895
|
*
|
|
1896
|
+
* // More examples:
|
|
1620
1897
|
* // Returns button0 because button0 is the first button below text
|
|
1621
1898
|
* ...button().below().text()
|
|
1622
1899
|
* ...button().below(0).text()
|
|
1623
|
-
*
|
|
1624
|
-
*
|
|
1625
|
-
* // Returns
|
|
1900
|
+
* ...button().below(0, 'element_edge_area').text()
|
|
1901
|
+
*
|
|
1902
|
+
* // Returns button3 because it is the second button touched by the
|
|
1903
|
+
* // vertical line from the center of text
|
|
1904
|
+
* // Notice: button1 is not touched
|
|
1905
|
+
* ...button().below(1, 'element_center_line').text()
|
|
1906
|
+
*
|
|
1907
|
+
* // Returns button3 because it is the third button touched by the
|
|
1908
|
+
* // vertical area below the x-axis of text
|
|
1909
|
+
* // Notice: button2 is not touched!
|
|
1910
|
+
* ...button().below(2, 'element_edge_area').text()
|
|
1911
|
+
*
|
|
1912
|
+
* // Returns button2 because it is the third element below text
|
|
1913
|
+
* ...button().below(2, 'display_edge_area').text()
|
|
1914
|
+
*
|
|
1915
|
+
* // Returns no element because text is above the buttons
|
|
1626
1916
|
* ...text().below().button()
|
|
1627
1917
|
* ```
|
|
1628
1918
|
* 
|
|
1629
1919
|
*
|
|
1920
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
1921
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
1922
|
+
*
|
|
1630
1923
|
* @return {FluentFiltersCondition}
|
|
1631
1924
|
*/
|
|
1632
|
-
below(
|
|
1925
|
+
below(index = 0, intersection_area = 'element_edge_area') {
|
|
1633
1926
|
this._textStr = '';
|
|
1634
|
-
if (
|
|
1635
|
-
this._textStr += `index ${
|
|
1927
|
+
if (index !== undefined) {
|
|
1928
|
+
this._textStr += `index ${index}`;
|
|
1636
1929
|
}
|
|
1637
1930
|
this._textStr += ' below';
|
|
1638
|
-
if (
|
|
1639
|
-
this._textStr += `
|
|
1931
|
+
if (intersection_area !== undefined) {
|
|
1932
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
1640
1933
|
}
|
|
1641
1934
|
return new FluentFiltersCondition(this);
|
|
1642
1935
|
}
|
|
1643
1936
|
/**
|
|
1644
1937
|
* Filters for an element above another element.
|
|
1645
1938
|
*
|
|
1646
|
-
* Takes an optional parameter `index` to select the
|
|
1647
|
-
*
|
|
1648
|
-
*
|
|
1649
|
-
*
|
|
1650
|
-
*
|
|
1651
|
-
*
|
|
1652
|
-
*
|
|
1653
|
-
*
|
|
1654
|
-
*
|
|
1655
|
-
*
|
|
1656
|
-
*
|
|
1657
|
-
*
|
|
1658
|
-
*
|
|
1659
|
-
*
|
|
1660
|
-
*
|
|
1939
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
1940
|
+
*
|
|
1941
|
+
* Takes an optional parameter `intersection_area` to specify which elements above of the other element are filtered for based on their horizontal position (y-coordinates of bounding box):
|
|
1942
|
+
* - `"element_center_line"` - considered above of the other element if element's bounding box intersects with a vertical line passing through the center of the other element
|
|
1943
|
+
* - `"element_edge_area"` - considered above of the other element if element's bounding box intersects with an area between the left and the right edge of the other element
|
|
1944
|
+
* - `"display_edge_area"` - considered above of the other element no matter where it is placed horizontally on the screen (y-axis)
|
|
1945
|
+
*
|
|
1946
|
+
* **Examples:**
|
|
1947
|
+
* ```typescript
|
|
1948
|
+
* ------------
|
|
1949
|
+
* | text3 |
|
|
1950
|
+
* ------------
|
|
1951
|
+
* ------------
|
|
1952
|
+
* | text2 |
|
|
1953
|
+
* ------------
|
|
1954
|
+
* ------------
|
|
1955
|
+
* | text1 |
|
|
1956
|
+
* ------------
|
|
1957
|
+
* ------------
|
|
1958
|
+
* | text0 |
|
|
1959
|
+
* ------------
|
|
1960
|
+
* ------------
|
|
1961
|
+
* | button |
|
|
1962
|
+
* ------------
|
|
1963
|
+
*
|
|
1964
|
+
* // General explanation for element_center_line
|
|
1965
|
+
* // This will find text0 and text3
|
|
1966
|
+
* ...text().above(..., 'element_center_line').button()
|
|
1967
|
+
*
|
|
1968
|
+
* // General explanation for element_edge_area
|
|
1969
|
+
* // This will find text0, text1 and text3
|
|
1970
|
+
* ...text().above(..., 'element_edge_area').button()
|
|
1971
|
+
*
|
|
1972
|
+
* // General explanation and display_edge_area
|
|
1973
|
+
* // This will find text0, text1, text2 and text3
|
|
1974
|
+
* ...text().above(..., 'display_edge_area').button()
|
|
1975
|
+
*
|
|
1976
|
+
* // More examples:
|
|
1977
|
+
* // Returns text0 because it is the first element above button
|
|
1661
1978
|
* ...text().above().button()
|
|
1662
1979
|
* ...text().above(0).button()
|
|
1663
|
-
*
|
|
1664
|
-
*
|
|
1665
|
-
* // Returns
|
|
1980
|
+
* ...text().above(0, 'element_edge_area').button()
|
|
1981
|
+
*
|
|
1982
|
+
* // Returns text3 because it is the second text touched by the
|
|
1983
|
+
* // vertical line from the center of button
|
|
1984
|
+
* // Notice: text1 is not touched!
|
|
1985
|
+
* ...text().above(1, 'element_center_line').button()
|
|
1986
|
+
*
|
|
1987
|
+
* // Returns text3 because it is the third text touched by the
|
|
1988
|
+
* // vertical area above the x-axis of button
|
|
1989
|
+
* // Notice: text2 is not touched!
|
|
1990
|
+
* ...text().above(2, 'element_edge_area').button()
|
|
1991
|
+
*
|
|
1992
|
+
* // Returns text2 because it is the third element above button
|
|
1993
|
+
* ...text().above(2, 'display_edge_area').button()
|
|
1994
|
+
*
|
|
1995
|
+
* // Returns no element because button is below the texts
|
|
1666
1996
|
* ...button().above().text()
|
|
1667
1997
|
* ```
|
|
1668
1998
|
* 
|
|
1669
1999
|
*
|
|
2000
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
2001
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
2002
|
+
*
|
|
1670
2003
|
* @return {FluentFiltersCondition}
|
|
1671
2004
|
*/
|
|
1672
|
-
above(
|
|
2005
|
+
above(index = 0, intersection_area = 'element_edge_area') {
|
|
1673
2006
|
this._textStr = '';
|
|
1674
|
-
if (
|
|
1675
|
-
this._textStr += `index ${
|
|
2007
|
+
if (index !== undefined) {
|
|
2008
|
+
this._textStr += `index ${index}`;
|
|
1676
2009
|
}
|
|
1677
2010
|
this._textStr += ' above';
|
|
1678
|
-
if (
|
|
1679
|
-
this._textStr += `
|
|
2011
|
+
if (intersection_area !== undefined) {
|
|
2012
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
1680
2013
|
}
|
|
1681
2014
|
return new FluentFiltersCondition(this);
|
|
1682
2015
|
}
|
|
@@ -1805,7 +2138,7 @@ class FluentCommand extends FluentBase {
|
|
|
1805
2138
|
super(undefined);
|
|
1806
2139
|
}
|
|
1807
2140
|
/**
|
|
1808
|
-
* Expects a condition,
|
|
2141
|
+
* Expects a condition, for example, `exists()` or `notExits()`.
|
|
1809
2142
|
*
|
|
1810
2143
|
* Use the structure `expect().<your filter>.(exists()|notExists())` as shown in the examples below.
|
|
1811
2144
|
*
|
|
@@ -1852,7 +2185,7 @@ class FluentCommand extends FluentBase {
|
|
|
1852
2185
|
* await aui.moveMouseTo().text().withText('Grinning_Face').exec()
|
|
1853
2186
|
* ```
|
|
1854
2187
|
*
|
|
1855
|
-
* 
|
|
1856
2189
|
*
|
|
1857
2190
|
*
|
|
1858
2191
|
*
|
|
@@ -1900,7 +2233,7 @@ class FluentCommand extends FluentBase {
|
|
|
1900
2233
|
* await aui.scrollInside(0,-500).text().withText('Bottom sheet').exec();
|
|
1901
2234
|
* ```
|
|
1902
2235
|
*
|
|
1903
|
-
* 
|
|
1904
2237
|
*
|
|
1905
2238
|
* @param {number} x_offset - A (positive/negative) x direction.
|
|
1906
2239
|
* @param {number} y_offset - A (positive/negative) y direction.
|
|
@@ -2004,7 +2337,7 @@ class FluentCommand extends FluentBase {
|
|
|
2004
2337
|
* await aui.moveMouseRelatively(0, 50).exec();
|
|
2005
2338
|
* ```
|
|
2006
2339
|
*
|
|
2007
|
-
* 
|
|
2008
2341
|
*
|
|
2009
2342
|
* @param {number} x_offset - A (positive/negative) x direction.
|
|
2010
2343
|
* @param {number} y_offset - A (positive/negative) y direction.
|
|
@@ -2083,7 +2416,7 @@ class FluentCommand extends FluentBase {
|
|
|
2083
2416
|
return new Exec(this);
|
|
2084
2417
|
}
|
|
2085
2418
|
/**
|
|
2086
|
-
* Executes a shell command on the device your
|
|
2419
|
+
* Executes a shell command on the device your AskUI Controller is connected to.
|
|
2087
2420
|
*
|
|
2088
2421
|
* **Example:**
|
|
2089
2422
|
* ```typescript
|
|
@@ -2185,7 +2518,7 @@ class FluentCommand extends FluentBase {
|
|
|
2185
2518
|
* await aui.mouseDoubleLeftClick().exec();
|
|
2186
2519
|
* ```
|
|
2187
2520
|
*
|
|
2188
|
-
* 
|
|
2189
2522
|
*
|
|
2190
2523
|
* @return {Exec}
|
|
2191
2524
|
*/
|
|
@@ -2377,7 +2710,7 @@ class FluentCommand extends FluentBase {
|
|
|
2377
2710
|
* await aui.pressAndroidTwoKey('volume_down', 'power').exec();
|
|
2378
2711
|
* ```
|
|
2379
2712
|
*
|
|
2380
|
-
* 
|
|
2381
2714
|
*
|
|
2382
2715
|
* @param {ANDROID_KEY} first_key - A Android key
|
|
2383
2716
|
* @param {ANDROID_KEY} second_key - A Android key
|
|
@@ -2564,6 +2897,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2564
2897
|
return new FluentFiltersOrRelationsGetter(this);
|
|
2565
2898
|
}
|
|
2566
2899
|
/**
|
|
2900
|
+
* Filters for a UI element 'table'.
|
|
2567
2901
|
*
|
|
2568
2902
|
* @return {FluentFiltersOrRelationsGetter}
|
|
2569
2903
|
*/
|
|
@@ -2592,6 +2926,8 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2592
2926
|
* await aui.click().text().withTextRegex('\b[Ss]\w+').exec();
|
|
2593
2927
|
* ```
|
|
2594
2928
|
*
|
|
2929
|
+
* @param {string} [text] - A text to be matched.
|
|
2930
|
+
*
|
|
2595
2931
|
* @return {FluentFiltersOrRelationsGetter}
|
|
2596
2932
|
*/
|
|
2597
2933
|
text(text) {
|
|
@@ -2624,9 +2960,9 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2624
2960
|
return new FluentFiltersOrRelationsGetter(this);
|
|
2625
2961
|
}
|
|
2626
2962
|
/**
|
|
2627
|
-
* Filters for a 'custom element', that is a UI element
|
|
2963
|
+
* Filters for a 'custom element', that is a UI element that 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()`.
|
|
2628
2964
|
*
|
|
2629
|
-
* See the tutorial - [Custom Element](https://docs.askui.com/docs/general/
|
|
2965
|
+
* See the tutorial - [Custom Element](https://docs.askui.com/docs/general/Element%20Selection/custom-elements) for more details.
|
|
2630
2966
|
*
|
|
2631
2967
|
* **Example**
|
|
2632
2968
|
* ```typescript
|
|
@@ -2635,7 +2971,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2635
2971
|
* .customElement({
|
|
2636
2972
|
* customImage: './logo.png', // required
|
|
2637
2973
|
* name: 'myLogo', // optional
|
|
2638
|
-
* threshold: 0.
|
|
2974
|
+
* threshold: 0.5, // optional, defaults to 0.5
|
|
2639
2975
|
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
2640
2976
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
2641
2977
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
@@ -2651,13 +2987,13 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2651
2987
|
* - **name** (*`string`, optional*):
|
|
2652
2988
|
* - 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.
|
|
2653
2989
|
* - **threshold** (*`number`, optional*):
|
|
2654
|
-
* - 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.
|
|
2990
|
+
* - 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.5`.
|
|
2655
2991
|
* - **stopThreshold** (*`number`, optional*):
|
|
2656
2992
|
* - 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`.
|
|
2657
2993
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
2658
2994
|
* - 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`.
|
|
2659
2995
|
* - **imageCompareFormat** (*`'RGB' | 'grayscale' | 'edges'`, optional*):
|
|
2660
|
-
* - 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'
|
|
2996
|
+
* - 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'`.
|
|
2661
2997
|
*
|
|
2662
2998
|
*
|
|
2663
2999
|
* @param {CustomElementJson} customElement - The custom element to filter for.
|
|
@@ -2672,7 +3008,13 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2672
3008
|
return new FluentFiltersOrRelationsGetter(this);
|
|
2673
3009
|
}
|
|
2674
3010
|
/**
|
|
2675
|
-
* Detects an AI Element created with the workflow
|
|
3011
|
+
* Detects an AI Element created with the [snipping workflow](https://docs.askui.com/docs/general/Components/aielement#snipping-workflow).
|
|
3012
|
+
*
|
|
3013
|
+
* **Examples:**
|
|
3014
|
+
*
|
|
3015
|
+
* ```typescript
|
|
3016
|
+
* await aui.click().aiElement('askui-logo').exec();
|
|
3017
|
+
* ```
|
|
2676
3018
|
*
|
|
2677
3019
|
* @param {string} aiElementName - Name of the AI Element.
|
|
2678
3020
|
*
|
|
@@ -2760,12 +3102,13 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2760
3102
|
* 'other' === withText('text') => false
|
|
2761
3103
|
*
|
|
2762
3104
|
* // optional parameter: similarity_score
|
|
2763
|
-
* '978-0-201-00650-6' == withText(
|
|
2764
|
-
* '978-0-201-00650-6' == withText(
|
|
3105
|
+
* '978-0-201-00650-6' == withText("978-0-201-00", 90) => false with 82.76 < 90 similarity
|
|
3106
|
+
* '978-0-201-00650-6' == withText("978-0-201-00650", 90) => true with 93.75 > 90 similarity
|
|
2765
3107
|
* ```
|
|
2766
3108
|
* 
|
|
2767
3109
|
*
|
|
2768
3110
|
* @param {string} text - A text to be matched.
|
|
3111
|
+
* @param {number} [similarityScore=70] - Similarity score minimum value, it should be between `0` and `100`.
|
|
2769
3112
|
*
|
|
2770
3113
|
* @return {FluentFiltersOrRelationsGetter}
|
|
2771
3114
|
*/
|
|
@@ -2792,7 +3135,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2792
3135
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
2793
3136
|
* ```
|
|
2794
3137
|
*
|
|
2795
|
-
* 
|
|
2796
3139
|
*
|
|
2797
3140
|
*
|
|
2798
3141
|
*
|
|
@@ -2824,7 +3167,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2824
3167
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
2825
3168
|
* ```
|
|
2826
3169
|
*
|
|
2827
|
-
* 
|
|
2828
3171
|
*
|
|
2829
3172
|
*
|
|
2830
3173
|
*
|
|
@@ -2872,10 +3215,10 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2872
3215
|
* **Important: _Matching only returns the best matching element when you use it with `get()`_**
|
|
2873
3216
|
*
|
|
2874
3217
|
* A bit of playing around to find a matching description is sometimes needed:
|
|
2875
|
-
*
|
|
3218
|
+
* For example, `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
2876
3219
|
* Generally, the more detail the better.
|
|
2877
3220
|
*
|
|
2878
|
-
* We also recommend to not restrict the type of element by using the
|
|
3221
|
+
* We also recommend to not restrict the type of element by using the general selector `element()` as shown in the examples below.
|
|
2879
3222
|
*
|
|
2880
3223
|
* **Examples:**
|
|
2881
3224
|
* ```typescript
|
|
@@ -3048,150 +3391,304 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3048
3391
|
/**
|
|
3049
3392
|
* Filters for an element right of another element.
|
|
3050
3393
|
*
|
|
3051
|
-
* Takes an optional parameter `index` to select the
|
|
3394
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
3395
|
+
*
|
|
3396
|
+
* Takes an optional parameter `intersection_area` to specify which elements right of the other element are filtered for based on their vertical position (y-coordinates of bounding box):
|
|
3397
|
+
* - `"element_center_line"` - considered right of the other element if element's bounding box intersects with a horizontal line passing through the center of the other element
|
|
3398
|
+
* - `"element_edge_area"` - considered right of the other element if element's bounding box intersects with an area between the top and the bottom edge of the other element
|
|
3399
|
+
* - `"display_edge_area"` - considered right of the other element no matter where it is placed vertically on the screen (y-axis)
|
|
3052
3400
|
*
|
|
3053
3401
|
* **Examples:**
|
|
3054
3402
|
* ```typescript
|
|
3055
|
-
*
|
|
3056
|
-
* |
|
|
3057
|
-
*
|
|
3403
|
+
* ---------- --------- ---------
|
|
3404
|
+
* | button | | text0 | | text3 |
|
|
3405
|
+
* ---------- --------- --------- ---------
|
|
3406
|
+
* | text1 | ---------
|
|
3407
|
+
* --------- | text2 |
|
|
3408
|
+
* ---------
|
|
3409
|
+
*
|
|
3410
|
+
* // General explanation for element_center_line
|
|
3411
|
+
* // This will find text0 and text3
|
|
3412
|
+
* ...text().rightOf(..., 'element_center_line').button()
|
|
3413
|
+
*
|
|
3414
|
+
* // General explanation for element_edge_area
|
|
3415
|
+
* // This will find text0, text1 and text3
|
|
3416
|
+
* ...text().rightOf(..., 'element_edge_area').button()
|
|
3417
|
+
*
|
|
3418
|
+
* // General explanation and display_edge_area
|
|
3419
|
+
* // This will find text0, text1, text2 and text3
|
|
3420
|
+
* ...text().rightOf(..., 'display_edge_area').button()
|
|
3058
3421
|
*
|
|
3059
|
-
* //
|
|
3060
|
-
*
|
|
3061
|
-
* ...
|
|
3062
|
-
*
|
|
3063
|
-
* ...
|
|
3064
|
-
*
|
|
3065
|
-
*
|
|
3422
|
+
* // More examples:
|
|
3423
|
+
* // Returns text0 because it is the first element rightOf button
|
|
3424
|
+
* ...text().rightOf().button()
|
|
3425
|
+
* ...text().rightOf(0).button()
|
|
3426
|
+
* ...text().rightOf(0, 'element_edge_area').button()
|
|
3427
|
+
*
|
|
3428
|
+
* // Returns text3 because it is the second text touched by the
|
|
3429
|
+
* // horizontal line from the center of button
|
|
3430
|
+
* // Notice: text1 is not touched!
|
|
3431
|
+
* ...text().rightOf(1, 'element_center_line').button()
|
|
3432
|
+
*
|
|
3433
|
+
* // Returns text3 because it is the third text touched by the
|
|
3434
|
+
* // vertical area rightOf the y-axis of button
|
|
3435
|
+
* // Notice: text2 is not touched!
|
|
3436
|
+
* ...text().rightOf(2, 'element_edge_area').button()
|
|
3437
|
+
*
|
|
3438
|
+
* // Returns text2 because it is the third element rightOf button
|
|
3439
|
+
* ...text().rightOf(2, 'display_edge_area').button()
|
|
3440
|
+
*
|
|
3441
|
+
* // Returns no element because button is rightOf the texts
|
|
3442
|
+
* ...button().rightOf().text()
|
|
3066
3443
|
* ```
|
|
3067
3444
|
* 
|
|
3068
3445
|
*
|
|
3446
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
3447
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
3448
|
+
*
|
|
3069
3449
|
* @return {FluentFiltersGetter}
|
|
3070
3450
|
*/
|
|
3071
|
-
rightOf(
|
|
3451
|
+
rightOf(index = 0, intersection_area = 'element_edge_area') {
|
|
3072
3452
|
this._textStr = '';
|
|
3073
|
-
if (
|
|
3074
|
-
this._textStr += `index ${
|
|
3453
|
+
if (index !== undefined) {
|
|
3454
|
+
this._textStr += `index ${index}`;
|
|
3075
3455
|
}
|
|
3076
3456
|
this._textStr += ' right';
|
|
3077
3457
|
this._textStr += ' of';
|
|
3078
|
-
if (
|
|
3079
|
-
this._textStr += `
|
|
3458
|
+
if (intersection_area !== undefined) {
|
|
3459
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
3080
3460
|
}
|
|
3081
3461
|
return new FluentFiltersGetter(this);
|
|
3082
3462
|
}
|
|
3083
3463
|
/**
|
|
3084
3464
|
* Filters for an element left of another element.
|
|
3085
3465
|
*
|
|
3086
|
-
* Takes an optional parameter `index` to select the
|
|
3466
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
3467
|
+
*
|
|
3468
|
+
* Takes an optional parameter `intersection_area` to specify which elements left of the other element are filtered for based on their vertical position (y-coordinates of bounding box):
|
|
3469
|
+
* - `"element_center_line"` - considered left of the other element if element's bounding box intersects with a horizontal line passing through the center of the other element
|
|
3470
|
+
* - `"element_edge_area"` - considered left of the other element if element's bounding box intersects with an area between the top and the bottom edge of the other element
|
|
3471
|
+
* - `"display_edge_area"` - considered left of the other element no matter where it is placed vertically on the screen (y-axis)
|
|
3087
3472
|
*
|
|
3088
3473
|
* **Examples:**
|
|
3089
3474
|
* ```typescript
|
|
3090
|
-
*
|
|
3091
|
-
* |
|
|
3092
|
-
*
|
|
3475
|
+
* --------- --------- ----------
|
|
3476
|
+
* | text3 | | text0 | | button |
|
|
3477
|
+
* --------- --------- --------- ----------
|
|
3478
|
+
* --------- | text1 |
|
|
3479
|
+
* | text2 | ---------
|
|
3480
|
+
* ---------
|
|
3481
|
+
*
|
|
3482
|
+
* // General explanation for element_center_line
|
|
3483
|
+
* // This will find text0 and text3
|
|
3484
|
+
* ...text().leftOf(..., 'element_center_line').button()
|
|
3485
|
+
*
|
|
3486
|
+
* // General explanation for element_edge_area
|
|
3487
|
+
* // This will find text0, text1 and text3
|
|
3488
|
+
* ...text().leftOf(..., 'element_edge_area').button()
|
|
3489
|
+
*
|
|
3490
|
+
* // General explanation and display_edge_area
|
|
3491
|
+
* // This will find text0, text1, text2 and text3
|
|
3492
|
+
* ...text().leftOf(..., 'display_edge_area').button()
|
|
3493
|
+
*
|
|
3494
|
+
* // More examples:
|
|
3495
|
+
* // Returns text0 because it is the first element leftOf button
|
|
3496
|
+
* ...text().leftOf().button()
|
|
3497
|
+
* ...text().leftOf(0).button()
|
|
3498
|
+
* ...text().leftOf(0, 'element_edge_area').button()
|
|
3499
|
+
*
|
|
3500
|
+
* // Returns text3 because it is the second text touched by the
|
|
3501
|
+
* // horizontal line from the center of button
|
|
3502
|
+
* // Notice: text1 is not touched!
|
|
3503
|
+
* ...text().leftOf(1, 'element_center_line').button()
|
|
3093
3504
|
*
|
|
3094
|
-
* // Returns
|
|
3095
|
-
*
|
|
3096
|
-
*
|
|
3097
|
-
*
|
|
3098
|
-
*
|
|
3099
|
-
* // Returns
|
|
3100
|
-
* ...
|
|
3505
|
+
* // Returns text3 because it is the third text touched by the
|
|
3506
|
+
* // vertical area leftOf the y-axis of button
|
|
3507
|
+
* // Notice: text2 is not touched!
|
|
3508
|
+
* ...text().leftOf(2, 'element_edge_area').button()
|
|
3509
|
+
*
|
|
3510
|
+
* // Returns text2 because it is the third element leftOf button
|
|
3511
|
+
* ...text().leftOf(2, 'display_edge_area').button()
|
|
3512
|
+
*
|
|
3513
|
+
* // Returns no element because button is rightOf the texts
|
|
3514
|
+
* ...button().leftOf().text()
|
|
3101
3515
|
* ```
|
|
3102
3516
|
* 
|
|
3103
3517
|
*
|
|
3518
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
3519
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
3520
|
+
*
|
|
3104
3521
|
* @return {FluentFiltersGetter}
|
|
3105
3522
|
*/
|
|
3106
|
-
leftOf(
|
|
3523
|
+
leftOf(index = 0, intersection_area = 'element_edge_area') {
|
|
3107
3524
|
this._textStr = '';
|
|
3108
|
-
if (
|
|
3109
|
-
this._textStr += `index ${
|
|
3525
|
+
if (index !== undefined) {
|
|
3526
|
+
this._textStr += `index ${index}`;
|
|
3110
3527
|
}
|
|
3111
3528
|
this._textStr += ' left';
|
|
3112
3529
|
this._textStr += ' of';
|
|
3113
|
-
if (
|
|
3114
|
-
this._textStr += `
|
|
3530
|
+
if (intersection_area !== undefined) {
|
|
3531
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
3115
3532
|
}
|
|
3116
3533
|
return new FluentFiltersGetter(this);
|
|
3117
3534
|
}
|
|
3118
3535
|
/**
|
|
3119
3536
|
* Filters for an element below another element.
|
|
3120
3537
|
*
|
|
3121
|
-
* Takes an optional parameter `index` to select the
|
|
3538
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
3539
|
+
*
|
|
3540
|
+
* Takes an optional parameter `intersection_area` to specify which elements below of the other element are filtered for based on their horizontal position (y-coordinates of bounding box):
|
|
3541
|
+
* - `"element_center_line"` - considered below of the other element if element's bounding box intersects with a vertical line passing through the center of the other element
|
|
3542
|
+
* - `"element_edge_area"` - considered below of the other element if element's bounding box intersects with an area between the left and the right edge of the other element
|
|
3543
|
+
* - `"display_edge_area"` - considered below of the other element no matter where it is placed horizontally on the screen (y-axis)
|
|
3122
3544
|
*
|
|
3123
3545
|
* **Examples:**
|
|
3124
3546
|
* ```typescript
|
|
3125
|
-
*
|
|
3126
|
-
* |
|
|
3127
|
-
*
|
|
3128
|
-
*
|
|
3129
|
-
* |
|
|
3130
|
-
*
|
|
3131
|
-
*
|
|
3132
|
-
*
|
|
3133
|
-
*
|
|
3547
|
+
* ------------
|
|
3548
|
+
* | text |
|
|
3549
|
+
* ------------
|
|
3550
|
+
* ------------
|
|
3551
|
+
* | button0 |
|
|
3552
|
+
* ------------
|
|
3553
|
+
* -----------
|
|
3554
|
+
* | button1 |
|
|
3555
|
+
* -----------
|
|
3556
|
+
* -----------
|
|
3557
|
+
* | button2 |
|
|
3558
|
+
* -----------
|
|
3559
|
+
* ------------
|
|
3560
|
+
* | button3 |
|
|
3561
|
+
* ------------
|
|
3134
3562
|
*
|
|
3563
|
+
* // General explanation for element_center_line
|
|
3564
|
+
* // This will find button0 and button3
|
|
3565
|
+
* ...button().below(..., 'element_center_line').text()
|
|
3566
|
+
*
|
|
3567
|
+
* // General explanation for element_edge_area
|
|
3568
|
+
* // This will find button0, button1 and button3
|
|
3569
|
+
* ...button().below(..., 'element_edge_area').text()
|
|
3570
|
+
*
|
|
3571
|
+
* // General explanation and display_edge_area
|
|
3572
|
+
* // This will find button0, button1, button2 and button3
|
|
3573
|
+
* ...button().below(..., 'display_edge_area').text()
|
|
3574
|
+
*
|
|
3575
|
+
* // More examples:
|
|
3135
3576
|
* // Returns button0 because button0 is the first button below text
|
|
3136
3577
|
* ...button().below().text()
|
|
3137
3578
|
* ...button().below(0).text()
|
|
3138
|
-
*
|
|
3139
|
-
*
|
|
3140
|
-
* // Returns
|
|
3579
|
+
* ...button().below(0, 'element_edge_area').text()
|
|
3580
|
+
*
|
|
3581
|
+
* // Returns button3 because it is the second button touched by the
|
|
3582
|
+
* // vertical line from the center of text
|
|
3583
|
+
* // Notice: button1 is not touched
|
|
3584
|
+
* ...button().below(1, 'element_center_line').text()
|
|
3585
|
+
*
|
|
3586
|
+
* // Returns button3 because it is the third button touched by the
|
|
3587
|
+
* // vertical area below the x-axis of text
|
|
3588
|
+
* // Notice: button2 is not touched!
|
|
3589
|
+
* ...button().below(2, 'element_edge_area').text()
|
|
3590
|
+
*
|
|
3591
|
+
* // Returns button2 because it is the third element below text
|
|
3592
|
+
* ...button().below(2, 'display_edge_area').text()
|
|
3593
|
+
*
|
|
3594
|
+
* // Returns no element because text is above the buttons
|
|
3141
3595
|
* ...text().below().button()
|
|
3142
3596
|
* ```
|
|
3143
3597
|
* 
|
|
3144
3598
|
*
|
|
3599
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
3600
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
3601
|
+
*
|
|
3145
3602
|
* @return {FluentFiltersGetter}
|
|
3146
3603
|
*/
|
|
3147
|
-
below(
|
|
3604
|
+
below(index = 0, intersection_area = 'element_edge_area') {
|
|
3148
3605
|
this._textStr = '';
|
|
3149
|
-
if (
|
|
3150
|
-
this._textStr += `index ${
|
|
3606
|
+
if (index !== undefined) {
|
|
3607
|
+
this._textStr += `index ${index}`;
|
|
3151
3608
|
}
|
|
3152
3609
|
this._textStr += ' below';
|
|
3153
|
-
if (
|
|
3154
|
-
this._textStr += `
|
|
3610
|
+
if (intersection_area !== undefined) {
|
|
3611
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
3155
3612
|
}
|
|
3156
3613
|
return new FluentFiltersGetter(this);
|
|
3157
3614
|
}
|
|
3158
3615
|
/**
|
|
3159
3616
|
* Filters for an element above another element.
|
|
3160
3617
|
*
|
|
3161
|
-
* Takes an optional parameter `index` to select the
|
|
3162
|
-
*
|
|
3163
|
-
*
|
|
3164
|
-
*
|
|
3165
|
-
*
|
|
3166
|
-
*
|
|
3167
|
-
*
|
|
3168
|
-
*
|
|
3169
|
-
*
|
|
3170
|
-
*
|
|
3171
|
-
*
|
|
3172
|
-
*
|
|
3173
|
-
*
|
|
3174
|
-
*
|
|
3175
|
-
*
|
|
3618
|
+
* Takes an optional parameter `index` to select the nth element (defaults to `0`).
|
|
3619
|
+
*
|
|
3620
|
+
* Takes an optional parameter `intersection_area` to specify which elements above of the other element are filtered for based on their horizontal position (y-coordinates of bounding box):
|
|
3621
|
+
* - `"element_center_line"` - considered above of the other element if element's bounding box intersects with a vertical line passing through the center of the other element
|
|
3622
|
+
* - `"element_edge_area"` - considered above of the other element if element's bounding box intersects with an area between the left and the right edge of the other element
|
|
3623
|
+
* - `"display_edge_area"` - considered above of the other element no matter where it is placed horizontally on the screen (y-axis)
|
|
3624
|
+
*
|
|
3625
|
+
* **Examples:**
|
|
3626
|
+
* ```typescript
|
|
3627
|
+
* ------------
|
|
3628
|
+
* | text3 |
|
|
3629
|
+
* ------------
|
|
3630
|
+
* ------------
|
|
3631
|
+
* | text2 |
|
|
3632
|
+
* ------------
|
|
3633
|
+
* ------------
|
|
3634
|
+
* | text1 |
|
|
3635
|
+
* ------------
|
|
3636
|
+
* ------------
|
|
3637
|
+
* | text0 |
|
|
3638
|
+
* ------------
|
|
3639
|
+
* ------------
|
|
3640
|
+
* | button |
|
|
3641
|
+
* ------------
|
|
3642
|
+
*
|
|
3643
|
+
* // General explanation for element_center_line
|
|
3644
|
+
* // This will find text0 and text3
|
|
3645
|
+
* ...text().above(..., 'element_center_line').button()
|
|
3646
|
+
*
|
|
3647
|
+
* // General explanation for element_edge_area
|
|
3648
|
+
* // This will find text0, text1 and text3
|
|
3649
|
+
* ...text().above(..., 'element_edge_area').button()
|
|
3650
|
+
*
|
|
3651
|
+
* // General explanation and display_edge_area
|
|
3652
|
+
* // This will find text0, text1, text2 and text3
|
|
3653
|
+
* ...text().above(..., 'display_edge_area').button()
|
|
3654
|
+
*
|
|
3655
|
+
* // More examples:
|
|
3656
|
+
* // Returns text0 because it is the first element above button
|
|
3176
3657
|
* ...text().above().button()
|
|
3177
3658
|
* ...text().above(0).button()
|
|
3178
|
-
*
|
|
3179
|
-
*
|
|
3180
|
-
* // Returns
|
|
3659
|
+
* ...text().above(0, 'element_edge_area').button()
|
|
3660
|
+
*
|
|
3661
|
+
* // Returns text3 because it is the second text touched by the
|
|
3662
|
+
* // vertical line from the center of button
|
|
3663
|
+
* // Notice: text1 is not touched!
|
|
3664
|
+
* ...text().above(1, 'element_center_line').button()
|
|
3665
|
+
*
|
|
3666
|
+
* // Returns text3 because it is the third text touched by the
|
|
3667
|
+
* // vertical area above the x-axis of button
|
|
3668
|
+
* // Notice: text2 is not touched!
|
|
3669
|
+
* ...text().above(2, 'element_edge_area').button()
|
|
3670
|
+
*
|
|
3671
|
+
* // Returns text2 because it is the third element above button
|
|
3672
|
+
* ...text().above(2, 'display_edge_area').button()
|
|
3673
|
+
*
|
|
3674
|
+
* // Returns no element because button is below the texts
|
|
3181
3675
|
* ...button().above().text()
|
|
3182
3676
|
* ```
|
|
3183
3677
|
* 
|
|
3184
3678
|
*
|
|
3679
|
+
* @param {number} [index=0] - Index of element to filter for going into the direction specified. Defaults to `0` which is the first element (zero-indexed) found in that direction.
|
|
3680
|
+
* @param {INTERSECTION_AREA} [intersection_area="element_edge_area"] - Intersecting with either `"element_center_line"`, `"element_edge_area"` or `"display_edge_area"`. Defaults to `"element_edge_area"`.
|
|
3681
|
+
*
|
|
3185
3682
|
* @return {FluentFiltersGetter}
|
|
3186
3683
|
*/
|
|
3187
|
-
above(
|
|
3684
|
+
above(index = 0, intersection_area = 'element_edge_area') {
|
|
3188
3685
|
this._textStr = '';
|
|
3189
|
-
if (
|
|
3190
|
-
this._textStr += `index ${
|
|
3686
|
+
if (index !== undefined) {
|
|
3687
|
+
this._textStr += `index ${index}`;
|
|
3191
3688
|
}
|
|
3192
3689
|
this._textStr += ' above';
|
|
3193
|
-
if (
|
|
3194
|
-
this._textStr += `
|
|
3690
|
+
if (intersection_area !== undefined) {
|
|
3691
|
+
this._textStr += ` intersection_area ${intersection_area}`;
|
|
3195
3692
|
}
|
|
3196
3693
|
return new FluentFiltersGetter(this);
|
|
3197
3694
|
}
|
|
@@ -3295,6 +3792,7 @@ class Getter extends FluentCommand {
|
|
|
3295
3792
|
* ]
|
|
3296
3793
|
* ```
|
|
3297
3794
|
*
|
|
3795
|
+
* ```typescript
|
|
3298
3796
|
* // *************************************************** //
|
|
3299
3797
|
* // Examples on how to work with the returned elements //
|
|
3300
3798
|
* // *************************************************** //
|
|
@@ -3378,6 +3876,7 @@ class Getter extends FluentCommand {
|
|
|
3378
3876
|
* xmax: 1178.8204241071428,
|
|
3379
3877
|
* ymax: 180.83512834821428
|
|
3380
3878
|
* },
|
|
3879
|
+
* },
|
|
3381
3880
|
* DetectedElement {
|
|
3382
3881
|
* name: 'ICON',
|
|
3383
3882
|
* text: 'search',
|
|
@@ -3387,8 +3886,8 @@ class Getter extends FluentCommand {
|
|
|
3387
3886
|
* xmax: 450.6304241071428,
|
|
3388
3887
|
* ymax: 950.47812834821428
|
|
3389
3888
|
* },
|
|
3390
|
-
*
|
|
3391
|
-
*
|
|
3889
|
+
* },
|
|
3890
|
+
* ... 381 more items
|
|
3392
3891
|
* ]
|
|
3393
3892
|
* ```
|
|
3394
3893
|
*
|