askui 0.4.0 → 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.
@@ -535,6 +535,114 @@ export declare class FluentFilters extends FluentBase {
535
535
  colored(color: COLOR): FluentFiltersOrRelations;
536
536
  }
537
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;
538
646
  /**
539
647
  * Filters for an element inside another element.
540
648
  *
@@ -1194,6 +1302,114 @@ export declare class FluentFiltersCondition extends FluentBase {
1194
1302
  colored(color: COLOR): FluentFiltersOrRelationsCondition;
1195
1303
  }
1196
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;
1197
1413
  /**
1198
1414
  * Filters for an element inside another element.
1199
1415
  *
@@ -2078,6 +2294,114 @@ export declare class FluentFiltersGetter extends FluentBase {
2078
2294
  colored(color: COLOR): FluentFiltersOrRelationsGetter;
2079
2295
  }
2080
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;
2081
2405
  /**
2082
2406
  * Filters for an element inside another element.
2083
2407
  *
@@ -2234,13 +2558,74 @@ export declare class FluentFiltersOrRelationsGetter extends FluentFiltersGetter
2234
2558
  }
2235
2559
  export declare abstract class Getter extends FluentCommand {
2236
2560
  /**
2237
- * Returns the filtered element
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
+ * ```
2238
2587
  *
2239
2588
  * @return {FluentFiltersGetter}
2240
2589
  */
2241
2590
  get(): FluentFiltersGetter;
2242
2591
  /**
2243
- * Returns all detected elements
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
+ * ```
2244
2629
  *
2245
2630
  * @return {ExecGetter}
2246
2631
  */