askui 0.3.2 → 0.5.0

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.
Files changed (60) hide show
  1. package/README.md +6 -12
  2. package/dist/cjs/core/annotation/annotation-writer.js +2 -4
  3. package/dist/cjs/core/annotation/annotation.d.ts +3 -4
  4. package/dist/cjs/core/annotation/annotation.js +5 -4
  5. package/dist/cjs/core/inference-response/inference-response.d.ts +15 -0
  6. package/dist/cjs/core/inference-response/inference-response.js +25 -0
  7. package/dist/cjs/core/model/annotation-result/boundary-box.d.ts +23 -0
  8. package/dist/cjs/core/model/annotation-result/boundary-box.js +27 -0
  9. package/dist/cjs/core/model/annotation-result/detected-element.d.ts +9 -3
  10. package/dist/cjs/core/model/annotation-result/detected-element.js +10 -4
  11. package/dist/cjs/core/ui-control-commands/control-command.d.ts +1 -1
  12. package/dist/cjs/core/ui-control-commands/control-command.js +2 -1
  13. package/dist/cjs/core/ui-control-commands/index.d.ts +1 -0
  14. package/dist/cjs/core/ui-control-commands/index.js +3 -1
  15. package/dist/cjs/execution/dsl.d.ts +1076 -2
  16. package/dist/cjs/execution/dsl.js +1371 -7
  17. package/dist/cjs/execution/dsl.spec.js +4 -4
  18. package/dist/cjs/execution/execution-runtime.d.ts +2 -0
  19. package/dist/cjs/execution/execution-runtime.js +11 -1
  20. package/dist/cjs/execution/inference-client.d.ts +3 -0
  21. package/dist/cjs/execution/inference-client.js +28 -12
  22. package/dist/cjs/execution/inference-response-error.d.ts +2 -0
  23. package/dist/cjs/execution/inference-response-error.js +6 -0
  24. package/dist/cjs/execution/ui-control-client.d.ts +5 -3
  25. package/dist/cjs/execution/ui-control-client.js +10 -2
  26. package/dist/cjs/lib/copy-example-project.js +40 -4
  27. package/dist/cjs/utils/http/http-client-got.js +5 -1
  28. package/dist/esm/core/annotation/annotation-writer.js +2 -4
  29. package/dist/esm/core/annotation/annotation.d.ts +3 -4
  30. package/dist/esm/core/annotation/annotation.js +5 -4
  31. package/dist/esm/core/inference-response/inference-response.d.ts +15 -0
  32. package/dist/esm/core/inference-response/inference-response.js +21 -0
  33. package/dist/esm/core/model/annotation-result/boundary-box.d.ts +23 -0
  34. package/dist/esm/core/model/annotation-result/boundary-box.js +27 -0
  35. package/dist/esm/core/model/annotation-result/detected-element.d.ts +9 -3
  36. package/dist/esm/core/model/annotation-result/detected-element.js +10 -4
  37. package/dist/esm/core/ui-control-commands/control-command.d.ts +1 -1
  38. package/dist/esm/core/ui-control-commands/control-command.js +2 -1
  39. package/dist/esm/core/ui-control-commands/index.d.ts +1 -0
  40. package/dist/esm/core/ui-control-commands/index.js +1 -0
  41. package/dist/esm/execution/dsl.d.ts +1076 -2
  42. package/dist/esm/execution/dsl.js +1365 -6
  43. package/dist/esm/execution/dsl.spec.js +4 -4
  44. package/dist/esm/execution/execution-runtime.d.ts +2 -0
  45. package/dist/esm/execution/execution-runtime.js +11 -1
  46. package/dist/esm/execution/inference-client.d.ts +3 -0
  47. package/dist/esm/execution/inference-client.js +29 -13
  48. package/dist/esm/execution/inference-response-error.d.ts +2 -0
  49. package/dist/esm/execution/inference-response-error.js +2 -0
  50. package/dist/esm/execution/ui-control-client.d.ts +5 -3
  51. package/dist/esm/execution/ui-control-client.js +11 -3
  52. package/dist/esm/lib/copy-example-project.js +40 -4
  53. package/dist/esm/utils/http/http-client-got.js +5 -1
  54. package/dist/example_projects_templates/typescript_jest/test/helper/jest.setup.ts +6 -1
  55. package/dist/example_projects_templates/typescript_jest/test/my-first-askui-test-suite.test.ts +5 -0
  56. package/package.json +1 -1
  57. package/dist/cjs/core/annotation/annotation-json.d.ts +0 -5
  58. package/dist/cjs/core/annotation/annotation-json.js +0 -2
  59. package/dist/esm/core/annotation/annotation-json.d.ts +0 -5
  60. package/dist/esm/core/annotation/annotation-json.js +0 -1
@@ -1,4 +1,5 @@
1
1
  import { CustomElementJson } from '../core/model/test-case-dto';
2
+ import { DetectedElement } from '../core/model/annotation-result/detected-element';
2
3
  export declare enum Separators {
3
4
  STRING = "<|string|>"
4
5
  }
@@ -13,7 +14,8 @@ declare abstract class FluentBase {
13
14
  protected _textStr: string;
14
15
  protected _params: Map<string, unknown>;
15
16
  protected static addParams(paramsList: Map<string, unknown[]>, params: Map<string, unknown>): Map<string, unknown[]>;
16
- protected commandStringBuilder(currentInstruction?: string, paramsList?: Map<string, unknown[]>): Promise<void>;
17
+ protected fluentCommandStringBuilder(currentInstruction?: string, paramsList?: Map<string, unknown[]>): Promise<void>;
18
+ protected getterStringBuilder(currentInstruction?: string, paramsList?: Map<string, unknown[]>): Promise<DetectedElement[]>;
17
19
  protected get textStr(): string;
18
20
  protected get params(): Map<string, unknown>;
19
21
  }
@@ -533,6 +535,114 @@ export declare class FluentFilters extends FluentBase {
533
535
  colored(color: COLOR): FluentFiltersOrRelations;
534
536
  }
535
537
  export declare class FluentFiltersOrRelations extends FluentFilters {
538
+ /**
539
+ * Logic or operator
540
+ *
541
+ * **Examples:**
542
+ * ```text
543
+ * scene 1
544
+ * -------------- ---------------
545
+ * | button | | icon |
546
+ * -------------- ---------------
547
+ *
548
+ * scene 2
549
+ * -------------- ---------------
550
+ * | button | | text |
551
+ * -------------- ---------------
552
+ *
553
+ * ```
554
+ * In case, that your reference element can have multiple values, in the following example, the element right of the button can be either icon or text.
555
+ * You can use **the `or()` relation**, so your teststep is valid for both scenes
556
+ * ```typescript
557
+ * const button = await aui.get().button().rightOf().icon().or().text().exec();
558
+ * console.log(button);
559
+ * ```
560
+ * Returns the same button for both cases
561
+ * ```text
562
+ * console output: [
563
+ * DetectedElement {
564
+ * name: 'BUTTON',
565
+ * text: 'button',
566
+ * colors: [ 'red', 'black', 'red' ],
567
+ * bndbox: BoundingBox {
568
+ * xmin: 900,
569
+ * ymin: 910,
570
+ * xmax: 920,
571
+ * ymax: 930
572
+ * }
573
+ * }
574
+ * ]
575
+ * ```
576
+ *
577
+ * @return {FluentFilters}
578
+ */
579
+ or(): FluentFilters;
580
+ /**
581
+ * Logic and operator
582
+ *
583
+ * **Examples:**
584
+ * ```text
585
+ * example scene:
586
+ * -------------------------- --------------------------
587
+ * | icon user colored black | | icon user colored red |
588
+ * -------------------------- --------------------------
589
+ * ```
590
+ * ```typescript
591
+ * const icons = await aui.get().icon().withText('user').exec();
592
+ * console.log(icons);
593
+ * ```
594
+ * Using only the filter withText, the get command will return both icons because they share the same text
595
+ * ```text
596
+ * console output: [
597
+ * DetectedElement {
598
+ * name: 'ICON',
599
+ * text: 'user',
600
+ * colors: [ 'black', 'black', 'black' ],
601
+ * bndbox: BoundingBox {
602
+ * xmin: 1000,
603
+ * ymin: 1010,
604
+ * xmax: 1020,
605
+ * ymax: 1030
606
+ * }
607
+ * },
608
+ * DetectedElement {
609
+ * name: 'ICON',
610
+ * text: 'user',
611
+ * colors: [ 'red', 'red', 'red' ],
612
+ * bndbox: BoundingBox {
613
+ * xmin: 900,
614
+ * ymin: 910,
615
+ * xmax: 920,
616
+ * ymax: 930
617
+ * }
618
+ * }
619
+ * ]
620
+ * ```
621
+ * You can combine filters with **the `and()` relation** and specify exactly which icon you want
622
+ * ```typescript
623
+ * const icons = await aui.get().icon().withText('user').and().colored('red').exec()
624
+ * console.log(icons)
625
+ * ```
626
+ * The get command returns only the red icon although both icons have the same text
627
+ * ```text
628
+ * console output: [
629
+ * DetectedElement {
630
+ * name: 'ICON',
631
+ * text: 'user',
632
+ * colors: [ 'red', 'red', 'red' ],
633
+ * bndbox: BoundingBox {
634
+ * xmin: 900,
635
+ * ymin: 910,
636
+ * xmax: 920,
637
+ * ymax: 930
638
+ * }
639
+ * }
640
+ * ]
641
+ * ```
642
+ *
643
+ * @return {FluentFilters}
644
+ */
645
+ and(): FluentFilters;
536
646
  /**
537
647
  * Filters for an element inside another element.
538
648
  *
@@ -1192,6 +1302,114 @@ export declare class FluentFiltersCondition extends FluentBase {
1192
1302
  colored(color: COLOR): FluentFiltersOrRelationsCondition;
1193
1303
  }
1194
1304
  export declare class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
1305
+ /**
1306
+ * Logic or operator
1307
+ *
1308
+ * **Examples:**
1309
+ * ```text
1310
+ * scene 1
1311
+ * -------------- ---------------
1312
+ * | button | | icon |
1313
+ * -------------- ---------------
1314
+ *
1315
+ * scene 2
1316
+ * -------------- ---------------
1317
+ * | button | | text |
1318
+ * -------------- ---------------
1319
+ *
1320
+ * ```
1321
+ * In case, that your reference element can have multiple values, in the following example, the element right of the button can be either icon or text.
1322
+ * You can use **the `or()` relation**, so your teststep is valid for both scenes
1323
+ * ```typescript
1324
+ * const button = await aui.get().button().rightOf().icon().or().text().exec();
1325
+ * console.log(button);
1326
+ * ```
1327
+ * Returns the same button for both cases
1328
+ * ```text
1329
+ * console output: [
1330
+ * DetectedElement {
1331
+ * name: 'BUTTON',
1332
+ * text: 'button',
1333
+ * colors: [ 'red', 'black', 'red' ],
1334
+ * bndbox: BoundingBox {
1335
+ * xmin: 900,
1336
+ * ymin: 910,
1337
+ * xmax: 920,
1338
+ * ymax: 930
1339
+ * }
1340
+ * }
1341
+ * ]
1342
+ * ```
1343
+ *
1344
+ * @return {FluentFiltersCondition}
1345
+ */
1346
+ or(): FluentFiltersCondition;
1347
+ /**
1348
+ * Logic and operator
1349
+ *
1350
+ * **Examples:**
1351
+ * ```text
1352
+ * example scene:
1353
+ * -------------------------- --------------------------
1354
+ * | icon user colored black | | icon user colored red |
1355
+ * -------------------------- --------------------------
1356
+ * ```
1357
+ * ```typescript
1358
+ * const icons = await aui.get().icon().withText('user').exec();
1359
+ * console.log(icons);
1360
+ * ```
1361
+ * Using only the filter withText, the get command will return both icons because they share the same text
1362
+ * ```text
1363
+ * console output: [
1364
+ * DetectedElement {
1365
+ * name: 'ICON',
1366
+ * text: 'user',
1367
+ * colors: [ 'black', 'black', 'black' ],
1368
+ * bndbox: BoundingBox {
1369
+ * xmin: 1000,
1370
+ * ymin: 1010,
1371
+ * xmax: 1020,
1372
+ * ymax: 1030
1373
+ * }
1374
+ * },
1375
+ * DetectedElement {
1376
+ * name: 'ICON',
1377
+ * text: 'user',
1378
+ * colors: [ 'red', 'red', 'red' ],
1379
+ * bndbox: BoundingBox {
1380
+ * xmin: 900,
1381
+ * ymin: 910,
1382
+ * xmax: 920,
1383
+ * ymax: 930
1384
+ * }
1385
+ * }
1386
+ * ]
1387
+ * ```
1388
+ * You can combine filters with **the `and()` relation** and specify exactly which icon you want
1389
+ * ```typescript
1390
+ * const icons = await aui.get().icon().withText('user').and().colored('red').exec()
1391
+ * console.log(icons)
1392
+ * ```
1393
+ * The get command returns only the red icon although both icons have the same text
1394
+ * ```text
1395
+ * console output: [
1396
+ * DetectedElement {
1397
+ * name: 'ICON',
1398
+ * text: 'user',
1399
+ * colors: [ 'red', 'red', 'red' ],
1400
+ * bndbox: BoundingBox {
1401
+ * xmin: 900,
1402
+ * ymin: 910,
1403
+ * xmax: 920,
1404
+ * ymax: 930
1405
+ * }
1406
+ * }
1407
+ * ]
1408
+ * ```
1409
+ *
1410
+ * @return {FluentFiltersCondition}
1411
+ */
1412
+ and(): FluentFiltersCondition;
1195
1413
  /**
1196
1414
  * Filters for an element inside another element.
1197
1415
  *
@@ -1558,6 +1776,862 @@ export declare abstract class FluentCommand extends FluentBase {
1558
1776
  * @return {Exec}
1559
1777
  */
1560
1778
  pressAndroidKey(key: ANDROID_KEY): Exec;
1561
- abstract exec(instruction: string, customElements: CustomElementJson[]): Promise<void>;
1779
+ abstract fluentCommandExecutor(instruction: string, customElements: CustomElementJson[]): Promise<void>;
1780
+ }
1781
+ export interface ExecutableGetter {
1782
+ exec(): Promise<DetectedElement[]>;
1783
+ }
1784
+ export declare class ExecGetter extends FluentBase implements ExecutableGetter {
1785
+ exec(): Promise<DetectedElement[]>;
1786
+ }
1787
+ export declare class FluentFiltersGetter extends FluentBase {
1788
+ /**
1789
+ * Filters for a UI element 'wizard item active'.
1790
+ *
1791
+ * @return {FluentFiltersOrRelationsGetter}
1792
+ */
1793
+ wizardItemActive(): FluentFiltersOrRelationsGetter;
1794
+ /**
1795
+ * Filters for a UI element 'wizard item'.
1796
+ *
1797
+ * @return {FluentFiltersOrRelationsGetter}
1798
+ */
1799
+ wizardItem(): FluentFiltersOrRelationsGetter;
1800
+ /**
1801
+ * Filters for a UI element 'wizard'.
1802
+ *
1803
+ * @return {FluentFiltersOrRelationsGetter}
1804
+ */
1805
+ wizard(): FluentFiltersOrRelationsGetter;
1806
+ /**
1807
+ * Filters for a UI element 'windows bar'.
1808
+ *
1809
+ * @return {FluentFiltersOrRelationsGetter}
1810
+ */
1811
+ windowsBar(): FluentFiltersOrRelationsGetter;
1812
+ /**
1813
+ * Filters for a UI element 'window'.
1814
+ *
1815
+ * @return {FluentFiltersOrRelationsGetter}
1816
+ */
1817
+ window(): FluentFiltersOrRelationsGetter;
1818
+ /**
1819
+ * Filters for a UI element 'video'.
1820
+ *
1821
+ * @return {FluentFiltersOrRelationsGetter}
1822
+ */
1823
+ video(): FluentFiltersOrRelationsGetter;
1824
+ /**
1825
+ * Filters for a UI element 'url'.
1826
+ *
1827
+ * @return {FluentFiltersOrRelationsGetter}
1828
+ */
1829
+ url(): FluentFiltersOrRelationsGetter;
1830
+ /**
1831
+ * Filters for a UI element 'tooltip'.
1832
+ *
1833
+ * @return {FluentFiltersOrRelationsGetter}
1834
+ */
1835
+ tooltip(): FluentFiltersOrRelationsGetter;
1836
+ /**
1837
+ * Filters for a UI element 'textfield'.
1838
+ *
1839
+ * @return {FluentFiltersOrRelationsGetter}
1840
+ */
1841
+ textfield(): FluentFiltersOrRelationsGetter;
1842
+ /**
1843
+ * Filters for a UI element 'textarea'.
1844
+ *
1845
+ * @return {FluentFiltersOrRelationsGetter}
1846
+ */
1847
+ textarea(): FluentFiltersOrRelationsGetter;
1848
+ /**
1849
+ * Filters for a UI element 'table row'.
1850
+ *
1851
+ * @return {FluentFiltersOrRelationsGetter}
1852
+ */
1853
+ tableRow(): FluentFiltersOrRelationsGetter;
1854
+ /**
1855
+ * Filters for a UI element 'table header'.
1856
+ *
1857
+ * @return {FluentFiltersOrRelationsGetter}
1858
+ */
1859
+ tableHeader(): FluentFiltersOrRelationsGetter;
1860
+ /**
1861
+ * Filters for a UI element 'table column'.
1862
+ *
1863
+ * @return {FluentFiltersOrRelationsGetter}
1864
+ */
1865
+ tableColumn(): FluentFiltersOrRelationsGetter;
1866
+ /**
1867
+ * Filters for a UI element 'table'.
1868
+ *
1869
+ * @return {FluentFiltersOrRelationsGetter}
1870
+ */
1871
+ table(): FluentFiltersOrRelationsGetter;
1872
+ /**
1873
+ * Filters for a UI element 'tab selected'.
1874
+ *
1875
+ * @return {FluentFiltersOrRelationsGetter}
1876
+ */
1877
+ tabSelected(): FluentFiltersOrRelationsGetter;
1878
+ /**
1879
+ * Filters for a UI element 'tab bar'.
1880
+ *
1881
+ * @return {FluentFiltersOrRelationsGetter}
1882
+ */
1883
+ tabBar(): FluentFiltersOrRelationsGetter;
1884
+ /**
1885
+ * Filters for a UI element 'tab active'.
1886
+ *
1887
+ * @return {FluentFiltersOrRelationsGetter}
1888
+ */
1889
+ tabActive(): FluentFiltersOrRelationsGetter;
1890
+ /**
1891
+ * Filters for a UI element 'tab'.
1892
+ *
1893
+ * @return {FluentFiltersOrRelationsGetter}
1894
+ */
1895
+ tab(): FluentFiltersOrRelationsGetter;
1896
+ /**
1897
+ * Filters for a UI element 'switch enabled'.
1898
+ *
1899
+ * @return {FluentFiltersOrRelationsGetter}
1900
+ */
1901
+ switchEnabled(): FluentFiltersOrRelationsGetter;
1902
+ /**
1903
+ * Filters for a UI element 'switch disabled'.
1904
+ *
1905
+ * @return {FluentFiltersOrRelationsGetter}
1906
+ */
1907
+ switchDisabled(): FluentFiltersOrRelationsGetter;
1908
+ /**
1909
+ * Filters for a UI element 'status bar'.
1910
+ *
1911
+ * @return {FluentFiltersOrRelationsGetter}
1912
+ */
1913
+ statusBar(): FluentFiltersOrRelationsGetter;
1914
+ /**
1915
+ * Filters for a UI element 'slider indicator'.
1916
+ *
1917
+ * @return {FluentFiltersOrRelationsGetter}
1918
+ */
1919
+ sliderIndicator(): FluentFiltersOrRelationsGetter;
1920
+ /**
1921
+ * Filters for a UI element 'slider'.
1922
+ *
1923
+ * @return {FluentFiltersOrRelationsGetter}
1924
+ */
1925
+ slider(): FluentFiltersOrRelationsGetter;
1926
+ /**
1927
+ * Filters for a UI element 'sidebar'.
1928
+ *
1929
+ * @return {FluentFiltersOrRelationsGetter}
1930
+ */
1931
+ sidebar(): FluentFiltersOrRelationsGetter;
1932
+ /**
1933
+ * Filters for a UI element 'scroll bar'.
1934
+ *
1935
+ * @return {FluentFiltersOrRelationsGetter}
1936
+ */
1937
+ scrollBar(): FluentFiltersOrRelationsGetter;
1938
+ /**
1939
+ * Filters for a UI element 'rect'.
1940
+ *
1941
+ * @return {FluentFiltersOrRelationsGetter}
1942
+ */
1943
+ rect(): FluentFiltersOrRelationsGetter;
1944
+ /**
1945
+ * Filters for a UI element 'recaptcha'.
1946
+ *
1947
+ * @return {FluentFiltersOrRelationsGetter}
1948
+ */
1949
+ recaptcha(): FluentFiltersOrRelationsGetter;
1950
+ /**
1951
+ * Filters for a UI element 'rate'.
1952
+ *
1953
+ * @return {FluentFiltersOrRelationsGetter}
1954
+ */
1955
+ rate(): FluentFiltersOrRelationsGetter;
1956
+ /**
1957
+ * Filters for a UI element 'radio button unselected'.
1958
+ *
1959
+ * @return {FluentFiltersOrRelationsGetter}
1960
+ */
1961
+ radioButtonUnselected(): FluentFiltersOrRelationsGetter;
1962
+ /**
1963
+ * Filters for a UI element 'radio button selected'.
1964
+ *
1965
+ * @return {FluentFiltersOrRelationsGetter}
1966
+ */
1967
+ radioButtonSelected(): FluentFiltersOrRelationsGetter;
1968
+ /**
1969
+ * Filters for a UI element 'progressbar'.
1970
+ *
1971
+ * @return {FluentFiltersOrRelationsGetter}
1972
+ */
1973
+ progressbar(): FluentFiltersOrRelationsGetter;
1974
+ /**
1975
+ * Filters for a UI element 'progress bar'.
1976
+ *
1977
+ * @return {FluentFiltersOrRelationsGetter}
1978
+ */
1979
+ progressBar(): FluentFiltersOrRelationsGetter;
1980
+ /**
1981
+ * Filters for a UI element 'popover'.
1982
+ *
1983
+ * @return {FluentFiltersOrRelationsGetter}
1984
+ */
1985
+ popover(): FluentFiltersOrRelationsGetter;
1986
+ /**
1987
+ * Filters for a UI element 'pil'.
1988
+ *
1989
+ * @return {FluentFiltersOrRelationsGetter}
1990
+ */
1991
+ pil(): FluentFiltersOrRelationsGetter;
1992
+ /**
1993
+ * Filters for a UI element 'password'.
1994
+ *
1995
+ * @return {FluentFiltersOrRelationsGetter}
1996
+ */
1997
+ password(): FluentFiltersOrRelationsGetter;
1998
+ /**
1999
+ * Filters for a UI element 'pager'.
2000
+ *
2001
+ * @return {FluentFiltersOrRelationsGetter}
2002
+ */
2003
+ pager(): FluentFiltersOrRelationsGetter;
2004
+ /**
2005
+ * Filters for a UI element 'navigation bar'.
2006
+ *
2007
+ * @return {FluentFiltersOrRelationsGetter}
2008
+ */
2009
+ navigationBar(): FluentFiltersOrRelationsGetter;
2010
+ /**
2011
+ * Filters for a UI element 'mouse text'.
2012
+ *
2013
+ * @return {FluentFiltersOrRelationsGetter}
2014
+ */
2015
+ mouseText(): FluentFiltersOrRelationsGetter;
2016
+ /**
2017
+ * Filters for a UI element 'mouse pointer'.
2018
+ *
2019
+ * @return {FluentFiltersOrRelationsGetter}
2020
+ */
2021
+ mousePointer(): FluentFiltersOrRelationsGetter;
2022
+ /**
2023
+ * Filters for a UI element 'mouse cursor'.
2024
+ *
2025
+ * @return {FluentFiltersOrRelationsGetter}
2026
+ */
2027
+ mouseCursor(): FluentFiltersOrRelationsGetter;
2028
+ /**
2029
+ * Filters for a UI element 'modal'.
2030
+ *
2031
+ * @return {FluentFiltersOrRelationsGetter}
2032
+ */
2033
+ modal(): FluentFiltersOrRelationsGetter;
2034
+ /**
2035
+ * Filters for a UI element 'message box'.
2036
+ *
2037
+ * @return {FluentFiltersOrRelationsGetter}
2038
+ */
2039
+ messageBox(): FluentFiltersOrRelationsGetter;
2040
+ /**
2041
+ * Filters for a UI element 'map'.
2042
+ *
2043
+ * @return {FluentFiltersOrRelationsGetter}
2044
+ */
2045
+ map(): FluentFiltersOrRelationsGetter;
2046
+ /**
2047
+ * Filters for a UI element 'logo'.
2048
+ *
2049
+ * @return {FluentFiltersOrRelationsGetter}
2050
+ */
2051
+ logo(): FluentFiltersOrRelationsGetter;
2052
+ /**
2053
+ * Filters for a UI element 'link'.
2054
+ *
2055
+ * @return {FluentFiltersOrRelationsGetter}
2056
+ */
2057
+ link(): FluentFiltersOrRelationsGetter;
2058
+ /**
2059
+ * Filters for a UI element 'keyboard'.
2060
+ *
2061
+ * @return {FluentFiltersOrRelationsGetter}
2062
+ */
2063
+ keyboard(): FluentFiltersOrRelationsGetter;
2064
+ /**
2065
+ * Filters for a UI element 'image'.
2066
+ *
2067
+ * @return {FluentFiltersOrRelationsGetter}
2068
+ */
2069
+ image(): FluentFiltersOrRelationsGetter;
2070
+ /**
2071
+ * Filters for a UI element 'header'.
2072
+ *
2073
+ * @return {FluentFiltersOrRelationsGetter}
2074
+ */
2075
+ header(): FluentFiltersOrRelationsGetter;
2076
+ /**
2077
+ * Filters for a UI element 'footer'.
2078
+ *
2079
+ * @return {FluentFiltersOrRelationsGetter}
2080
+ */
2081
+ footer(): FluentFiltersOrRelationsGetter;
2082
+ /**
2083
+ * Filters for a UI element 'flag'.
2084
+ *
2085
+ * @return {FluentFiltersOrRelationsGetter}
2086
+ */
2087
+ flag(): FluentFiltersOrRelationsGetter;
2088
+ /**
2089
+ * Filters for a UI element 'dropdown menu'.
2090
+ *
2091
+ * @return {FluentFiltersOrRelationsGetter}
2092
+ */
2093
+ dropdownMenu(): FluentFiltersOrRelationsGetter;
2094
+ /**
2095
+ * Filters for a UI element 'divider'.
2096
+ *
2097
+ * @return {FluentFiltersOrRelationsGetter}
2098
+ */
2099
+ divider(): FluentFiltersOrRelationsGetter;
2100
+ /**
2101
+ * Filters for a UI element 'circle'.
2102
+ *
2103
+ * @return {FluentFiltersOrRelationsGetter}
2104
+ */
2105
+ circle(): FluentFiltersOrRelationsGetter;
2106
+ /**
2107
+ * Filters for a UI element 'checkbox unchecked'.
2108
+ *
2109
+ * @return {FluentFiltersOrRelationsGetter}
2110
+ */
2111
+ checkboxUnchecked(): FluentFiltersOrRelationsGetter;
2112
+ /**
2113
+ * Filters for a UI element 'checkbox checked'.
2114
+ *
2115
+ * @return {FluentFiltersOrRelationsGetter}
2116
+ */
2117
+ checkboxChecked(): FluentFiltersOrRelationsGetter;
2118
+ /**
2119
+ * Filters for a UI element 'chart pie'.
2120
+ *
2121
+ * @return {FluentFiltersOrRelationsGetter}
2122
+ */
2123
+ chartPie(): FluentFiltersOrRelationsGetter;
2124
+ /**
2125
+ * Filters for a UI element 'chart'.
2126
+ *
2127
+ * @return {FluentFiltersOrRelationsGetter}
2128
+ */
2129
+ chart(): FluentFiltersOrRelationsGetter;
2130
+ /**
2131
+ * Filters for a UI element 'card'.
2132
+ *
2133
+ * @return {FluentFiltersOrRelationsGetter}
2134
+ */
2135
+ card(): FluentFiltersOrRelationsGetter;
2136
+ /**
2137
+ * Filters for a UI element 'browser bar'.
2138
+ *
2139
+ * @return {FluentFiltersOrRelationsGetter}
2140
+ */
2141
+ browserBar(): FluentFiltersOrRelationsGetter;
2142
+ /**
2143
+ * Filters for a UI element 'breadcrumb'.
2144
+ *
2145
+ * @return {FluentFiltersOrRelationsGetter}
2146
+ */
2147
+ breadcrumb(): FluentFiltersOrRelationsGetter;
2148
+ /**
2149
+ * Filters for a UI element 'banner'.
2150
+ *
2151
+ * @return {FluentFiltersOrRelationsGetter}
2152
+ */
2153
+ banner(): FluentFiltersOrRelationsGetter;
2154
+ /**
2155
+ * Filters for a UI element 'badge'.
2156
+ *
2157
+ * @return {FluentFiltersOrRelationsGetter}
2158
+ */
2159
+ badge(): FluentFiltersOrRelationsGetter;
2160
+ /**
2161
+ * Filters for a UI element 'alert'.
2162
+ *
2163
+ * @return {FluentFiltersOrRelationsGetter}
2164
+ */
2165
+ alert(): FluentFiltersOrRelationsGetter;
2166
+ /**
2167
+ * Filters for a UI element 'unknown'.
2168
+ *
2169
+ * @return {FluentFiltersOrRelationsGetter}
2170
+ */
2171
+ unknown(): FluentFiltersOrRelationsGetter;
2172
+ /**
2173
+ * Filters for an UI element 'button'.
2174
+ *
2175
+ * @return {FluentFiltersOrRelationsGetter}
2176
+ */
2177
+ button(): FluentFiltersOrRelationsGetter;
2178
+ /**
2179
+ * Filters for an UI element 'text'.
2180
+ *
2181
+ * @return {FluentFiltersOrRelationsGetter}
2182
+ */
2183
+ text(): FluentFiltersOrRelationsGetter;
2184
+ /**
2185
+ * Filters for an UI element 'dropdown'.
2186
+ *
2187
+ * @return {FluentFiltersOrRelationsGetter}
2188
+ */
2189
+ dropdown(): FluentFiltersOrRelationsGetter;
2190
+ /**
2191
+ * Filters for an UI element 'icon'.
2192
+ *
2193
+ * You can combine it with the 'withText' command to look for a specific icon.
2194
+ *
2195
+ * **Examples:**
2196
+ * ```typescript
2197
+ * icon().withText('plus')
2198
+ * ```
2199
+ *
2200
+ * Note: This is an alpha feature. The prediction of the icon name is sometimes unstable. Use custom elements as an alternative.
2201
+ *
2202
+ * @return {FluentFiltersOrRelationsGetter}
2203
+ */
2204
+ icon(): FluentFiltersOrRelationsGetter;
2205
+ /**
2206
+ * Filters for a custom UI element (see {@link CustomElementJson}).
2207
+ *
2208
+ * **Important**: This increases the runtime quite a bit. So
2209
+ * only use it when absolutely necessary.
2210
+ *
2211
+ * @param {CustomElementJson} customElement - The custom element to filter for.
2212
+ *
2213
+ * @return {FluentFiltersOrRelationsGetter}
2214
+ */
2215
+ customElement(customElement: CustomElementJson): FluentFiltersOrRelationsGetter;
2216
+ /**
2217
+ * Filters for a UI element 'checkbox' checked or unchecked.
2218
+ *
2219
+ * @return {FluentFiltersOrRelationsGetter}
2220
+ */
2221
+ checkbox(): FluentFiltersOrRelationsGetter;
2222
+ /**
2223
+ * Filters for similar (doesn't need to be a 100% equal) text.
2224
+ *
2225
+ * **Examples:**
2226
+ * ```typescript
2227
+ * 'text' === withText('text') => true
2228
+ * 'test' === withText('text') => true
2229
+ * 'other' === withText('text') => false
2230
+ * ```
2231
+ *
2232
+ * @param {string} text - A text to be matched.
2233
+ *
2234
+ * @return {FluentFiltersOrRelationsGetter}
2235
+ */
2236
+ withText(text: string): FluentFiltersOrRelationsGetter;
2237
+ /**
2238
+ * Filters for texts, which match the regex pattern.
2239
+ *
2240
+ * **Examples:**
2241
+ *
2242
+ * ```typescript
2243
+ * 'The rain in Spain' === withTextRegex('\b[Ss]\w+') => true
2244
+ * 'The rain in Portugal' === withTextRegex('\b[Ss]\w+') => false
2245
+ * 'The rain in switzerland' === withTextRegex('\b[Ss]\w+') => true
2246
+ * ```
2247
+ *
2248
+ * @param {string} regex_pattern - An regex pattern
2249
+ *
2250
+ * @return {FluentFiltersOrRelationsGetter}
2251
+ */
2252
+ withTextRegex(regex_pattern: string): FluentFiltersOrRelationsGetter;
2253
+ /**
2254
+ * Filters for equal text.
2255
+ *
2256
+ * **Note:** This should be only used in cases where the similarity
2257
+ * comparison of {@link FluentFilters.withText()} allows not for
2258
+ * specific enough filtering (too many elements).
2259
+ *
2260
+ * **Examples:**
2261
+ * ```typescript
2262
+ * 'text' === withExactText('text') => true
2263
+ * 'test' === withExactText('text') => false
2264
+ * 'other' === withExactText('text') => false
2265
+ * ```
2266
+ *
2267
+ * @param {string} text - A text to be matched.
2268
+ *
2269
+ * @return {FluentFiltersOrRelationsGetter}
2270
+ */
2271
+ withExactText(text: string): FluentFiltersOrRelationsGetter;
2272
+ /**
2273
+ * Filters for text containing the text provided as an argument.
2274
+ *
2275
+ * **Examples:**
2276
+ * ```typescript
2277
+ * 'This is an text' === containsText('text') => true
2278
+ * 'This is an text' === containsText('other text') => false
2279
+ * 'This is an text' === containsText('other') => false
2280
+ * ```
2281
+ *
2282
+ * @param {string} text - A text to be matched.
2283
+ *
2284
+ * @return {FluentFiltersOrRelationsGetter}
2285
+ */
2286
+ containsText(text: string): FluentFiltersOrRelationsGetter;
2287
+ /**
2288
+ * Filters for elements having a specific color.
2289
+ *
2290
+ * @param {COLOR} color - A color to match
2291
+ *
2292
+ * @return {FluentFiltersOrRelationsGetter}
2293
+ */
2294
+ colored(color: COLOR): FluentFiltersOrRelationsGetter;
2295
+ }
2296
+ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
2297
+ /**
2298
+ * Logic or operator
2299
+ *
2300
+ * **Examples:**
2301
+ * ```text
2302
+ * scene 1
2303
+ * -------------- ---------------
2304
+ * | button | | icon |
2305
+ * -------------- ---------------
2306
+ *
2307
+ * scene 2
2308
+ * -------------- ---------------
2309
+ * | button | | text |
2310
+ * -------------- ---------------
2311
+ *
2312
+ * ```
2313
+ * In case, that your reference element can have multiple values, in the following example, the element right of the button can be either icon or text.
2314
+ * You can use **the `or()` relation**, so your teststep is valid for both scenes
2315
+ * ```typescript
2316
+ * const button = await aui.get().button().rightOf().icon().or().text().exec();
2317
+ * console.log(button);
2318
+ * ```
2319
+ * Returns the same button for both cases
2320
+ * ```text
2321
+ * console output: [
2322
+ * DetectedElement {
2323
+ * name: 'BUTTON',
2324
+ * text: 'button',
2325
+ * colors: [ 'red', 'black', 'red' ],
2326
+ * bndbox: BoundingBox {
2327
+ * xmin: 900,
2328
+ * ymin: 910,
2329
+ * xmax: 920,
2330
+ * ymax: 930
2331
+ * }
2332
+ * }
2333
+ * ]
2334
+ * ```
2335
+ *
2336
+ * @return {FluentFiltersGetter}
2337
+ */
2338
+ or(): FluentFiltersGetter;
2339
+ /**
2340
+ * Logic and operator
2341
+ *
2342
+ * **Examples:**
2343
+ * ```text
2344
+ * example scene:
2345
+ * -------------------------- --------------------------
2346
+ * | icon user colored black | | icon user colored red |
2347
+ * -------------------------- --------------------------
2348
+ * ```
2349
+ * ```typescript
2350
+ * const icons = await aui.get().icon().withText('user').exec();
2351
+ * console.log(icons);
2352
+ * ```
2353
+ * Using only the filter withText, the get command will return both icons because they share the same text
2354
+ * ```text
2355
+ * console output: [
2356
+ * DetectedElement {
2357
+ * name: 'ICON',
2358
+ * text: 'user',
2359
+ * colors: [ 'black', 'black', 'black' ],
2360
+ * bndbox: BoundingBox {
2361
+ * xmin: 1000,
2362
+ * ymin: 1010,
2363
+ * xmax: 1020,
2364
+ * ymax: 1030
2365
+ * }
2366
+ * },
2367
+ * DetectedElement {
2368
+ * name: 'ICON',
2369
+ * text: 'user',
2370
+ * colors: [ 'red', 'red', 'red' ],
2371
+ * bndbox: BoundingBox {
2372
+ * xmin: 900,
2373
+ * ymin: 910,
2374
+ * xmax: 920,
2375
+ * ymax: 930
2376
+ * }
2377
+ * }
2378
+ * ]
2379
+ * ```
2380
+ * You can combine filters with **the `and()` relation** and specify exactly which icon you want
2381
+ * ```typescript
2382
+ * const icons = await aui.get().icon().withText('user').and().colored('red').exec()
2383
+ * console.log(icons)
2384
+ * ```
2385
+ * The get command returns only the red icon although both icons have the same text
2386
+ * ```text
2387
+ * console output: [
2388
+ * DetectedElement {
2389
+ * name: 'ICON',
2390
+ * text: 'user',
2391
+ * colors: [ 'red', 'red', 'red' ],
2392
+ * bndbox: BoundingBox {
2393
+ * xmin: 900,
2394
+ * ymin: 910,
2395
+ * xmax: 920,
2396
+ * ymax: 930
2397
+ * }
2398
+ * }
2399
+ * ]
2400
+ * ```
2401
+ *
2402
+ * @return {FluentFiltersGetter}
2403
+ */
2404
+ and(): FluentFiltersGetter;
2405
+ /**
2406
+ * Filters for an element inside another element.
2407
+ *
2408
+ * **Examples:**
2409
+ * ```typescript
2410
+ * --------------------
2411
+ * | outerEl |
2412
+ * | -------------- |
2413
+ * | | innerEl | |
2414
+ * | -------------- |
2415
+ * | |
2416
+ * --------------------
2417
+ *
2418
+ * // Returns innerEl because innerEl is inside outerEl
2419
+ * ...innerEl().in().outerEl()
2420
+ * // Returns nothing because innerEl is not inside outerEl
2421
+ * ...outerEl().in().innerEl()
2422
+ * ```
2423
+ *
2424
+ * @return {FluentFiltersGetter}
2425
+ */
2426
+ in(): FluentFiltersGetter;
2427
+ /**
2428
+ * Filters for an element right of another element.
2429
+ *
2430
+ * **Examples:**
2431
+ * ```typescript
2432
+ * -------------- --------------
2433
+ * | leftEl | | rightEl |
2434
+ * -------------- --------------
2435
+ *
2436
+ * // Returns rightEl because rightEl is right of leftEl
2437
+ * ...rightEl().rightOf().leftEl()
2438
+ * // Returns no element because leftEl is left of rightEl
2439
+ * ...leftEl().rightOf().rightEl()
2440
+ * ```
2441
+ *
2442
+ * @return {FluentFiltersGetter}
2443
+ */
2444
+ rightOf(): FluentFiltersGetter;
2445
+ /**
2446
+ * Filters for an element left of another element.
2447
+ *
2448
+ * **Examples:**
2449
+ * ```typescript
2450
+ * -------------- --------------
2451
+ * | leftEl | | rightEl |
2452
+ * -------------- --------------
2453
+ *
2454
+ * // Returns leftEl because leftEl is left of rightEl
2455
+ * ...leftEl().leftOf().rightEl()
2456
+ * // Returns no element because rightEl is left of leftEl
2457
+ * ...rightEl().leftOf().leftEl()
2458
+ * ```
2459
+ *
2460
+ * @return {FluentFiltersGetter}
2461
+ */
2462
+ leftOf(): FluentFiltersGetter;
2463
+ /**
2464
+ * Filters for an element below another element.
2465
+ *
2466
+ * **Examples:**
2467
+ * ```typescript
2468
+ * --------------
2469
+ * | text |
2470
+ * --------------
2471
+ * --------------
2472
+ * | button |
2473
+ * --------------
2474
+ *
2475
+ * // Returns button because button is below text
2476
+ * ...button().below().text()
2477
+ * // Returns no element because text is above button
2478
+ * ...text().below().button()
2479
+ * ```
2480
+ *
2481
+ * @return {FluentFiltersGetter}
2482
+ */
2483
+ below(): FluentFiltersGetter;
2484
+ /**
2485
+ * Filters for an element above another element.
2486
+ *
2487
+ * **Examples:**
2488
+ * ```typescript
2489
+ * --------------
2490
+ * | text |
2491
+ * --------------
2492
+ * --------------
2493
+ * | button |
2494
+ * --------------
2495
+ *
2496
+ * // Returns text because text is above button
2497
+ * ...text().above().button()
2498
+ * // Returns no element because button is below text
2499
+ * ...button().above().text()
2500
+ * ```
2501
+ *
2502
+ * @return {FluentFiltersGetter}
2503
+ */
2504
+ above(): FluentFiltersGetter;
2505
+ /**
2506
+ * Filters for an element nearest to another element.
2507
+ *
2508
+ * **Examples:**
2509
+ * ```typescript
2510
+ * --------------
2511
+ * | button 1 |
2512
+ * --------------
2513
+ * --------------
2514
+ * | text |
2515
+ * --------------
2516
+ *
2517
+ *
2518
+ *
2519
+ * --------------
2520
+ * | button 2 |
2521
+ * --------------
2522
+ *
2523
+ * // Returns button 1 because button 1 is nearer to the text than button 2
2524
+ * ...button().nearestTo().text()
2525
+ * ```
2526
+ *
2527
+ * @return {FluentFiltersGetter}
2528
+ */
2529
+ nearestTo(): FluentFiltersGetter;
2530
+ /**
2531
+ * Filters for an element containing another element.
2532
+ *
2533
+ * **Example:**
2534
+ * ```typescript
2535
+ * --------------------
2536
+ * | outerEl |
2537
+ * | -------------- |
2538
+ * | | innerEl | |
2539
+ * | -------------- |
2540
+ * | |
2541
+ * --------------------
2542
+ *
2543
+ * // Returns outerEl because outerEl contains innerEl
2544
+ * ...outerEl().contains().innerEl()
2545
+ * // Returns no element because innerEl contains no outerEl
2546
+ * ...innerEl().contains().outerEl()
2547
+ * ```
2548
+ *
2549
+ * @return {FluentFiltersGetter}
2550
+ */
2551
+ contains(): FluentFiltersGetter;
2552
+ /**
2553
+ * Returns a list of detected elements
2554
+ *
2555
+ * @return {DetectedElement[]}
2556
+ */
2557
+ exec(): Promise<DetectedElement[]>;
2558
+ }
2559
+ export declare abstract class Getter extends FluentCommand {
2560
+ /**
2561
+ * Returns an array with all filtered elements.
2562
+ * A detected element has the following properties:
2563
+ * - `name` of the element
2564
+ * - `text` content of element
2565
+ * - `colors` of element
2566
+ * - `bndbox`: location of element described with coordinates of a bounding box
2567
+ * **Examples:**
2568
+ * ```typescript
2569
+ * const text = await aui.get().text().withText('Sign').exec();
2570
+ * console.log(text);
2571
+ * ```
2572
+ * ```text
2573
+ * console output: [
2574
+ * DetectedElement {
2575
+ * name: 'TEXT',
2576
+ * text: 'Sign In',
2577
+ * colors: [ 'black', 'gray', 'gray' ],
2578
+ * bndbox: BoundingBox {
2579
+ * xmin: 1128.2720982142857,
2580
+ * ymin: 160.21332310267857,
2581
+ * xmax: 1178.8204241071428,
2582
+ * ymax: 180.83512834821428
2583
+ * }
2584
+ * }
2585
+ * ]
2586
+ * ```
2587
+ *
2588
+ * @return {FluentFiltersGetter}
2589
+ */
2590
+ get(): FluentFiltersGetter;
2591
+ /**
2592
+ * Returns an array with all detected elements.
2593
+ * A detected element has the following properties:
2594
+ * - `name` of the element
2595
+ * - `text` content of element
2596
+ * - `colors` of element
2597
+ * - `bndbox`: location of element described with coordinates of a bounding box
2598
+ * **Examples:**
2599
+ * ```typescript
2600
+ * const detectedElements = await aui.getAll().exec();
2601
+ * console.log(detectedElements);
2602
+ * ```
2603
+ * ```text
2604
+ * console output: [
2605
+ * DetectedElement {
2606
+ * name: 'TEXT',
2607
+ * text: 'Sign In',
2608
+ * colors: [ 'black', 'gray', 'gray' ],
2609
+ * bndbox: BoundingBox {
2610
+ * xmin: 1128.2720982142857,
2611
+ * ymin: 160.21332310267857,
2612
+ * xmax: 1178.8204241071428,
2613
+ * ymax: 180.83512834821428
2614
+ * },
2615
+ * DetectedElement {
2616
+ * name: 'ICON',
2617
+ * text: 'search',
2618
+ * colors: [ 'black', 'red', 'gray' ],
2619
+ * bndbox: BoundingBox {
2620
+ * xmin: 250.8204241071428,
2621
+ * ymin: 300.21332310267857,
2622
+ * xmax: 450.6304241071428,
2623
+ * ymax: 950.47812834821428
2624
+ * },
2625
+ * ... 381 more items
2626
+ * }
2627
+ * ]
2628
+ * ```
2629
+ *
2630
+ * @return {ExecGetter}
2631
+ */
2632
+ getAll(): ExecGetter;
2633
+ abstract getterExecutor(instruction: string, customElements: CustomElementJson[]): Promise<DetectedElement[]>;
2634
+ }
2635
+ export declare abstract class ApiCommands extends Getter {
1562
2636
  }
1563
2637
  export {};