askui 0.20.2 → 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 +528 -162
- package/dist/cjs/execution/dsl.js +533 -162
- package/dist/esm/core/model/custom-element-json.d.ts +1 -1
- package/dist/esm/execution/dsl.d.ts +528 -162
- package/dist/esm/execution/dsl.js +533 -162
- package/package.json +1 -1
- 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;
|
|
@@ -289,7 +294,7 @@ class FluentFilters extends FluentBase {
|
|
|
289
294
|
* .customElement({
|
|
290
295
|
* customImage: './logo.png', // required
|
|
291
296
|
* name: 'myLogo', // optional
|
|
292
|
-
* threshold: 0.
|
|
297
|
+
* threshold: 0.5, // optional, defaults to 0.5
|
|
293
298
|
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
294
299
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
295
300
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
@@ -305,7 +310,7 @@ class FluentFilters extends FluentBase {
|
|
|
305
310
|
* - **name** (*`string`, optional*):
|
|
306
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.
|
|
307
312
|
* - **threshold** (*`number`, optional*):
|
|
308
|
-
* - 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`.
|
|
309
314
|
* - **stopThreshold** (*`number`, optional*):
|
|
310
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`.
|
|
311
316
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
@@ -453,7 +458,7 @@ class FluentFilters extends FluentBase {
|
|
|
453
458
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
454
459
|
* ```
|
|
455
460
|
*
|
|
456
|
-
* 
|
|
457
462
|
*
|
|
458
463
|
*
|
|
459
464
|
*
|
|
@@ -485,7 +490,7 @@ class FluentFilters extends FluentBase {
|
|
|
485
490
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
486
491
|
* ```
|
|
487
492
|
*
|
|
488
|
-
* 
|
|
489
494
|
*
|
|
490
495
|
*
|
|
491
496
|
*
|
|
@@ -533,7 +538,7 @@ class FluentFilters extends FluentBase {
|
|
|
533
538
|
* **Important: _Matching only returns the best matching element when you use it with `get()`_**
|
|
534
539
|
*
|
|
535
540
|
* A bit of playing around to find a matching description is sometimes needed:
|
|
536
|
-
*
|
|
541
|
+
* For example, `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
537
542
|
* Generally, the more detail the better.
|
|
538
543
|
*
|
|
539
544
|
* We also recommend to not restrict the type of element by using the general selector `element()` as shown in the examples below.
|
|
@@ -718,17 +723,46 @@ class FluentFiltersOrRelations extends FluentFilters {
|
|
|
718
723
|
*
|
|
719
724
|
* **Examples:**
|
|
720
725
|
* ```typescript
|
|
721
|
-
*
|
|
722
|
-
* |
|
|
723
|
-
*
|
|
726
|
+
* ---------- --------- ---------
|
|
727
|
+
* | button | | text0 | | text3 |
|
|
728
|
+
* ---------- --------- --------- ---------
|
|
729
|
+
* | text1 | ---------
|
|
730
|
+
* --------- | text2 |
|
|
731
|
+
* ---------
|
|
724
732
|
*
|
|
725
|
-
* //
|
|
726
|
-
*
|
|
727
|
-
* ...
|
|
728
|
-
*
|
|
729
|
-
*
|
|
730
|
-
* //
|
|
731
|
-
* ...
|
|
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()
|
|
750
|
+
*
|
|
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()
|
|
732
766
|
* ```
|
|
733
767
|
* 
|
|
734
768
|
*
|
|
@@ -761,17 +795,46 @@ class FluentFiltersOrRelations extends FluentFilters {
|
|
|
761
795
|
*
|
|
762
796
|
* **Examples:**
|
|
763
797
|
* ```typescript
|
|
764
|
-
*
|
|
765
|
-
* |
|
|
766
|
-
*
|
|
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()
|
|
827
|
+
*
|
|
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()
|
|
767
835
|
*
|
|
768
|
-
* // Returns
|
|
769
|
-
* ...
|
|
770
|
-
* ...leftEl().leftOf(0).rightEl()
|
|
771
|
-
* // Returns leftEl1 because leftEl1 is the second element left of rightEl
|
|
772
|
-
* ...leftEl().leftOf(1).rightEl()
|
|
773
|
-
* // Returns no element because rightEl is left of leftEl
|
|
774
|
-
* ...rightEl().leftOf().leftEl()
|
|
836
|
+
* // Returns no element because button is rightOf the texts
|
|
837
|
+
* ...button().leftOf().text()
|
|
775
838
|
* ```
|
|
776
839
|
* 
|
|
777
840
|
*
|
|
@@ -804,22 +867,54 @@ class FluentFiltersOrRelations extends FluentFilters {
|
|
|
804
867
|
*
|
|
805
868
|
* **Examples:**
|
|
806
869
|
* ```typescript
|
|
807
|
-
*
|
|
808
|
-
* |
|
|
809
|
-
*
|
|
810
|
-
*
|
|
811
|
-
* |
|
|
812
|
-
*
|
|
813
|
-
*
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
*
|
|
870
|
+
* ------------
|
|
871
|
+
* | text |
|
|
872
|
+
* ------------
|
|
873
|
+
* ------------
|
|
874
|
+
* | button0 |
|
|
875
|
+
* ------------
|
|
876
|
+
* -----------
|
|
877
|
+
* | button1 |
|
|
878
|
+
* -----------
|
|
879
|
+
* -----------
|
|
880
|
+
* | button2 |
|
|
881
|
+
* -----------
|
|
882
|
+
* ------------
|
|
883
|
+
* | button3 |
|
|
884
|
+
* ------------
|
|
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:
|
|
817
899
|
* // Returns button0 because button0 is the first button below text
|
|
818
900
|
* ...button().below().text()
|
|
819
901
|
* ...button().below(0).text()
|
|
820
|
-
*
|
|
821
|
-
*
|
|
822
|
-
* // 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
|
|
823
918
|
* ...text().below().button()
|
|
824
919
|
* ```
|
|
825
920
|
* 
|
|
@@ -852,22 +947,54 @@ class FluentFiltersOrRelations extends FluentFilters {
|
|
|
852
947
|
*
|
|
853
948
|
* **Examples:**
|
|
854
949
|
* ```typescript
|
|
855
|
-
*
|
|
856
|
-
* |
|
|
857
|
-
*
|
|
858
|
-
*
|
|
859
|
-
*
|
|
860
|
-
*
|
|
861
|
-
*
|
|
862
|
-
*
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
*
|
|
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
|
|
866
980
|
* ...text().above().button()
|
|
867
981
|
* ...text().above(0).button()
|
|
868
|
-
*
|
|
869
|
-
*
|
|
870
|
-
* // 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
|
|
871
998
|
* ...button().above().text()
|
|
872
999
|
* ```
|
|
873
1000
|
* 
|
|
@@ -1165,7 +1292,7 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1165
1292
|
* .customElement({
|
|
1166
1293
|
* customImage: './logo.png', // required
|
|
1167
1294
|
* name: 'myLogo', // optional
|
|
1168
|
-
* threshold: 0.
|
|
1295
|
+
* threshold: 0.5, // optional, defaults to 0.5
|
|
1169
1296
|
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
1170
1297
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
1171
1298
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
@@ -1181,7 +1308,7 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1181
1308
|
* - **name** (*`string`, optional*):
|
|
1182
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.
|
|
1183
1310
|
* - **threshold** (*`number`, optional*):
|
|
1184
|
-
* - 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`.
|
|
1185
1312
|
* - **stopThreshold** (*`number`, optional*):
|
|
1186
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`.
|
|
1187
1314
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
@@ -1329,7 +1456,7 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1329
1456
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
1330
1457
|
* ```
|
|
1331
1458
|
*
|
|
1332
|
-
* 
|
|
1333
1460
|
*
|
|
1334
1461
|
*
|
|
1335
1462
|
*
|
|
@@ -1361,7 +1488,7 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1361
1488
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
1362
1489
|
* ```
|
|
1363
1490
|
*
|
|
1364
|
-
* 
|
|
1365
1492
|
*
|
|
1366
1493
|
*
|
|
1367
1494
|
*
|
|
@@ -1409,7 +1536,7 @@ class FluentFiltersCondition extends FluentBase {
|
|
|
1409
1536
|
* **Important: _Matching only returns the best matching element when you use it with `get()`_**
|
|
1410
1537
|
*
|
|
1411
1538
|
* A bit of playing around to find a matching description is sometimes needed:
|
|
1412
|
-
*
|
|
1539
|
+
* For example, `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
1413
1540
|
* Generally, the more detail the better.
|
|
1414
1541
|
*
|
|
1415
1542
|
* We also recommend to not restrict the type of element by using the general selector `element()` as shown in the examples below.
|
|
@@ -1594,17 +1721,46 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1594
1721
|
*
|
|
1595
1722
|
* **Examples:**
|
|
1596
1723
|
* ```typescript
|
|
1597
|
-
*
|
|
1598
|
-
* |
|
|
1599
|
-
*
|
|
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()
|
|
1734
|
+
*
|
|
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()
|
|
1600
1753
|
*
|
|
1601
|
-
* // Returns
|
|
1602
|
-
*
|
|
1603
|
-
*
|
|
1604
|
-
*
|
|
1605
|
-
*
|
|
1606
|
-
* // Returns
|
|
1607
|
-
* ...
|
|
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()
|
|
1608
1764
|
* ```
|
|
1609
1765
|
* 
|
|
1610
1766
|
*
|
|
@@ -1637,17 +1793,46 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1637
1793
|
*
|
|
1638
1794
|
* **Examples:**
|
|
1639
1795
|
* ```typescript
|
|
1640
|
-
*
|
|
1641
|
-
* |
|
|
1642
|
-
*
|
|
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()
|
|
1810
|
+
*
|
|
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()
|
|
1643
1825
|
*
|
|
1644
|
-
* // Returns
|
|
1645
|
-
*
|
|
1646
|
-
*
|
|
1647
|
-
*
|
|
1648
|
-
*
|
|
1649
|
-
* // Returns
|
|
1650
|
-
* ...
|
|
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()
|
|
1651
1836
|
* ```
|
|
1652
1837
|
* 
|
|
1653
1838
|
*
|
|
@@ -1680,22 +1865,54 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1680
1865
|
*
|
|
1681
1866
|
* **Examples:**
|
|
1682
1867
|
* ```typescript
|
|
1683
|
-
*
|
|
1684
|
-
* |
|
|
1685
|
-
*
|
|
1686
|
-
*
|
|
1687
|
-
* |
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
1690
|
-
*
|
|
1691
|
-
*
|
|
1692
|
-
*
|
|
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()
|
|
1895
|
+
*
|
|
1896
|
+
* // More examples:
|
|
1693
1897
|
* // Returns button0 because button0 is the first button below text
|
|
1694
1898
|
* ...button().below().text()
|
|
1695
1899
|
* ...button().below(0).text()
|
|
1696
|
-
*
|
|
1697
|
-
*
|
|
1698
|
-
* // 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
|
|
1699
1916
|
* ...text().below().button()
|
|
1700
1917
|
* ```
|
|
1701
1918
|
* 
|
|
@@ -1728,22 +1945,54 @@ class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1728
1945
|
*
|
|
1729
1946
|
* **Examples:**
|
|
1730
1947
|
* ```typescript
|
|
1731
|
-
*
|
|
1732
|
-
* |
|
|
1733
|
-
*
|
|
1734
|
-
*
|
|
1735
|
-
*
|
|
1736
|
-
*
|
|
1737
|
-
*
|
|
1738
|
-
*
|
|
1739
|
-
*
|
|
1740
|
-
*
|
|
1741
|
-
*
|
|
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
|
|
1742
1978
|
* ...text().above().button()
|
|
1743
1979
|
* ...text().above(0).button()
|
|
1744
|
-
*
|
|
1745
|
-
*
|
|
1746
|
-
* // 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
|
|
1747
1996
|
* ...button().above().text()
|
|
1748
1997
|
* ```
|
|
1749
1998
|
* 
|
|
@@ -1889,7 +2138,7 @@ class FluentCommand extends FluentBase {
|
|
|
1889
2138
|
super(undefined);
|
|
1890
2139
|
}
|
|
1891
2140
|
/**
|
|
1892
|
-
* Expects a condition,
|
|
2141
|
+
* Expects a condition, for example, `exists()` or `notExits()`.
|
|
1893
2142
|
*
|
|
1894
2143
|
* Use the structure `expect().<your filter>.(exists()|notExists())` as shown in the examples below.
|
|
1895
2144
|
*
|
|
@@ -1936,7 +2185,7 @@ class FluentCommand extends FluentBase {
|
|
|
1936
2185
|
* await aui.moveMouseTo().text().withText('Grinning_Face').exec()
|
|
1937
2186
|
* ```
|
|
1938
2187
|
*
|
|
1939
|
-
* 
|
|
1940
2189
|
*
|
|
1941
2190
|
*
|
|
1942
2191
|
*
|
|
@@ -1984,7 +2233,7 @@ class FluentCommand extends FluentBase {
|
|
|
1984
2233
|
* await aui.scrollInside(0,-500).text().withText('Bottom sheet').exec();
|
|
1985
2234
|
* ```
|
|
1986
2235
|
*
|
|
1987
|
-
* 
|
|
1988
2237
|
*
|
|
1989
2238
|
* @param {number} x_offset - A (positive/negative) x direction.
|
|
1990
2239
|
* @param {number} y_offset - A (positive/negative) y direction.
|
|
@@ -2088,7 +2337,7 @@ class FluentCommand extends FluentBase {
|
|
|
2088
2337
|
* await aui.moveMouseRelatively(0, 50).exec();
|
|
2089
2338
|
* ```
|
|
2090
2339
|
*
|
|
2091
|
-
* 
|
|
2092
2341
|
*
|
|
2093
2342
|
* @param {number} x_offset - A (positive/negative) x direction.
|
|
2094
2343
|
* @param {number} y_offset - A (positive/negative) y direction.
|
|
@@ -2269,7 +2518,7 @@ class FluentCommand extends FluentBase {
|
|
|
2269
2518
|
* await aui.mouseDoubleLeftClick().exec();
|
|
2270
2519
|
* ```
|
|
2271
2520
|
*
|
|
2272
|
-
* 
|
|
2273
2522
|
*
|
|
2274
2523
|
* @return {Exec}
|
|
2275
2524
|
*/
|
|
@@ -2461,7 +2710,7 @@ class FluentCommand extends FluentBase {
|
|
|
2461
2710
|
* await aui.pressAndroidTwoKey('volume_down', 'power').exec();
|
|
2462
2711
|
* ```
|
|
2463
2712
|
*
|
|
2464
|
-
* 
|
|
2465
2714
|
*
|
|
2466
2715
|
* @param {ANDROID_KEY} first_key - A Android key
|
|
2467
2716
|
* @param {ANDROID_KEY} second_key - A Android key
|
|
@@ -2722,7 +2971,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2722
2971
|
* .customElement({
|
|
2723
2972
|
* customImage: './logo.png', // required
|
|
2724
2973
|
* name: 'myLogo', // optional
|
|
2725
|
-
* threshold: 0.
|
|
2974
|
+
* threshold: 0.5, // optional, defaults to 0.5
|
|
2726
2975
|
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
2727
2976
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
2728
2977
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
@@ -2738,7 +2987,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2738
2987
|
* - **name** (*`string`, optional*):
|
|
2739
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.
|
|
2740
2989
|
* - **threshold** (*`number`, optional*):
|
|
2741
|
-
* - 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`.
|
|
2742
2991
|
* - **stopThreshold** (*`number`, optional*):
|
|
2743
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`.
|
|
2744
2993
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
@@ -2886,7 +3135,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2886
3135
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
2887
3136
|
* ```
|
|
2888
3137
|
*
|
|
2889
|
-
* 
|
|
2890
3139
|
*
|
|
2891
3140
|
*
|
|
2892
3141
|
*
|
|
@@ -2918,7 +3167,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2918
3167
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
2919
3168
|
* ```
|
|
2920
3169
|
*
|
|
2921
|
-
* 
|
|
2922
3171
|
*
|
|
2923
3172
|
*
|
|
2924
3173
|
*
|
|
@@ -2966,7 +3215,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2966
3215
|
* **Important: _Matching only returns the best matching element when you use it with `get()`_**
|
|
2967
3216
|
*
|
|
2968
3217
|
* A bit of playing around to find a matching description is sometimes needed:
|
|
2969
|
-
*
|
|
3218
|
+
* For example, `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
2970
3219
|
* Generally, the more detail the better.
|
|
2971
3220
|
*
|
|
2972
3221
|
* We also recommend to not restrict the type of element by using the general selector `element()` as shown in the examples below.
|
|
@@ -3151,17 +3400,46 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3151
3400
|
*
|
|
3152
3401
|
* **Examples:**
|
|
3153
3402
|
* ```typescript
|
|
3154
|
-
*
|
|
3155
|
-
* |
|
|
3156
|
-
*
|
|
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()
|
|
3157
3421
|
*
|
|
3158
|
-
* //
|
|
3159
|
-
*
|
|
3160
|
-
* ...
|
|
3161
|
-
*
|
|
3162
|
-
* ...
|
|
3163
|
-
*
|
|
3164
|
-
*
|
|
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()
|
|
3165
3443
|
* ```
|
|
3166
3444
|
* 
|
|
3167
3445
|
*
|
|
@@ -3194,17 +3472,46 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3194
3472
|
*
|
|
3195
3473
|
* **Examples:**
|
|
3196
3474
|
* ```typescript
|
|
3197
|
-
*
|
|
3198
|
-
* |
|
|
3199
|
-
*
|
|
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()
|
|
3200
3489
|
*
|
|
3201
|
-
* //
|
|
3202
|
-
*
|
|
3203
|
-
* ...
|
|
3204
|
-
*
|
|
3205
|
-
*
|
|
3206
|
-
* // Returns
|
|
3207
|
-
* ...
|
|
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()
|
|
3504
|
+
*
|
|
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()
|
|
3208
3515
|
* ```
|
|
3209
3516
|
* 
|
|
3210
3517
|
*
|
|
@@ -3237,22 +3544,54 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3237
3544
|
*
|
|
3238
3545
|
* **Examples:**
|
|
3239
3546
|
* ```typescript
|
|
3240
|
-
*
|
|
3241
|
-
* |
|
|
3242
|
-
*
|
|
3243
|
-
*
|
|
3244
|
-
* |
|
|
3245
|
-
*
|
|
3246
|
-
*
|
|
3247
|
-
*
|
|
3248
|
-
*
|
|
3249
|
-
*
|
|
3547
|
+
* ------------
|
|
3548
|
+
* | text |
|
|
3549
|
+
* ------------
|
|
3550
|
+
* ------------
|
|
3551
|
+
* | button0 |
|
|
3552
|
+
* ------------
|
|
3553
|
+
* -----------
|
|
3554
|
+
* | button1 |
|
|
3555
|
+
* -----------
|
|
3556
|
+
* -----------
|
|
3557
|
+
* | button2 |
|
|
3558
|
+
* -----------
|
|
3559
|
+
* ------------
|
|
3560
|
+
* | button3 |
|
|
3561
|
+
* ------------
|
|
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:
|
|
3250
3576
|
* // Returns button0 because button0 is the first button below text
|
|
3251
3577
|
* ...button().below().text()
|
|
3252
3578
|
* ...button().below(0).text()
|
|
3253
|
-
*
|
|
3254
|
-
*
|
|
3255
|
-
* // 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
|
|
3256
3595
|
* ...text().below().button()
|
|
3257
3596
|
* ```
|
|
3258
3597
|
* 
|
|
@@ -3285,22 +3624,54 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3285
3624
|
*
|
|
3286
3625
|
* **Examples:**
|
|
3287
3626
|
* ```typescript
|
|
3288
|
-
*
|
|
3289
|
-
* |
|
|
3290
|
-
*
|
|
3291
|
-
*
|
|
3292
|
-
*
|
|
3293
|
-
*
|
|
3294
|
-
*
|
|
3295
|
-
*
|
|
3296
|
-
*
|
|
3297
|
-
*
|
|
3298
|
-
*
|
|
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
|
|
3299
3657
|
* ...text().above().button()
|
|
3300
3658
|
* ...text().above(0).button()
|
|
3301
|
-
*
|
|
3302
|
-
*
|
|
3303
|
-
* // 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
|
|
3304
3675
|
* ...button().above().text()
|
|
3305
3676
|
* ```
|
|
3306
3677
|
* 
|