askui 0.6.1 → 0.7.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 (37) hide show
  1. package/dist/cjs/core/annotation/template.html +11390 -1
  2. package/dist/cjs/core/model/annotation-result/detected-element.d.ts +3 -3
  3. package/dist/cjs/core/model/annotation-result/detected-element.js +4 -4
  4. package/dist/cjs/execution/dsl.d.ts +194 -127
  5. package/dist/cjs/execution/dsl.js +194 -160
  6. package/dist/cjs/execution/ui-controller-client-interface.d.ts +1 -1
  7. package/dist/esm/core/annotation/template.html +11390 -1
  8. package/dist/esm/core/model/annotation-result/detected-element.d.ts +3 -3
  9. package/dist/esm/core/model/annotation-result/detected-element.js +4 -4
  10. package/dist/esm/execution/dsl.d.ts +194 -127
  11. package/dist/esm/execution/dsl.js +194 -160
  12. package/dist/esm/execution/ui-controller-client-interface.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/dist/cjs/core/annotation/annotation-json.d.ts +0 -5
  15. package/dist/cjs/core/annotation/annotation-json.js +0 -2
  16. package/dist/cjs/core/model/test-case-dto/custom-element.spec.d.ts +0 -1
  17. package/dist/cjs/core/model/test-case-dto/custom-element.spec.js +0 -53
  18. package/dist/cjs/execution/dsl.spec.d.ts +0 -1
  19. package/dist/cjs/execution/dsl.spec.js +0 -75
  20. package/dist/cjs/execution/read-environment-credentials.spec.d.ts +0 -1
  21. package/dist/cjs/execution/read-environment-credentials.spec.js +0 -11
  22. package/dist/cjs/lib/ui-controller-args.spec.d.ts +0 -1
  23. package/dist/cjs/lib/ui-controller-args.spec.js +0 -23
  24. package/dist/cjs/utils/http/credentials.spec.d.ts +0 -1
  25. package/dist/cjs/utils/http/credentials.spec.js +0 -11
  26. package/dist/esm/core/annotation/annotation-json.d.ts +0 -5
  27. package/dist/esm/core/annotation/annotation-json.js +0 -1
  28. package/dist/esm/core/model/test-case-dto/custom-element.spec.d.ts +0 -1
  29. package/dist/esm/core/model/test-case-dto/custom-element.spec.js +0 -51
  30. package/dist/esm/execution/dsl.spec.d.ts +0 -1
  31. package/dist/esm/execution/dsl.spec.js +0 -73
  32. package/dist/esm/execution/read-environment-credentials.spec.d.ts +0 -1
  33. package/dist/esm/execution/read-environment-credentials.spec.js +0 -9
  34. package/dist/esm/lib/ui-controller-args.spec.d.ts +0 -1
  35. package/dist/esm/lib/ui-controller-args.spec.js +0 -21
  36. package/dist/esm/utils/http/credentials.spec.d.ts +0 -1
  37. package/dist/esm/utils/http/credentials.spec.js +0 -9
@@ -637,6 +637,11 @@ export class FluentFilters extends FluentBase {
637
637
  /**
638
638
  * Filters for an UI element 'button'.
639
639
  *
640
+ * **Examples:**
641
+ * ```typescript
642
+ * await aui.moveMouseTo().button().exec()
643
+ * ```
644
+ *
640
645
  * @return {FluentFiltersOrRelations}
641
646
  */
642
647
  button() {
@@ -710,8 +715,17 @@ export class FluentFilters extends FluentBase {
710
715
  * ```typescript
711
716
  * 'text' === withText('text') => true
712
717
  * 'test' === withText('text') => true
718
+ * 'Test' === withText('text') => true
719
+ * 'Text' === withText('text') => true
720
+ * 'TEXT' === withText('text') => true
721
+ * 'texst' === withText('text') => true
722
+ * 'texts' === withText('text') => true
723
+ *
724
+ * // usually false
725
+ * 'atebxtc' === withText('text') => false
713
726
  * 'other' === withText('text') => false
714
727
  * ```
728
+ * ![](https://docs.askui.com/img/gif/withText.gif)
715
729
  *
716
730
  * @param {string} text - A text to be matched.
717
731
  *
@@ -730,9 +744,11 @@ export class FluentFilters extends FluentBase {
730
744
  * 'The rain in Spain' === withTextRegex('\b[Ss]\w+') => true
731
745
  * 'The rain in Portugal' === withTextRegex('\b[Ss]\w+') => false
732
746
  * 'The rain in switzerland' === withTextRegex('\b[Ss]\w+') => true
747
+ *
748
+ * await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
733
749
  * ```
734
750
  *
735
- * @param {string} regex_pattern - An regex pattern
751
+ * @param {string} regex_pattern - A regex pattern
736
752
  *
737
753
  * @return {FluentFiltersOrRelations}
738
754
  */
@@ -752,6 +768,8 @@ export class FluentFilters extends FluentBase {
752
768
  * 'text' === withExactText('text') => true
753
769
  * 'test' === withExactText('text') => false
754
770
  * 'other' === withExactText('text') => false
771
+ *
772
+ * await aui.moveMouseTo().text().withExactText('Password').exec()
755
773
  * ```
756
774
  *
757
775
  * @param {string} text - A text to be matched.
@@ -771,6 +789,7 @@ export class FluentFilters extends FluentBase {
771
789
  * 'This is an text' === containsText('other text') => false
772
790
  * 'This is an text' === containsText('other') => false
773
791
  * ```
792
+ * ![](https://docs.askui.com/img/gif/containsText.gif)
774
793
  *
775
794
  * @param {string} text - A text to be matched.
776
795
  *
@@ -780,17 +799,6 @@ export class FluentFilters extends FluentBase {
780
799
  this._textStr = `contain text ${Separators.STRING}${text}${Separators.STRING}`;
781
800
  return new FluentFiltersOrRelations(this);
782
801
  }
783
- /**
784
- * Filters for elements having a specific color.
785
- *
786
- * @param {COLOR} color - A color to match
787
- *
788
- * @return {FluentFiltersOrRelations}
789
- */
790
- colored(color) {
791
- this._textStr = `with color ${color}`;
792
- return new FluentFiltersOrRelations(this);
793
- }
794
802
  }
795
803
  // Relations
796
804
  export class FluentFiltersOrRelations extends FluentFilters {
@@ -822,7 +830,6 @@ export class FluentFiltersOrRelations extends FluentFilters {
822
830
  * DetectedElement {
823
831
  * name: 'BUTTON',
824
832
  * text: 'button',
825
- * colors: [ 'red', 'black', 'red' ],
826
833
  * bndbox: BoundingBox {
827
834
  * xmin: 900,
828
835
  * ymin: 910,
@@ -845,21 +852,19 @@ export class FluentFiltersOrRelations extends FluentFilters {
845
852
  * **Examples:**
846
853
  * ```text
847
854
  * example scene:
848
- * -------------------------- --------------------------
849
- * | icon user colored black | | icon user colored red |
850
- * -------------------------- --------------------------
851
- * ```
855
+ * --------------- ----------------
856
+ * | icon user | | icon search |
857
+ * --------------- ---------------n```
852
858
  * ```typescript
853
- * const icons = await aui.get().icon().withText('user').exec();
859
+ * const icons = await aui.get().icon().exec();
854
860
  * console.log(icons);
855
861
  * ```
856
- * Using only the filter withText, the get command will return both icons because they share the same text
862
+ * Using only the filter icon, the get command will return both icons
857
863
  * ```text
858
864
  * console output: [
859
865
  * DetectedElement {
860
866
  * name: 'ICON',
861
867
  * text: 'user',
862
- * colors: [ 'black', 'black', 'black' ],
863
868
  * bndbox: BoundingBox {
864
869
  * xmin: 1000,
865
870
  * ymin: 1010,
@@ -869,8 +874,7 @@ export class FluentFiltersOrRelations extends FluentFilters {
869
874
  * },
870
875
  * DetectedElement {
871
876
  * name: 'ICON',
872
- * text: 'user',
873
- * colors: [ 'red', 'red', 'red' ],
877
+ * text: 'search',
874
878
  * bndbox: BoundingBox {
875
879
  * xmin: 900,
876
880
  * ymin: 910,
@@ -882,16 +886,15 @@ export class FluentFiltersOrRelations extends FluentFilters {
882
886
  * ```
883
887
  * You can combine filters with **the `and()` relation** and specify exactly which icon you want
884
888
  * ```typescript
885
- * const icons = await aui.get().icon().withText('user').and().colored('red').exec()
889
+ * const icons = await aui.get().icon().and().withText('user').exec()
886
890
  * console.log(icons)
887
891
  * ```
888
- * The get command returns only the red icon although both icons have the same text
892
+ * The get command returns only the user icon although both elements are icons
889
893
  * ```text
890
894
  * console output: [
891
895
  * DetectedElement {
892
896
  * name: 'ICON',
893
897
  * text: 'user',
894
- * colors: [ 'red', 'red', 'red' ],
895
898
  * bndbox: BoundingBox {
896
899
  * xmin: 900,
897
900
  * ymin: 910,
@@ -926,6 +929,7 @@ export class FluentFiltersOrRelations extends FluentFilters {
926
929
  * // Returns nothing because innerEl is not inside outerEl
927
930
  * ...outerEl().in().innerEl()
928
931
  * ```
932
+ * ![](https://docs.askui.com/img/gif/in.gif)
929
933
  *
930
934
  * @return {FluentFilters}
931
935
  */
@@ -947,6 +951,7 @@ export class FluentFiltersOrRelations extends FluentFilters {
947
951
  * // Returns no element because leftEl is left of rightEl
948
952
  * ...leftEl().rightOf().rightEl()
949
953
  * ```
954
+ * ![](https://docs.askui.com/img/gif/rightOf.gif)
950
955
  *
951
956
  * @return {FluentFilters}
952
957
  */
@@ -968,6 +973,7 @@ export class FluentFiltersOrRelations extends FluentFilters {
968
973
  * // Returns no element because rightEl is left of leftEl
969
974
  * ...rightEl().leftOf().leftEl()
970
975
  * ```
976
+ * ![](https://docs.askui.com/img/gif/leftOf.gif)
971
977
  *
972
978
  * @return {FluentFilters}
973
979
  */
@@ -992,6 +998,7 @@ export class FluentFiltersOrRelations extends FluentFilters {
992
998
  * // Returns no element because text is above button
993
999
  * ...text().below().button()
994
1000
  * ```
1001
+ * ![](https://docs.askui.com/img/gif/below.gif)
995
1002
  *
996
1003
  * @return {FluentFilters}
997
1004
  */
@@ -1016,6 +1023,7 @@ export class FluentFiltersOrRelations extends FluentFilters {
1016
1023
  * // Returns no element because button is below text
1017
1024
  * ...button().above().text()
1018
1025
  * ```
1026
+ * ![](https://docs.askui.com/img/gif/above.gif)
1019
1027
  *
1020
1028
  * @return {FluentFilters}
1021
1029
  */
@@ -1044,6 +1052,7 @@ export class FluentFiltersOrRelations extends FluentFilters {
1044
1052
  * // Returns button 1 because button 1 is nearer to the text than button 2
1045
1053
  * ...button().nearestTo().text()
1046
1054
  * ```
1055
+ * ![](https://docs.askui.com/img/gif/nearestTo.gif)
1047
1056
  *
1048
1057
  * @return {FluentFilters}
1049
1058
  */
@@ -1069,6 +1078,7 @@ export class FluentFiltersOrRelations extends FluentFilters {
1069
1078
  * // Returns no element because innerEl contains no outerEl
1070
1079
  * ...innerEl().contains().outerEl()
1071
1080
  * ```
1081
+ * ![](https://docs.askui.com/img/gif/contains.gif)
1072
1082
  *
1073
1083
  * @return {FluentFilters}
1074
1084
  */
@@ -1661,6 +1671,11 @@ export class FluentFiltersCondition extends FluentBase {
1661
1671
  /**
1662
1672
  * Filters for an UI element 'button'.
1663
1673
  *
1674
+ * **Examples:**
1675
+ * ```typescript
1676
+ * await aui.moveMouseTo().button().exec()
1677
+ * ```
1678
+ *
1664
1679
  * @return {FluentFiltersOrRelationsCondition}
1665
1680
  */
1666
1681
  button() {
@@ -1734,8 +1749,17 @@ export class FluentFiltersCondition extends FluentBase {
1734
1749
  * ```typescript
1735
1750
  * 'text' === withText('text') => true
1736
1751
  * 'test' === withText('text') => true
1752
+ * 'Test' === withText('text') => true
1753
+ * 'Text' === withText('text') => true
1754
+ * 'TEXT' === withText('text') => true
1755
+ * 'texst' === withText('text') => true
1756
+ * 'texts' === withText('text') => true
1757
+ *
1758
+ * // usually false
1759
+ * 'atebxtc' === withText('text') => false
1737
1760
  * 'other' === withText('text') => false
1738
1761
  * ```
1762
+ * ![](https://docs.askui.com/img/gif/withText.gif)
1739
1763
  *
1740
1764
  * @param {string} text - A text to be matched.
1741
1765
  *
@@ -1754,9 +1778,11 @@ export class FluentFiltersCondition extends FluentBase {
1754
1778
  * 'The rain in Spain' === withTextRegex('\b[Ss]\w+') => true
1755
1779
  * 'The rain in Portugal' === withTextRegex('\b[Ss]\w+') => false
1756
1780
  * 'The rain in switzerland' === withTextRegex('\b[Ss]\w+') => true
1781
+ *
1782
+ * await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
1757
1783
  * ```
1758
1784
  *
1759
- * @param {string} regex_pattern - An regex pattern
1785
+ * @param {string} regex_pattern - A regex pattern
1760
1786
  *
1761
1787
  * @return {FluentFiltersOrRelationsCondition}
1762
1788
  */
@@ -1776,6 +1802,8 @@ export class FluentFiltersCondition extends FluentBase {
1776
1802
  * 'text' === withExactText('text') => true
1777
1803
  * 'test' === withExactText('text') => false
1778
1804
  * 'other' === withExactText('text') => false
1805
+ *
1806
+ * await aui.moveMouseTo().text().withExactText('Password').exec()
1779
1807
  * ```
1780
1808
  *
1781
1809
  * @param {string} text - A text to be matched.
@@ -1795,6 +1823,7 @@ export class FluentFiltersCondition extends FluentBase {
1795
1823
  * 'This is an text' === containsText('other text') => false
1796
1824
  * 'This is an text' === containsText('other') => false
1797
1825
  * ```
1826
+ * ![](https://docs.askui.com/img/gif/containsText.gif)
1798
1827
  *
1799
1828
  * @param {string} text - A text to be matched.
1800
1829
  *
@@ -1804,17 +1833,6 @@ export class FluentFiltersCondition extends FluentBase {
1804
1833
  this._textStr = `contain text ${Separators.STRING}${text}${Separators.STRING}`;
1805
1834
  return new FluentFiltersOrRelationsCondition(this);
1806
1835
  }
1807
- /**
1808
- * Filters for elements having a specific color.
1809
- *
1810
- * @param {COLOR} color - A color to match
1811
- *
1812
- * @return {FluentFiltersOrRelationsCondition}
1813
- */
1814
- colored(color) {
1815
- this._textStr = `with color ${color}`;
1816
- return new FluentFiltersOrRelationsCondition(this);
1817
- }
1818
1836
  }
1819
1837
  // Relations
1820
1838
  export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
@@ -1846,7 +1864,6 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
1846
1864
  * DetectedElement {
1847
1865
  * name: 'BUTTON',
1848
1866
  * text: 'button',
1849
- * colors: [ 'red', 'black', 'red' ],
1850
1867
  * bndbox: BoundingBox {
1851
1868
  * xmin: 900,
1852
1869
  * ymin: 910,
@@ -1869,21 +1886,19 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
1869
1886
  * **Examples:**
1870
1887
  * ```text
1871
1888
  * example scene:
1872
- * -------------------------- --------------------------
1873
- * | icon user colored black | | icon user colored red |
1874
- * -------------------------- --------------------------
1875
- * ```
1889
+ * --------------- ----------------
1890
+ * | icon user | | icon search |
1891
+ * --------------- ---------------n```
1876
1892
  * ```typescript
1877
- * const icons = await aui.get().icon().withText('user').exec();
1893
+ * const icons = await aui.get().icon().exec();
1878
1894
  * console.log(icons);
1879
1895
  * ```
1880
- * Using only the filter withText, the get command will return both icons because they share the same text
1896
+ * Using only the filter icon, the get command will return both icons
1881
1897
  * ```text
1882
1898
  * console output: [
1883
1899
  * DetectedElement {
1884
1900
  * name: 'ICON',
1885
1901
  * text: 'user',
1886
- * colors: [ 'black', 'black', 'black' ],
1887
1902
  * bndbox: BoundingBox {
1888
1903
  * xmin: 1000,
1889
1904
  * ymin: 1010,
@@ -1893,8 +1908,7 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
1893
1908
  * },
1894
1909
  * DetectedElement {
1895
1910
  * name: 'ICON',
1896
- * text: 'user',
1897
- * colors: [ 'red', 'red', 'red' ],
1911
+ * text: 'search',
1898
1912
  * bndbox: BoundingBox {
1899
1913
  * xmin: 900,
1900
1914
  * ymin: 910,
@@ -1906,16 +1920,15 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
1906
1920
  * ```
1907
1921
  * You can combine filters with **the `and()` relation** and specify exactly which icon you want
1908
1922
  * ```typescript
1909
- * const icons = await aui.get().icon().withText('user').and().colored('red').exec()
1923
+ * const icons = await aui.get().icon().and().withText('user').exec()
1910
1924
  * console.log(icons)
1911
1925
  * ```
1912
- * The get command returns only the red icon although both icons have the same text
1926
+ * The get command returns only the user icon although both elements are icons
1913
1927
  * ```text
1914
1928
  * console output: [
1915
1929
  * DetectedElement {
1916
1930
  * name: 'ICON',
1917
1931
  * text: 'user',
1918
- * colors: [ 'red', 'red', 'red' ],
1919
1932
  * bndbox: BoundingBox {
1920
1933
  * xmin: 900,
1921
1934
  * ymin: 910,
@@ -1950,6 +1963,7 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
1950
1963
  * // Returns nothing because innerEl is not inside outerEl
1951
1964
  * ...outerEl().in().innerEl()
1952
1965
  * ```
1966
+ * ![](https://docs.askui.com/img/gif/in.gif)
1953
1967
  *
1954
1968
  * @return {FluentFiltersCondition}
1955
1969
  */
@@ -1971,6 +1985,7 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
1971
1985
  * // Returns no element because leftEl is left of rightEl
1972
1986
  * ...leftEl().rightOf().rightEl()
1973
1987
  * ```
1988
+ * ![](https://docs.askui.com/img/gif/rightOf.gif)
1974
1989
  *
1975
1990
  * @return {FluentFiltersCondition}
1976
1991
  */
@@ -1992,6 +2007,7 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
1992
2007
  * // Returns no element because rightEl is left of leftEl
1993
2008
  * ...rightEl().leftOf().leftEl()
1994
2009
  * ```
2010
+ * ![](https://docs.askui.com/img/gif/leftOf.gif)
1995
2011
  *
1996
2012
  * @return {FluentFiltersCondition}
1997
2013
  */
@@ -2016,6 +2032,7 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
2016
2032
  * // Returns no element because text is above button
2017
2033
  * ...text().below().button()
2018
2034
  * ```
2035
+ * ![](https://docs.askui.com/img/gif/below.gif)
2019
2036
  *
2020
2037
  * @return {FluentFiltersCondition}
2021
2038
  */
@@ -2040,6 +2057,7 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
2040
2057
  * // Returns no element because button is below text
2041
2058
  * ...button().above().text()
2042
2059
  * ```
2060
+ * ![](https://docs.askui.com/img/gif/above.gif)
2043
2061
  *
2044
2062
  * @return {FluentFiltersCondition}
2045
2063
  */
@@ -2068,6 +2086,7 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
2068
2086
  * // Returns button 1 because button 1 is nearer to the text than button 2
2069
2087
  * ...button().nearestTo().text()
2070
2088
  * ```
2089
+ * ![](https://docs.askui.com/img/gif/nearestTo.gif)
2071
2090
  *
2072
2091
  * @return {FluentFiltersCondition}
2073
2092
  */
@@ -2093,6 +2112,7 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
2093
2112
  * // Returns no element because innerEl contains no outerEl
2094
2113
  * ...innerEl().contains().outerEl()
2095
2114
  * ```
2115
+ * ![](https://docs.askui.com/img/gif/contains.gif)
2096
2116
  *
2097
2117
  * @return {FluentFiltersCondition}
2098
2118
  */
@@ -2103,6 +2123,11 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
2103
2123
  /**
2104
2124
  * Expects that filtered element exists.
2105
2125
  *
2126
+ * **Examples:**
2127
+ * ```typescript
2128
+ * await aui.expect().text().withText('Login').exists().exec()
2129
+ * ```
2130
+ *
2106
2131
  * @return {ExecCondition}
2107
2132
  */
2108
2133
  exists() {
@@ -2112,6 +2137,11 @@ export class FluentFiltersOrRelationsCondition extends FluentFiltersCondition {
2112
2137
  /**
2113
2138
  * Expects that filtered element does not exist.
2114
2139
  *
2140
+ * **Examples:**
2141
+ * ```typescript
2142
+ * await aui.expect().text().withText('Login').notExists().exec()
2143
+ * ```
2144
+ *
2115
2145
  * @return {ExecCondition}
2116
2146
  */
2117
2147
  notExists() {
@@ -2127,8 +2157,13 @@ export class FluentCommand extends FluentBase {
2127
2157
  super(undefined);
2128
2158
  }
2129
2159
  /**
2130
- * Expects a condition, e.g., `exists()` or `notExits()`,
2131
- * e.g., `...expect().text().withText('Login').exists()`.
2160
+ * Expects a condition, e.g., `exists()` or `notExits()`.
2161
+ *
2162
+ * **Examples:**
2163
+ * ```typescript
2164
+ * await aui.expect().text().withText('Login').exists().exec()
2165
+ * await aui.expect().text().withText('Login').notExists().exec()
2166
+ * ```
2132
2167
  *
2133
2168
  * @return {FluentFiltersCondition}
2134
2169
  */
@@ -2139,6 +2174,11 @@ export class FluentCommand extends FluentBase {
2139
2174
  /**
2140
2175
  * Clicks on the filtered element.
2141
2176
  *
2177
+ * **Example:**
2178
+ * ```typescript
2179
+ * await aui.click().button().withText('Submit').exec()
2180
+ * ```
2181
+ *
2142
2182
  * @return {FluentFilters}
2143
2183
  */
2144
2184
  click() {
@@ -2148,6 +2188,11 @@ export class FluentCommand extends FluentBase {
2148
2188
  /**
2149
2189
  * Move mouse over the filtered element.
2150
2190
  *
2191
+ * **Example:**
2192
+ * ```typescript
2193
+ * await aui.moveMouseTo().button().withText('Submit').exec()
2194
+ * ```
2195
+ *
2151
2196
  * @return {FluentFilters}
2152
2197
  */
2153
2198
  moveMouseTo() {
@@ -2155,7 +2200,16 @@ export class FluentCommand extends FluentBase {
2155
2200
  return new FluentFilters(this);
2156
2201
  }
2157
2202
  /**
2158
- * Types a text inside the filtered element.
2203
+ * Puts the focus on the filtered element and types in the text.
2204
+ *
2205
+ * **Examples:**
2206
+ * ```typescript
2207
+ * await aui.typeIn('Type some text').textfield().exec()
2208
+ *
2209
+ * // mask the text so it is not send to the askui-inference server
2210
+ * await aui.typeIn('Type some text', { isSecret: true, secretMask: '**' }).textfield().exec()
2211
+ * ```
2212
+ * ![](https://docs.askui.com/img/gif/typeIn.gif)
2159
2213
  *
2160
2214
  * @param {string} text - A text to type
2161
2215
  *
@@ -2168,6 +2222,13 @@ export class FluentCommand extends FluentBase {
2168
2222
  /**
2169
2223
  * Moves mouse to the filtered element and scrolls in the x and y direction.
2170
2224
  *
2225
+ * **macOS**: May not work as expected!
2226
+ *
2227
+ * **Example:**
2228
+ * ```typescript
2229
+ * await aui.scroll(0, 10).textarea().exec()
2230
+ * ```
2231
+ *
2171
2232
  * @param {number} x_offset - A (positive/negative) x direction.
2172
2233
  * @param {number} y_offset - A (positive/negative) y direction.
2173
2234
  *
@@ -2179,7 +2240,14 @@ export class FluentCommand extends FluentBase {
2179
2240
  }
2180
2241
  /**
2181
2242
  * Moves the mouse relatively to an element in the direction.
2182
- * This can be used when the mouse should not hover over on an element anymore.
2243
+ * This can be used when the mouse should not hover over an element anymore.
2244
+ *
2245
+ * **Examples:**
2246
+ * ```typescript
2247
+ * // Move mouse 30 pixels below button
2248
+ * await aui.moveMouseRelativelyTo(0, 30).button().withText('Submit').exec()
2249
+ * ```
2250
+ * ![](https://docs.askui.com/img/gif/moveMouseRelativelyTo.gif)
2183
2251
  *
2184
2252
  * @param {number} x_offset - A (positive/negative) x direction.
2185
2253
  * @param {number} y_offset - A (positive/negative) y direction.
@@ -2191,10 +2259,19 @@ export class FluentCommand extends FluentBase {
2191
2259
  return new FluentFilters(this);
2192
2260
  }
2193
2261
  /**
2194
- * Swipe an element in the x and y direction
2262
+ * Swipe an element in the x and y direction.
2263
+ * Holds the left mouse button down on Windows, Linux and macOS and drags the element.
2264
+ * On touch devices it taps the element and then drags it.
2195
2265
  *
2196
- * @param {number} x_offset - A x direction. positive an negative values are accepted
2197
- * @param {number} y_offset - A y direction. positive an negative values are accepted
2266
+ * **Example:**
2267
+ * ```typescript
2268
+ * // Swipe the element 500 to the right
2269
+ * await aui.swipe(500, 0).image().exec()
2270
+ * ```
2271
+ * ![](https://docs.askui.com/img/gif/swipe.gif)
2272
+ *
2273
+ * @param {number} x_offset - A x direction. positive and negative values are accepted
2274
+ * @param {number} y_offset - A y direction. positive and negative values are accepted
2198
2275
  *
2199
2276
  * @return {FluentFilters}
2200
2277
  */
@@ -2204,6 +2281,14 @@ export class FluentCommand extends FluentBase {
2204
2281
  }
2205
2282
  /**
2206
2283
  * Types a text at the current position.
2284
+ * If you need to focus the element first, use typeIn()
2285
+ *
2286
+ * **Examples:**
2287
+ * ```typescript
2288
+ * await aui.type('Type some text').exec()
2289
+ *
2290
+ * // mask the text so it is not send to the askui-inference serverawait aui.type('Type some text', { isSecret: true, secretMask: '**' }).exec()
2291
+ * ```
2207
2292
  *
2208
2293
  * @param {string} text - A text to type
2209
2294
  *
@@ -2242,6 +2327,14 @@ export class FluentCommand extends FluentBase {
2242
2327
  *
2243
2328
  * **Important**: Mouse must be positioned in a scrollable area.
2244
2329
  *
2330
+ * **macOS**: May not work as expected!
2331
+ *
2332
+ * **Example:**
2333
+ * ```typescript
2334
+ * // Scroll 10 up in y direction
2335
+ * await aui.scroll(0, 10).exec()
2336
+ * ```
2337
+ *
2245
2338
  * @param {number} x_offset - A (positive/negative) x direction.
2246
2339
  * @param {number} y_offset - A (positive/negative) y direction.
2247
2340
  *
@@ -2252,7 +2345,13 @@ export class FluentCommand extends FluentBase {
2252
2345
  return new Exec(this);
2253
2346
  }
2254
2347
  /**
2255
- * Executes a shell command.
2348
+ * Executes a shell command on the device.
2349
+ *
2350
+ * **Example:**
2351
+ * ```typescript
2352
+ * // Open the lastpass app
2353
+ * await aui.execOnShell('monkey -p com.lastpass.authenticator 1').exec()
2354
+ * ```
2256
2355
  *
2257
2356
  * @param {string} shell_command - A shell command which is executed.
2258
2357
  *
@@ -2262,78 +2361,6 @@ export class FluentCommand extends FluentBase {
2262
2361
  this._textStr = `Execute shell command ${Separators.STRING}${shell_command}${Separators.STRING}`;
2263
2362
  return new Exec(this);
2264
2363
  }
2265
- /**
2266
- * Clicks with left mouse key.
2267
- *
2268
- * @return {Exec}
2269
- */
2270
- mouseLeftClick() {
2271
- this._textStr = 'Mouse left click';
2272
- return new Exec(this);
2273
- }
2274
- /**
2275
- * Clicks with right mouse key.
2276
- *
2277
- * @return {Exec}
2278
- */
2279
- mouseRightClick() {
2280
- this._textStr = 'Mouse right click';
2281
- return new Exec(this);
2282
- }
2283
- /**
2284
- * Clicks with middle mouse key.
2285
- *
2286
- * @return {Exec}
2287
- */
2288
- mouseMiddleClick() {
2289
- this._textStr = 'Mouse middle click';
2290
- return new Exec(this);
2291
- }
2292
- /**
2293
- * Double-clicks with left mouse key.
2294
- *
2295
- * @return {Exec}
2296
- */
2297
- mouseDoubleLeftClick() {
2298
- this._textStr = 'Mouse double left click';
2299
- return new Exec(this);
2300
- }
2301
- /**
2302
- * Double-clicks with right mouse key.
2303
- *
2304
- * @return {Exec}
2305
- */
2306
- mouseDoubleRightClick() {
2307
- this._textStr = 'Mouse double right click';
2308
- return new Exec(this);
2309
- }
2310
- /**
2311
- * Double-clicks with middle mouse key.
2312
- *
2313
- * @return {Exec}
2314
- */
2315
- mouseDoubleMiddleClick() {
2316
- this._textStr = 'Mouse double middle click';
2317
- return new Exec(this);
2318
- }
2319
- /**
2320
- * Toggles mouse down.
2321
- *
2322
- * @return {Exec}
2323
- */
2324
- mouseToggleDown() {
2325
- this._textStr = 'Mouse toggle down';
2326
- return new Exec(this);
2327
- }
2328
- /**
2329
- * Toggles mouse up.
2330
- *
2331
- * @return {Exec}
2332
- */
2333
- mouseToggleUp() {
2334
- this._textStr = 'Mouse toggle up';
2335
- return new Exec(this);
2336
- }
2337
2364
  /**
2338
2365
  * Press three keys like `CTRL+ALT+DEL`
2339
2366
  *
@@ -2993,6 +3020,11 @@ export class FluentFiltersGetter extends FluentBase {
2993
3020
  /**
2994
3021
  * Filters for an UI element 'button'.
2995
3022
  *
3023
+ * **Examples:**
3024
+ * ```typescript
3025
+ * await aui.moveMouseTo().button().exec()
3026
+ * ```
3027
+ *
2996
3028
  * @return {FluentFiltersOrRelationsGetter}
2997
3029
  */
2998
3030
  button() {
@@ -3066,8 +3098,17 @@ export class FluentFiltersGetter extends FluentBase {
3066
3098
  * ```typescript
3067
3099
  * 'text' === withText('text') => true
3068
3100
  * 'test' === withText('text') => true
3101
+ * 'Test' === withText('text') => true
3102
+ * 'Text' === withText('text') => true
3103
+ * 'TEXT' === withText('text') => true
3104
+ * 'texst' === withText('text') => true
3105
+ * 'texts' === withText('text') => true
3106
+ *
3107
+ * // usually false
3108
+ * 'atebxtc' === withText('text') => false
3069
3109
  * 'other' === withText('text') => false
3070
3110
  * ```
3111
+ * ![](https://docs.askui.com/img/gif/withText.gif)
3071
3112
  *
3072
3113
  * @param {string} text - A text to be matched.
3073
3114
  *
@@ -3086,9 +3127,11 @@ export class FluentFiltersGetter extends FluentBase {
3086
3127
  * 'The rain in Spain' === withTextRegex('\b[Ss]\w+') => true
3087
3128
  * 'The rain in Portugal' === withTextRegex('\b[Ss]\w+') => false
3088
3129
  * 'The rain in switzerland' === withTextRegex('\b[Ss]\w+') => true
3130
+ *
3131
+ * await aui.get().text().withTextRegex('\b[Ss]\w+').exec()
3089
3132
  * ```
3090
3133
  *
3091
- * @param {string} regex_pattern - An regex pattern
3134
+ * @param {string} regex_pattern - A regex pattern
3092
3135
  *
3093
3136
  * @return {FluentFiltersOrRelationsGetter}
3094
3137
  */
@@ -3108,6 +3151,8 @@ export class FluentFiltersGetter extends FluentBase {
3108
3151
  * 'text' === withExactText('text') => true
3109
3152
  * 'test' === withExactText('text') => false
3110
3153
  * 'other' === withExactText('text') => false
3154
+ *
3155
+ * await aui.moveMouseTo().text().withExactText('Password').exec()
3111
3156
  * ```
3112
3157
  *
3113
3158
  * @param {string} text - A text to be matched.
@@ -3127,6 +3172,7 @@ export class FluentFiltersGetter extends FluentBase {
3127
3172
  * 'This is an text' === containsText('other text') => false
3128
3173
  * 'This is an text' === containsText('other') => false
3129
3174
  * ```
3175
+ * ![](https://docs.askui.com/img/gif/containsText.gif)
3130
3176
  *
3131
3177
  * @param {string} text - A text to be matched.
3132
3178
  *
@@ -3136,17 +3182,6 @@ export class FluentFiltersGetter extends FluentBase {
3136
3182
  this._textStr = `contain text ${Separators.STRING}${text}${Separators.STRING}`;
3137
3183
  return new FluentFiltersOrRelationsGetter(this);
3138
3184
  }
3139
- /**
3140
- * Filters for elements having a specific color.
3141
- *
3142
- * @param {COLOR} color - A color to match
3143
- *
3144
- * @return {FluentFiltersOrRelationsGetter}
3145
- */
3146
- colored(color) {
3147
- this._textStr = `with color ${color}`;
3148
- return new FluentFiltersOrRelationsGetter(this);
3149
- }
3150
3185
  }
3151
3186
  // Relations
3152
3187
  export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
@@ -3178,7 +3213,6 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3178
3213
  * DetectedElement {
3179
3214
  * name: 'BUTTON',
3180
3215
  * text: 'button',
3181
- * colors: [ 'red', 'black', 'red' ],
3182
3216
  * bndbox: BoundingBox {
3183
3217
  * xmin: 900,
3184
3218
  * ymin: 910,
@@ -3201,21 +3235,19 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3201
3235
  * **Examples:**
3202
3236
  * ```text
3203
3237
  * example scene:
3204
- * -------------------------- --------------------------
3205
- * | icon user colored black | | icon user colored red |
3206
- * -------------------------- --------------------------
3207
- * ```
3238
+ * --------------- ----------------
3239
+ * | icon user | | icon search |
3240
+ * --------------- ---------------n```
3208
3241
  * ```typescript
3209
- * const icons = await aui.get().icon().withText('user').exec();
3242
+ * const icons = await aui.get().icon().exec();
3210
3243
  * console.log(icons);
3211
3244
  * ```
3212
- * Using only the filter withText, the get command will return both icons because they share the same text
3245
+ * Using only the filter icon, the get command will return both icons
3213
3246
  * ```text
3214
3247
  * console output: [
3215
3248
  * DetectedElement {
3216
3249
  * name: 'ICON',
3217
3250
  * text: 'user',
3218
- * colors: [ 'black', 'black', 'black' ],
3219
3251
  * bndbox: BoundingBox {
3220
3252
  * xmin: 1000,
3221
3253
  * ymin: 1010,
@@ -3225,8 +3257,7 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3225
3257
  * },
3226
3258
  * DetectedElement {
3227
3259
  * name: 'ICON',
3228
- * text: 'user',
3229
- * colors: [ 'red', 'red', 'red' ],
3260
+ * text: 'search',
3230
3261
  * bndbox: BoundingBox {
3231
3262
  * xmin: 900,
3232
3263
  * ymin: 910,
@@ -3238,16 +3269,15 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3238
3269
  * ```
3239
3270
  * You can combine filters with **the `and()` relation** and specify exactly which icon you want
3240
3271
  * ```typescript
3241
- * const icons = await aui.get().icon().withText('user').and().colored('red').exec()
3272
+ * const icons = await aui.get().icon().and().withText('user').exec()
3242
3273
  * console.log(icons)
3243
3274
  * ```
3244
- * The get command returns only the red icon although both icons have the same text
3275
+ * The get command returns only the user icon although both elements are icons
3245
3276
  * ```text
3246
3277
  * console output: [
3247
3278
  * DetectedElement {
3248
3279
  * name: 'ICON',
3249
3280
  * text: 'user',
3250
- * colors: [ 'red', 'red', 'red' ],
3251
3281
  * bndbox: BoundingBox {
3252
3282
  * xmin: 900,
3253
3283
  * ymin: 910,
@@ -3282,6 +3312,7 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3282
3312
  * // Returns nothing because innerEl is not inside outerEl
3283
3313
  * ...outerEl().in().innerEl()
3284
3314
  * ```
3315
+ * ![](https://docs.askui.com/img/gif/in.gif)
3285
3316
  *
3286
3317
  * @return {FluentFiltersGetter}
3287
3318
  */
@@ -3303,6 +3334,7 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3303
3334
  * // Returns no element because leftEl is left of rightEl
3304
3335
  * ...leftEl().rightOf().rightEl()
3305
3336
  * ```
3337
+ * ![](https://docs.askui.com/img/gif/rightOf.gif)
3306
3338
  *
3307
3339
  * @return {FluentFiltersGetter}
3308
3340
  */
@@ -3324,6 +3356,7 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3324
3356
  * // Returns no element because rightEl is left of leftEl
3325
3357
  * ...rightEl().leftOf().leftEl()
3326
3358
  * ```
3359
+ * ![](https://docs.askui.com/img/gif/leftOf.gif)
3327
3360
  *
3328
3361
  * @return {FluentFiltersGetter}
3329
3362
  */
@@ -3348,6 +3381,7 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3348
3381
  * // Returns no element because text is above button
3349
3382
  * ...text().below().button()
3350
3383
  * ```
3384
+ * ![](https://docs.askui.com/img/gif/below.gif)
3351
3385
  *
3352
3386
  * @return {FluentFiltersGetter}
3353
3387
  */
@@ -3372,6 +3406,7 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3372
3406
  * // Returns no element because button is below text
3373
3407
  * ...button().above().text()
3374
3408
  * ```
3409
+ * ![](https://docs.askui.com/img/gif/above.gif)
3375
3410
  *
3376
3411
  * @return {FluentFiltersGetter}
3377
3412
  */
@@ -3400,6 +3435,7 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3400
3435
  * // Returns button 1 because button 1 is nearer to the text than button 2
3401
3436
  * ...button().nearestTo().text()
3402
3437
  * ```
3438
+ * ![](https://docs.askui.com/img/gif/nearestTo.gif)
3403
3439
  *
3404
3440
  * @return {FluentFiltersGetter}
3405
3441
  */
@@ -3425,6 +3461,7 @@ export class FluentFiltersOrRelationsGetter extends FluentFiltersGetter {
3425
3461
  * // Returns no element because innerEl contains no outerEl
3426
3462
  * ...innerEl().contains().outerEl()
3427
3463
  * ```
3464
+ * ![](https://docs.askui.com/img/gif/contains.gif)
3428
3465
  *
3429
3466
  * @return {FluentFiltersGetter}
3430
3467
  */
@@ -3448,8 +3485,8 @@ export class Getter extends FluentCommand {
3448
3485
  * A detected element has the following properties:
3449
3486
  * - `name` of the element
3450
3487
  * - `text` content of element
3451
- * - `colors` of element
3452
3488
  * - `bndbox`: location of element described with coordinates of a bounding box
3489
+ *
3453
3490
  * **Examples:**
3454
3491
  * ```typescript
3455
3492
  * const text = await aui.get().text().withText('Sign').exec();
@@ -3460,7 +3497,6 @@ export class Getter extends FluentCommand {
3460
3497
  * DetectedElement {
3461
3498
  * name: 'TEXT',
3462
3499
  * text: 'Sign In',
3463
- * colors: [ 'black', 'gray', 'gray' ],
3464
3500
  * bndbox: BoundingBox {
3465
3501
  * xmin: 1128.2720982142857,
3466
3502
  * ymin: 160.21332310267857,
@@ -3482,8 +3518,8 @@ export class Getter extends FluentCommand {
3482
3518
  * A detected element has the following properties:
3483
3519
  * - `name` of the element
3484
3520
  * - `text` content of element
3485
- * - `colors` of element
3486
3521
  * - `bndbox`: location of element described with coordinates of a bounding box
3522
+ *
3487
3523
  * **Examples:**
3488
3524
  * ```typescript
3489
3525
  * const detectedElements = await aui.getAll().exec();
@@ -3494,7 +3530,6 @@ export class Getter extends FluentCommand {
3494
3530
  * DetectedElement {
3495
3531
  * name: 'TEXT',
3496
3532
  * text: 'Sign In',
3497
- * colors: [ 'black', 'gray', 'gray' ],
3498
3533
  * bndbox: BoundingBox {
3499
3534
  * xmin: 1128.2720982142857,
3500
3535
  * ymin: 160.21332310267857,
@@ -3504,7 +3539,6 @@ export class Getter extends FluentCommand {
3504
3539
  * DetectedElement {
3505
3540
  * name: 'ICON',
3506
3541
  * text: 'search',
3507
- * colors: [ 'black', 'red', 'gray' ],
3508
3542
  * bndbox: BoundingBox {
3509
3543
  * xmin: 250.8204241071428,
3510
3544
  * ymin: 300.21332310267857,