d5-testing-library 2.0.0-alpha.15 → 2.0.0-alpha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FormEdit-V5FY7PL5.mjs → FormEdit-KBNOTYNX.mjs} +1 -1
- package/dist/{ListForm-DB2J5ED6.mjs → ListForm-TFNVONCF.mjs} +1 -1
- package/dist/{TreeView-VOVTTSRC.mjs → TreeView-XOIPJAT7.mjs} +1 -1
- package/dist/{chunk-XN4OIA4L.mjs → chunk-YL3AEJ7O.mjs} +84 -32
- package/dist/cjs/d5-testing-library.cjs +142 -88
- package/dist/cjs/d5-testing-library.d.ts +17 -0
- package/dist/d5-testing-library.d.mts +17 -0
- package/dist/d5-testing-library.legacy-esm.js +1 -1
- package/dist/d5-testing-library.mjs +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
3323
|
+
SubFormFactoryClass = (await import("./ListForm-TFNVONCF.mjs")).default;
|
|
3324
3324
|
break;
|
|
3325
3325
|
case "3" /* TREE */:
|
|
3326
|
-
SubFormFactoryClass = (await import("./TreeView-
|
|
3326
|
+
SubFormFactoryClass = (await import("./TreeView-XOIPJAT7.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-
|
|
3331
|
+
SubFormFactoryClass = (await import("./FormEdit-KBNOTYNX.mjs")).default;
|
|
3332
3332
|
break;
|
|
3333
3333
|
default:
|
|
3334
3334
|
throw new Error(`Unsupported form type ${formType}`);
|
|
@@ -3573,17 +3573,30 @@ var Row = class extends AbstractElementWithParent {
|
|
|
3573
3573
|
getCellByTitle(title) {
|
|
3574
3574
|
return this._getCell({ title });
|
|
3575
3575
|
}
|
|
3576
|
+
async deselect() {
|
|
3577
|
+
const row = this.getLocator();
|
|
3578
|
+
const classes = await this.getClasses();
|
|
3579
|
+
if (!classes.includes(DX_SELECTION_CLASS)) {
|
|
3580
|
+
return;
|
|
3581
|
+
}
|
|
3582
|
+
const cell = row.locator(FIRST_CLICKED_CELL_SELECTOR);
|
|
3583
|
+
await cell.click({ modifiers: ["ControlOrMeta"] });
|
|
3584
|
+
await wait(
|
|
3585
|
+
async () => {
|
|
3586
|
+
const classes2 = await this.getClasses();
|
|
3587
|
+
return !classes2.includes(DX_SELECTION_CLASS);
|
|
3588
|
+
},
|
|
3589
|
+
this.page,
|
|
3590
|
+
"Cannot deselect row"
|
|
3591
|
+
);
|
|
3592
|
+
}
|
|
3576
3593
|
async select(preserve = false) {
|
|
3577
3594
|
const rowEl = this.getLocator();
|
|
3578
3595
|
const classes = await this.getClasses();
|
|
3579
3596
|
const isSelected = classes.includes(DX_SELECTION_CLASS);
|
|
3580
3597
|
const clickedElement = rowEl.locator(FIRST_CLICKED_CELL_SELECTOR);
|
|
3581
|
-
if (isSelected && !preserve) {
|
|
3582
|
-
await this.page.keyboard.up("Control");
|
|
3583
|
-
}
|
|
3584
3598
|
if (preserve && !isSelected) {
|
|
3585
|
-
await
|
|
3586
|
-
await clickedElement.click();
|
|
3599
|
+
await clickedElement.click({ modifiers: ["ControlOrMeta"] });
|
|
3587
3600
|
return;
|
|
3588
3601
|
}
|
|
3589
3602
|
await clickedElement.click();
|
|
@@ -4657,8 +4670,33 @@ var isArrayOfDates = function(array) {
|
|
|
4657
4670
|
};
|
|
4658
4671
|
var isUndefined = (val) => val === void 0;
|
|
4659
4672
|
|
|
4673
|
+
// src/pageObjects/elements/EditorButton.ts
|
|
4674
|
+
var EditorButton = class extends AbstractElementWithParent {
|
|
4675
|
+
name;
|
|
4676
|
+
constructor(parentCssSelector, name, page) {
|
|
4677
|
+
super(parentCssSelector, byTestIdCssSelector(createEditorButtonTestId(name)), page);
|
|
4678
|
+
this.name = name;
|
|
4679
|
+
}
|
|
4680
|
+
buttonNotDisplayedError() {
|
|
4681
|
+
return `Editor Button ${this.name} cannot be clicked. It is not displayed or it is disabled`;
|
|
4682
|
+
}
|
|
4683
|
+
async click() {
|
|
4684
|
+
const button = this.getLocator();
|
|
4685
|
+
await button.click();
|
|
4686
|
+
}
|
|
4687
|
+
async isVisible() {
|
|
4688
|
+
try {
|
|
4689
|
+
const button = this.getLocator();
|
|
4690
|
+
return await button.isVisible();
|
|
4691
|
+
} catch {
|
|
4692
|
+
return false;
|
|
4693
|
+
}
|
|
4694
|
+
}
|
|
4695
|
+
};
|
|
4696
|
+
|
|
4660
4697
|
// src/pageObjects/elements/Editors/SelectBoxEditor.ts
|
|
4661
4698
|
var SELECT_BOX_OPTION_TEXT_CONTAINER_CLASS = "d5-multi-select-item";
|
|
4699
|
+
var ELLIPSIS_BUTTON_NAME = "d5-ellipsis-button";
|
|
4662
4700
|
var combinedValueXpath = (value) => `//body/div[@id="root"]/div[contains(@class, "dx-overlay-wrapper")]//${XPathHelper.getClassAndValueXpath(SELECT_BOX_OPTION_TEXT_CONTAINER_CLASS, value)}`;
|
|
4663
4701
|
var dropDownOptionClick = async (optionValue, page, delay = true) => {
|
|
4664
4702
|
const locator = page.locator(`xpath=${combinedValueXpath(optionValue)}`);
|
|
@@ -4700,6 +4738,9 @@ var SelectBoxEditor = class extends AbstractDXEditorWithInput {
|
|
|
4700
4738
|
dropDownListItem(text) {
|
|
4701
4739
|
return this.dropdownList.listItem(text);
|
|
4702
4740
|
}
|
|
4741
|
+
async ellipsisButtonClick() {
|
|
4742
|
+
await new EditorButton(this.getFullCssSelector(), ELLIPSIS_BUTTON_NAME, this.page).click();
|
|
4743
|
+
}
|
|
4703
4744
|
async setSelectInputValue(value) {
|
|
4704
4745
|
const inputEl = this.getInputLocator();
|
|
4705
4746
|
await inputEl.click();
|
|
@@ -4788,6 +4829,9 @@ var TagBox = class extends AbstractDXEditorWithInput {
|
|
|
4788
4829
|
dropDownListItem(text) {
|
|
4789
4830
|
return this.dropdownList.listItem(text);
|
|
4790
4831
|
}
|
|
4832
|
+
async ellipsisButtonClick() {
|
|
4833
|
+
await new EditorButton(this.getFullCssSelector(), ELLIPSIS_BUTTON_NAME, this.page).click();
|
|
4834
|
+
}
|
|
4791
4835
|
async setTagBoxInputValue(values) {
|
|
4792
4836
|
for (const value of values) {
|
|
4793
4837
|
const input = this.getInputLocator();
|
|
@@ -5466,30 +5510,6 @@ var editorFactory = async (parentCssSelector, elementCssSelector, page) => {
|
|
|
5466
5510
|
throw new Error("Unknown type of editor. Please write ticket to the support");
|
|
5467
5511
|
};
|
|
5468
5512
|
|
|
5469
|
-
// src/pageObjects/elements/EditorButton.ts
|
|
5470
|
-
var EditorButton = class extends AbstractElementWithParent {
|
|
5471
|
-
name;
|
|
5472
|
-
constructor(parentCssSelector, name, page) {
|
|
5473
|
-
super(parentCssSelector, byTestIdCssSelector(createEditorButtonTestId(name)), page);
|
|
5474
|
-
this.name = name;
|
|
5475
|
-
}
|
|
5476
|
-
buttonNotDisplayedError() {
|
|
5477
|
-
return `Editor Button ${this.name} cannot be clicked. It is not displayed or it is disabled`;
|
|
5478
|
-
}
|
|
5479
|
-
async click() {
|
|
5480
|
-
const button = this.getLocator();
|
|
5481
|
-
await button.click();
|
|
5482
|
-
}
|
|
5483
|
-
async isVisible() {
|
|
5484
|
-
try {
|
|
5485
|
-
const button = this.getLocator();
|
|
5486
|
-
return await button.isVisible();
|
|
5487
|
-
} catch {
|
|
5488
|
-
return false;
|
|
5489
|
-
}
|
|
5490
|
-
}
|
|
5491
|
-
};
|
|
5492
|
-
|
|
5493
5513
|
// src/pageObjects/elements/EditorTitle.ts
|
|
5494
5514
|
var CAPTION_TEXT_CLASS = " .caption-text";
|
|
5495
5515
|
var EditorTitle = class extends AbstractElementWithParent {
|
|
@@ -5656,6 +5676,13 @@ var AbstractEditor = class extends AbstractElementWithParent {
|
|
|
5656
5676
|
parentCssSelector: this.getFullCssSelector()
|
|
5657
5677
|
}).listItem(text);
|
|
5658
5678
|
}
|
|
5679
|
+
async ellipsisButtonClick() {
|
|
5680
|
+
await this.initEditor();
|
|
5681
|
+
if (!this.editor.ellipsisButtonClick) {
|
|
5682
|
+
throw new Error("The ellipsisButtonClick method is not available for this field type.");
|
|
5683
|
+
}
|
|
5684
|
+
return this.editor.ellipsisButtonClick();
|
|
5685
|
+
}
|
|
5659
5686
|
};
|
|
5660
5687
|
|
|
5661
5688
|
// src/pageObjects/elements/FormField.ts
|
|
@@ -5841,6 +5868,31 @@ var Table = class extends AbstractElementWithParent {
|
|
|
5841
5868
|
await this.selectRowByIndex(index, true);
|
|
5842
5869
|
}
|
|
5843
5870
|
}
|
|
5871
|
+
/**
|
|
5872
|
+
* Зняти виділення з рядка по індексу.
|
|
5873
|
+
* @param index починається з 0
|
|
5874
|
+
*/
|
|
5875
|
+
deselectRowByIndex(index) {
|
|
5876
|
+
return this.getRowByIndex(index).deselect();
|
|
5877
|
+
}
|
|
5878
|
+
/**
|
|
5879
|
+
* Зняти виділення з масиву рядків по індексу.
|
|
5880
|
+
* @param indexes починається з 0
|
|
5881
|
+
*/
|
|
5882
|
+
async deselectRowsByIndexes(indexes) {
|
|
5883
|
+
for (const index of indexes) {
|
|
5884
|
+
await this.deselectRowByIndex(index);
|
|
5885
|
+
}
|
|
5886
|
+
}
|
|
5887
|
+
/**
|
|
5888
|
+
* Зняти виділення з усіх виділених рядків.
|
|
5889
|
+
*/
|
|
5890
|
+
async clearSelection() {
|
|
5891
|
+
const selectedRows = await this.getSelectedRows();
|
|
5892
|
+
for (const row of selectedRows) {
|
|
5893
|
+
await row.deselect();
|
|
5894
|
+
}
|
|
5895
|
+
}
|
|
5844
5896
|
getRowElements() {
|
|
5845
5897
|
const rowsSelector = `${this.getFullCssSelector()} ${this.tableContentCssSelector} .dx-row.dx-data-row`;
|
|
5846
5898
|
return this.page.locator(rowsSelector);
|
|
@@ -646,8 +646,90 @@ var init_typesUtil = __esm({
|
|
|
646
646
|
}
|
|
647
647
|
});
|
|
648
648
|
|
|
649
|
+
// src/utils/createDataTestId.ts
|
|
650
|
+
function createDataTestId(formName, itemType, itemName) {
|
|
651
|
+
return `${formName}-${itemType}-${itemName}`;
|
|
652
|
+
}
|
|
653
|
+
function createFieldTestId(formName, itemName) {
|
|
654
|
+
return createDataTestId(formName, "form_field" /* FORM_FIELD */, itemName);
|
|
655
|
+
}
|
|
656
|
+
function createGroupTestId(formName, itemName) {
|
|
657
|
+
return createDataTestId(formName, "group" /* GROUP */, itemName);
|
|
658
|
+
}
|
|
659
|
+
function createFilterTestId(formName, itemName, layout) {
|
|
660
|
+
return createDataTestId(formName, "filter" /* FILTER */, itemName) + `-${layout}`;
|
|
661
|
+
}
|
|
662
|
+
function createDocFilterTestId(formName, itemName) {
|
|
663
|
+
return createFilterTestId(formName, itemName, "dock-panel-filter" /* DOCK_PANEL */);
|
|
664
|
+
}
|
|
665
|
+
function createHeaderFilterTestId(formName, itemName) {
|
|
666
|
+
return createFilterTestId(formName, itemName, "header-filter" /* HEADER_FILTER */);
|
|
667
|
+
}
|
|
668
|
+
function createLayoutFilterTestId(formName, itemName) {
|
|
669
|
+
return createFilterTestId(formName, itemName, "layout-filter" /* LAYOUT */);
|
|
670
|
+
}
|
|
671
|
+
function createTableId(formName) {
|
|
672
|
+
return `${"table" /* TABLE */}-${formName}`;
|
|
673
|
+
}
|
|
674
|
+
function createFormButtonTestId(formName, itemName) {
|
|
675
|
+
return createDataTestId(formName, "button" /* BUTTON */, itemName);
|
|
676
|
+
}
|
|
677
|
+
function createSubSystemTestId(itemName) {
|
|
678
|
+
return `${"subsystem-item" /* SUBSYSTEM_ITEM */}-${itemName}`;
|
|
679
|
+
}
|
|
680
|
+
function createEditorButtonTestId(itemName) {
|
|
681
|
+
return `${"editor-button" /* EDITOR_BUTTON */}-${itemName}`;
|
|
682
|
+
}
|
|
683
|
+
function createLabelFieldTestId(formName, itemName) {
|
|
684
|
+
return `${"label" /* LABEL */}-${createFieldTestId(formName, itemName)}`;
|
|
685
|
+
}
|
|
686
|
+
function createLabelDocFilterTestId(formName, itemName) {
|
|
687
|
+
return `${"label" /* LABEL */}-${createDocFilterTestId(formName, itemName)}`;
|
|
688
|
+
}
|
|
689
|
+
function createLabelLayoutFilterTestId(formName, itemName) {
|
|
690
|
+
return `${"label" /* LABEL */}-${createLayoutFilterTestId(formName, itemName)}`;
|
|
691
|
+
}
|
|
692
|
+
var init_createDataTestId = __esm({
|
|
693
|
+
"src/utils/createDataTestId.ts"() {
|
|
694
|
+
"use strict";
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
// src/pageObjects/elements/EditorButton.ts
|
|
699
|
+
var EditorButton;
|
|
700
|
+
var init_EditorButton = __esm({
|
|
701
|
+
"src/pageObjects/elements/EditorButton.ts"() {
|
|
702
|
+
"use strict";
|
|
703
|
+
init_locators();
|
|
704
|
+
init_createDataTestId();
|
|
705
|
+
init_AbstractElementWithParent();
|
|
706
|
+
EditorButton = class extends AbstractElementWithParent {
|
|
707
|
+
name;
|
|
708
|
+
constructor(parentCssSelector, name, page) {
|
|
709
|
+
super(parentCssSelector, byTestIdCssSelector(createEditorButtonTestId(name)), page);
|
|
710
|
+
this.name = name;
|
|
711
|
+
}
|
|
712
|
+
buttonNotDisplayedError() {
|
|
713
|
+
return `Editor Button ${this.name} cannot be clicked. It is not displayed or it is disabled`;
|
|
714
|
+
}
|
|
715
|
+
async click() {
|
|
716
|
+
const button = this.getLocator();
|
|
717
|
+
await button.click();
|
|
718
|
+
}
|
|
719
|
+
async isVisible() {
|
|
720
|
+
try {
|
|
721
|
+
const button = this.getLocator();
|
|
722
|
+
return await button.isVisible();
|
|
723
|
+
} catch {
|
|
724
|
+
return false;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
|
|
649
731
|
// src/pageObjects/elements/Editors/SelectBoxEditor.ts
|
|
650
|
-
var SELECT_BOX_OPTION_TEXT_CONTAINER_CLASS, combinedValueXpath, dropDownOptionClick, SelectBoxEditor;
|
|
732
|
+
var SELECT_BOX_OPTION_TEXT_CONTAINER_CLASS, ELLIPSIS_BUTTON_NAME, combinedValueXpath, dropDownOptionClick, SelectBoxEditor;
|
|
651
733
|
var init_SelectBoxEditor = __esm({
|
|
652
734
|
"src/pageObjects/elements/Editors/SelectBoxEditor.ts"() {
|
|
653
735
|
"use strict";
|
|
@@ -657,7 +739,9 @@ var init_SelectBoxEditor = __esm({
|
|
|
657
739
|
init_src();
|
|
658
740
|
init_typesUtil();
|
|
659
741
|
init_DropDownList();
|
|
742
|
+
init_EditorButton();
|
|
660
743
|
SELECT_BOX_OPTION_TEXT_CONTAINER_CLASS = "d5-multi-select-item";
|
|
744
|
+
ELLIPSIS_BUTTON_NAME = "d5-ellipsis-button";
|
|
661
745
|
combinedValueXpath = (value) => `//body/div[@id="root"]/div[contains(@class, "dx-overlay-wrapper")]//${XPathHelper.getClassAndValueXpath(SELECT_BOX_OPTION_TEXT_CONTAINER_CLASS, value)}`;
|
|
662
746
|
dropDownOptionClick = async (optionValue, page, delay = true) => {
|
|
663
747
|
const locator = page.locator(`xpath=${combinedValueXpath(optionValue)}`);
|
|
@@ -699,6 +783,9 @@ var init_SelectBoxEditor = __esm({
|
|
|
699
783
|
dropDownListItem(text) {
|
|
700
784
|
return this.dropdownList.listItem(text);
|
|
701
785
|
}
|
|
786
|
+
async ellipsisButtonClick() {
|
|
787
|
+
await new EditorButton(this.getFullCssSelector(), ELLIPSIS_BUTTON_NAME, this.page).click();
|
|
788
|
+
}
|
|
702
789
|
async setSelectInputValue(value) {
|
|
703
790
|
const inputEl = this.getInputLocator();
|
|
704
791
|
await inputEl.click();
|
|
@@ -778,6 +865,7 @@ var init_TagBox = __esm({
|
|
|
778
865
|
init_SelectBoxEditor();
|
|
779
866
|
init_wait();
|
|
780
867
|
init_DropDownList();
|
|
868
|
+
init_EditorButton();
|
|
781
869
|
TAGS_SELECTOR = ".dx-tag .tag-text";
|
|
782
870
|
DX_TAG_CONTAINER = "dx-tag-container";
|
|
783
871
|
DX_TEXTEDITOR_EMPTY2 = "dx-texteditor-empty";
|
|
@@ -807,6 +895,9 @@ var init_TagBox = __esm({
|
|
|
807
895
|
dropDownListItem(text) {
|
|
808
896
|
return this.dropdownList.listItem(text);
|
|
809
897
|
}
|
|
898
|
+
async ellipsisButtonClick() {
|
|
899
|
+
await new EditorButton(this.getFullCssSelector(), ELLIPSIS_BUTTON_NAME, this.page).click();
|
|
900
|
+
}
|
|
810
901
|
async setTagBoxInputValue(values) {
|
|
811
902
|
for (const value of values) {
|
|
812
903
|
const input = this.getInputLocator();
|
|
@@ -1640,55 +1731,6 @@ var init_SubsystemItem = __esm({
|
|
|
1640
1731
|
}
|
|
1641
1732
|
});
|
|
1642
1733
|
|
|
1643
|
-
// src/utils/createDataTestId.ts
|
|
1644
|
-
function createDataTestId(formName, itemType, itemName) {
|
|
1645
|
-
return `${formName}-${itemType}-${itemName}`;
|
|
1646
|
-
}
|
|
1647
|
-
function createFieldTestId(formName, itemName) {
|
|
1648
|
-
return createDataTestId(formName, "form_field" /* FORM_FIELD */, itemName);
|
|
1649
|
-
}
|
|
1650
|
-
function createGroupTestId(formName, itemName) {
|
|
1651
|
-
return createDataTestId(formName, "group" /* GROUP */, itemName);
|
|
1652
|
-
}
|
|
1653
|
-
function createFilterTestId(formName, itemName, layout) {
|
|
1654
|
-
return createDataTestId(formName, "filter" /* FILTER */, itemName) + `-${layout}`;
|
|
1655
|
-
}
|
|
1656
|
-
function createDocFilterTestId(formName, itemName) {
|
|
1657
|
-
return createFilterTestId(formName, itemName, "dock-panel-filter" /* DOCK_PANEL */);
|
|
1658
|
-
}
|
|
1659
|
-
function createHeaderFilterTestId(formName, itemName) {
|
|
1660
|
-
return createFilterTestId(formName, itemName, "header-filter" /* HEADER_FILTER */);
|
|
1661
|
-
}
|
|
1662
|
-
function createLayoutFilterTestId(formName, itemName) {
|
|
1663
|
-
return createFilterTestId(formName, itemName, "layout-filter" /* LAYOUT */);
|
|
1664
|
-
}
|
|
1665
|
-
function createTableId(formName) {
|
|
1666
|
-
return `${"table" /* TABLE */}-${formName}`;
|
|
1667
|
-
}
|
|
1668
|
-
function createFormButtonTestId(formName, itemName) {
|
|
1669
|
-
return createDataTestId(formName, "button" /* BUTTON */, itemName);
|
|
1670
|
-
}
|
|
1671
|
-
function createSubSystemTestId(itemName) {
|
|
1672
|
-
return `${"subsystem-item" /* SUBSYSTEM_ITEM */}-${itemName}`;
|
|
1673
|
-
}
|
|
1674
|
-
function createEditorButtonTestId(itemName) {
|
|
1675
|
-
return `${"editor-button" /* EDITOR_BUTTON */}-${itemName}`;
|
|
1676
|
-
}
|
|
1677
|
-
function createLabelFieldTestId(formName, itemName) {
|
|
1678
|
-
return `${"label" /* LABEL */}-${createFieldTestId(formName, itemName)}`;
|
|
1679
|
-
}
|
|
1680
|
-
function createLabelDocFilterTestId(formName, itemName) {
|
|
1681
|
-
return `${"label" /* LABEL */}-${createDocFilterTestId(formName, itemName)}`;
|
|
1682
|
-
}
|
|
1683
|
-
function createLabelLayoutFilterTestId(formName, itemName) {
|
|
1684
|
-
return `${"label" /* LABEL */}-${createLayoutFilterTestId(formName, itemName)}`;
|
|
1685
|
-
}
|
|
1686
|
-
var init_createDataTestId = __esm({
|
|
1687
|
-
"src/utils/createDataTestId.ts"() {
|
|
1688
|
-
"use strict";
|
|
1689
|
-
}
|
|
1690
|
-
});
|
|
1691
|
-
|
|
1692
1734
|
// src/pageObjects/elements/SubsystemsPanel/SubsystemsPanel.ts
|
|
1693
1735
|
var SEARCH_ITEM_SELECTOR, BACK_BUTTON_SELECTOR, SEARCH_INPUT_SELECTOR, byTitleCssSelector, SubsystemsPanel;
|
|
1694
1736
|
var init_SubsystemsPanel = __esm({
|
|
@@ -2364,17 +2406,30 @@ var init_Row = __esm({
|
|
|
2364
2406
|
getCellByTitle(title) {
|
|
2365
2407
|
return this._getCell({ title });
|
|
2366
2408
|
}
|
|
2409
|
+
async deselect() {
|
|
2410
|
+
const row = this.getLocator();
|
|
2411
|
+
const classes = await this.getClasses();
|
|
2412
|
+
if (!classes.includes(DX_SELECTION_CLASS)) {
|
|
2413
|
+
return;
|
|
2414
|
+
}
|
|
2415
|
+
const cell = row.locator(FIRST_CLICKED_CELL_SELECTOR);
|
|
2416
|
+
await cell.click({ modifiers: ["ControlOrMeta"] });
|
|
2417
|
+
await wait(
|
|
2418
|
+
async () => {
|
|
2419
|
+
const classes2 = await this.getClasses();
|
|
2420
|
+
return !classes2.includes(DX_SELECTION_CLASS);
|
|
2421
|
+
},
|
|
2422
|
+
this.page,
|
|
2423
|
+
"Cannot deselect row"
|
|
2424
|
+
);
|
|
2425
|
+
}
|
|
2367
2426
|
async select(preserve = false) {
|
|
2368
2427
|
const rowEl = this.getLocator();
|
|
2369
2428
|
const classes = await this.getClasses();
|
|
2370
2429
|
const isSelected = classes.includes(DX_SELECTION_CLASS);
|
|
2371
2430
|
const clickedElement = rowEl.locator(FIRST_CLICKED_CELL_SELECTOR);
|
|
2372
|
-
if (isSelected && !preserve) {
|
|
2373
|
-
await this.page.keyboard.up("Control");
|
|
2374
|
-
}
|
|
2375
2431
|
if (preserve && !isSelected) {
|
|
2376
|
-
await
|
|
2377
|
-
await clickedElement.click();
|
|
2432
|
+
await clickedElement.click({ modifiers: ["ControlOrMeta"] });
|
|
2378
2433
|
return;
|
|
2379
2434
|
}
|
|
2380
2435
|
await clickedElement.click();
|
|
@@ -2495,39 +2550,6 @@ var init_Column = __esm({
|
|
|
2495
2550
|
}
|
|
2496
2551
|
});
|
|
2497
2552
|
|
|
2498
|
-
// src/pageObjects/elements/EditorButton.ts
|
|
2499
|
-
var EditorButton;
|
|
2500
|
-
var init_EditorButton = __esm({
|
|
2501
|
-
"src/pageObjects/elements/EditorButton.ts"() {
|
|
2502
|
-
"use strict";
|
|
2503
|
-
init_locators();
|
|
2504
|
-
init_createDataTestId();
|
|
2505
|
-
init_AbstractElementWithParent();
|
|
2506
|
-
EditorButton = class extends AbstractElementWithParent {
|
|
2507
|
-
name;
|
|
2508
|
-
constructor(parentCssSelector, name, page) {
|
|
2509
|
-
super(parentCssSelector, byTestIdCssSelector(createEditorButtonTestId(name)), page);
|
|
2510
|
-
this.name = name;
|
|
2511
|
-
}
|
|
2512
|
-
buttonNotDisplayedError() {
|
|
2513
|
-
return `Editor Button ${this.name} cannot be clicked. It is not displayed or it is disabled`;
|
|
2514
|
-
}
|
|
2515
|
-
async click() {
|
|
2516
|
-
const button = this.getLocator();
|
|
2517
|
-
await button.click();
|
|
2518
|
-
}
|
|
2519
|
-
async isVisible() {
|
|
2520
|
-
try {
|
|
2521
|
-
const button = this.getLocator();
|
|
2522
|
-
return await button.isVisible();
|
|
2523
|
-
} catch {
|
|
2524
|
-
return false;
|
|
2525
|
-
}
|
|
2526
|
-
}
|
|
2527
|
-
};
|
|
2528
|
-
}
|
|
2529
|
-
});
|
|
2530
|
-
|
|
2531
2553
|
// src/pageObjects/elements/EditorTitle.ts
|
|
2532
2554
|
var CAPTION_TEXT_CLASS, EditorTitle;
|
|
2533
2555
|
var init_EditorTitle = __esm({
|
|
@@ -2709,6 +2731,13 @@ var init_AbstractEditor2 = __esm({
|
|
|
2709
2731
|
parentCssSelector: this.getFullCssSelector()
|
|
2710
2732
|
}).listItem(text);
|
|
2711
2733
|
}
|
|
2734
|
+
async ellipsisButtonClick() {
|
|
2735
|
+
await this.initEditor();
|
|
2736
|
+
if (!this.editor.ellipsisButtonClick) {
|
|
2737
|
+
throw new Error("The ellipsisButtonClick method is not available for this field type.");
|
|
2738
|
+
}
|
|
2739
|
+
return this.editor.ellipsisButtonClick();
|
|
2740
|
+
}
|
|
2712
2741
|
};
|
|
2713
2742
|
}
|
|
2714
2743
|
});
|
|
@@ -2940,6 +2969,31 @@ var init_Table = __esm({
|
|
|
2940
2969
|
await this.selectRowByIndex(index, true);
|
|
2941
2970
|
}
|
|
2942
2971
|
}
|
|
2972
|
+
/**
|
|
2973
|
+
* Зняти виділення з рядка по індексу.
|
|
2974
|
+
* @param index починається з 0
|
|
2975
|
+
*/
|
|
2976
|
+
deselectRowByIndex(index) {
|
|
2977
|
+
return this.getRowByIndex(index).deselect();
|
|
2978
|
+
}
|
|
2979
|
+
/**
|
|
2980
|
+
* Зняти виділення з масиву рядків по індексу.
|
|
2981
|
+
* @param indexes починається з 0
|
|
2982
|
+
*/
|
|
2983
|
+
async deselectRowsByIndexes(indexes) {
|
|
2984
|
+
for (const index of indexes) {
|
|
2985
|
+
await this.deselectRowByIndex(index);
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
/**
|
|
2989
|
+
* Зняти виділення з усіх виділених рядків.
|
|
2990
|
+
*/
|
|
2991
|
+
async clearSelection() {
|
|
2992
|
+
const selectedRows = await this.getSelectedRows();
|
|
2993
|
+
for (const row of selectedRows) {
|
|
2994
|
+
await row.deselect();
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2943
2997
|
getRowElements() {
|
|
2944
2998
|
const rowsSelector = `${this.getFullCssSelector()} ${this.tableContentCssSelector} .dx-row.dx-data-row`;
|
|
2945
2999
|
return this.page.locator(rowsSelector);
|
|
@@ -102,6 +102,7 @@ interface Editor {
|
|
|
102
102
|
dropDownClose?(): Promise<void>;
|
|
103
103
|
dropDownList?(): Promise<ListItem[]>;
|
|
104
104
|
dropDownListItem?(text: string): ListItem;
|
|
105
|
+
ellipsisButtonClick?(): Promise<void>;
|
|
105
106
|
isReadonly?(): Promise<boolean>;
|
|
106
107
|
isDisabled?(): Promise<boolean>;
|
|
107
108
|
download?(): Promise<string>;
|
|
@@ -478,6 +479,7 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
478
479
|
dropDownClose(): Promise<void>;
|
|
479
480
|
dropDownList(): Promise<ListItem[]>;
|
|
480
481
|
dropDownListItem(text: string): ListItem;
|
|
482
|
+
ellipsisButtonClick(): Promise<void>;
|
|
481
483
|
}
|
|
482
484
|
|
|
483
485
|
declare class FormField extends AbstractEditor {
|
|
@@ -633,6 +635,7 @@ declare class Row extends AbstractElementWithParent {
|
|
|
633
635
|
getCellByIndex(index: number): Cell;
|
|
634
636
|
getCell(name: string): Cell;
|
|
635
637
|
getCellByTitle(title: string): Cell;
|
|
638
|
+
deselect(): Promise<void>;
|
|
636
639
|
select(preserve?: boolean): Promise<void>;
|
|
637
640
|
isSelected(): Promise<boolean>;
|
|
638
641
|
getIndex(): number;
|
|
@@ -704,6 +707,20 @@ declare class Table extends AbstractElementWithParent {
|
|
|
704
707
|
* @param indexes починається з 0
|
|
705
708
|
*/
|
|
706
709
|
selectRowsByIndexes(indexes: number[]): Promise<void>;
|
|
710
|
+
/**
|
|
711
|
+
* Зняти виділення з рядка по індексу.
|
|
712
|
+
* @param index починається з 0
|
|
713
|
+
*/
|
|
714
|
+
deselectRowByIndex(index: number): Promise<void>;
|
|
715
|
+
/**
|
|
716
|
+
* Зняти виділення з масиву рядків по індексу.
|
|
717
|
+
* @param indexes починається з 0
|
|
718
|
+
*/
|
|
719
|
+
deselectRowsByIndexes(indexes: number[]): Promise<void>;
|
|
720
|
+
/**
|
|
721
|
+
* Зняти виділення з усіх виділених рядків.
|
|
722
|
+
*/
|
|
723
|
+
clearSelection(): Promise<void>;
|
|
707
724
|
protected getRowElements(): Locator;
|
|
708
725
|
getRows(): Promise<Row[]>;
|
|
709
726
|
getColumns(): Promise<Column[]>;
|
|
@@ -102,6 +102,7 @@ interface Editor {
|
|
|
102
102
|
dropDownClose?(): Promise<void>;
|
|
103
103
|
dropDownList?(): Promise<ListItem[]>;
|
|
104
104
|
dropDownListItem?(text: string): ListItem;
|
|
105
|
+
ellipsisButtonClick?(): Promise<void>;
|
|
105
106
|
isReadonly?(): Promise<boolean>;
|
|
106
107
|
isDisabled?(): Promise<boolean>;
|
|
107
108
|
download?(): Promise<string>;
|
|
@@ -478,6 +479,7 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
478
479
|
dropDownClose(): Promise<void>;
|
|
479
480
|
dropDownList(): Promise<ListItem[]>;
|
|
480
481
|
dropDownListItem(text: string): ListItem;
|
|
482
|
+
ellipsisButtonClick(): Promise<void>;
|
|
481
483
|
}
|
|
482
484
|
|
|
483
485
|
declare class FormField extends AbstractEditor {
|
|
@@ -633,6 +635,7 @@ declare class Row extends AbstractElementWithParent {
|
|
|
633
635
|
getCellByIndex(index: number): Cell;
|
|
634
636
|
getCell(name: string): Cell;
|
|
635
637
|
getCellByTitle(title: string): Cell;
|
|
638
|
+
deselect(): Promise<void>;
|
|
636
639
|
select(preserve?: boolean): Promise<void>;
|
|
637
640
|
isSelected(): Promise<boolean>;
|
|
638
641
|
getIndex(): number;
|
|
@@ -704,6 +707,20 @@ declare class Table extends AbstractElementWithParent {
|
|
|
704
707
|
* @param indexes починається з 0
|
|
705
708
|
*/
|
|
706
709
|
selectRowsByIndexes(indexes: number[]): Promise<void>;
|
|
710
|
+
/**
|
|
711
|
+
* Зняти виділення з рядка по індексу.
|
|
712
|
+
* @param index починається з 0
|
|
713
|
+
*/
|
|
714
|
+
deselectRowByIndex(index: number): Promise<void>;
|
|
715
|
+
/**
|
|
716
|
+
* Зняти виділення з масиву рядків по індексу.
|
|
717
|
+
* @param indexes починається з 0
|
|
718
|
+
*/
|
|
719
|
+
deselectRowsByIndexes(indexes: number[]): Promise<void>;
|
|
720
|
+
/**
|
|
721
|
+
* Зняти виділення з усіх виділених рядків.
|
|
722
|
+
*/
|
|
723
|
+
clearSelection(): Promise<void>;
|
|
707
724
|
protected getRowElements(): Locator;
|
|
708
725
|
getRows(): Promise<Row[]>;
|
|
709
726
|
getColumns(): Promise<Column[]>;
|