d5-testing-library 2.0.0-alpha.12 → 2.0.0-alpha.13

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FormEdit
3
- } from "./chunk-IU2SMSJW.mjs";
3
+ } from "./chunk-VB77YEH6.mjs";
4
4
  export {
5
5
  FormEdit as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ListForm
3
- } from "./chunk-IU2SMSJW.mjs";
3
+ } from "./chunk-VB77YEH6.mjs";
4
4
  export {
5
5
  ListForm as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TreeView
3
- } from "./chunk-IU2SMSJW.mjs";
3
+ } from "./chunk-VB77YEH6.mjs";
4
4
  export {
5
5
  TreeView as default
6
6
  };
@@ -3320,15 +3320,15 @@ async function classDependencyInjector(formType) {
3320
3320
  let SubFormFactoryClass;
3321
3321
  switch (formType) {
3322
3322
  case "1" /* LIST */:
3323
- SubFormFactoryClass = (await import("./ListForm-PJOXJ3TD.mjs")).default;
3323
+ SubFormFactoryClass = (await import("./ListForm-5IEPHR73.mjs")).default;
3324
3324
  break;
3325
3325
  case "3" /* TREE */:
3326
- SubFormFactoryClass = (await import("./TreeView-GXCLUOMI.mjs")).default;
3326
+ SubFormFactoryClass = (await import("./TreeView-VBE3G4KU.mjs")).default;
3327
3327
  break;
3328
3328
  case "2" /* EDIT */:
3329
3329
  case "99" /* FREE_FORM */:
3330
3330
  case "4" /* REPORT */:
3331
- SubFormFactoryClass = (await import("./FormEdit-AHCGTBML.mjs")).default;
3331
+ SubFormFactoryClass = (await import("./FormEdit-N37GKB3D.mjs")).default;
3332
3332
  break;
3333
3333
  default:
3334
3334
  throw new Error(`Unsupported form type ${formType}`);
@@ -3773,6 +3773,119 @@ var NumberEditor = class extends AbstractDXEditorWithInput {
3773
3773
  }
3774
3774
  };
3775
3775
 
3776
+ // src/pageObjects/elements/Editors/ListItem.ts
3777
+ var DropDownListItem = class {
3778
+ page;
3779
+ itemSelector;
3780
+ textSelector;
3781
+ index;
3782
+ exactText;
3783
+ constructor(options) {
3784
+ this.page = options.page;
3785
+ this.itemSelector = options.itemSelector;
3786
+ this.textSelector = options.textSelector;
3787
+ this.index = options.index;
3788
+ this.exactText = options.exactText;
3789
+ }
3790
+ getExactTextRegExp(value) {
3791
+ const escapedText = value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
3792
+ return new RegExp(`^\\s*${escapedText}\\s*$`);
3793
+ }
3794
+ getLocatorInternal() {
3795
+ const items = this.page.locator(this.itemSelector);
3796
+ if (this.index != null) {
3797
+ return items.nth(this.index);
3798
+ }
3799
+ if (this.exactText != null) {
3800
+ return items.filter({ has: this.page.locator(this.textSelector), hasText: this.getExactTextRegExp(this.exactText) }).first();
3801
+ }
3802
+ return items.first();
3803
+ }
3804
+ async text() {
3805
+ const value = await this.getLocatorInternal().locator(this.textSelector).first().innerText();
3806
+ return value.trim();
3807
+ }
3808
+ getLocator() {
3809
+ return this.getLocatorInternal();
3810
+ }
3811
+ };
3812
+
3813
+ // src/pageObjects/elements/Editors/DropDownList.ts
3814
+ var OVERLAY_SELECTOR = ".dx-overlay-wrapper";
3815
+ var DROPDOWN_BUTTON_SELECTOR = ".dx-icon.dx-dropdowneditor-icon";
3816
+ var DROPDOWN_LIST_ITEM_SELECTOR = ".dx-item.dx-list-item";
3817
+ var LIST_ITEM_TEXT_SELECTOR = ".d5-multi-select-item__text";
3818
+ var DROPDOWN_LIST_SELECTOR = ".dx-list-items";
3819
+ var LIST_ITEMS_WAIT_TIMEOUT = 1e3;
3820
+ var DropDownList = class {
3821
+ page;
3822
+ parentCssSelector;
3823
+ constructor(options) {
3824
+ this.page = options.page;
3825
+ this.parentCssSelector = options.parentCssSelector;
3826
+ }
3827
+ getDropDownButtonLocator() {
3828
+ return this.page.locator(`${this.parentCssSelector} ${DROPDOWN_BUTTON_SELECTOR}`).first();
3829
+ }
3830
+ getDropDownListItemLocator() {
3831
+ return this.page.locator(`${OVERLAY_SELECTOR} ${DROPDOWN_LIST_ITEM_SELECTOR}`);
3832
+ }
3833
+ async isDropDownListVisible() {
3834
+ try {
3835
+ return await this.page.locator(`${OVERLAY_SELECTOR} ${DROPDOWN_LIST_SELECTOR}`).isVisible();
3836
+ } catch (_) {
3837
+ return false;
3838
+ }
3839
+ }
3840
+ async open() {
3841
+ if (await this.isDropDownListVisible()) return;
3842
+ await this.getDropDownButtonLocator().click();
3843
+ await this.waitForListItems("visible");
3844
+ }
3845
+ async close() {
3846
+ if (!await this.isDropDownListVisible()) return;
3847
+ await this.getDropDownButtonLocator().click();
3848
+ await this.waitForListItems("hidden");
3849
+ }
3850
+ async waitForListItems(state) {
3851
+ try {
3852
+ await this.getDropDownListItemLocator().first().waitFor({
3853
+ state,
3854
+ timeout: LIST_ITEMS_WAIT_TIMEOUT
3855
+ });
3856
+ return true;
3857
+ } catch {
3858
+ return false;
3859
+ }
3860
+ }
3861
+ async list() {
3862
+ if (!await this.waitForListItems("visible")) {
3863
+ return [];
3864
+ }
3865
+ const count = await this.getDropDownListItemLocator().count();
3866
+ const result = [];
3867
+ for (let i = 0; i < count; i++) {
3868
+ result.push(
3869
+ new DropDownListItem({
3870
+ page: this.page,
3871
+ itemSelector: DROPDOWN_LIST_ITEM_SELECTOR,
3872
+ textSelector: LIST_ITEM_TEXT_SELECTOR,
3873
+ index: i
3874
+ })
3875
+ );
3876
+ }
3877
+ return result;
3878
+ }
3879
+ listItem(text) {
3880
+ return new DropDownListItem({
3881
+ page: this.page,
3882
+ itemSelector: `${OVERLAY_SELECTOR} ${DROPDOWN_LIST_ITEM_SELECTOR}`,
3883
+ textSelector: LIST_ITEM_TEXT_SELECTOR,
3884
+ exactText: text.trim()
3885
+ });
3886
+ }
3887
+ };
3888
+
3776
3889
  // src/pageObjects/elements/Editors/types.ts
3777
3890
  var ControlClass = /* @__PURE__ */ ((ControlClass2) => {
3778
3891
  ControlClass2["Text"] = "text-control";
@@ -4563,13 +4676,30 @@ var dropDownOptionClick = async (optionValue, page, delay = true) => {
4563
4676
  await locator.click();
4564
4677
  };
4565
4678
  var SelectBoxEditor = class extends AbstractDXEditorWithInput {
4679
+ dropdownList;
4566
4680
  constructor(parentCssSelector, elementCssSelector, page) {
4567
4681
  super(parentCssSelector, elementCssSelector, page);
4568
4682
  this.setClearStrategy(new ClearButtonStrategy(this.getFullCssSelector(), page));
4683
+ this.dropdownList = new DropDownList({
4684
+ page,
4685
+ parentCssSelector: this.getFullCssSelector()
4686
+ });
4569
4687
  }
4570
4688
  getInputLocator() {
4571
4689
  return this.page.locator(`${this.getFullCssSelector()} .dx-texteditor-input`);
4572
4690
  }
4691
+ async dropDownOpen() {
4692
+ await this.dropdownList.open();
4693
+ }
4694
+ async dropDownClose() {
4695
+ await this.dropdownList.close();
4696
+ }
4697
+ async dropDownList() {
4698
+ return this.dropdownList.list();
4699
+ }
4700
+ dropDownListItem(text) {
4701
+ return this.dropdownList.listItem(text);
4702
+ }
4573
4703
  async setSelectInputValue(value) {
4574
4704
  const inputEl = this.getInputLocator();
4575
4705
  await inputEl.click();
@@ -4634,13 +4764,30 @@ var DX_TAG_CONTAINER = "dx-tag-container";
4634
4764
  var DX_TEXTEDITOR_EMPTY2 = "dx-texteditor-empty";
4635
4765
  var BTN_OK_SELECTOR = ".dx-tagbox-popup-wrapper .dx-popup-bottom .dx-button.dx-popup-done";
4636
4766
  var TagBox = class extends AbstractDXEditorWithInput {
4767
+ dropdownList;
4637
4768
  constructor(parentCssSelector, elementCssSelector, page) {
4638
4769
  super(parentCssSelector, elementCssSelector, page);
4639
4770
  this.setClearStrategy(new ClearButtonStrategy(this.getFullCssSelector(), page));
4771
+ this.dropdownList = new DropDownList({
4772
+ page,
4773
+ parentCssSelector: this.getFullCssSelector()
4774
+ });
4640
4775
  }
4641
4776
  getInputLocator() {
4642
4777
  return this.page.locator(`${this.getFullCssSelector()} .dx-texteditor-input`);
4643
4778
  }
4779
+ async dropDownOpen() {
4780
+ await this.dropdownList.open();
4781
+ }
4782
+ async dropDownClose() {
4783
+ await this.dropdownList.close();
4784
+ }
4785
+ async dropDownList() {
4786
+ return this.dropdownList.list();
4787
+ }
4788
+ dropDownListItem(text) {
4789
+ return this.dropdownList.listItem(text);
4790
+ }
4644
4791
  async setTagBoxInputValue(values) {
4645
4792
  const lastElement = values[values.length - 1];
4646
4793
  const input = this.getInputLocator();
@@ -5487,6 +5634,32 @@ var AbstractEditor = class extends AbstractElementWithParent {
5487
5634
  }
5488
5635
  return this.editor.download();
5489
5636
  }
5637
+ async dropDownOpen() {
5638
+ await this.initEditor();
5639
+ if (!this.editor.dropDownOpen) {
5640
+ throw new Error("The dropDownOpen method is not available for this field type.");
5641
+ }
5642
+ return this.editor.dropDownOpen();
5643
+ }
5644
+ async dropDownClose() {
5645
+ await this.initEditor();
5646
+ if (!this.editor.dropDownClose) {
5647
+ throw new Error("The dropDownClose method is not available for this field type.");
5648
+ }
5649
+ return this.editor.dropDownClose();
5650
+ }
5651
+ async dropDownList() {
5652
+ return new DropDownList({
5653
+ page: this.page,
5654
+ parentCssSelector: this.getFullCssSelector()
5655
+ }).list();
5656
+ }
5657
+ dropDownListItem(text) {
5658
+ return new DropDownList({
5659
+ page: this.page,
5660
+ parentCssSelector: this.getFullCssSelector()
5661
+ }).listItem(text);
5662
+ }
5490
5663
  };
5491
5664
 
5492
5665
  // src/pageObjects/elements/FormField.ts
@@ -6374,6 +6547,8 @@ export {
6374
6547
  wait,
6375
6548
  TextEditor,
6376
6549
  NumberEditor,
6550
+ DropDownListItem,
6551
+ DropDownList,
6377
6552
  ControlClass,
6378
6553
  editorFactory,
6379
6554
  SubsystemsPanel,
@@ -388,6 +388,132 @@ var init_NumberEditor = __esm({
388
388
  }
389
389
  });
390
390
 
391
+ // src/pageObjects/elements/Editors/ListItem.ts
392
+ var DropDownListItem;
393
+ var init_ListItem = __esm({
394
+ "src/pageObjects/elements/Editors/ListItem.ts"() {
395
+ "use strict";
396
+ DropDownListItem = class {
397
+ page;
398
+ itemSelector;
399
+ textSelector;
400
+ index;
401
+ exactText;
402
+ constructor(options) {
403
+ this.page = options.page;
404
+ this.itemSelector = options.itemSelector;
405
+ this.textSelector = options.textSelector;
406
+ this.index = options.index;
407
+ this.exactText = options.exactText;
408
+ }
409
+ getExactTextRegExp(value) {
410
+ const escapedText = value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
411
+ return new RegExp(`^\\s*${escapedText}\\s*$`);
412
+ }
413
+ getLocatorInternal() {
414
+ const items = this.page.locator(this.itemSelector);
415
+ if (this.index != null) {
416
+ return items.nth(this.index);
417
+ }
418
+ if (this.exactText != null) {
419
+ return items.filter({ has: this.page.locator(this.textSelector), hasText: this.getExactTextRegExp(this.exactText) }).first();
420
+ }
421
+ return items.first();
422
+ }
423
+ async text() {
424
+ const value = await this.getLocatorInternal().locator(this.textSelector).first().innerText();
425
+ return value.trim();
426
+ }
427
+ getLocator() {
428
+ return this.getLocatorInternal();
429
+ }
430
+ };
431
+ }
432
+ });
433
+
434
+ // src/pageObjects/elements/Editors/DropDownList.ts
435
+ var OVERLAY_SELECTOR, DROPDOWN_BUTTON_SELECTOR, DROPDOWN_LIST_ITEM_SELECTOR, LIST_ITEM_TEXT_SELECTOR, DROPDOWN_LIST_SELECTOR, LIST_ITEMS_WAIT_TIMEOUT, DropDownList;
436
+ var init_DropDownList = __esm({
437
+ "src/pageObjects/elements/Editors/DropDownList.ts"() {
438
+ "use strict";
439
+ init_ListItem();
440
+ OVERLAY_SELECTOR = ".dx-overlay-wrapper";
441
+ DROPDOWN_BUTTON_SELECTOR = ".dx-icon.dx-dropdowneditor-icon";
442
+ DROPDOWN_LIST_ITEM_SELECTOR = ".dx-item.dx-list-item";
443
+ LIST_ITEM_TEXT_SELECTOR = ".d5-multi-select-item__text";
444
+ DROPDOWN_LIST_SELECTOR = ".dx-list-items";
445
+ LIST_ITEMS_WAIT_TIMEOUT = 1e3;
446
+ DropDownList = class {
447
+ page;
448
+ parentCssSelector;
449
+ constructor(options) {
450
+ this.page = options.page;
451
+ this.parentCssSelector = options.parentCssSelector;
452
+ }
453
+ getDropDownButtonLocator() {
454
+ return this.page.locator(`${this.parentCssSelector} ${DROPDOWN_BUTTON_SELECTOR}`).first();
455
+ }
456
+ getDropDownListItemLocator() {
457
+ return this.page.locator(`${OVERLAY_SELECTOR} ${DROPDOWN_LIST_ITEM_SELECTOR}`);
458
+ }
459
+ async isDropDownListVisible() {
460
+ try {
461
+ return await this.page.locator(`${OVERLAY_SELECTOR} ${DROPDOWN_LIST_SELECTOR}`).isVisible();
462
+ } catch (_) {
463
+ return false;
464
+ }
465
+ }
466
+ async open() {
467
+ if (await this.isDropDownListVisible()) return;
468
+ await this.getDropDownButtonLocator().click();
469
+ await this.waitForListItems("visible");
470
+ }
471
+ async close() {
472
+ if (!await this.isDropDownListVisible()) return;
473
+ await this.getDropDownButtonLocator().click();
474
+ await this.waitForListItems("hidden");
475
+ }
476
+ async waitForListItems(state) {
477
+ try {
478
+ await this.getDropDownListItemLocator().first().waitFor({
479
+ state,
480
+ timeout: LIST_ITEMS_WAIT_TIMEOUT
481
+ });
482
+ return true;
483
+ } catch {
484
+ return false;
485
+ }
486
+ }
487
+ async list() {
488
+ if (!await this.waitForListItems("visible")) {
489
+ return [];
490
+ }
491
+ const count = await this.getDropDownListItemLocator().count();
492
+ const result = [];
493
+ for (let i = 0; i < count; i++) {
494
+ result.push(
495
+ new DropDownListItem({
496
+ page: this.page,
497
+ itemSelector: DROPDOWN_LIST_ITEM_SELECTOR,
498
+ textSelector: LIST_ITEM_TEXT_SELECTOR,
499
+ index: i
500
+ })
501
+ );
502
+ }
503
+ return result;
504
+ }
505
+ listItem(text) {
506
+ return new DropDownListItem({
507
+ page: this.page,
508
+ itemSelector: `${OVERLAY_SELECTOR} ${DROPDOWN_LIST_ITEM_SELECTOR}`,
509
+ textSelector: LIST_ITEM_TEXT_SELECTOR,
510
+ exactText: text.trim()
511
+ });
512
+ }
513
+ };
514
+ }
515
+ });
516
+
391
517
  // src/pageObjects/elements/Editors/types.ts
392
518
  var ControlClass;
393
519
  var init_types = __esm({
@@ -530,6 +656,7 @@ var init_SelectBoxEditor = __esm({
530
656
  init_xpathHelper();
531
657
  init_src();
532
658
  init_typesUtil();
659
+ init_DropDownList();
533
660
  SELECT_BOX_OPTION_TEXT_CONTAINER_CLASS = "d5-multi-select-item";
534
661
  combinedValueXpath = (value) => `//body/div[@id="root"]/div[contains(@class, "dx-overlay-wrapper")]//${XPathHelper.getClassAndValueXpath(SELECT_BOX_OPTION_TEXT_CONTAINER_CLASS, value)}`;
535
662
  dropDownOptionClick = async (optionValue, page, delay = true) => {
@@ -548,13 +675,30 @@ var init_SelectBoxEditor = __esm({
548
675
  await locator.click();
549
676
  };
550
677
  SelectBoxEditor = class extends AbstractDXEditorWithInput {
678
+ dropdownList;
551
679
  constructor(parentCssSelector, elementCssSelector, page) {
552
680
  super(parentCssSelector, elementCssSelector, page);
553
681
  this.setClearStrategy(new ClearButtonStrategy(this.getFullCssSelector(), page));
682
+ this.dropdownList = new DropDownList({
683
+ page,
684
+ parentCssSelector: this.getFullCssSelector()
685
+ });
554
686
  }
555
687
  getInputLocator() {
556
688
  return this.page.locator(`${this.getFullCssSelector()} .dx-texteditor-input`);
557
689
  }
690
+ async dropDownOpen() {
691
+ await this.dropdownList.open();
692
+ }
693
+ async dropDownClose() {
694
+ await this.dropdownList.close();
695
+ }
696
+ async dropDownList() {
697
+ return this.dropdownList.list();
698
+ }
699
+ dropDownListItem(text) {
700
+ return this.dropdownList.listItem(text);
701
+ }
558
702
  async setSelectInputValue(value) {
559
703
  const inputEl = this.getInputLocator();
560
704
  await inputEl.click();
@@ -633,18 +777,36 @@ var init_TagBox = __esm({
633
777
  init_locators();
634
778
  init_SelectBoxEditor();
635
779
  init_wait();
780
+ init_DropDownList();
636
781
  TAGS_SELECTOR = ".dx-tag .tag-text";
637
782
  DX_TAG_CONTAINER = "dx-tag-container";
638
783
  DX_TEXTEDITOR_EMPTY2 = "dx-texteditor-empty";
639
784
  BTN_OK_SELECTOR = ".dx-tagbox-popup-wrapper .dx-popup-bottom .dx-button.dx-popup-done";
640
785
  TagBox = class extends AbstractDXEditorWithInput {
786
+ dropdownList;
641
787
  constructor(parentCssSelector, elementCssSelector, page) {
642
788
  super(parentCssSelector, elementCssSelector, page);
643
789
  this.setClearStrategy(new ClearButtonStrategy(this.getFullCssSelector(), page));
790
+ this.dropdownList = new DropDownList({
791
+ page,
792
+ parentCssSelector: this.getFullCssSelector()
793
+ });
644
794
  }
645
795
  getInputLocator() {
646
796
  return this.page.locator(`${this.getFullCssSelector()} .dx-texteditor-input`);
647
797
  }
798
+ async dropDownOpen() {
799
+ await this.dropdownList.open();
800
+ }
801
+ async dropDownClose() {
802
+ await this.dropdownList.close();
803
+ }
804
+ async dropDownList() {
805
+ return this.dropdownList.list();
806
+ }
807
+ dropDownListItem(text) {
808
+ return this.dropdownList.listItem(text);
809
+ }
648
810
  async setTagBoxInputValue(values) {
649
811
  const lastElement = values[values.length - 1];
650
812
  const input = this.getInputLocator();
@@ -1446,6 +1608,8 @@ var init_Editors = __esm({
1446
1608
  "use strict";
1447
1609
  init_TextEditor();
1448
1610
  init_NumberEditor();
1611
+ init_ListItem();
1612
+ init_DropDownList();
1449
1613
  init_editorFactory();
1450
1614
  init_types();
1451
1615
  }
@@ -2523,6 +2687,32 @@ var init_AbstractEditor2 = __esm({
2523
2687
  }
2524
2688
  return this.editor.download();
2525
2689
  }
2690
+ async dropDownOpen() {
2691
+ await this.initEditor();
2692
+ if (!this.editor.dropDownOpen) {
2693
+ throw new Error("The dropDownOpen method is not available for this field type.");
2694
+ }
2695
+ return this.editor.dropDownOpen();
2696
+ }
2697
+ async dropDownClose() {
2698
+ await this.initEditor();
2699
+ if (!this.editor.dropDownClose) {
2700
+ throw new Error("The dropDownClose method is not available for this field type.");
2701
+ }
2702
+ return this.editor.dropDownClose();
2703
+ }
2704
+ async dropDownList() {
2705
+ return new DropDownList({
2706
+ page: this.page,
2707
+ parentCssSelector: this.getFullCssSelector()
2708
+ }).list();
2709
+ }
2710
+ dropDownListItem(text) {
2711
+ return new DropDownList({
2712
+ page: this.page,
2713
+ parentCssSelector: this.getFullCssSelector()
2714
+ }).listItem(text);
2715
+ }
2526
2716
  };
2527
2717
  }
2528
2718
  });
@@ -7080,6 +7270,8 @@ __export(src_exports, {
7080
7270
  ApiRequest: () => ApiRequest,
7081
7271
  ControlClass: () => ControlClass,
7082
7272
  Dialog: () => Dialog,
7273
+ DropDownList: () => DropDownList,
7274
+ DropDownListItem: () => DropDownListItem,
7083
7275
  FilterPanel: () => FilterPanel,
7084
7276
  FormEdit: () => FormEdit,
7085
7277
  FormField: () => FormField,
@@ -7132,6 +7324,8 @@ init_src();
7132
7324
  ApiRequest,
7133
7325
  ControlClass,
7134
7326
  Dialog,
7327
+ DropDownList,
7328
+ DropDownListItem,
7135
7329
  FilterPanel,
7136
7330
  FormEdit,
7137
7331
  FormField,
@@ -89,11 +89,19 @@ interface PlaywrightWaitParams {
89
89
  */
90
90
  declare function wait(condition: PlaywrightWaitParams['condition'], page: Page, errorMessage?: string, timeout?: number): Promise<void>;
91
91
 
92
+ interface ListItem {
93
+ text(): Promise<string>;
94
+ getLocator(): Locator;
95
+ }
92
96
  interface Editor {
93
97
  setValue(value: any): Promise<void>;
94
98
  getValue(): Promise<any>;
95
99
  remove?(itemText: string): Promise<void>;
96
100
  clear?(): Promise<void>;
101
+ dropDownOpen?(): Promise<void>;
102
+ dropDownClose?(): Promise<void>;
103
+ dropDownList?(): Promise<ListItem[]>;
104
+ dropDownListItem?(text: string): ListItem;
97
105
  isReadonly?(): Promise<boolean>;
98
106
  isDisabled?(): Promise<boolean>;
99
107
  download?(): Promise<string>;
@@ -150,6 +158,44 @@ declare class NumberEditor extends AbstractDXEditorWithInput {
150
158
  setValue(value: any): Promise<void>;
151
159
  }
152
160
 
161
+ interface DropDownListItemOptions {
162
+ page: Page;
163
+ itemSelector: string;
164
+ textSelector: string;
165
+ index?: number;
166
+ exactText?: string;
167
+ }
168
+ declare class DropDownListItem implements ListItem {
169
+ private readonly page;
170
+ private readonly itemSelector;
171
+ private readonly textSelector;
172
+ private readonly index?;
173
+ private readonly exactText?;
174
+ constructor(options: DropDownListItemOptions);
175
+ private getExactTextRegExp;
176
+ private getLocatorInternal;
177
+ text(): Promise<string>;
178
+ getLocator(): Locator;
179
+ }
180
+
181
+ interface DropDownListOptions {
182
+ page: Page;
183
+ parentCssSelector: string;
184
+ }
185
+ declare class DropDownList {
186
+ private readonly page;
187
+ private readonly parentCssSelector;
188
+ constructor(options: DropDownListOptions);
189
+ private getDropDownButtonLocator;
190
+ private getDropDownListItemLocator;
191
+ private isDropDownListVisible;
192
+ open(): Promise<void>;
193
+ close(): Promise<void>;
194
+ private waitForListItems;
195
+ list(): Promise<ListItem[]>;
196
+ listItem(text: string): ListItem;
197
+ }
198
+
153
199
  declare const editorFactory: (parentCssSelector: string, elementCssSelector: string, page: Page) => Promise<Editor>;
154
200
 
155
201
  interface ISubsystemItem {
@@ -427,6 +473,10 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
427
473
  * expect(filename()).toBe('file.pdf');
428
474
  */
429
475
  download(): Promise<string>;
476
+ dropDownOpen(): Promise<void>;
477
+ dropDownClose(): Promise<void>;
478
+ dropDownList(): Promise<ListItem[]>;
479
+ dropDownListItem(text: string): ListItem;
430
480
  }
431
481
 
432
482
  declare class FormField extends AbstractEditor {
@@ -1055,4 +1105,4 @@ declare class Dialog extends AbstractElement {
1055
1105
 
1056
1106
  declare function ApiRequest(objectName: string, operation: string): any;
1057
1107
 
1058
- export { AbstractPage, ApiRequest, ControlClass, Dialog, type Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, LoginPage, NumberEditor, PanelFilterField, ReportForm, SubsystemsPanel, TextEditor, TreeView, byTestId, byTestIdCssSelector, config, disabledLocator, editorFactory, readonlyLocator, wait, waitElementIsVisible };
1108
+ export { AbstractPage, ApiRequest, ControlClass, Dialog, DropDownList, DropDownListItem, type Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, type ListItem, LoginPage, NumberEditor, PanelFilterField, ReportForm, SubsystemsPanel, TextEditor, TreeView, byTestId, byTestIdCssSelector, config, disabledLocator, editorFactory, readonlyLocator, wait, waitElementIsVisible };
@@ -89,11 +89,19 @@ interface PlaywrightWaitParams {
89
89
  */
90
90
  declare function wait(condition: PlaywrightWaitParams['condition'], page: Page, errorMessage?: string, timeout?: number): Promise<void>;
91
91
 
92
+ interface ListItem {
93
+ text(): Promise<string>;
94
+ getLocator(): Locator;
95
+ }
92
96
  interface Editor {
93
97
  setValue(value: any): Promise<void>;
94
98
  getValue(): Promise<any>;
95
99
  remove?(itemText: string): Promise<void>;
96
100
  clear?(): Promise<void>;
101
+ dropDownOpen?(): Promise<void>;
102
+ dropDownClose?(): Promise<void>;
103
+ dropDownList?(): Promise<ListItem[]>;
104
+ dropDownListItem?(text: string): ListItem;
97
105
  isReadonly?(): Promise<boolean>;
98
106
  isDisabled?(): Promise<boolean>;
99
107
  download?(): Promise<string>;
@@ -150,6 +158,44 @@ declare class NumberEditor extends AbstractDXEditorWithInput {
150
158
  setValue(value: any): Promise<void>;
151
159
  }
152
160
 
161
+ interface DropDownListItemOptions {
162
+ page: Page;
163
+ itemSelector: string;
164
+ textSelector: string;
165
+ index?: number;
166
+ exactText?: string;
167
+ }
168
+ declare class DropDownListItem implements ListItem {
169
+ private readonly page;
170
+ private readonly itemSelector;
171
+ private readonly textSelector;
172
+ private readonly index?;
173
+ private readonly exactText?;
174
+ constructor(options: DropDownListItemOptions);
175
+ private getExactTextRegExp;
176
+ private getLocatorInternal;
177
+ text(): Promise<string>;
178
+ getLocator(): Locator;
179
+ }
180
+
181
+ interface DropDownListOptions {
182
+ page: Page;
183
+ parentCssSelector: string;
184
+ }
185
+ declare class DropDownList {
186
+ private readonly page;
187
+ private readonly parentCssSelector;
188
+ constructor(options: DropDownListOptions);
189
+ private getDropDownButtonLocator;
190
+ private getDropDownListItemLocator;
191
+ private isDropDownListVisible;
192
+ open(): Promise<void>;
193
+ close(): Promise<void>;
194
+ private waitForListItems;
195
+ list(): Promise<ListItem[]>;
196
+ listItem(text: string): ListItem;
197
+ }
198
+
153
199
  declare const editorFactory: (parentCssSelector: string, elementCssSelector: string, page: Page) => Promise<Editor>;
154
200
 
155
201
  interface ISubsystemItem {
@@ -427,6 +473,10 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
427
473
  * expect(filename()).toBe('file.pdf');
428
474
  */
429
475
  download(): Promise<string>;
476
+ dropDownOpen(): Promise<void>;
477
+ dropDownClose(): Promise<void>;
478
+ dropDownList(): Promise<ListItem[]>;
479
+ dropDownListItem(text: string): ListItem;
430
480
  }
431
481
 
432
482
  declare class FormField extends AbstractEditor {
@@ -1055,4 +1105,4 @@ declare class Dialog extends AbstractElement {
1055
1105
 
1056
1106
  declare function ApiRequest(objectName: string, operation: string): any;
1057
1107
 
1058
- export { AbstractPage, ApiRequest, ControlClass, Dialog, type Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, LoginPage, NumberEditor, PanelFilterField, ReportForm, SubsystemsPanel, TextEditor, TreeView, byTestId, byTestIdCssSelector, config, disabledLocator, editorFactory, readonlyLocator, wait, waitElementIsVisible };
1108
+ export { AbstractPage, ApiRequest, ControlClass, Dialog, DropDownList, DropDownListItem, type Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, type ListItem, LoginPage, NumberEditor, PanelFilterField, ReportForm, SubsystemsPanel, TextEditor, TreeView, byTestId, byTestIdCssSelector, config, disabledLocator, editorFactory, readonlyLocator, wait, waitElementIsVisible };
@@ -3,6 +3,8 @@ import {
3
3
  ApiRequest,
4
4
  ControlClass,
5
5
  Dialog,
6
+ DropDownList,
7
+ DropDownListItem,
6
8
  FilterPanel,
7
9
  FormEdit,
8
10
  FormField,
@@ -23,12 +25,14 @@ import {
23
25
  readonlyLocator,
24
26
  wait,
25
27
  waitElementIsVisible_default
26
- } from "./chunk-IU2SMSJW.mjs";
28
+ } from "./chunk-VB77YEH6.mjs";
27
29
  export {
28
30
  AbstractPage,
29
31
  ApiRequest,
30
32
  ControlClass,
31
33
  Dialog,
34
+ DropDownList,
35
+ DropDownListItem,
32
36
  FilterPanel,
33
37
  FormEdit,
34
38
  FormField,
@@ -3,6 +3,8 @@ import {
3
3
  ApiRequest,
4
4
  ControlClass,
5
5
  Dialog,
6
+ DropDownList,
7
+ DropDownListItem,
6
8
  FilterPanel,
7
9
  FormEdit,
8
10
  FormField,
@@ -23,12 +25,14 @@ import {
23
25
  readonlyLocator,
24
26
  wait,
25
27
  waitElementIsVisible_default
26
- } from "./chunk-IU2SMSJW.mjs";
28
+ } from "./chunk-VB77YEH6.mjs";
27
29
  export {
28
30
  AbstractPage,
29
31
  ApiRequest,
30
32
  ControlClass,
31
33
  Dialog,
34
+ DropDownList,
35
+ DropDownListItem,
32
36
  FilterPanel,
33
37
  FormEdit,
34
38
  FormField,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "d5-testing-library",
3
- "version": "2.0.0-alpha.12",
3
+ "version": "2.0.0-alpha.13",
4
4
  "description": "e2e testing D5 projects",
5
5
  "main": "dist/cjs/d5-testing-library.cjs",
6
6
  "module": "dist/d5-testing-library.legacy-esm.js",