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,3 +1,8 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
2
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
+
/* eslint-disable max-classes-per-file */
|
|
4
|
+
/* eslint-disable max-len */
|
|
5
|
+
// Autogenerated from typescript.template file
|
|
1
6
|
export var Separators;
|
|
2
7
|
(function (Separators) {
|
|
3
8
|
Separators["STRING"] = "<|string|>";
|
|
@@ -285,7 +290,7 @@ export class FluentFilters extends FluentBase {
|
|
|
285
290
|
* .customElement({
|
|
286
291
|
* customImage: './logo.png', // required
|
|
287
292
|
* name: 'myLogo', // optional
|
|
288
|
-
* threshold: 0.
|
|
293
|
+
* threshold: 0.5, // optional, defaults to 0.5
|
|
289
294
|
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
290
295
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
291
296
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
@@ -301,7 +306,7 @@ export class FluentFilters extends FluentBase {
|
|
|
301
306
|
* - **name** (*`string`, optional*):
|
|
302
307
|
* - 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.
|
|
303
308
|
* - **threshold** (*`number`, optional*):
|
|
304
|
-
* - 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.
|
|
309
|
+
* - 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`.
|
|
305
310
|
* - **stopThreshold** (*`number`, optional*):
|
|
306
311
|
* - 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`.
|
|
307
312
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
@@ -449,7 +454,7 @@ export class FluentFilters extends FluentBase {
|
|
|
449
454
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
450
455
|
* ```
|
|
451
456
|
*
|
|
452
|
-
* 
|
|
453
458
|
*
|
|
454
459
|
*
|
|
455
460
|
*
|
|
@@ -481,7 +486,7 @@ export class FluentFilters extends FluentBase {
|
|
|
481
486
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
482
487
|
* ```
|
|
483
488
|
*
|
|
484
|
-
* 
|
|
485
490
|
*
|
|
486
491
|
*
|
|
487
492
|
*
|
|
@@ -529,7 +534,7 @@ export class FluentFilters extends FluentBase {
|
|
|
529
534
|
* **Important: _Matching only returns the best matching element when you use it with `get()`_**
|
|
530
535
|
*
|
|
531
536
|
* A bit of playing around to find a matching description is sometimes needed:
|
|
532
|
-
*
|
|
537
|
+
* For example, `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
533
538
|
* Generally, the more detail the better.
|
|
534
539
|
*
|
|
535
540
|
* We also recommend to not restrict the type of element by using the general selector `element()` as shown in the examples below.
|
|
@@ -713,17 +718,46 @@ export class FluentFiltersOrRelations extends FluentFilters {
|
|
|
713
718
|
*
|
|
714
719
|
* **Examples:**
|
|
715
720
|
* ```typescript
|
|
716
|
-
*
|
|
717
|
-
* |
|
|
718
|
-
*
|
|
721
|
+
* ---------- --------- ---------
|
|
722
|
+
* | button | | text0 | | text3 |
|
|
723
|
+
* ---------- --------- --------- ---------
|
|
724
|
+
* | text1 | ---------
|
|
725
|
+
* --------- | text2 |
|
|
726
|
+
* ---------
|
|
719
727
|
*
|
|
720
|
-
* //
|
|
721
|
-
*
|
|
722
|
-
* ...
|
|
723
|
-
*
|
|
724
|
-
*
|
|
725
|
-
* //
|
|
726
|
-
* ...
|
|
728
|
+
* // General explanation for element_center_line
|
|
729
|
+
* // This will find text0 and text3
|
|
730
|
+
* ...text().rightOf(..., 'element_center_line').button()
|
|
731
|
+
*
|
|
732
|
+
* // General explanation for element_edge_area
|
|
733
|
+
* // This will find text0, text1 and text3
|
|
734
|
+
* ...text().rightOf(..., 'element_edge_area').button()
|
|
735
|
+
*
|
|
736
|
+
* // General explanation and display_edge_area
|
|
737
|
+
* // This will find text0, text1, text2 and text3
|
|
738
|
+
* ...text().rightOf(..., 'display_edge_area').button()
|
|
739
|
+
*
|
|
740
|
+
* // More examples:
|
|
741
|
+
* // Returns text0 because it is the first element rightOf button
|
|
742
|
+
* ...text().rightOf().button()
|
|
743
|
+
* ...text().rightOf(0).button()
|
|
744
|
+
* ...text().rightOf(0, 'element_edge_area').button()
|
|
745
|
+
*
|
|
746
|
+
* // Returns text3 because it is the second text touched by the
|
|
747
|
+
* // horizontal line from the center of button
|
|
748
|
+
* // Notice: text1 is not touched!
|
|
749
|
+
* ...text().rightOf(1, 'element_center_line').button()
|
|
750
|
+
*
|
|
751
|
+
* // Returns text3 because it is the third text touched by the
|
|
752
|
+
* // vertical area rightOf the y-axis of button
|
|
753
|
+
* // Notice: text2 is not touched!
|
|
754
|
+
* ...text().rightOf(2, 'element_edge_area').button()
|
|
755
|
+
*
|
|
756
|
+
* // Returns text2 because it is the third element rightOf button
|
|
757
|
+
* ...text().rightOf(2, 'display_edge_area').button()
|
|
758
|
+
*
|
|
759
|
+
* // Returns no element because button is rightOf the texts
|
|
760
|
+
* ...button().rightOf().text()
|
|
727
761
|
* ```
|
|
728
762
|
* 
|
|
729
763
|
*
|
|
@@ -756,17 +790,46 @@ export class FluentFiltersOrRelations extends FluentFilters {
|
|
|
756
790
|
*
|
|
757
791
|
* **Examples:**
|
|
758
792
|
* ```typescript
|
|
759
|
-
*
|
|
760
|
-
* |
|
|
761
|
-
*
|
|
793
|
+
* --------- --------- ----------
|
|
794
|
+
* | text3 | | text0 | | button |
|
|
795
|
+
* --------- --------- --------- ----------
|
|
796
|
+
* --------- | text1 |
|
|
797
|
+
* | text2 | ---------
|
|
798
|
+
* ---------
|
|
799
|
+
*
|
|
800
|
+
* // General explanation for element_center_line
|
|
801
|
+
* // This will find text0 and text3
|
|
802
|
+
* ...text().leftOf(..., 'element_center_line').button()
|
|
803
|
+
*
|
|
804
|
+
* // General explanation for element_edge_area
|
|
805
|
+
* // This will find text0, text1 and text3
|
|
806
|
+
* ...text().leftOf(..., 'element_edge_area').button()
|
|
807
|
+
*
|
|
808
|
+
* // General explanation and display_edge_area
|
|
809
|
+
* // This will find text0, text1, text2 and text3
|
|
810
|
+
* ...text().leftOf(..., 'display_edge_area').button()
|
|
811
|
+
*
|
|
812
|
+
* // More examples:
|
|
813
|
+
* // Returns text0 because it is the first element leftOf button
|
|
814
|
+
* ...text().leftOf().button()
|
|
815
|
+
* ...text().leftOf(0).button()
|
|
816
|
+
* ...text().leftOf(0, 'element_edge_area').button()
|
|
817
|
+
*
|
|
818
|
+
* // Returns text3 because it is the second text touched by the
|
|
819
|
+
* // horizontal line from the center of button
|
|
820
|
+
* // Notice: text1 is not touched!
|
|
821
|
+
* ...text().leftOf(1, 'element_center_line').button()
|
|
822
|
+
*
|
|
823
|
+
* // Returns text3 because it is the third text touched by the
|
|
824
|
+
* // vertical area leftOf the y-axis of button
|
|
825
|
+
* // Notice: text2 is not touched!
|
|
826
|
+
* ...text().leftOf(2, 'element_edge_area').button()
|
|
827
|
+
*
|
|
828
|
+
* // Returns text2 because it is the third element leftOf button
|
|
829
|
+
* ...text().leftOf(2, 'display_edge_area').button()
|
|
762
830
|
*
|
|
763
|
-
* // Returns
|
|
764
|
-
* ...
|
|
765
|
-
* ...leftEl().leftOf(0).rightEl()
|
|
766
|
-
* // Returns leftEl1 because leftEl1 is the second element left of rightEl
|
|
767
|
-
* ...leftEl().leftOf(1).rightEl()
|
|
768
|
-
* // Returns no element because rightEl is left of leftEl
|
|
769
|
-
* ...rightEl().leftOf().leftEl()
|
|
831
|
+
* // Returns no element because button is rightOf the texts
|
|
832
|
+
* ...button().leftOf().text()
|
|
770
833
|
* ```
|
|
771
834
|
* 
|
|
772
835
|
*
|
|
@@ -799,22 +862,54 @@ export class FluentFiltersOrRelations extends FluentFilters {
|
|
|
799
862
|
*
|
|
800
863
|
* **Examples:**
|
|
801
864
|
* ```typescript
|
|
802
|
-
*
|
|
803
|
-
* |
|
|
804
|
-
*
|
|
805
|
-
*
|
|
806
|
-
* |
|
|
807
|
-
*
|
|
808
|
-
*
|
|
809
|
-
*
|
|
810
|
-
*
|
|
811
|
-
*
|
|
865
|
+
* ------------
|
|
866
|
+
* | text |
|
|
867
|
+
* ------------
|
|
868
|
+
* ------------
|
|
869
|
+
* | button0 |
|
|
870
|
+
* ------------
|
|
871
|
+
* -----------
|
|
872
|
+
* | button1 |
|
|
873
|
+
* -----------
|
|
874
|
+
* -----------
|
|
875
|
+
* | button2 |
|
|
876
|
+
* -----------
|
|
877
|
+
* ------------
|
|
878
|
+
* | button3 |
|
|
879
|
+
* ------------
|
|
880
|
+
*
|
|
881
|
+
* // General explanation for element_center_line
|
|
882
|
+
* // This will find button0 and button3
|
|
883
|
+
* ...button().below(..., 'element_center_line').text()
|
|
884
|
+
*
|
|
885
|
+
* // General explanation for element_edge_area
|
|
886
|
+
* // This will find button0, button1 and button3
|
|
887
|
+
* ...button().below(..., 'element_edge_area').text()
|
|
888
|
+
*
|
|
889
|
+
* // General explanation and display_edge_area
|
|
890
|
+
* // This will find button0, button1, button2 and button3
|
|
891
|
+
* ...button().below(..., 'display_edge_area').text()
|
|
892
|
+
*
|
|
893
|
+
* // More examples:
|
|
812
894
|
* // Returns button0 because button0 is the first button below text
|
|
813
895
|
* ...button().below().text()
|
|
814
896
|
* ...button().below(0).text()
|
|
815
|
-
*
|
|
816
|
-
*
|
|
817
|
-
* // Returns
|
|
897
|
+
* ...button().below(0, 'element_edge_area').text()
|
|
898
|
+
*
|
|
899
|
+
* // Returns button3 because it is the second button touched by the
|
|
900
|
+
* // vertical line from the center of text
|
|
901
|
+
* // Notice: button1 is not touched
|
|
902
|
+
* ...button().below(1, 'element_center_line').text()
|
|
903
|
+
*
|
|
904
|
+
* // Returns button3 because it is the third button touched by the
|
|
905
|
+
* // vertical area below the x-axis of text
|
|
906
|
+
* // Notice: button2 is not touched!
|
|
907
|
+
* ...button().below(2, 'element_edge_area').text()
|
|
908
|
+
*
|
|
909
|
+
* // Returns button2 because it is the third element below text
|
|
910
|
+
* ...button().below(2, 'display_edge_area').text()
|
|
911
|
+
*
|
|
912
|
+
* // Returns no element because text is above the buttons
|
|
818
913
|
* ...text().below().button()
|
|
819
914
|
* ```
|
|
820
915
|
* 
|
|
@@ -847,22 +942,54 @@ export class FluentFiltersOrRelations extends FluentFilters {
|
|
|
847
942
|
*
|
|
848
943
|
* **Examples:**
|
|
849
944
|
* ```typescript
|
|
850
|
-
*
|
|
851
|
-
* |
|
|
852
|
-
*
|
|
853
|
-
*
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
*
|
|
857
|
-
*
|
|
858
|
-
*
|
|
859
|
-
*
|
|
860
|
-
*
|
|
945
|
+
* ------------
|
|
946
|
+
* | text3 |
|
|
947
|
+
* ------------
|
|
948
|
+
* ------------
|
|
949
|
+
* | text2 |
|
|
950
|
+
* ------------
|
|
951
|
+
* ------------
|
|
952
|
+
* | text1 |
|
|
953
|
+
* ------------
|
|
954
|
+
* ------------
|
|
955
|
+
* | text0 |
|
|
956
|
+
* ------------
|
|
957
|
+
* ------------
|
|
958
|
+
* | button |
|
|
959
|
+
* ------------
|
|
960
|
+
*
|
|
961
|
+
* // General explanation for element_center_line
|
|
962
|
+
* // This will find text0 and text3
|
|
963
|
+
* ...text().above(..., 'element_center_line').button()
|
|
964
|
+
*
|
|
965
|
+
* // General explanation for element_edge_area
|
|
966
|
+
* // This will find text0, text1 and text3
|
|
967
|
+
* ...text().above(..., 'element_edge_area').button()
|
|
968
|
+
*
|
|
969
|
+
* // General explanation and display_edge_area
|
|
970
|
+
* // This will find text0, text1, text2 and text3
|
|
971
|
+
* ...text().above(..., 'display_edge_area').button()
|
|
972
|
+
*
|
|
973
|
+
* // More examples:
|
|
974
|
+
* // Returns text0 because it is the first element above button
|
|
861
975
|
* ...text().above().button()
|
|
862
976
|
* ...text().above(0).button()
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
* // Returns
|
|
977
|
+
* ...text().above(0, 'element_edge_area').button()
|
|
978
|
+
*
|
|
979
|
+
* // Returns text3 because it is the second text touched by the
|
|
980
|
+
* // vertical line from the center of button
|
|
981
|
+
* // Notice: text1 is not touched!
|
|
982
|
+
* ...text().above(1, 'element_center_line').button()
|
|
983
|
+
*
|
|
984
|
+
* // Returns text3 because it is the third text touched by the
|
|
985
|
+
* // vertical area above the x-axis of button
|
|
986
|
+
* // Notice: text2 is not touched!
|
|
987
|
+
* ...text().above(2, 'element_edge_area').button()
|
|
988
|
+
*
|
|
989
|
+
* // Returns text2 because it is the third element above button
|
|
990
|
+
* ...text().above(2, 'display_edge_area').button()
|
|
991
|
+
*
|
|
992
|
+
* // Returns no element because button is below the texts
|
|
866
993
|
* ...button().above().text()
|
|
867
994
|
* ```
|
|
868
995
|
* 
|
|
@@ -1159,7 +1286,7 @@ export class FluentFiltersCondition extends FluentBase {
|
|
|
1159
1286
|
* .customElement({
|
|
1160
1287
|
* customImage: './logo.png', // required
|
|
1161
1288
|
* name: 'myLogo', // optional
|
|
1162
|
-
* threshold: 0.
|
|
1289
|
+
* threshold: 0.5, // optional, defaults to 0.5
|
|
1163
1290
|
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
1164
1291
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
1165
1292
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
@@ -1175,7 +1302,7 @@ export class FluentFiltersCondition extends FluentBase {
|
|
|
1175
1302
|
* - **name** (*`string`, optional*):
|
|
1176
1303
|
* - 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.
|
|
1177
1304
|
* - **threshold** (*`number`, optional*):
|
|
1178
|
-
* - 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.
|
|
1305
|
+
* - 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`.
|
|
1179
1306
|
* - **stopThreshold** (*`number`, optional*):
|
|
1180
1307
|
* - 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`.
|
|
1181
1308
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
@@ -1323,7 +1450,7 @@ export class FluentFiltersCondition extends FluentBase {
|
|
|
1323
1450
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
1324
1451
|
* ```
|
|
1325
1452
|
*
|
|
1326
|
-
* 
|
|
1327
1454
|
*
|
|
1328
1455
|
*
|
|
1329
1456
|
*
|
|
@@ -1355,7 +1482,7 @@ export class FluentFiltersCondition extends FluentBase {
|
|
|
1355
1482
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
1356
1483
|
* ```
|
|
1357
1484
|
*
|
|
1358
|
-
* 
|
|
1359
1486
|
*
|
|
1360
1487
|
*
|
|
1361
1488
|
*
|
|
@@ -1403,7 +1530,7 @@ export class FluentFiltersCondition extends FluentBase {
|
|
|
1403
1530
|
* **Important: _Matching only returns the best matching element when you use it with `get()`_**
|
|
1404
1531
|
*
|
|
1405
1532
|
* A bit of playing around to find a matching description is sometimes needed:
|
|
1406
|
-
*
|
|
1533
|
+
* For example, `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
1407
1534
|
* Generally, the more detail the better.
|
|
1408
1535
|
*
|
|
1409
1536
|
* We also recommend to not restrict the type of element by using the general selector `element()` as shown in the examples below.
|
|
@@ -1587,17 +1714,46 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1587
1714
|
*
|
|
1588
1715
|
* **Examples:**
|
|
1589
1716
|
* ```typescript
|
|
1590
|
-
*
|
|
1591
|
-
* |
|
|
1592
|
-
*
|
|
1717
|
+
* ---------- --------- ---------
|
|
1718
|
+
* | button | | text0 | | text3 |
|
|
1719
|
+
* ---------- --------- --------- ---------
|
|
1720
|
+
* | text1 | ---------
|
|
1721
|
+
* --------- | text2 |
|
|
1722
|
+
* ---------
|
|
1723
|
+
*
|
|
1724
|
+
* // General explanation for element_center_line
|
|
1725
|
+
* // This will find text0 and text3
|
|
1726
|
+
* ...text().rightOf(..., 'element_center_line').button()
|
|
1727
|
+
*
|
|
1728
|
+
* // General explanation for element_edge_area
|
|
1729
|
+
* // This will find text0, text1 and text3
|
|
1730
|
+
* ...text().rightOf(..., 'element_edge_area').button()
|
|
1731
|
+
*
|
|
1732
|
+
* // General explanation and display_edge_area
|
|
1733
|
+
* // This will find text0, text1, text2 and text3
|
|
1734
|
+
* ...text().rightOf(..., 'display_edge_area').button()
|
|
1735
|
+
*
|
|
1736
|
+
* // More examples:
|
|
1737
|
+
* // Returns text0 because it is the first element rightOf button
|
|
1738
|
+
* ...text().rightOf().button()
|
|
1739
|
+
* ...text().rightOf(0).button()
|
|
1740
|
+
* ...text().rightOf(0, 'element_edge_area').button()
|
|
1741
|
+
*
|
|
1742
|
+
* // Returns text3 because it is the second text touched by the
|
|
1743
|
+
* // horizontal line from the center of button
|
|
1744
|
+
* // Notice: text1 is not touched!
|
|
1745
|
+
* ...text().rightOf(1, 'element_center_line').button()
|
|
1746
|
+
*
|
|
1747
|
+
* // Returns text3 because it is the third text touched by the
|
|
1748
|
+
* // vertical area rightOf the y-axis of button
|
|
1749
|
+
* // Notice: text2 is not touched!
|
|
1750
|
+
* ...text().rightOf(2, 'element_edge_area').button()
|
|
1593
1751
|
*
|
|
1594
|
-
* // Returns
|
|
1595
|
-
* ...
|
|
1596
|
-
*
|
|
1597
|
-
* // Returns
|
|
1598
|
-
* ...
|
|
1599
|
-
* // Returns no element because leftEl is left of rightEl
|
|
1600
|
-
* ...leftEl().rightOf().rightEl()
|
|
1752
|
+
* // Returns text2 because it is the third element rightOf button
|
|
1753
|
+
* ...text().rightOf(2, 'display_edge_area').button()
|
|
1754
|
+
*
|
|
1755
|
+
* // Returns no element because button is rightOf the texts
|
|
1756
|
+
* ...button().rightOf().text()
|
|
1601
1757
|
* ```
|
|
1602
1758
|
* 
|
|
1603
1759
|
*
|
|
@@ -1630,17 +1786,46 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1630
1786
|
*
|
|
1631
1787
|
* **Examples:**
|
|
1632
1788
|
* ```typescript
|
|
1633
|
-
*
|
|
1634
|
-
* |
|
|
1635
|
-
*
|
|
1789
|
+
* --------- --------- ----------
|
|
1790
|
+
* | text3 | | text0 | | button |
|
|
1791
|
+
* --------- --------- --------- ----------
|
|
1792
|
+
* --------- | text1 |
|
|
1793
|
+
* | text2 | ---------
|
|
1794
|
+
* ---------
|
|
1795
|
+
*
|
|
1796
|
+
* // General explanation for element_center_line
|
|
1797
|
+
* // This will find text0 and text3
|
|
1798
|
+
* ...text().leftOf(..., 'element_center_line').button()
|
|
1799
|
+
*
|
|
1800
|
+
* // General explanation for element_edge_area
|
|
1801
|
+
* // This will find text0, text1 and text3
|
|
1802
|
+
* ...text().leftOf(..., 'element_edge_area').button()
|
|
1803
|
+
*
|
|
1804
|
+
* // General explanation and display_edge_area
|
|
1805
|
+
* // This will find text0, text1, text2 and text3
|
|
1806
|
+
* ...text().leftOf(..., 'display_edge_area').button()
|
|
1807
|
+
*
|
|
1808
|
+
* // More examples:
|
|
1809
|
+
* // Returns text0 because it is the first element leftOf button
|
|
1810
|
+
* ...text().leftOf().button()
|
|
1811
|
+
* ...text().leftOf(0).button()
|
|
1812
|
+
* ...text().leftOf(0, 'element_edge_area').button()
|
|
1813
|
+
*
|
|
1814
|
+
* // Returns text3 because it is the second text touched by the
|
|
1815
|
+
* // horizontal line from the center of button
|
|
1816
|
+
* // Notice: text1 is not touched!
|
|
1817
|
+
* ...text().leftOf(1, 'element_center_line').button()
|
|
1818
|
+
*
|
|
1819
|
+
* // Returns text3 because it is the third text touched by the
|
|
1820
|
+
* // vertical area leftOf the y-axis of button
|
|
1821
|
+
* // Notice: text2 is not touched!
|
|
1822
|
+
* ...text().leftOf(2, 'element_edge_area').button()
|
|
1636
1823
|
*
|
|
1637
|
-
* // Returns
|
|
1638
|
-
* ...
|
|
1639
|
-
*
|
|
1640
|
-
* // Returns
|
|
1641
|
-
* ...
|
|
1642
|
-
* // Returns no element because rightEl is left of leftEl
|
|
1643
|
-
* ...rightEl().leftOf().leftEl()
|
|
1824
|
+
* // Returns text2 because it is the third element leftOf button
|
|
1825
|
+
* ...text().leftOf(2, 'display_edge_area').button()
|
|
1826
|
+
*
|
|
1827
|
+
* // Returns no element because button is rightOf the texts
|
|
1828
|
+
* ...button().leftOf().text()
|
|
1644
1829
|
* ```
|
|
1645
1830
|
* 
|
|
1646
1831
|
*
|
|
@@ -1673,22 +1858,54 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1673
1858
|
*
|
|
1674
1859
|
* **Examples:**
|
|
1675
1860
|
* ```typescript
|
|
1676
|
-
*
|
|
1677
|
-
* |
|
|
1678
|
-
*
|
|
1679
|
-
*
|
|
1680
|
-
* |
|
|
1681
|
-
*
|
|
1682
|
-
*
|
|
1683
|
-
*
|
|
1684
|
-
*
|
|
1685
|
-
*
|
|
1861
|
+
* ------------
|
|
1862
|
+
* | text |
|
|
1863
|
+
* ------------
|
|
1864
|
+
* ------------
|
|
1865
|
+
* | button0 |
|
|
1866
|
+
* ------------
|
|
1867
|
+
* -----------
|
|
1868
|
+
* | button1 |
|
|
1869
|
+
* -----------
|
|
1870
|
+
* -----------
|
|
1871
|
+
* | button2 |
|
|
1872
|
+
* -----------
|
|
1873
|
+
* ------------
|
|
1874
|
+
* | button3 |
|
|
1875
|
+
* ------------
|
|
1876
|
+
*
|
|
1877
|
+
* // General explanation for element_center_line
|
|
1878
|
+
* // This will find button0 and button3
|
|
1879
|
+
* ...button().below(..., 'element_center_line').text()
|
|
1880
|
+
*
|
|
1881
|
+
* // General explanation for element_edge_area
|
|
1882
|
+
* // This will find button0, button1 and button3
|
|
1883
|
+
* ...button().below(..., 'element_edge_area').text()
|
|
1884
|
+
*
|
|
1885
|
+
* // General explanation and display_edge_area
|
|
1886
|
+
* // This will find button0, button1, button2 and button3
|
|
1887
|
+
* ...button().below(..., 'display_edge_area').text()
|
|
1888
|
+
*
|
|
1889
|
+
* // More examples:
|
|
1686
1890
|
* // Returns button0 because button0 is the first button below text
|
|
1687
1891
|
* ...button().below().text()
|
|
1688
1892
|
* ...button().below(0).text()
|
|
1689
|
-
*
|
|
1690
|
-
*
|
|
1691
|
-
* // Returns
|
|
1893
|
+
* ...button().below(0, 'element_edge_area').text()
|
|
1894
|
+
*
|
|
1895
|
+
* // Returns button3 because it is the second button touched by the
|
|
1896
|
+
* // vertical line from the center of text
|
|
1897
|
+
* // Notice: button1 is not touched
|
|
1898
|
+
* ...button().below(1, 'element_center_line').text()
|
|
1899
|
+
*
|
|
1900
|
+
* // Returns button3 because it is the third button touched by the
|
|
1901
|
+
* // vertical area below the x-axis of text
|
|
1902
|
+
* // Notice: button2 is not touched!
|
|
1903
|
+
* ...button().below(2, 'element_edge_area').text()
|
|
1904
|
+
*
|
|
1905
|
+
* // Returns button2 because it is the third element below text
|
|
1906
|
+
* ...button().below(2, 'display_edge_area').text()
|
|
1907
|
+
*
|
|
1908
|
+
* // Returns no element because text is above the buttons
|
|
1692
1909
|
* ...text().below().button()
|
|
1693
1910
|
* ```
|
|
1694
1911
|
* 
|
|
@@ -1721,22 +1938,54 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
|
|
|
1721
1938
|
*
|
|
1722
1939
|
* **Examples:**
|
|
1723
1940
|
* ```typescript
|
|
1724
|
-
*
|
|
1725
|
-
* |
|
|
1726
|
-
*
|
|
1727
|
-
*
|
|
1728
|
-
*
|
|
1729
|
-
*
|
|
1730
|
-
*
|
|
1731
|
-
*
|
|
1732
|
-
*
|
|
1733
|
-
*
|
|
1734
|
-
*
|
|
1941
|
+
* ------------
|
|
1942
|
+
* | text3 |
|
|
1943
|
+
* ------------
|
|
1944
|
+
* ------------
|
|
1945
|
+
* | text2 |
|
|
1946
|
+
* ------------
|
|
1947
|
+
* ------------
|
|
1948
|
+
* | text1 |
|
|
1949
|
+
* ------------
|
|
1950
|
+
* ------------
|
|
1951
|
+
* | text0 |
|
|
1952
|
+
* ------------
|
|
1953
|
+
* ------------
|
|
1954
|
+
* | button |
|
|
1955
|
+
* ------------
|
|
1956
|
+
*
|
|
1957
|
+
* // General explanation for element_center_line
|
|
1958
|
+
* // This will find text0 and text3
|
|
1959
|
+
* ...text().above(..., 'element_center_line').button()
|
|
1960
|
+
*
|
|
1961
|
+
* // General explanation for element_edge_area
|
|
1962
|
+
* // This will find text0, text1 and text3
|
|
1963
|
+
* ...text().above(..., 'element_edge_area').button()
|
|
1964
|
+
*
|
|
1965
|
+
* // General explanation and display_edge_area
|
|
1966
|
+
* // This will find text0, text1, text2 and text3
|
|
1967
|
+
* ...text().above(..., 'display_edge_area').button()
|
|
1968
|
+
*
|
|
1969
|
+
* // More examples:
|
|
1970
|
+
* // Returns text0 because it is the first element above button
|
|
1735
1971
|
* ...text().above().button()
|
|
1736
1972
|
* ...text().above(0).button()
|
|
1737
|
-
*
|
|
1738
|
-
*
|
|
1739
|
-
* // Returns
|
|
1973
|
+
* ...text().above(0, 'element_edge_area').button()
|
|
1974
|
+
*
|
|
1975
|
+
* // Returns text3 because it is the second text touched by the
|
|
1976
|
+
* // vertical line from the center of button
|
|
1977
|
+
* // Notice: text1 is not touched!
|
|
1978
|
+
* ...text().above(1, 'element_center_line').button()
|
|
1979
|
+
*
|
|
1980
|
+
* // Returns text3 because it is the third text touched by the
|
|
1981
|
+
* // vertical area above the x-axis of button
|
|
1982
|
+
* // Notice: text2 is not touched!
|
|
1983
|
+
* ...text().above(2, 'element_edge_area').button()
|
|
1984
|
+
*
|
|
1985
|
+
* // Returns text2 because it is the third element above button
|
|
1986
|
+
* ...text().above(2, 'display_edge_area').button()
|
|
1987
|
+
*
|
|
1988
|
+
* // Returns no element because button is below the texts
|
|
1740
1989
|
* ...button().above().text()
|
|
1741
1990
|
* ```
|
|
1742
1991
|
* 
|
|
@@ -1881,7 +2130,7 @@ export class FluentCommand extends FluentBase {
|
|
|
1881
2130
|
super(undefined);
|
|
1882
2131
|
}
|
|
1883
2132
|
/**
|
|
1884
|
-
* Expects a condition,
|
|
2133
|
+
* Expects a condition, for example, `exists()` or `notExits()`.
|
|
1885
2134
|
*
|
|
1886
2135
|
* Use the structure `expect().<your filter>.(exists()|notExists())` as shown in the examples below.
|
|
1887
2136
|
*
|
|
@@ -1928,7 +2177,7 @@ export class FluentCommand extends FluentBase {
|
|
|
1928
2177
|
* await aui.moveMouseTo().text().withText('Grinning_Face').exec()
|
|
1929
2178
|
* ```
|
|
1930
2179
|
*
|
|
1931
|
-
* 
|
|
1932
2181
|
*
|
|
1933
2182
|
*
|
|
1934
2183
|
*
|
|
@@ -1976,7 +2225,7 @@ export class FluentCommand extends FluentBase {
|
|
|
1976
2225
|
* await aui.scrollInside(0,-500).text().withText('Bottom sheet').exec();
|
|
1977
2226
|
* ```
|
|
1978
2227
|
*
|
|
1979
|
-
* 
|
|
1980
2229
|
*
|
|
1981
2230
|
* @param {number} x_offset - A (positive/negative) x direction.
|
|
1982
2231
|
* @param {number} y_offset - A (positive/negative) y direction.
|
|
@@ -2080,7 +2329,7 @@ export class FluentCommand extends FluentBase {
|
|
|
2080
2329
|
* await aui.moveMouseRelatively(0, 50).exec();
|
|
2081
2330
|
* ```
|
|
2082
2331
|
*
|
|
2083
|
-
* 
|
|
2084
2333
|
*
|
|
2085
2334
|
* @param {number} x_offset - A (positive/negative) x direction.
|
|
2086
2335
|
* @param {number} y_offset - A (positive/negative) y direction.
|
|
@@ -2176,16 +2425,20 @@ export class FluentCommand extends FluentBase {
|
|
|
2176
2425
|
* await aui.execOnShell("chrome").exec();
|
|
2177
2426
|
* ```
|
|
2178
2427
|
*
|
|
2179
|
-
* @param {string}
|
|
2428
|
+
* @param {string} shellCommand - A shell command which is executed.
|
|
2429
|
+
* @param {number} [timeoutInMilliseconds=1] - A timeout in milliseconds.
|
|
2180
2430
|
*
|
|
2181
2431
|
* @return {Exec}
|
|
2182
2432
|
*/
|
|
2183
|
-
execOnShell(
|
|
2433
|
+
execOnShell(shellCommand, timeoutInMilliseconds = 1) {
|
|
2184
2434
|
this._textStr = '';
|
|
2185
2435
|
this._textStr += 'Execute';
|
|
2186
2436
|
this._textStr += ' shell';
|
|
2187
2437
|
this._textStr += ' command';
|
|
2188
|
-
this._textStr += ` ${Separators.STRING}${
|
|
2438
|
+
this._textStr += ` ${Separators.STRING}${shellCommand}${Separators.STRING}`;
|
|
2439
|
+
if (timeoutInMilliseconds !== undefined) {
|
|
2440
|
+
this._textStr += ` with ${timeoutInMilliseconds} milliseconds timeout`;
|
|
2441
|
+
}
|
|
2189
2442
|
return new Exec(this);
|
|
2190
2443
|
}
|
|
2191
2444
|
/**
|
|
@@ -2261,7 +2514,7 @@ export class FluentCommand extends FluentBase {
|
|
|
2261
2514
|
* await aui.mouseDoubleLeftClick().exec();
|
|
2262
2515
|
* ```
|
|
2263
2516
|
*
|
|
2264
|
-
* 
|
|
2265
2518
|
*
|
|
2266
2519
|
* @return {Exec}
|
|
2267
2520
|
*/
|
|
@@ -2453,7 +2706,7 @@ export class FluentCommand extends FluentBase {
|
|
|
2453
2706
|
* await aui.pressAndroidTwoKey('volume_down', 'power').exec();
|
|
2454
2707
|
* ```
|
|
2455
2708
|
*
|
|
2456
|
-
* 
|
|
2457
2710
|
*
|
|
2458
2711
|
* @param {ANDROID_KEY} first_key - A Android key
|
|
2459
2712
|
* @param {ANDROID_KEY} second_key - A Android key
|
|
@@ -2712,7 +2965,7 @@ export class FluentFiltersGetter extends FluentBase {
|
|
|
2712
2965
|
* .customElement({
|
|
2713
2966
|
* customImage: './logo.png', // required
|
|
2714
2967
|
* name: 'myLogo', // optional
|
|
2715
|
-
* threshold: 0.
|
|
2968
|
+
* threshold: 0.5, // optional, defaults to 0.5
|
|
2716
2969
|
* stopThreshold: 0.9, // optional, defaults to 0.9
|
|
2717
2970
|
* rotationDegreePerStep: 0, // optional, defaults to 0
|
|
2718
2971
|
* imageCompareFormat: 'grayscale', // optional, defaults to 'grayscale'
|
|
@@ -2728,7 +2981,7 @@ export class FluentFiltersGetter extends FluentBase {
|
|
|
2728
2981
|
* - **name** (*`string`, optional*):
|
|
2729
2982
|
* - 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.
|
|
2730
2983
|
* - **threshold** (*`number`, optional*):
|
|
2731
|
-
* - 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.
|
|
2984
|
+
* - 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`.
|
|
2732
2985
|
* - **stopThreshold** (*`number`, optional*):
|
|
2733
2986
|
* - 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`.
|
|
2734
2987
|
* - **rotationDegreePerStep** (*`number`, optional*):
|
|
@@ -2876,7 +3129,7 @@ export class FluentFiltersGetter extends FluentBase {
|
|
|
2876
3129
|
* await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
|
|
2877
3130
|
* ```
|
|
2878
3131
|
*
|
|
2879
|
-
* 
|
|
2880
3133
|
*
|
|
2881
3134
|
*
|
|
2882
3135
|
*
|
|
@@ -2908,7 +3161,7 @@ export class FluentFiltersGetter extends FluentBase {
|
|
|
2908
3161
|
* await aui.moveMouseTo().text().withExactText('Password').exec()
|
|
2909
3162
|
* ```
|
|
2910
3163
|
*
|
|
2911
|
-
* 
|
|
2912
3165
|
*
|
|
2913
3166
|
*
|
|
2914
3167
|
*
|
|
@@ -2956,7 +3209,7 @@ export class FluentFiltersGetter extends FluentBase {
|
|
|
2956
3209
|
* **Important: _Matching only returns the best matching element when you use it with `get()`_**
|
|
2957
3210
|
*
|
|
2958
3211
|
* A bit of playing around to find a matching description is sometimes needed:
|
|
2959
|
-
*
|
|
3212
|
+
* For example, `puzzle piece` can fail while `an icon showing a puzzle piece` might work.
|
|
2960
3213
|
* Generally, the more detail the better.
|
|
2961
3214
|
*
|
|
2962
3215
|
* We also recommend to not restrict the type of element by using the general selector `element()` as shown in the examples below.
|
|
@@ -3140,17 +3393,46 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3140
3393
|
*
|
|
3141
3394
|
* **Examples:**
|
|
3142
3395
|
* ```typescript
|
|
3143
|
-
*
|
|
3144
|
-
* |
|
|
3145
|
-
*
|
|
3396
|
+
* ---------- --------- ---------
|
|
3397
|
+
* | button | | text0 | | text3 |
|
|
3398
|
+
* ---------- --------- --------- ---------
|
|
3399
|
+
* | text1 | ---------
|
|
3400
|
+
* --------- | text2 |
|
|
3401
|
+
* ---------
|
|
3402
|
+
*
|
|
3403
|
+
* // General explanation for element_center_line
|
|
3404
|
+
* // This will find text0 and text3
|
|
3405
|
+
* ...text().rightOf(..., 'element_center_line').button()
|
|
3406
|
+
*
|
|
3407
|
+
* // General explanation for element_edge_area
|
|
3408
|
+
* // This will find text0, text1 and text3
|
|
3409
|
+
* ...text().rightOf(..., 'element_edge_area').button()
|
|
3410
|
+
*
|
|
3411
|
+
* // General explanation and display_edge_area
|
|
3412
|
+
* // This will find text0, text1, text2 and text3
|
|
3413
|
+
* ...text().rightOf(..., 'display_edge_area').button()
|
|
3146
3414
|
*
|
|
3147
|
-
* //
|
|
3148
|
-
*
|
|
3149
|
-
* ...
|
|
3150
|
-
*
|
|
3151
|
-
* ...
|
|
3152
|
-
*
|
|
3153
|
-
*
|
|
3415
|
+
* // More examples:
|
|
3416
|
+
* // Returns text0 because it is the first element rightOf button
|
|
3417
|
+
* ...text().rightOf().button()
|
|
3418
|
+
* ...text().rightOf(0).button()
|
|
3419
|
+
* ...text().rightOf(0, 'element_edge_area').button()
|
|
3420
|
+
*
|
|
3421
|
+
* // Returns text3 because it is the second text touched by the
|
|
3422
|
+
* // horizontal line from the center of button
|
|
3423
|
+
* // Notice: text1 is not touched!
|
|
3424
|
+
* ...text().rightOf(1, 'element_center_line').button()
|
|
3425
|
+
*
|
|
3426
|
+
* // Returns text3 because it is the third text touched by the
|
|
3427
|
+
* // vertical area rightOf the y-axis of button
|
|
3428
|
+
* // Notice: text2 is not touched!
|
|
3429
|
+
* ...text().rightOf(2, 'element_edge_area').button()
|
|
3430
|
+
*
|
|
3431
|
+
* // Returns text2 because it is the third element rightOf button
|
|
3432
|
+
* ...text().rightOf(2, 'display_edge_area').button()
|
|
3433
|
+
*
|
|
3434
|
+
* // Returns no element because button is rightOf the texts
|
|
3435
|
+
* ...button().rightOf().text()
|
|
3154
3436
|
* ```
|
|
3155
3437
|
* 
|
|
3156
3438
|
*
|
|
@@ -3183,17 +3465,46 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3183
3465
|
*
|
|
3184
3466
|
* **Examples:**
|
|
3185
3467
|
* ```typescript
|
|
3186
|
-
*
|
|
3187
|
-
* |
|
|
3188
|
-
*
|
|
3468
|
+
* --------- --------- ----------
|
|
3469
|
+
* | text3 | | text0 | | button |
|
|
3470
|
+
* --------- --------- --------- ----------
|
|
3471
|
+
* --------- | text1 |
|
|
3472
|
+
* | text2 | ---------
|
|
3473
|
+
* ---------
|
|
3474
|
+
*
|
|
3475
|
+
* // General explanation for element_center_line
|
|
3476
|
+
* // This will find text0 and text3
|
|
3477
|
+
* ...text().leftOf(..., 'element_center_line').button()
|
|
3478
|
+
*
|
|
3479
|
+
* // General explanation for element_edge_area
|
|
3480
|
+
* // This will find text0, text1 and text3
|
|
3481
|
+
* ...text().leftOf(..., 'element_edge_area').button()
|
|
3189
3482
|
*
|
|
3190
|
-
* //
|
|
3191
|
-
*
|
|
3192
|
-
* ...
|
|
3193
|
-
*
|
|
3194
|
-
*
|
|
3195
|
-
* // Returns
|
|
3196
|
-
* ...
|
|
3483
|
+
* // General explanation and display_edge_area
|
|
3484
|
+
* // This will find text0, text1, text2 and text3
|
|
3485
|
+
* ...text().leftOf(..., 'display_edge_area').button()
|
|
3486
|
+
*
|
|
3487
|
+
* // More examples:
|
|
3488
|
+
* // Returns text0 because it is the first element leftOf button
|
|
3489
|
+
* ...text().leftOf().button()
|
|
3490
|
+
* ...text().leftOf(0).button()
|
|
3491
|
+
* ...text().leftOf(0, 'element_edge_area').button()
|
|
3492
|
+
*
|
|
3493
|
+
* // Returns text3 because it is the second text touched by the
|
|
3494
|
+
* // horizontal line from the center of button
|
|
3495
|
+
* // Notice: text1 is not touched!
|
|
3496
|
+
* ...text().leftOf(1, 'element_center_line').button()
|
|
3497
|
+
*
|
|
3498
|
+
* // Returns text3 because it is the third text touched by the
|
|
3499
|
+
* // vertical area leftOf the y-axis of button
|
|
3500
|
+
* // Notice: text2 is not touched!
|
|
3501
|
+
* ...text().leftOf(2, 'element_edge_area').button()
|
|
3502
|
+
*
|
|
3503
|
+
* // Returns text2 because it is the third element leftOf button
|
|
3504
|
+
* ...text().leftOf(2, 'display_edge_area').button()
|
|
3505
|
+
*
|
|
3506
|
+
* // Returns no element because button is rightOf the texts
|
|
3507
|
+
* ...button().leftOf().text()
|
|
3197
3508
|
* ```
|
|
3198
3509
|
* 
|
|
3199
3510
|
*
|
|
@@ -3226,22 +3537,54 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3226
3537
|
*
|
|
3227
3538
|
* **Examples:**
|
|
3228
3539
|
* ```typescript
|
|
3229
|
-
*
|
|
3230
|
-
* |
|
|
3231
|
-
*
|
|
3232
|
-
*
|
|
3233
|
-
* |
|
|
3234
|
-
*
|
|
3235
|
-
*
|
|
3236
|
-
*
|
|
3237
|
-
*
|
|
3238
|
-
*
|
|
3540
|
+
* ------------
|
|
3541
|
+
* | text |
|
|
3542
|
+
* ------------
|
|
3543
|
+
* ------------
|
|
3544
|
+
* | button0 |
|
|
3545
|
+
* ------------
|
|
3546
|
+
* -----------
|
|
3547
|
+
* | button1 |
|
|
3548
|
+
* -----------
|
|
3549
|
+
* -----------
|
|
3550
|
+
* | button2 |
|
|
3551
|
+
* -----------
|
|
3552
|
+
* ------------
|
|
3553
|
+
* | button3 |
|
|
3554
|
+
* ------------
|
|
3555
|
+
*
|
|
3556
|
+
* // General explanation for element_center_line
|
|
3557
|
+
* // This will find button0 and button3
|
|
3558
|
+
* ...button().below(..., 'element_center_line').text()
|
|
3559
|
+
*
|
|
3560
|
+
* // General explanation for element_edge_area
|
|
3561
|
+
* // This will find button0, button1 and button3
|
|
3562
|
+
* ...button().below(..., 'element_edge_area').text()
|
|
3563
|
+
*
|
|
3564
|
+
* // General explanation and display_edge_area
|
|
3565
|
+
* // This will find button0, button1, button2 and button3
|
|
3566
|
+
* ...button().below(..., 'display_edge_area').text()
|
|
3567
|
+
*
|
|
3568
|
+
* // More examples:
|
|
3239
3569
|
* // Returns button0 because button0 is the first button below text
|
|
3240
3570
|
* ...button().below().text()
|
|
3241
3571
|
* ...button().below(0).text()
|
|
3242
|
-
*
|
|
3243
|
-
*
|
|
3244
|
-
* // Returns
|
|
3572
|
+
* ...button().below(0, 'element_edge_area').text()
|
|
3573
|
+
*
|
|
3574
|
+
* // Returns button3 because it is the second button touched by the
|
|
3575
|
+
* // vertical line from the center of text
|
|
3576
|
+
* // Notice: button1 is not touched
|
|
3577
|
+
* ...button().below(1, 'element_center_line').text()
|
|
3578
|
+
*
|
|
3579
|
+
* // Returns button3 because it is the third button touched by the
|
|
3580
|
+
* // vertical area below the x-axis of text
|
|
3581
|
+
* // Notice: button2 is not touched!
|
|
3582
|
+
* ...button().below(2, 'element_edge_area').text()
|
|
3583
|
+
*
|
|
3584
|
+
* // Returns button2 because it is the third element below text
|
|
3585
|
+
* ...button().below(2, 'display_edge_area').text()
|
|
3586
|
+
*
|
|
3587
|
+
* // Returns no element because text is above the buttons
|
|
3245
3588
|
* ...text().below().button()
|
|
3246
3589
|
* ```
|
|
3247
3590
|
* 
|
|
@@ -3274,22 +3617,54 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
|
|
|
3274
3617
|
*
|
|
3275
3618
|
* **Examples:**
|
|
3276
3619
|
* ```typescript
|
|
3277
|
-
*
|
|
3278
|
-
* |
|
|
3279
|
-
*
|
|
3280
|
-
*
|
|
3281
|
-
*
|
|
3282
|
-
*
|
|
3283
|
-
*
|
|
3284
|
-
*
|
|
3285
|
-
*
|
|
3286
|
-
*
|
|
3287
|
-
*
|
|
3620
|
+
* ------------
|
|
3621
|
+
* | text3 |
|
|
3622
|
+
* ------------
|
|
3623
|
+
* ------------
|
|
3624
|
+
* | text2 |
|
|
3625
|
+
* ------------
|
|
3626
|
+
* ------------
|
|
3627
|
+
* | text1 |
|
|
3628
|
+
* ------------
|
|
3629
|
+
* ------------
|
|
3630
|
+
* | text0 |
|
|
3631
|
+
* ------------
|
|
3632
|
+
* ------------
|
|
3633
|
+
* | button |
|
|
3634
|
+
* ------------
|
|
3635
|
+
*
|
|
3636
|
+
* // General explanation for element_center_line
|
|
3637
|
+
* // This will find text0 and text3
|
|
3638
|
+
* ...text().above(..., 'element_center_line').button()
|
|
3639
|
+
*
|
|
3640
|
+
* // General explanation for element_edge_area
|
|
3641
|
+
* // This will find text0, text1 and text3
|
|
3642
|
+
* ...text().above(..., 'element_edge_area').button()
|
|
3643
|
+
*
|
|
3644
|
+
* // General explanation and display_edge_area
|
|
3645
|
+
* // This will find text0, text1, text2 and text3
|
|
3646
|
+
* ...text().above(..., 'display_edge_area').button()
|
|
3647
|
+
*
|
|
3648
|
+
* // More examples:
|
|
3649
|
+
* // Returns text0 because it is the first element above button
|
|
3288
3650
|
* ...text().above().button()
|
|
3289
3651
|
* ...text().above(0).button()
|
|
3290
|
-
*
|
|
3291
|
-
*
|
|
3292
|
-
* // Returns
|
|
3652
|
+
* ...text().above(0, 'element_edge_area').button()
|
|
3653
|
+
*
|
|
3654
|
+
* // Returns text3 because it is the second text touched by the
|
|
3655
|
+
* // vertical line from the center of button
|
|
3656
|
+
* // Notice: text1 is not touched!
|
|
3657
|
+
* ...text().above(1, 'element_center_line').button()
|
|
3658
|
+
*
|
|
3659
|
+
* // Returns text3 because it is the third text touched by the
|
|
3660
|
+
* // vertical area above the x-axis of button
|
|
3661
|
+
* // Notice: text2 is not touched!
|
|
3662
|
+
* ...text().above(2, 'element_edge_area').button()
|
|
3663
|
+
*
|
|
3664
|
+
* // Returns text2 because it is the third element above button
|
|
3665
|
+
* ...text().above(2, 'display_edge_area').button()
|
|
3666
|
+
*
|
|
3667
|
+
* // Returns no element because button is below the texts
|
|
3293
3668
|
* ...button().above().text()
|
|
3294
3669
|
* ```
|
|
3295
3670
|
* 
|