d5-testing-library 2.0.0-alpha.5 → 2.0.0-alpha.7
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-252GXW3Z.mjs → FormEdit-3SOUFQYD.mjs} +1 -1
- package/dist/{ListForm-SD2263JC.mjs → ListForm-5PVPUASR.mjs} +1 -1
- package/dist/{TreeView-2EXBXJQK.mjs → TreeView-Q2LHHV2B.mjs} +1 -1
- package/dist/{chunk-WFIWSDDW.mjs → chunk-WQR3N5X2.mjs} +81 -19
- package/dist/cjs/d5-testing-library.cjs +87 -16
- package/dist/cjs/d5-testing-library.d.ts +23 -9
- package/dist/d5-testing-library.d.mts +23 -9
- package/dist/d5-testing-library.legacy-esm.js +1 -1
- package/dist/d5-testing-library.mjs +1 -1
- package/package.json +1 -1
|
@@ -2859,11 +2859,14 @@ var AbstractElement = class {
|
|
|
2859
2859
|
joinRelativeCssSelectors(selectors) {
|
|
2860
2860
|
return selectors.join(" ");
|
|
2861
2861
|
}
|
|
2862
|
-
|
|
2862
|
+
syncLocator() {
|
|
2863
2863
|
return this.page.locator(`css=${this.getFullCssSelector()}`);
|
|
2864
2864
|
}
|
|
2865
|
+
getLocator() {
|
|
2866
|
+
return this.syncLocator();
|
|
2867
|
+
}
|
|
2865
2868
|
async getAttribute(attr) {
|
|
2866
|
-
const locator = this.
|
|
2869
|
+
const locator = this.syncLocator();
|
|
2867
2870
|
if (await locator.isVisible()) {
|
|
2868
2871
|
return locator.getAttribute(attr);
|
|
2869
2872
|
}
|
|
@@ -2941,6 +2944,15 @@ function createSubSystemTestId(itemName) {
|
|
|
2941
2944
|
function createEditorButtonTestId(itemName) {
|
|
2942
2945
|
return `${"editor-button" /* EDITOR_BUTTON */}-${itemName}`;
|
|
2943
2946
|
}
|
|
2947
|
+
function createLabelFieldTestId(formName, itemName) {
|
|
2948
|
+
return `${"label" /* LABEL */}-${createFieldTestId(formName, itemName)}`;
|
|
2949
|
+
}
|
|
2950
|
+
function createLabelDocFilterTestId(formName, itemName) {
|
|
2951
|
+
return `${"label" /* LABEL */}-${createDocFilterTestId(formName, itemName)}`;
|
|
2952
|
+
}
|
|
2953
|
+
function createLabelLayoutFilterTestId(formName, itemName) {
|
|
2954
|
+
return `${"label" /* LABEL */}-${createLayoutFilterTestId(formName, itemName)}`;
|
|
2955
|
+
}
|
|
2944
2956
|
|
|
2945
2957
|
// src/pageObjects/AbstractElementWithParent.ts
|
|
2946
2958
|
var AbstractElementWithParent = class extends AbstractElement {
|
|
@@ -3308,15 +3320,15 @@ async function classDependencyInjector(formType) {
|
|
|
3308
3320
|
let SubFormFactoryClass;
|
|
3309
3321
|
switch (formType) {
|
|
3310
3322
|
case "1" /* LIST */:
|
|
3311
|
-
SubFormFactoryClass = (await import("./ListForm-
|
|
3323
|
+
SubFormFactoryClass = (await import("./ListForm-5PVPUASR.mjs")).default;
|
|
3312
3324
|
break;
|
|
3313
3325
|
case "3" /* TREE */:
|
|
3314
|
-
SubFormFactoryClass = (await import("./TreeView-
|
|
3326
|
+
SubFormFactoryClass = (await import("./TreeView-Q2LHHV2B.mjs")).default;
|
|
3315
3327
|
break;
|
|
3316
3328
|
case "2" /* EDIT */:
|
|
3317
3329
|
case "99" /* FREE_FORM */:
|
|
3318
3330
|
case "4" /* REPORT */:
|
|
3319
|
-
SubFormFactoryClass = (await import("./FormEdit-
|
|
3331
|
+
SubFormFactoryClass = (await import("./FormEdit-3SOUFQYD.mjs")).default;
|
|
3320
3332
|
break;
|
|
3321
3333
|
default:
|
|
3322
3334
|
throw new Error(`Unsupported form type ${formType}`);
|
|
@@ -3478,14 +3490,14 @@ var Cell = class extends AbstractElementWithParent {
|
|
|
3478
3490
|
}
|
|
3479
3491
|
return getDate(value);
|
|
3480
3492
|
}
|
|
3481
|
-
async
|
|
3493
|
+
async getLocator() {
|
|
3482
3494
|
if (this._index == null) {
|
|
3483
3495
|
this.index = await this.getCellIndex();
|
|
3484
3496
|
}
|
|
3485
|
-
return this.
|
|
3497
|
+
return this.syncLocator();
|
|
3486
3498
|
}
|
|
3487
3499
|
async getValue() {
|
|
3488
|
-
const cellEl = await this.
|
|
3500
|
+
const cellEl = await this.getLocator();
|
|
3489
3501
|
const cellElClass = await cellEl.getAttribute("class") ?? "";
|
|
3490
3502
|
if (cellElClass.includes("boolean-column" /* Boolean */)) return this.getBooleanValue(cellEl);
|
|
3491
3503
|
if (cellElClass.includes("tags-column" /* Tags */)) return this.getTagsValue(cellEl);
|
|
@@ -3643,9 +3655,9 @@ var Column = class extends AbstractElementWithParent {
|
|
|
3643
3655
|
get index() {
|
|
3644
3656
|
return this._index;
|
|
3645
3657
|
}
|
|
3646
|
-
async
|
|
3658
|
+
async getLocator() {
|
|
3647
3659
|
await this.getIndex();
|
|
3648
|
-
return this.
|
|
3660
|
+
return this.syncLocator();
|
|
3649
3661
|
}
|
|
3650
3662
|
async getColumnHeaderIndexBy(cssSelector) {
|
|
3651
3663
|
const column = this.page.locator(`${this.parentCssSelector} ${this.headerCssSelector} ${cssSelector}`);
|
|
@@ -3658,7 +3670,7 @@ var Column = class extends AbstractElementWithParent {
|
|
|
3658
3670
|
return this.getColumnHeaderIndexBy(getColumnByNameCssSelector(this._name));
|
|
3659
3671
|
}
|
|
3660
3672
|
async caption() {
|
|
3661
|
-
const el = await this.
|
|
3673
|
+
const el = await this.getLocator();
|
|
3662
3674
|
const text = await el.innerText();
|
|
3663
3675
|
return text?.trim() ?? null;
|
|
3664
3676
|
}
|
|
@@ -4157,7 +4169,12 @@ var FormFilterField = class extends AbstractEditor {
|
|
|
4157
4169
|
formName;
|
|
4158
4170
|
name;
|
|
4159
4171
|
constructor(parentCssSelector, formName, name, page) {
|
|
4160
|
-
super(
|
|
4172
|
+
super({
|
|
4173
|
+
parentCssSelector,
|
|
4174
|
+
elementCssSelector: byTestIdCssSelector(createLayoutFilterTestId(formName, name)),
|
|
4175
|
+
titleCssSelector: byTestIdCssSelector(createLabelLayoutFilterTestId(formName, name)),
|
|
4176
|
+
page
|
|
4177
|
+
});
|
|
4161
4178
|
this.formName = formName;
|
|
4162
4179
|
this.name = name;
|
|
4163
4180
|
}
|
|
@@ -4261,7 +4278,12 @@ var PanelFilterField = class extends AbstractEditor {
|
|
|
4261
4278
|
formName;
|
|
4262
4279
|
name;
|
|
4263
4280
|
constructor(parentCssSelector, formName, name, page) {
|
|
4264
|
-
super(
|
|
4281
|
+
super({
|
|
4282
|
+
parentCssSelector,
|
|
4283
|
+
elementCssSelector: byTestIdCssSelector(createDocFilterTestId(formName, name)),
|
|
4284
|
+
titleCssSelector: byTestIdCssSelector(createLabelDocFilterTestId(formName, name)),
|
|
4285
|
+
page
|
|
4286
|
+
});
|
|
4265
4287
|
this.formName = formName;
|
|
4266
4288
|
this.name = name;
|
|
4267
4289
|
}
|
|
@@ -5203,11 +5225,25 @@ var EditorButton = class extends AbstractElementWithParent {
|
|
|
5203
5225
|
}
|
|
5204
5226
|
};
|
|
5205
5227
|
|
|
5228
|
+
// src/pageObjects/elements/EditorTitle.ts
|
|
5229
|
+
var CAPTION_TEXT_CLASS = " .caption-text";
|
|
5230
|
+
var EditorTitle = class extends AbstractElementWithParent {
|
|
5231
|
+
constructor({ parentCssSelector, elementCssSelector, page }) {
|
|
5232
|
+
super(parentCssSelector, elementCssSelector, page);
|
|
5233
|
+
}
|
|
5234
|
+
async getTitle() {
|
|
5235
|
+
const captionElement = this.getLocator().locator(CAPTION_TEXT_CLASS);
|
|
5236
|
+
return captionElement.innerText();
|
|
5237
|
+
}
|
|
5238
|
+
};
|
|
5239
|
+
|
|
5206
5240
|
// src/pageObjects/elements/AbstractEditor.ts
|
|
5207
5241
|
var AbstractEditor = class extends AbstractElementWithParent {
|
|
5208
5242
|
editor;
|
|
5209
|
-
|
|
5243
|
+
_titleCssSelector;
|
|
5244
|
+
constructor({ parentCssSelector, elementCssSelector, titleCssSelector, page }) {
|
|
5210
5245
|
super(parentCssSelector, elementCssSelector, page);
|
|
5246
|
+
this._titleCssSelector = titleCssSelector;
|
|
5211
5247
|
}
|
|
5212
5248
|
async initEditor() {
|
|
5213
5249
|
if (!this.editor) {
|
|
@@ -5303,12 +5339,30 @@ var AbstractEditor = class extends AbstractElementWithParent {
|
|
|
5303
5339
|
button(name) {
|
|
5304
5340
|
return new EditorButton(this.getFullCssSelector(), name, this.page);
|
|
5305
5341
|
}
|
|
5342
|
+
/**
|
|
5343
|
+
* Повертає загловок едітора
|
|
5344
|
+
* @example
|
|
5345
|
+
* expect(await formEdit.field('NumberFld').title()).toBe('Title1');
|
|
5346
|
+
* expect(await formEdit.field('TextFld').title()).toBe('Title2`);
|
|
5347
|
+
*/
|
|
5348
|
+
async title() {
|
|
5349
|
+
return new EditorTitle({
|
|
5350
|
+
elementCssSelector: this._titleCssSelector,
|
|
5351
|
+
parentCssSelector: this.parentCssSelector,
|
|
5352
|
+
page: this.page
|
|
5353
|
+
}).getTitle();
|
|
5354
|
+
}
|
|
5306
5355
|
};
|
|
5307
5356
|
|
|
5308
5357
|
// src/pageObjects/elements/FormField.ts
|
|
5309
5358
|
var FormField = class extends AbstractEditor {
|
|
5310
5359
|
constructor(parentCssSelector, formName, name, page) {
|
|
5311
|
-
super(
|
|
5360
|
+
super({
|
|
5361
|
+
parentCssSelector,
|
|
5362
|
+
elementCssSelector: byTestIdCssSelector(createFieldTestId(formName, name)),
|
|
5363
|
+
titleCssSelector: byTestIdCssSelector(createLabelFieldTestId(formName, name)),
|
|
5364
|
+
page
|
|
5365
|
+
});
|
|
5312
5366
|
}
|
|
5313
5367
|
};
|
|
5314
5368
|
|
|
@@ -5558,7 +5612,7 @@ var Table = class extends AbstractElementWithParent {
|
|
|
5558
5612
|
[row] = await this.getSelectedRows();
|
|
5559
5613
|
}
|
|
5560
5614
|
if (!row) throw new Error("No row available row for context menu");
|
|
5561
|
-
const cellElement = await row.getCell(fieldName).
|
|
5615
|
+
const cellElement = await row.getCell(fieldName).getLocator();
|
|
5562
5616
|
await cellElement.click({ button: "right" });
|
|
5563
5617
|
});
|
|
5564
5618
|
}
|
|
@@ -5846,7 +5900,10 @@ var ToolbarItem = class extends AbstractElementWithParent {
|
|
|
5846
5900
|
async click() {
|
|
5847
5901
|
try {
|
|
5848
5902
|
await this.init();
|
|
5849
|
-
await
|
|
5903
|
+
await wait(async () => {
|
|
5904
|
+
const element = this._button.getLocator();
|
|
5905
|
+
return await element.isEnabled() && await element.isVisible();
|
|
5906
|
+
}, this.page);
|
|
5850
5907
|
await this._button.click();
|
|
5851
5908
|
} catch (error) {
|
|
5852
5909
|
throw new Error(`Cannot click on toolbar item: ${this._itemName}`);
|
|
@@ -5906,7 +5963,12 @@ var FormToolbar = class extends AbstractElementWithParent {
|
|
|
5906
5963
|
// src/pageObjects/elements/Filters/HeaderFilterField.ts
|
|
5907
5964
|
var HeaderFilterField = class extends AbstractEditor {
|
|
5908
5965
|
constructor(parentCssSelector, formName, name, page) {
|
|
5909
|
-
super(
|
|
5966
|
+
super({
|
|
5967
|
+
parentCssSelector,
|
|
5968
|
+
elementCssSelector: byTestIdCssSelector(createHeaderFilterTestId(formName, name)),
|
|
5969
|
+
titleCssSelector: "",
|
|
5970
|
+
page
|
|
5971
|
+
});
|
|
5910
5972
|
}
|
|
5911
5973
|
async getValue() {
|
|
5912
5974
|
return super.getValue();
|
|
@@ -5958,7 +6020,7 @@ var ColumnFilter = class {
|
|
|
5958
6020
|
await this.getCancelButton().click();
|
|
5959
6021
|
}
|
|
5960
6022
|
async initFilter() {
|
|
5961
|
-
const columnEl = await this._column.
|
|
6023
|
+
const columnEl = await this._column.getLocator();
|
|
5962
6024
|
await columnEl.hover();
|
|
5963
6025
|
const headerFilterIcon = columnEl.locator(HEADER_FILTER_ICON);
|
|
5964
6026
|
await headerFilterIcon.waitFor({ state: "visible" });
|
|
@@ -76,11 +76,14 @@ var init_AbstractElement = __esm({
|
|
|
76
76
|
joinRelativeCssSelectors(selectors) {
|
|
77
77
|
return selectors.join(" ");
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
syncLocator() {
|
|
80
80
|
return this.page.locator(`css=${this.getFullCssSelector()}`);
|
|
81
81
|
}
|
|
82
|
+
getLocator() {
|
|
83
|
+
return this.syncLocator();
|
|
84
|
+
}
|
|
82
85
|
async getAttribute(attr) {
|
|
83
|
-
const locator = this.
|
|
86
|
+
const locator = this.syncLocator();
|
|
84
87
|
if (await locator.isVisible()) {
|
|
85
88
|
return locator.getAttribute(attr);
|
|
86
89
|
}
|
|
@@ -1380,6 +1383,15 @@ function createSubSystemTestId(itemName) {
|
|
|
1380
1383
|
function createEditorButtonTestId(itemName) {
|
|
1381
1384
|
return `${"editor-button" /* EDITOR_BUTTON */}-${itemName}`;
|
|
1382
1385
|
}
|
|
1386
|
+
function createLabelFieldTestId(formName, itemName) {
|
|
1387
|
+
return `${"label" /* LABEL */}-${createFieldTestId(formName, itemName)}`;
|
|
1388
|
+
}
|
|
1389
|
+
function createLabelDocFilterTestId(formName, itemName) {
|
|
1390
|
+
return `${"label" /* LABEL */}-${createDocFilterTestId(formName, itemName)}`;
|
|
1391
|
+
}
|
|
1392
|
+
function createLabelLayoutFilterTestId(formName, itemName) {
|
|
1393
|
+
return `${"label" /* LABEL */}-${createLayoutFilterTestId(formName, itemName)}`;
|
|
1394
|
+
}
|
|
1383
1395
|
var init_createDataTestId = __esm({
|
|
1384
1396
|
"src/utils/createDataTestId.ts"() {
|
|
1385
1397
|
"use strict";
|
|
@@ -1991,14 +2003,14 @@ var init_Cell = __esm({
|
|
|
1991
2003
|
}
|
|
1992
2004
|
return getDate(value);
|
|
1993
2005
|
}
|
|
1994
|
-
async
|
|
2006
|
+
async getLocator() {
|
|
1995
2007
|
if (this._index == null) {
|
|
1996
2008
|
this.index = await this.getCellIndex();
|
|
1997
2009
|
}
|
|
1998
|
-
return this.
|
|
2010
|
+
return this.syncLocator();
|
|
1999
2011
|
}
|
|
2000
2012
|
async getValue() {
|
|
2001
|
-
const cellEl = await this.
|
|
2013
|
+
const cellEl = await this.getLocator();
|
|
2002
2014
|
const cellElClass = await cellEl.getAttribute("class") ?? "";
|
|
2003
2015
|
if (cellElClass.includes("boolean-column" /* Boolean */)) return this.getBooleanValue(cellEl);
|
|
2004
2016
|
if (cellElClass.includes("tags-column" /* Tags */)) return this.getTagsValue(cellEl);
|
|
@@ -2157,9 +2169,9 @@ var init_Column = __esm({
|
|
|
2157
2169
|
get index() {
|
|
2158
2170
|
return this._index;
|
|
2159
2171
|
}
|
|
2160
|
-
async
|
|
2172
|
+
async getLocator() {
|
|
2161
2173
|
await this.getIndex();
|
|
2162
|
-
return this.
|
|
2174
|
+
return this.syncLocator();
|
|
2163
2175
|
}
|
|
2164
2176
|
async getColumnHeaderIndexBy(cssSelector) {
|
|
2165
2177
|
const column = this.page.locator(`${this.parentCssSelector} ${this.headerCssSelector} ${cssSelector}`);
|
|
@@ -2172,7 +2184,7 @@ var init_Column = __esm({
|
|
|
2172
2184
|
return this.getColumnHeaderIndexBy(getColumnByNameCssSelector(this._name));
|
|
2173
2185
|
}
|
|
2174
2186
|
async caption() {
|
|
2175
|
-
const el = await this.
|
|
2187
|
+
const el = await this.getLocator();
|
|
2176
2188
|
const text = await el.innerText();
|
|
2177
2189
|
return text?.trim() ?? null;
|
|
2178
2190
|
}
|
|
@@ -2225,6 +2237,25 @@ var init_EditorButton = __esm({
|
|
|
2225
2237
|
}
|
|
2226
2238
|
});
|
|
2227
2239
|
|
|
2240
|
+
// src/pageObjects/elements/EditorTitle.ts
|
|
2241
|
+
var CAPTION_TEXT_CLASS, EditorTitle;
|
|
2242
|
+
var init_EditorTitle = __esm({
|
|
2243
|
+
"src/pageObjects/elements/EditorTitle.ts"() {
|
|
2244
|
+
"use strict";
|
|
2245
|
+
init_AbstractElementWithParent();
|
|
2246
|
+
CAPTION_TEXT_CLASS = " .caption-text";
|
|
2247
|
+
EditorTitle = class extends AbstractElementWithParent {
|
|
2248
|
+
constructor({ parentCssSelector, elementCssSelector, page }) {
|
|
2249
|
+
super(parentCssSelector, elementCssSelector, page);
|
|
2250
|
+
}
|
|
2251
|
+
async getTitle() {
|
|
2252
|
+
const captionElement = this.getLocator().locator(CAPTION_TEXT_CLASS);
|
|
2253
|
+
return captionElement.innerText();
|
|
2254
|
+
}
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
});
|
|
2258
|
+
|
|
2228
2259
|
// src/pageObjects/elements/AbstractEditor.ts
|
|
2229
2260
|
var AbstractEditor;
|
|
2230
2261
|
var init_AbstractEditor2 = __esm({
|
|
@@ -2233,10 +2264,13 @@ var init_AbstractEditor2 = __esm({
|
|
|
2233
2264
|
init_AbstractElementWithParent();
|
|
2234
2265
|
init_Editors();
|
|
2235
2266
|
init_EditorButton();
|
|
2267
|
+
init_EditorTitle();
|
|
2236
2268
|
AbstractEditor = class extends AbstractElementWithParent {
|
|
2237
2269
|
editor;
|
|
2238
|
-
|
|
2270
|
+
_titleCssSelector;
|
|
2271
|
+
constructor({ parentCssSelector, elementCssSelector, titleCssSelector, page }) {
|
|
2239
2272
|
super(parentCssSelector, elementCssSelector, page);
|
|
2273
|
+
this._titleCssSelector = titleCssSelector;
|
|
2240
2274
|
}
|
|
2241
2275
|
async initEditor() {
|
|
2242
2276
|
if (!this.editor) {
|
|
@@ -2332,6 +2366,19 @@ var init_AbstractEditor2 = __esm({
|
|
|
2332
2366
|
button(name) {
|
|
2333
2367
|
return new EditorButton(this.getFullCssSelector(), name, this.page);
|
|
2334
2368
|
}
|
|
2369
|
+
/**
|
|
2370
|
+
* Повертає загловок едітора
|
|
2371
|
+
* @example
|
|
2372
|
+
* expect(await formEdit.field('NumberFld').title()).toBe('Title1');
|
|
2373
|
+
* expect(await formEdit.field('TextFld').title()).toBe('Title2`);
|
|
2374
|
+
*/
|
|
2375
|
+
async title() {
|
|
2376
|
+
return new EditorTitle({
|
|
2377
|
+
elementCssSelector: this._titleCssSelector,
|
|
2378
|
+
parentCssSelector: this.parentCssSelector,
|
|
2379
|
+
page: this.page
|
|
2380
|
+
}).getTitle();
|
|
2381
|
+
}
|
|
2335
2382
|
};
|
|
2336
2383
|
}
|
|
2337
2384
|
});
|
|
@@ -2346,7 +2393,12 @@ var init_FormField = __esm({
|
|
|
2346
2393
|
init_AbstractEditor2();
|
|
2347
2394
|
FormField = class extends AbstractEditor {
|
|
2348
2395
|
constructor(parentCssSelector, formName, name, page) {
|
|
2349
|
-
super(
|
|
2396
|
+
super({
|
|
2397
|
+
parentCssSelector,
|
|
2398
|
+
elementCssSelector: byTestIdCssSelector(createFieldTestId(formName, name)),
|
|
2399
|
+
titleCssSelector: byTestIdCssSelector(createLabelFieldTestId(formName, name)),
|
|
2400
|
+
page
|
|
2401
|
+
});
|
|
2350
2402
|
}
|
|
2351
2403
|
};
|
|
2352
2404
|
}
|
|
@@ -2633,7 +2685,7 @@ var init_Table = __esm({
|
|
|
2633
2685
|
[row] = await this.getSelectedRows();
|
|
2634
2686
|
}
|
|
2635
2687
|
if (!row) throw new Error("No row available row for context menu");
|
|
2636
|
-
const cellElement = await row.getCell(fieldName).
|
|
2688
|
+
const cellElement = await row.getCell(fieldName).getLocator();
|
|
2637
2689
|
await cellElement.click({ button: "right" });
|
|
2638
2690
|
});
|
|
2639
2691
|
}
|
|
@@ -2951,6 +3003,7 @@ var init_ToolbarItem = __esm({
|
|
|
2951
3003
|
init_locators();
|
|
2952
3004
|
init_ToolbarMenu();
|
|
2953
3005
|
init_waitElementIsVisible();
|
|
3006
|
+
init_wait();
|
|
2954
3007
|
GROUP_BUTTON_CLASS = "toolbar-group-button";
|
|
2955
3008
|
toolbarItemSelector = (form, name) => byTestIdCssSelector(`ftb-${form}-${name}`);
|
|
2956
3009
|
ToolbarItem = class extends AbstractElementWithParent {
|
|
@@ -2974,7 +3027,10 @@ var init_ToolbarItem = __esm({
|
|
|
2974
3027
|
async click() {
|
|
2975
3028
|
try {
|
|
2976
3029
|
await this.init();
|
|
2977
|
-
await
|
|
3030
|
+
await wait(async () => {
|
|
3031
|
+
const element = this._button.getLocator();
|
|
3032
|
+
return await element.isEnabled() && await element.isVisible();
|
|
3033
|
+
}, this.page);
|
|
2978
3034
|
await this._button.click();
|
|
2979
3035
|
} catch (error) {
|
|
2980
3036
|
throw new Error(`Cannot click on toolbar item: ${this._itemName}`);
|
|
@@ -3149,7 +3205,12 @@ var init_FormFilterField = __esm({
|
|
|
3149
3205
|
formName;
|
|
3150
3206
|
name;
|
|
3151
3207
|
constructor(parentCssSelector, formName, name, page) {
|
|
3152
|
-
super(
|
|
3208
|
+
super({
|
|
3209
|
+
parentCssSelector,
|
|
3210
|
+
elementCssSelector: byTestIdCssSelector(createLayoutFilterTestId(formName, name)),
|
|
3211
|
+
titleCssSelector: byTestIdCssSelector(createLabelLayoutFilterTestId(formName, name)),
|
|
3212
|
+
page
|
|
3213
|
+
});
|
|
3153
3214
|
this.formName = formName;
|
|
3154
3215
|
this.name = name;
|
|
3155
3216
|
}
|
|
@@ -3263,7 +3324,12 @@ var init_PanelFilterField = __esm({
|
|
|
3263
3324
|
formName;
|
|
3264
3325
|
name;
|
|
3265
3326
|
constructor(parentCssSelector, formName, name, page) {
|
|
3266
|
-
super(
|
|
3327
|
+
super({
|
|
3328
|
+
parentCssSelector,
|
|
3329
|
+
elementCssSelector: byTestIdCssSelector(createDocFilterTestId(formName, name)),
|
|
3330
|
+
titleCssSelector: byTestIdCssSelector(createLabelDocFilterTestId(formName, name)),
|
|
3331
|
+
page
|
|
3332
|
+
});
|
|
3267
3333
|
this.formName = formName;
|
|
3268
3334
|
this.name = name;
|
|
3269
3335
|
}
|
|
@@ -3431,7 +3497,12 @@ var init_HeaderFilterField = __esm({
|
|
|
3431
3497
|
init_AbstractEditor2();
|
|
3432
3498
|
HeaderFilterField = class extends AbstractEditor {
|
|
3433
3499
|
constructor(parentCssSelector, formName, name, page) {
|
|
3434
|
-
super(
|
|
3500
|
+
super({
|
|
3501
|
+
parentCssSelector,
|
|
3502
|
+
elementCssSelector: byTestIdCssSelector(createHeaderFilterTestId(formName, name)),
|
|
3503
|
+
titleCssSelector: "",
|
|
3504
|
+
page
|
|
3505
|
+
});
|
|
3435
3506
|
}
|
|
3436
3507
|
async getValue() {
|
|
3437
3508
|
return super.getValue();
|
|
@@ -3493,7 +3564,7 @@ var init_ColumnFilter = __esm({
|
|
|
3493
3564
|
await this.getCancelButton().click();
|
|
3494
3565
|
}
|
|
3495
3566
|
async initFilter() {
|
|
3496
|
-
const columnEl = await this._column.
|
|
3567
|
+
const columnEl = await this._column.getLocator();
|
|
3497
3568
|
await columnEl.hover();
|
|
3498
3569
|
const headerFilterIcon = columnEl.locator(HEADER_FILTER_ICON);
|
|
3499
3570
|
await headerFilterIcon.waitFor({ state: "visible" });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
2
|
import * as playwright_core from 'playwright-core';
|
|
3
3
|
|
|
4
4
|
type IConfig = {
|
|
@@ -9,13 +9,14 @@ type IConfig = {
|
|
|
9
9
|
};
|
|
10
10
|
declare function config(cfg?: IConfig): IConfig;
|
|
11
11
|
|
|
12
|
-
declare abstract class AbstractElement {
|
|
12
|
+
declare abstract class AbstractElement<TLocator extends Locator | Promise<Locator> = Locator> {
|
|
13
13
|
page: Page;
|
|
14
14
|
protected elementCssSelector: string;
|
|
15
15
|
protected constructor(page: Page, elementCssSelector?: string);
|
|
16
16
|
protected getFullCssSelector(): string;
|
|
17
17
|
protected joinRelativeCssSelectors(selectors: string[]): string;
|
|
18
|
-
|
|
18
|
+
protected syncLocator(): Locator;
|
|
19
|
+
getLocator(): TLocator;
|
|
19
20
|
getAttribute(attr: string): Promise<string>;
|
|
20
21
|
getClasses(): Promise<string>;
|
|
21
22
|
getDataTestId(): Promise<string>;
|
|
@@ -115,7 +116,7 @@ interface ClearStrategy {
|
|
|
115
116
|
clear(editor: Editor): Promise<void>;
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
declare abstract class AbstractElementWithParent extends AbstractElement {
|
|
119
|
+
declare abstract class AbstractElementWithParent<TLocator extends Locator | Promise<Locator> = Locator> extends AbstractElement<TLocator> {
|
|
119
120
|
protected parentCssSelector: string;
|
|
120
121
|
constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
121
122
|
protected getFullCssSelector(): string;
|
|
@@ -347,7 +348,13 @@ declare class EditorButton extends AbstractElementWithParent {
|
|
|
347
348
|
|
|
348
349
|
declare class AbstractEditor extends AbstractElementWithParent implements Editor {
|
|
349
350
|
protected editor: Editor;
|
|
350
|
-
|
|
351
|
+
protected _titleCssSelector: string;
|
|
352
|
+
constructor({ parentCssSelector, elementCssSelector, titleCssSelector, page }: {
|
|
353
|
+
parentCssSelector: string;
|
|
354
|
+
elementCssSelector: string;
|
|
355
|
+
titleCssSelector: string;
|
|
356
|
+
page: Page;
|
|
357
|
+
});
|
|
351
358
|
protected initEditor(): Promise<void>;
|
|
352
359
|
/**
|
|
353
360
|
* Возвращает значение в поле
|
|
@@ -404,6 +411,13 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
404
411
|
* await form.field('Name').button('editorButton).click()
|
|
405
412
|
*/
|
|
406
413
|
button(name: string): EditorButton;
|
|
414
|
+
/**
|
|
415
|
+
* Повертає загловок едітора
|
|
416
|
+
* @example
|
|
417
|
+
* expect(await formEdit.field('NumberFld').title()).toBe('Title1');
|
|
418
|
+
* expect(await formEdit.field('TextFld').title()).toBe('Title2`);
|
|
419
|
+
*/
|
|
420
|
+
title(): Promise<string>;
|
|
407
421
|
}
|
|
408
422
|
|
|
409
423
|
declare class FormField extends AbstractEditor {
|
|
@@ -500,7 +514,7 @@ declare class ToolbarItem extends AbstractElementWithParent implements Button {
|
|
|
500
514
|
get menu(): ToolbarMenu;
|
|
501
515
|
}
|
|
502
516
|
|
|
503
|
-
declare class Cell extends AbstractElementWithParent {
|
|
517
|
+
declare class Cell extends AbstractElementWithParent<Promise<Locator>> {
|
|
504
518
|
private _index;
|
|
505
519
|
private readonly getCellIndex;
|
|
506
520
|
constructor(parentCssSelector: string, getCellIndex: () => Promise<number>, page: Page, index?: number);
|
|
@@ -509,7 +523,7 @@ declare class Cell extends AbstractElementWithParent {
|
|
|
509
523
|
private getTagsValue;
|
|
510
524
|
private getNumberValue;
|
|
511
525
|
private getDateValue;
|
|
512
|
-
|
|
526
|
+
getLocator(): Promise<Locator>;
|
|
513
527
|
getValue(): Promise<string | number | 1 | 0 | string[] | Date | Date[] | null>;
|
|
514
528
|
getIndex(): number;
|
|
515
529
|
}
|
|
@@ -522,7 +536,7 @@ interface ConstructorParams$1 {
|
|
|
522
536
|
index?: number;
|
|
523
537
|
page: Page;
|
|
524
538
|
}
|
|
525
|
-
declare class Column extends AbstractElementWithParent {
|
|
539
|
+
declare class Column extends AbstractElementWithParent<Promise<Locator>> {
|
|
526
540
|
private _index;
|
|
527
541
|
private _caption;
|
|
528
542
|
private _name;
|
|
@@ -530,7 +544,7 @@ declare class Column extends AbstractElementWithParent {
|
|
|
530
544
|
constructor({ parentCssSelector, headerCssSelector, name, caption, index, page }: ConstructorParams$1);
|
|
531
545
|
private set index(value);
|
|
532
546
|
private get index();
|
|
533
|
-
|
|
547
|
+
getLocator(): Promise<Locator>;
|
|
534
548
|
private getColumnHeaderIndexBy;
|
|
535
549
|
private getIndexByCaption;
|
|
536
550
|
private getIndexByName;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
2
|
import * as playwright_core from 'playwright-core';
|
|
3
3
|
|
|
4
4
|
type IConfig = {
|
|
@@ -9,13 +9,14 @@ type IConfig = {
|
|
|
9
9
|
};
|
|
10
10
|
declare function config(cfg?: IConfig): IConfig;
|
|
11
11
|
|
|
12
|
-
declare abstract class AbstractElement {
|
|
12
|
+
declare abstract class AbstractElement<TLocator extends Locator | Promise<Locator> = Locator> {
|
|
13
13
|
page: Page;
|
|
14
14
|
protected elementCssSelector: string;
|
|
15
15
|
protected constructor(page: Page, elementCssSelector?: string);
|
|
16
16
|
protected getFullCssSelector(): string;
|
|
17
17
|
protected joinRelativeCssSelectors(selectors: string[]): string;
|
|
18
|
-
|
|
18
|
+
protected syncLocator(): Locator;
|
|
19
|
+
getLocator(): TLocator;
|
|
19
20
|
getAttribute(attr: string): Promise<string>;
|
|
20
21
|
getClasses(): Promise<string>;
|
|
21
22
|
getDataTestId(): Promise<string>;
|
|
@@ -115,7 +116,7 @@ interface ClearStrategy {
|
|
|
115
116
|
clear(editor: Editor): Promise<void>;
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
declare abstract class AbstractElementWithParent extends AbstractElement {
|
|
119
|
+
declare abstract class AbstractElementWithParent<TLocator extends Locator | Promise<Locator> = Locator> extends AbstractElement<TLocator> {
|
|
119
120
|
protected parentCssSelector: string;
|
|
120
121
|
constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
121
122
|
protected getFullCssSelector(): string;
|
|
@@ -347,7 +348,13 @@ declare class EditorButton extends AbstractElementWithParent {
|
|
|
347
348
|
|
|
348
349
|
declare class AbstractEditor extends AbstractElementWithParent implements Editor {
|
|
349
350
|
protected editor: Editor;
|
|
350
|
-
|
|
351
|
+
protected _titleCssSelector: string;
|
|
352
|
+
constructor({ parentCssSelector, elementCssSelector, titleCssSelector, page }: {
|
|
353
|
+
parentCssSelector: string;
|
|
354
|
+
elementCssSelector: string;
|
|
355
|
+
titleCssSelector: string;
|
|
356
|
+
page: Page;
|
|
357
|
+
});
|
|
351
358
|
protected initEditor(): Promise<void>;
|
|
352
359
|
/**
|
|
353
360
|
* Возвращает значение в поле
|
|
@@ -404,6 +411,13 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
404
411
|
* await form.field('Name').button('editorButton).click()
|
|
405
412
|
*/
|
|
406
413
|
button(name: string): EditorButton;
|
|
414
|
+
/**
|
|
415
|
+
* Повертає загловок едітора
|
|
416
|
+
* @example
|
|
417
|
+
* expect(await formEdit.field('NumberFld').title()).toBe('Title1');
|
|
418
|
+
* expect(await formEdit.field('TextFld').title()).toBe('Title2`);
|
|
419
|
+
*/
|
|
420
|
+
title(): Promise<string>;
|
|
407
421
|
}
|
|
408
422
|
|
|
409
423
|
declare class FormField extends AbstractEditor {
|
|
@@ -500,7 +514,7 @@ declare class ToolbarItem extends AbstractElementWithParent implements Button {
|
|
|
500
514
|
get menu(): ToolbarMenu;
|
|
501
515
|
}
|
|
502
516
|
|
|
503
|
-
declare class Cell extends AbstractElementWithParent {
|
|
517
|
+
declare class Cell extends AbstractElementWithParent<Promise<Locator>> {
|
|
504
518
|
private _index;
|
|
505
519
|
private readonly getCellIndex;
|
|
506
520
|
constructor(parentCssSelector: string, getCellIndex: () => Promise<number>, page: Page, index?: number);
|
|
@@ -509,7 +523,7 @@ declare class Cell extends AbstractElementWithParent {
|
|
|
509
523
|
private getTagsValue;
|
|
510
524
|
private getNumberValue;
|
|
511
525
|
private getDateValue;
|
|
512
|
-
|
|
526
|
+
getLocator(): Promise<Locator>;
|
|
513
527
|
getValue(): Promise<string | number | 1 | 0 | string[] | Date | Date[] | null>;
|
|
514
528
|
getIndex(): number;
|
|
515
529
|
}
|
|
@@ -522,7 +536,7 @@ interface ConstructorParams$1 {
|
|
|
522
536
|
index?: number;
|
|
523
537
|
page: Page;
|
|
524
538
|
}
|
|
525
|
-
declare class Column extends AbstractElementWithParent {
|
|
539
|
+
declare class Column extends AbstractElementWithParent<Promise<Locator>> {
|
|
526
540
|
private _index;
|
|
527
541
|
private _caption;
|
|
528
542
|
private _name;
|
|
@@ -530,7 +544,7 @@ declare class Column extends AbstractElementWithParent {
|
|
|
530
544
|
constructor({ parentCssSelector, headerCssSelector, name, caption, index, page }: ConstructorParams$1);
|
|
531
545
|
private set index(value);
|
|
532
546
|
private get index();
|
|
533
|
-
|
|
547
|
+
getLocator(): Promise<Locator>;
|
|
534
548
|
private getColumnHeaderIndexBy;
|
|
535
549
|
private getIndexByCaption;
|
|
536
550
|
private getIndexByName;
|