askui 0.20.2 → 0.20.4
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/core/ui-control-commands/action.d.ts +5 -1
- package/dist/cjs/core/ui-control-commands/action.js +3 -2
- package/dist/cjs/core/ui-control-commands/control-command.js +1 -1
- package/dist/cjs/execution/dsl.d.ts +531 -164
- package/dist/cjs/execution/dsl.js +540 -165
- package/dist/esm/core/model/custom-element-json.d.ts +1 -1
- package/dist/esm/core/ui-control-commands/action.d.ts +5 -1
- package/dist/esm/core/ui-control-commands/action.js +3 -2
- package/dist/esm/core/ui-control-commands/control-command.js +1 -1
- package/dist/esm/execution/dsl.d.ts +531 -164
- package/dist/esm/execution/dsl.js +540 -165
- 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()
|
|
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()
|
|
1600
1758
|
*
|
|
1601
|
-
* // Returns
|
|
1602
|
-
* ...
|
|
1603
|
-
*
|
|
1604
|
-
* // Returns
|
|
1605
|
-
* ...
|
|
1606
|
-
* // Returns no element because leftEl is left of rightEl
|
|
1607
|
-
* ...leftEl().rightOf().rightEl()
|
|
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()
|
|
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()
|
|
1643
1830
|
*
|
|
1644
|
-
* // Returns
|
|
1645
|
-
* ...
|
|
1646
|
-
*
|
|
1647
|
-
* // Returns
|
|
1648
|
-
* ...
|
|
1649
|
-
* // Returns no element because rightEl is left of leftEl
|
|
1650
|
-
* ...rightEl().leftOf().leftEl()
|
|
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.
|
|
@@ -2184,16 +2433,20 @@ class FluentCommand extends FluentBase {
|
|
|
2184
2433
|
* await aui.execOnShell("chrome").exec();
|
|
2185
2434
|
* ```
|
|
2186
2435
|
*
|
|
2187
|
-
* @param {string}
|
|
2436
|
+
* @param {string} shellCommand - A shell command which is executed.
|
|
2437
|
+
* @param {number} [timeoutInMilliseconds=1] - A timeout in milliseconds.
|
|
2188
2438
|
*
|
|
2189
2439
|
* @return {Exec}
|
|
2190
2440
|
*/
|
|
2191
|
-
execOnShell(
|
|
2441
|
+
execOnShell(shellCommand, timeoutInMilliseconds = 1) {
|
|
2192
2442
|
this._textStr = '';
|
|
2193
2443
|
this._textStr += 'Execute';
|
|
2194
2444
|
this._textStr += ' shell';
|
|
2195
2445
|
this._textStr += ' command';
|
|
2196
|
-
this._textStr += ` ${Separators.STRING}${
|
|
2446
|
+
this._textStr += ` ${Separators.STRING}${shellCommand}${Separators.STRING}`;
|
|
2447
|
+
if (timeoutInMilliseconds !== undefined) {
|
|
2448
|
+
this._textStr += ` with ${timeoutInMilliseconds} milliseconds timeout`;
|
|
2449
|
+
}
|
|
2197
2450
|
return new Exec(this);
|
|
2198
2451
|
}
|
|
2199
2452
|
/**
|
|
@@ -2269,7 +2522,7 @@ class FluentCommand extends FluentBase {
|
|
|
2269
2522
|
* await aui.mouseDoubleLeftClick().exec();
|
|
2270
2523
|
* ```
|
|
2271
2524
|
*
|
|
2272
|
-
* 
|
|
2273
2526
|
*
|
|
2274
2527
|
* @return {Exec}
|
|
2275
2528
|
*/
|
|
@@ -2461,7 +2714,7 @@ class FluentCommand extends FluentBase {
|
|
|
2461
2714
|
* await aui.pressAndroidTwoKey('volume_down', 'power').exec();
|
|
2462
2715
|
* ```
|
|
2463
2716
|
*
|
|
2464
|
-
* 
|
|
2465
2718
|
*
|
|
2466
2719
|
* @param {ANDROID_KEY} first_key - A Android key
|
|
2467
2720
|
* @param {ANDROID_KEY} second_key - A Android key
|
|
@@ -2722,7 +2975,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2722
2975
|
* .customElement({
|
|
2723
2976
|
* customImage: './logo.png', // required
|
|
2724
2977
|
* name: 'myLogo', // optional
|
|
2725
|
-
* threshold: 0.
|
|
2978
|
+
* threshold: 0.5, // optional, defaults to 0.5
|
|
2726
2979
|
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
2727
2980
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
2728
2981
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
@@ -2738,7 +2991,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2738
2991
|
* - **name** (*`string`, optional*):
|
|
2739
2992
|
* - 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
2993
|
* - **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.
|
|
2994
|
+
* - 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
2995
|
* - **stopThreshold** (*`number`, optional*):
|
|
2743
2996
|
* - 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
2997
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
@@ -2886,7 +3139,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2886
3139
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
2887
3140
|
* ```
|
|
2888
3141
|
*
|
|
2889
|
-
* 
|
|
2890
3143
|
*
|
|
2891
3144
|
*
|
|
2892
3145
|
*
|
|
@@ -2918,7 +3171,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2918
3171
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
2919
3172
|
* ```
|
|
2920
3173
|
*
|
|
2921
|
-
* 
|
|
2922
3175
|
*
|
|
2923
3176
|
*
|
|
2924
3177
|
*
|
|
@@ -2966,7 +3219,7 @@ class FluentFiltersGetter extends FluentBase {
|
|
|
2966
3219
|
* **Important: _Matching only returns the best matching element when you use it with `get()`_**
|
|
2967
3220
|
*
|
|
2968
3221
|
* A bit of playing around to find a matching description is sometimes needed:
|
|
2969
|
-
*
|
|
3222
|
+
* For example, `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
2970
3223
|
* Generally, the more detail the better.
|
|
2971
3224
|
*
|
|
2972
3225
|
* We also recommend to not restrict the type of element by using the general selector `element()` as shown in the examples below.
|
|
@@ -3151,17 +3404,46 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3151
3404
|
*
|
|
3152
3405
|
* **Examples:**
|
|
3153
3406
|
* ```typescript
|
|
3154
|
-
*
|
|
3155
|
-
* |
|
|
3156
|
-
*
|
|
3407
|
+
* ---------- --------- ---------
|
|
3408
|
+
* | button | | text0 | | text3 |
|
|
3409
|
+
* ---------- --------- --------- ---------
|
|
3410
|
+
* | text1 | ---------
|
|
3411
|
+
* --------- | text2 |
|
|
3412
|
+
* ---------
|
|
3413
|
+
*
|
|
3414
|
+
* // General explanation for element_center_line
|
|
3415
|
+
* // This will find text0 and text3
|
|
3416
|
+
* ...text().rightOf(..., 'element_center_line').button()
|
|
3417
|
+
*
|
|
3418
|
+
* // General explanation for element_edge_area
|
|
3419
|
+
* // This will find text0, text1 and text3
|
|
3420
|
+
* ...text().rightOf(..., 'element_edge_area').button()
|
|
3421
|
+
*
|
|
3422
|
+
* // General explanation and display_edge_area
|
|
3423
|
+
* // This will find text0, text1, text2 and text3
|
|
3424
|
+
* ...text().rightOf(..., 'display_edge_area').button()
|
|
3157
3425
|
*
|
|
3158
|
-
* //
|
|
3159
|
-
*
|
|
3160
|
-
* ...
|
|
3161
|
-
*
|
|
3162
|
-
* ...
|
|
3163
|
-
*
|
|
3164
|
-
*
|
|
3426
|
+
* // More examples:
|
|
3427
|
+
* // Returns text0 because it is the first element rightOf button
|
|
3428
|
+
* ...text().rightOf().button()
|
|
3429
|
+
* ...text().rightOf(0).button()
|
|
3430
|
+
* ...text().rightOf(0, 'element_edge_area').button()
|
|
3431
|
+
*
|
|
3432
|
+
* // Returns text3 because it is the second text touched by the
|
|
3433
|
+
* // horizontal line from the center of button
|
|
3434
|
+
* // Notice: text1 is not touched!
|
|
3435
|
+
* ...text().rightOf(1, 'element_center_line').button()
|
|
3436
|
+
*
|
|
3437
|
+
* // Returns text3 because it is the third text touched by the
|
|
3438
|
+
* // vertical area rightOf the y-axis of button
|
|
3439
|
+
* // Notice: text2 is not touched!
|
|
3440
|
+
* ...text().rightOf(2, 'element_edge_area').button()
|
|
3441
|
+
*
|
|
3442
|
+
* // Returns text2 because it is the third element rightOf button
|
|
3443
|
+
* ...text().rightOf(2, 'display_edge_area').button()
|
|
3444
|
+
*
|
|
3445
|
+
* // Returns no element because button is rightOf the texts
|
|
3446
|
+
* ...button().rightOf().text()
|
|
3165
3447
|
* ```
|
|
3166
3448
|
* 
|
|
3167
3449
|
*
|
|
@@ -3194,17 +3476,46 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3194
3476
|
*
|
|
3195
3477
|
* **Examples:**
|
|
3196
3478
|
* ```typescript
|
|
3197
|
-
*
|
|
3198
|
-
* |
|
|
3199
|
-
*
|
|
3479
|
+
* --------- --------- ----------
|
|
3480
|
+
* | text3 | | text0 | | button |
|
|
3481
|
+
* --------- --------- --------- ----------
|
|
3482
|
+
* --------- | text1 |
|
|
3483
|
+
* | text2 | ---------
|
|
3484
|
+
* ---------
|
|
3485
|
+
*
|
|
3486
|
+
* // General explanation for element_center_line
|
|
3487
|
+
* // This will find text0 and text3
|
|
3488
|
+
* ...text().leftOf(..., 'element_center_line').button()
|
|
3489
|
+
*
|
|
3490
|
+
* // General explanation for element_edge_area
|
|
3491
|
+
* // This will find text0, text1 and text3
|
|
3492
|
+
* ...text().leftOf(..., 'element_edge_area').button()
|
|
3200
3493
|
*
|
|
3201
|
-
* //
|
|
3202
|
-
*
|
|
3203
|
-
* ...
|
|
3204
|
-
*
|
|
3205
|
-
*
|
|
3206
|
-
* // Returns
|
|
3207
|
-
* ...
|
|
3494
|
+
* // General explanation and display_edge_area
|
|
3495
|
+
* // This will find text0, text1, text2 and text3
|
|
3496
|
+
* ...text().leftOf(..., 'display_edge_area').button()
|
|
3497
|
+
*
|
|
3498
|
+
* // More examples:
|
|
3499
|
+
* // Returns text0 because it is the first element leftOf button
|
|
3500
|
+
* ...text().leftOf().button()
|
|
3501
|
+
* ...text().leftOf(0).button()
|
|
3502
|
+
* ...text().leftOf(0, 'element_edge_area').button()
|
|
3503
|
+
*
|
|
3504
|
+
* // Returns text3 because it is the second text touched by the
|
|
3505
|
+
* // horizontal line from the center of button
|
|
3506
|
+
* // Notice: text1 is not touched!
|
|
3507
|
+
* ...text().leftOf(1, 'element_center_line').button()
|
|
3508
|
+
*
|
|
3509
|
+
* // Returns text3 because it is the third text touched by the
|
|
3510
|
+
* // vertical area leftOf the y-axis of button
|
|
3511
|
+
* // Notice: text2 is not touched!
|
|
3512
|
+
* ...text().leftOf(2, 'element_edge_area').button()
|
|
3513
|
+
*
|
|
3514
|
+
* // Returns text2 because it is the third element leftOf button
|
|
3515
|
+
* ...text().leftOf(2, 'display_edge_area').button()
|
|
3516
|
+
*
|
|
3517
|
+
* // Returns no element because button is rightOf the texts
|
|
3518
|
+
* ...button().leftOf().text()
|
|
3208
3519
|
* ```
|
|
3209
3520
|
* 
|
|
3210
3521
|
*
|
|
@@ -3237,22 +3548,54 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3237
3548
|
*
|
|
3238
3549
|
* **Examples:**
|
|
3239
3550
|
* ```typescript
|
|
3240
|
-
*
|
|
3241
|
-
* |
|
|
3242
|
-
*
|
|
3243
|
-
*
|
|
3244
|
-
* |
|
|
3245
|
-
*
|
|
3246
|
-
*
|
|
3247
|
-
*
|
|
3248
|
-
*
|
|
3249
|
-
*
|
|
3551
|
+
* ------------
|
|
3552
|
+
* | text |
|
|
3553
|
+
* ------------
|
|
3554
|
+
* ------------
|
|
3555
|
+
* | button0 |
|
|
3556
|
+
* ------------
|
|
3557
|
+
* -----------
|
|
3558
|
+
* | button1 |
|
|
3559
|
+
* -----------
|
|
3560
|
+
* -----------
|
|
3561
|
+
* | button2 |
|
|
3562
|
+
* -----------
|
|
3563
|
+
* ------------
|
|
3564
|
+
* | button3 |
|
|
3565
|
+
* ------------
|
|
3566
|
+
*
|
|
3567
|
+
* // General explanation for element_center_line
|
|
3568
|
+
* // This will find button0 and button3
|
|
3569
|
+
* ...button().below(..., 'element_center_line').text()
|
|
3570
|
+
*
|
|
3571
|
+
* // General explanation for element_edge_area
|
|
3572
|
+
* // This will find button0, button1 and button3
|
|
3573
|
+
* ...button().below(..., 'element_edge_area').text()
|
|
3574
|
+
*
|
|
3575
|
+
* // General explanation and display_edge_area
|
|
3576
|
+
* // This will find button0, button1, button2 and button3
|
|
3577
|
+
* ...button().below(..., 'display_edge_area').text()
|
|
3578
|
+
*
|
|
3579
|
+
* // More examples:
|
|
3250
3580
|
* // Returns button0 because button0 is the first button below text
|
|
3251
3581
|
* ...button().below().text()
|
|
3252
3582
|
* ...button().below(0).text()
|
|
3253
|
-
*
|
|
3254
|
-
*
|
|
3255
|
-
* // Returns
|
|
3583
|
+
* ...button().below(0, 'element_edge_area').text()
|
|
3584
|
+
*
|
|
3585
|
+
* // Returns button3 because it is the second button touched by the
|
|
3586
|
+
* // vertical line from the center of text
|
|
3587
|
+
* // Notice: button1 is not touched
|
|
3588
|
+
* ...button().below(1, 'element_center_line').text()
|
|
3589
|
+
*
|
|
3590
|
+
* // Returns button3 because it is the third button touched by the
|
|
3591
|
+
* // vertical area below the x-axis of text
|
|
3592
|
+
* // Notice: button2 is not touched!
|
|
3593
|
+
* ...button().below(2, 'element_edge_area').text()
|
|
3594
|
+
*
|
|
3595
|
+
* // Returns button2 because it is the third element below text
|
|
3596
|
+
* ...button().below(2, 'display_edge_area').text()
|
|
3597
|
+
*
|
|
3598
|
+
* // Returns no element because text is above the buttons
|
|
3256
3599
|
* ...text().below().button()
|
|
3257
3600
|
* ```
|
|
3258
3601
|
* 
|
|
@@ -3285,22 +3628,54 @@ class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3285
3628
|
*
|
|
3286
3629
|
* **Examples:**
|
|
3287
3630
|
* ```typescript
|
|
3288
|
-
*
|
|
3289
|
-
* |
|
|
3290
|
-
*
|
|
3291
|
-
*
|
|
3292
|
-
*
|
|
3293
|
-
*
|
|
3294
|
-
*
|
|
3295
|
-
*
|
|
3296
|
-
*
|
|
3297
|
-
*
|
|
3298
|
-
*
|
|
3631
|
+
* ------------
|
|
3632
|
+
* | text3 |
|
|
3633
|
+
* ------------
|
|
3634
|
+
* ------------
|
|
3635
|
+
* | text2 |
|
|
3636
|
+
* ------------
|
|
3637
|
+
* ------------
|
|
3638
|
+
* | text1 |
|
|
3639
|
+
* ------------
|
|
3640
|
+
* ------------
|
|
3641
|
+
* | text0 |
|
|
3642
|
+
* ------------
|
|
3643
|
+
* ------------
|
|
3644
|
+
* | button |
|
|
3645
|
+
* ------------
|
|
3646
|
+
*
|
|
3647
|
+
* // General explanation for element_center_line
|
|
3648
|
+
* // This will find text0 and text3
|
|
3649
|
+
* ...text().above(..., 'element_center_line').button()
|
|
3650
|
+
*
|
|
3651
|
+
* // General explanation for element_edge_area
|
|
3652
|
+
* // This will find text0, text1 and text3
|
|
3653
|
+
* ...text().above(..., 'element_edge_area').button()
|
|
3654
|
+
*
|
|
3655
|
+
* // General explanation and display_edge_area
|
|
3656
|
+
* // This will find text0, text1, text2 and text3
|
|
3657
|
+
* ...text().above(..., 'display_edge_area').button()
|
|
3658
|
+
*
|
|
3659
|
+
* // More examples:
|
|
3660
|
+
* // Returns text0 because it is the first element above button
|
|
3299
3661
|
* ...text().above().button()
|
|
3300
3662
|
* ...text().above(0).button()
|
|
3301
|
-
*
|
|
3302
|
-
*
|
|
3303
|
-
* // Returns
|
|
3663
|
+
* ...text().above(0, 'element_edge_area').button()
|
|
3664
|
+
*
|
|
3665
|
+
* // Returns text3 because it is the second text touched by the
|
|
3666
|
+
* // vertical line from the center of button
|
|
3667
|
+
* // Notice: text1 is not touched!
|
|
3668
|
+
* ...text().above(1, 'element_center_line').button()
|
|
3669
|
+
*
|
|
3670
|
+
* // Returns text3 because it is the third text touched by the
|
|
3671
|
+
* // vertical area above the x-axis of button
|
|
3672
|
+
* // Notice: text2 is not touched!
|
|
3673
|
+
* ...text().above(2, 'element_edge_area').button()
|
|
3674
|
+
*
|
|
3675
|
+
* // Returns text2 because it is the third element above button
|
|
3676
|
+
* ...text().above(2, 'display_edge_area').button()
|
|
3677
|
+
*
|
|
3678
|
+
* // Returns no element because button is below the texts
|
|
3304
3679
|
* ...button().above().text()
|
|
3305
3680
|
* ```
|
|
3306
3681
|
* 
|