d5-testing-library 1.8.0-alpha.8 → 1.8.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.
- package/dist/FormEdit-QNZOB7PA.mjs +7 -0
- package/dist/ListForm-MXGUBMWS.mjs +7 -0
- package/dist/TreeView-VZBOZCFW.mjs +8 -0
- package/dist/{chunk-K6JEWF3Y.mjs → chunk-32KSAOFJ.mjs} +171 -147
- package/dist/{chunk-S6ZF7DZF.mjs → chunk-75FRHQCI.mjs} +5 -2
- package/dist/{chunk-7TTKFTZM.mjs → chunk-S62QEWWA.mjs} +450 -120
- package/dist/{chunk-43FE34WA.mjs → chunk-XGIXXZD6.mjs} +3 -3
- package/dist/cjs/d5-testing-library.cjs +785 -325
- package/dist/{d5-testing-library.d.ts → d5-testing-library.d.mts} +196 -72
- package/dist/d5-testing-library.legacy-esm.js +83 -28
- package/dist/d5-testing-library.mjs +83 -28
- package/package.json +23 -11
- package/dist/FormEdit-5JMOGDF5.mjs +0 -7
- package/dist/ListForm-RYJQQ7PK.mjs +0 -7
- package/dist/TreeView-YRHW5YVA.mjs +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as selenium_webdriver from 'selenium-webdriver';
|
|
2
|
-
import {
|
|
2
|
+
import { Browser, WebDriver, WebElement, By, Condition } from 'selenium-webdriver';
|
|
3
3
|
|
|
4
4
|
type DriverType = typeof Browser;
|
|
5
5
|
type BrowserList = DriverType[keyof DriverType];
|
|
@@ -11,14 +11,14 @@ type IConfig = {
|
|
|
11
11
|
};
|
|
12
12
|
timeout: number;
|
|
13
13
|
browser: BrowserList;
|
|
14
|
-
|
|
14
|
+
headless?: 'true' | 'false';
|
|
15
15
|
};
|
|
16
16
|
declare function config(cfg?: IConfig): IConfig;
|
|
17
17
|
|
|
18
18
|
declare abstract class AbstractElement {
|
|
19
19
|
driver: WebDriver;
|
|
20
20
|
protected elementCssSelector: string;
|
|
21
|
-
protected constructor(driver
|
|
21
|
+
protected constructor(driver: WebDriver, elementCssSelector?: string);
|
|
22
22
|
protected getFullCssSelector(): string;
|
|
23
23
|
protected joinRelativeCssSelectors(selectors: string[]): string;
|
|
24
24
|
getElement(): Promise<WebElement>;
|
|
@@ -30,7 +30,7 @@ declare abstract class AbstractElement {
|
|
|
30
30
|
declare abstract class AbstractPage extends AbstractElement {
|
|
31
31
|
protected url: string;
|
|
32
32
|
protected host: string;
|
|
33
|
-
constructor(driver
|
|
33
|
+
constructor(driver: WebDriver);
|
|
34
34
|
private prependHash;
|
|
35
35
|
protected goToUrl(url: string): Promise<void>;
|
|
36
36
|
protected get path(): string;
|
|
@@ -39,9 +39,9 @@ declare abstract class AbstractPage extends AbstractElement {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
declare class LoginPage extends AbstractPage {
|
|
42
|
-
usernameField:
|
|
43
|
-
passwordField:
|
|
44
|
-
loginButton:
|
|
42
|
+
usernameField: By;
|
|
43
|
+
passwordField: By;
|
|
44
|
+
loginButton: By;
|
|
45
45
|
locate(): Promise<void>;
|
|
46
46
|
get path(): string;
|
|
47
47
|
enterUsername(username: string): Promise<void>;
|
|
@@ -74,40 +74,45 @@ declare const createDriver: (browser?: BrowserList) => Promise<WebDriver>;
|
|
|
74
74
|
|
|
75
75
|
declare const elementIsNotPresent: (locator: By) => Condition<boolean>;
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
type WithElement$1 = {
|
|
78
78
|
element: WebElement;
|
|
79
|
+
};
|
|
80
|
+
type WithBy$1 = {
|
|
81
|
+
by: By;
|
|
82
|
+
};
|
|
83
|
+
type Args$1 = {
|
|
79
84
|
timeout?: number;
|
|
80
85
|
errorMessage?: string;
|
|
81
|
-
driver
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
driver: WebDriver;
|
|
87
|
+
};
|
|
88
|
+
type ArgsWithElement$1 = Args$1 & WithElement$1;
|
|
89
|
+
type ArgsWithWithBy$1 = Args$1 & WithBy$1;
|
|
90
|
+
declare function waitElementIsVisible(args: ArgsWithElement$1): Promise<void>;
|
|
91
|
+
declare function waitElementIsVisible(args: ArgsWithWithBy$1): Promise<void>;
|
|
92
|
+
|
|
93
|
+
type WithElement = {
|
|
94
|
+
element: WebElement;
|
|
95
|
+
};
|
|
96
|
+
type WithBy = {
|
|
97
|
+
by: By;
|
|
98
|
+
};
|
|
99
|
+
type Args = {
|
|
100
|
+
timeout?: number;
|
|
101
|
+
errorMessage?: string;
|
|
102
|
+
driver: WebDriver;
|
|
103
|
+
};
|
|
104
|
+
type ArgsWithElement = Args & WithElement;
|
|
105
|
+
type ArgsWithWithBy = Args & WithBy;
|
|
106
|
+
declare function waitElementIsClickable(args: ArgsWithElement): Promise<void>;
|
|
107
|
+
declare function waitElementIsClickable(args: ArgsWithWithBy): Promise<void>;
|
|
94
108
|
|
|
95
109
|
interface WaiteParams {
|
|
96
|
-
condition: (driver
|
|
110
|
+
condition: (driver: WebDriver) => Promise<boolean>;
|
|
97
111
|
timeout?: number;
|
|
98
112
|
errorMessage?: string;
|
|
99
|
-
driver
|
|
113
|
+
driver: WebDriver;
|
|
100
114
|
}
|
|
101
|
-
|
|
102
|
-
* Waits until a specified web element is visible within a given timeout.
|
|
103
|
-
*
|
|
104
|
-
* @param condition
|
|
105
|
-
* @param {number} [timeout] - The maximum time to wait for the element to be visible, in milliseconds. If not provided, the default timeout is used.
|
|
106
|
-
* @param {string} [errorMessage] - The error message to display if the wait times out. If not provided, a default error message is used.
|
|
107
|
-
* @param {WebDriver} [driver] - The web driver instance to use. If not provided, the default driver from the configuration is used.
|
|
108
|
-
* @returns {Promise<void>} A promise that resolves when the element becomes visible.
|
|
109
|
-
*/
|
|
110
|
-
declare function wait(condition: WaiteParams['condition'], driver?: WebDriver, errorMessage?: string, timeout?: number): Promise<void>;
|
|
115
|
+
declare function safeWait(condition: WaiteParams['condition'], driver: WebDriver, errorMessage?: string, timeout?: number): Promise<void>;
|
|
111
116
|
|
|
112
117
|
declare function signIn(driver?: WebDriver): Promise<WebDriver>;
|
|
113
118
|
|
|
@@ -118,7 +123,8 @@ declare function signIn(driver?: WebDriver): Promise<WebDriver>;
|
|
|
118
123
|
* @param {WebDriver} [driver] - The web driver instance to use. If not provided, the default driver from the configuration is used.
|
|
119
124
|
* @returns {Promise<void>} A promise that resolves when the click action is complete.
|
|
120
125
|
*/
|
|
121
|
-
declare const click: (webElement: WebElement, driver
|
|
126
|
+
declare const click: (webElement: WebElement, driver: WebDriver) => Promise<void>;
|
|
127
|
+
declare const contextMenu: (webElement: WebElement, driver: WebDriver) => Promise<void>;
|
|
122
128
|
|
|
123
129
|
interface Editor {
|
|
124
130
|
setValue(value: any): Promise<void>;
|
|
@@ -148,7 +154,7 @@ interface ClearStrategy {
|
|
|
148
154
|
|
|
149
155
|
declare abstract class AbstractElementWithParent extends AbstractElement {
|
|
150
156
|
protected parentCssSelector: string;
|
|
151
|
-
constructor(parentCssSelector: string, elementCssSelector: string, driver
|
|
157
|
+
constructor(parentCssSelector: string, elementCssSelector: string, driver: WebDriver);
|
|
152
158
|
protected getFullCssSelector(): string;
|
|
153
159
|
isReadonly(): Promise<boolean>;
|
|
154
160
|
}
|
|
@@ -166,13 +172,13 @@ declare abstract class AbstractDXEditorWithInput extends AbstractElementWithPare
|
|
|
166
172
|
}
|
|
167
173
|
|
|
168
174
|
declare class TextEditor extends AbstractDXEditorWithInput {
|
|
169
|
-
constructor(parentCssSelector: string, elementCssSelector: string, driver
|
|
170
|
-
getValue(): Promise<string>;
|
|
175
|
+
constructor(parentCssSelector: string, elementCssSelector: string, driver: WebDriver);
|
|
176
|
+
getValue(): Promise<string | null>;
|
|
171
177
|
setValue(value: string): Promise<void>;
|
|
172
178
|
}
|
|
173
179
|
|
|
174
180
|
declare class NumberEditor extends AbstractDXEditorWithInput {
|
|
175
|
-
constructor(parentCssSelector: string, elementCssSelector: string, driver
|
|
181
|
+
constructor(parentCssSelector: string, elementCssSelector: string, driver: WebDriver);
|
|
176
182
|
getValue(): Promise<number | null>;
|
|
177
183
|
setValue(value: any): Promise<void>;
|
|
178
184
|
}
|
|
@@ -180,7 +186,7 @@ declare class NumberEditor extends AbstractDXEditorWithInput {
|
|
|
180
186
|
declare const editorFactory: (parentCssSelector: string, elementCssSelector: string, driver: WebDriver) => Promise<Editor>;
|
|
181
187
|
|
|
182
188
|
interface ISubsystemItem {
|
|
183
|
-
driver
|
|
189
|
+
driver: WebDriver;
|
|
184
190
|
bySelector: By;
|
|
185
191
|
}
|
|
186
192
|
declare class SubsystemItem {
|
|
@@ -194,7 +200,7 @@ declare class SubsystemItem {
|
|
|
194
200
|
|
|
195
201
|
declare class SubsystemsPanel extends AbstractElement {
|
|
196
202
|
private header;
|
|
197
|
-
constructor(driver
|
|
203
|
+
constructor(driver: WebDriver);
|
|
198
204
|
headerTitle(): Promise<string>;
|
|
199
205
|
protected getSearchComponent(): TextEditor;
|
|
200
206
|
/**
|
|
@@ -243,13 +249,15 @@ interface Button {
|
|
|
243
249
|
click(): Promise<void>;
|
|
244
250
|
isDisabled(): Promise<boolean>;
|
|
245
251
|
isDisplayed(): Promise<boolean>;
|
|
252
|
+
getTitle(): Promise<string>;
|
|
246
253
|
}
|
|
247
254
|
declare abstract class AbstractButton extends AbstractElementWithParent implements Button {
|
|
248
|
-
protected constructor(parentCssSelector: string, elementCssSelector: string, driver
|
|
255
|
+
protected constructor(parentCssSelector: string, elementCssSelector: string, driver: WebDriver);
|
|
249
256
|
protected abstract buttonNotDisplayedError(): string;
|
|
250
257
|
click(): Promise<void>;
|
|
251
258
|
isDisabled(): Promise<boolean>;
|
|
252
259
|
isDisplayed(): Promise<boolean>;
|
|
260
|
+
abstract getTitle(): Promise<string>;
|
|
253
261
|
}
|
|
254
262
|
|
|
255
263
|
declare abstract class DXButton extends AbstractButton {
|
|
@@ -258,8 +266,9 @@ declare abstract class DXButton extends AbstractButton {
|
|
|
258
266
|
|
|
259
267
|
declare class FormButton extends DXButton {
|
|
260
268
|
private readonly name;
|
|
261
|
-
constructor(parentCssSelector: string, formName: string, name: string, driver
|
|
269
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver: WebDriver);
|
|
262
270
|
protected buttonNotDisplayedError(): string;
|
|
271
|
+
getTitle(): Promise<string>;
|
|
263
272
|
}
|
|
264
273
|
|
|
265
274
|
interface Group<TItem = unknown> {
|
|
@@ -272,7 +281,7 @@ interface Group<TItem = unknown> {
|
|
|
272
281
|
|
|
273
282
|
declare class FormGroup extends AbstractElementWithParent implements Group {
|
|
274
283
|
private groupInstance;
|
|
275
|
-
constructor(parentCssSelector: string, formName: string, name: string, driver
|
|
284
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver: WebDriver);
|
|
276
285
|
private initInstance;
|
|
277
286
|
/**
|
|
278
287
|
* Возвращает булевое значение доступна ли группа
|
|
@@ -329,6 +338,9 @@ declare class AbstractForm extends AbstractPage {
|
|
|
329
338
|
group(name: string): FormGroup;
|
|
330
339
|
}
|
|
331
340
|
|
|
341
|
+
interface SubFormOptions {
|
|
342
|
+
isDockPanel?: boolean;
|
|
343
|
+
}
|
|
332
344
|
declare abstract class Form extends AbstractForm {
|
|
333
345
|
protected popupContainerCssSelector: string;
|
|
334
346
|
protected constructor(driver: WebDriver);
|
|
@@ -350,12 +362,12 @@ declare abstract class Form extends AbstractForm {
|
|
|
350
362
|
* //...
|
|
351
363
|
* expect(await form.subForm(name));
|
|
352
364
|
*/
|
|
353
|
-
subForm(name: string): Promise<unknown>;
|
|
365
|
+
subForm(name: string, options?: SubFormOptions): Promise<unknown>;
|
|
354
366
|
}
|
|
355
367
|
|
|
356
368
|
declare class EditorButton extends AbstractElementWithParent {
|
|
357
369
|
private readonly name;
|
|
358
|
-
constructor(parentCssSelector: string, name: string, driver
|
|
370
|
+
constructor(parentCssSelector: string, name: string, driver: WebDriver);
|
|
359
371
|
protected buttonNotDisplayedError(): string;
|
|
360
372
|
click(): Promise<void>;
|
|
361
373
|
isDisplayed(): Promise<boolean>;
|
|
@@ -363,7 +375,7 @@ declare class EditorButton extends AbstractElementWithParent {
|
|
|
363
375
|
|
|
364
376
|
declare class AbstractEditor extends AbstractElementWithParent implements Editor {
|
|
365
377
|
protected editor: Editor;
|
|
366
|
-
constructor(parentCssSelector: string, elementCssSelector: string, driver
|
|
378
|
+
constructor(parentCssSelector: string, elementCssSelector: string, driver: WebDriver);
|
|
367
379
|
protected initEditor(): Promise<void>;
|
|
368
380
|
/**
|
|
369
381
|
* Возвращает значение в поле
|
|
@@ -398,6 +410,13 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
398
410
|
* expect(await formEdit.field('TextFld').isReadonly()).toBe(false);
|
|
399
411
|
*/
|
|
400
412
|
isReadonly(): Promise<boolean>;
|
|
413
|
+
/**
|
|
414
|
+
* Возвращает значение true|false в зависимости isDisplayed поле или нет
|
|
415
|
+
* @example
|
|
416
|
+
* expect(await formEdit.field('NumberFld').isDisplayed()).toBe(true);
|
|
417
|
+
* expect(await formEdit.field('TextFld').isDisplayed()).toBe(false);
|
|
418
|
+
*/
|
|
419
|
+
isDisplayed(): Promise<boolean>;
|
|
401
420
|
/**
|
|
402
421
|
* Находит кнопку на поле по имени
|
|
403
422
|
* @example
|
|
@@ -409,7 +428,7 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
409
428
|
}
|
|
410
429
|
|
|
411
430
|
declare class FormField extends AbstractEditor {
|
|
412
|
-
constructor(parentCssSelector: string, formName: string, name: string, driver
|
|
431
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver: WebDriver);
|
|
413
432
|
}
|
|
414
433
|
|
|
415
434
|
declare class FormEdit extends Form {
|
|
@@ -451,13 +470,40 @@ declare class FormEdit extends Form {
|
|
|
451
470
|
closeButtonClick(): Promise<void>;
|
|
452
471
|
}
|
|
453
472
|
|
|
454
|
-
declare class
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
private
|
|
459
|
-
private
|
|
460
|
-
|
|
473
|
+
declare abstract class AbstractDropDownMenuList extends AbstractElementWithParent {
|
|
474
|
+
protected abstract getButtonNameBy(name: string): By;
|
|
475
|
+
protected abstract getButtonTitleBy(name: string): By;
|
|
476
|
+
protected buttonNotDisplayedError(name: string): string;
|
|
477
|
+
private clickItemBy;
|
|
478
|
+
private getElementByPath;
|
|
479
|
+
clickButton(name: string | string[]): Promise<void>;
|
|
480
|
+
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
481
|
+
getMenuItemElementByTitle(title: string | string[]): Promise<WebElement>;
|
|
482
|
+
getMenuItemElementByName(name: string | string[]): Promise<WebElement>;
|
|
483
|
+
isVisible(): Promise<boolean>;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
declare abstract class AbstractDropDownMenuButton extends AbstractElementWithParent {
|
|
487
|
+
private readonly _list;
|
|
488
|
+
protected constructor(parentCssSelector: string, elementCssSelector: string, list: AbstractDropDownMenuList, driver: WebDriver);
|
|
489
|
+
protected openDropdownMenu(): Promise<void>;
|
|
490
|
+
clickButton(name: string | string[]): Promise<void>;
|
|
491
|
+
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
492
|
+
getMenuItemElementByTitle(title: string | string[]): Promise<WebElement>;
|
|
493
|
+
getMenuItemElementByName(name: string | string[]): Promise<WebElement>;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
declare class ToolbarMenu extends AbstractDropDownMenuButton {
|
|
497
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver: WebDriver);
|
|
498
|
+
private checkNameValue;
|
|
499
|
+
private checkTitleValue;
|
|
500
|
+
private buttonByName;
|
|
501
|
+
private buttonByTitle;
|
|
502
|
+
buttonIsDisplayed(name: string | string[]): Promise<boolean>;
|
|
503
|
+
buttonByTitleIsDisplayed(title: string | string[]): Promise<boolean>;
|
|
504
|
+
buttonTitle(name: string | string[]): Promise<string>;
|
|
505
|
+
buttonIsDisabled(name: string | string[]): Promise<boolean>;
|
|
506
|
+
buttonByTitleIsDisabled(title: string | string[]): Promise<boolean>;
|
|
461
507
|
clickButton(name: string | string[]): Promise<void>;
|
|
462
508
|
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
463
509
|
}
|
|
@@ -466,40 +512,43 @@ declare class ToolbarItem extends AbstractElementWithParent implements Button {
|
|
|
466
512
|
private _button;
|
|
467
513
|
private readonly _formName;
|
|
468
514
|
private readonly _itemName;
|
|
469
|
-
constructor(parentCssSelector: string, formName: string, itemName: string, driver
|
|
515
|
+
constructor(parentCssSelector: string, formName: string, itemName: string, driver: WebDriver);
|
|
470
516
|
private init;
|
|
471
517
|
click(): Promise<void>;
|
|
472
518
|
isDisabled(): Promise<boolean>;
|
|
473
519
|
isDisplayed(): Promise<boolean>;
|
|
520
|
+
getTitle(): Promise<string>;
|
|
474
521
|
get menu(): ToolbarMenu;
|
|
475
522
|
}
|
|
476
523
|
|
|
477
524
|
declare class Cell extends AbstractElementWithParent {
|
|
478
525
|
private _index;
|
|
479
526
|
private getCellIndex;
|
|
480
|
-
constructor(parentCssSelector: string, getCellIndex: () => Promise<number>,
|
|
527
|
+
constructor(parentCssSelector: string, getCellIndex: () => Promise<number>, driver: WebDriver, index?: number);
|
|
481
528
|
private set index(value);
|
|
482
529
|
private getBooleanValue;
|
|
483
530
|
private getTagsValue;
|
|
531
|
+
private getNumberValue;
|
|
532
|
+
private getDateValue;
|
|
484
533
|
getElement(): Promise<WebElement>;
|
|
485
|
-
getValue(): Promise<string | 1 | 0 | string[]>;
|
|
534
|
+
getValue(): Promise<string | number | 1 | 0 | string[] | Date>;
|
|
486
535
|
getIndex(): number;
|
|
487
536
|
}
|
|
488
537
|
|
|
489
|
-
interface ConstructorParams {
|
|
538
|
+
interface ConstructorParams$1 {
|
|
490
539
|
parentCssSelector: string;
|
|
491
540
|
headerCssSelector?: string;
|
|
492
541
|
name?: string;
|
|
493
542
|
caption?: string;
|
|
494
543
|
index?: number;
|
|
495
|
-
driver
|
|
544
|
+
driver: WebDriver;
|
|
496
545
|
}
|
|
497
546
|
declare class Column extends AbstractElementWithParent {
|
|
498
547
|
private _index;
|
|
499
548
|
private _caption;
|
|
500
549
|
private _name;
|
|
501
550
|
protected headerCssSelector: string | undefined;
|
|
502
|
-
constructor({ parentCssSelector, headerCssSelector, name, caption, index, driver }: ConstructorParams);
|
|
551
|
+
constructor({ parentCssSelector, headerCssSelector, name, caption, index, driver }: ConstructorParams$1);
|
|
503
552
|
private set index(value);
|
|
504
553
|
private get index();
|
|
505
554
|
getElement(): Promise<WebElement>;
|
|
@@ -511,13 +560,20 @@ declare class Column extends AbstractElementWithParent {
|
|
|
511
560
|
}
|
|
512
561
|
|
|
513
562
|
declare class Row extends AbstractElementWithParent {
|
|
514
|
-
index
|
|
563
|
+
private readonly index;
|
|
515
564
|
protected getColumnBy: (_: {
|
|
516
565
|
title?: string;
|
|
517
566
|
name?: string;
|
|
518
567
|
}) => Column;
|
|
519
568
|
protected fixedTableContentCssSelector: string;
|
|
520
|
-
|
|
569
|
+
/**
|
|
570
|
+
* @param parentCssSelector
|
|
571
|
+
* @param fixedTableContentCssSelector
|
|
572
|
+
* @param index починається з 0 (в getCssRowByIndexSelector додається +1)
|
|
573
|
+
* @param driver
|
|
574
|
+
* @param getColumnBy
|
|
575
|
+
*/
|
|
576
|
+
constructor(parentCssSelector: string, fixedTableContentCssSelector: string, index: number, driver: WebDriver, getColumnBy?: (_: {
|
|
521
577
|
title?: string;
|
|
522
578
|
name?: string;
|
|
523
579
|
}) => Column);
|
|
@@ -536,16 +592,59 @@ declare class Row extends AbstractElementWithParent {
|
|
|
536
592
|
cancel(): Promise<void>;
|
|
537
593
|
}
|
|
538
594
|
|
|
595
|
+
declare abstract class DXContextMenuList extends AbstractDropDownMenuList {
|
|
596
|
+
/**
|
|
597
|
+
* @param parentCssSelector
|
|
598
|
+
* @param classNames - Список класів. Починається з крапки
|
|
599
|
+
* @param driver
|
|
600
|
+
*/
|
|
601
|
+
protected constructor(parentCssSelector: string, classNames: string, driver: WebDriver);
|
|
602
|
+
protected getButtonTitleBy(title: string): By;
|
|
603
|
+
isVisible(): Promise<boolean>;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
declare class ContextMenu extends DXContextMenuList {
|
|
607
|
+
private readonly _formName;
|
|
608
|
+
private _initFn;
|
|
609
|
+
constructor(cssClass: string, formName: string, driver: WebDriver);
|
|
610
|
+
setInit(cb: () => Promise<void>): this;
|
|
611
|
+
protected getButtonNameBy(name: string): By;
|
|
612
|
+
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
613
|
+
clickButton(name: string | string[]): Promise<void>;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
interface ConstructorParams {
|
|
617
|
+
parentCssSelector: string;
|
|
618
|
+
headerCssSelector: string;
|
|
619
|
+
fixedTableContentCssSelector: string;
|
|
620
|
+
contextMenuCssSelector: string;
|
|
621
|
+
tableContentCssSelector: string;
|
|
622
|
+
formName: string;
|
|
623
|
+
driver: WebDriver;
|
|
624
|
+
}
|
|
539
625
|
declare class Table extends AbstractElementWithParent {
|
|
540
626
|
protected formName: string;
|
|
541
627
|
protected headerCssSelector: string;
|
|
628
|
+
protected contextMenuCssSelector: string;
|
|
542
629
|
protected fixedTableContentCssSelector: string;
|
|
543
|
-
|
|
630
|
+
protected tableContentCssSelector: string;
|
|
631
|
+
constructor({ parentCssSelector, contextMenuCssSelector, tableContentCssSelector, headerCssSelector, fixedTableContentCssSelector, formName, driver }: ConstructorParams);
|
|
544
632
|
private getColumnBy;
|
|
633
|
+
/**
|
|
634
|
+
* Отримати рядок по індексу.
|
|
635
|
+
* @param index починається з 0
|
|
636
|
+
*/
|
|
545
637
|
getRowByIndex(index: number): Row;
|
|
638
|
+
/**
|
|
639
|
+
* @param index починається з 0
|
|
640
|
+
*/
|
|
546
641
|
getColumnByIndex(index: number): Column;
|
|
547
642
|
getColumnByTitle: (title: string) => Column;
|
|
548
643
|
getColumnByName: (name: string) => Column;
|
|
644
|
+
/**
|
|
645
|
+
* Вибрати рядок по індексу.
|
|
646
|
+
* @param index починається з 0
|
|
647
|
+
*/
|
|
549
648
|
selectRowByIndex(index: number): Promise<void>;
|
|
550
649
|
getRows(): Promise<Row[]>;
|
|
551
650
|
getColumns(): Promise<Column[]>;
|
|
@@ -558,12 +657,34 @@ declare class Table extends AbstractElementWithParent {
|
|
|
558
657
|
* expect(await form.field('Name').getValue()).toBe('test value');
|
|
559
658
|
*/
|
|
560
659
|
field(name: string): FormField;
|
|
660
|
+
/**
|
|
661
|
+
* Возвращает список строк которые выделены
|
|
662
|
+
* @returns Row[]
|
|
663
|
+
* @example
|
|
664
|
+
* const form = new MyForm();
|
|
665
|
+
* //...
|
|
666
|
+
* await form.getSelectedRows();
|
|
667
|
+
*/
|
|
668
|
+
getSelectedRows(): Promise<Row[]>;
|
|
669
|
+
/**
|
|
670
|
+
* Вызывает контекстное меню в области с данными.
|
|
671
|
+
* @param fieldName - имя поля
|
|
672
|
+
* @param [rowIndex] - индекс строки. Если значение не передано, то по умолчанию контекстное меню будет вызвано на первой выделенной строке.
|
|
673
|
+
* @throws {Error} Если нет выделенных строк, то выбросит исключение.
|
|
674
|
+
* @example
|
|
675
|
+
* const form = new MyForm();
|
|
676
|
+
* //...
|
|
677
|
+
* await form.contextMenu('FieldName').clickButton('OpenFormButton');
|
|
678
|
+
* // or
|
|
679
|
+
* await form.contextMenu('FieldName', 3).clickButton(['Group', 'ButtonInGroup']);
|
|
680
|
+
*/
|
|
681
|
+
contextMenu(fieldName: string, rowIndex?: number): ContextMenu;
|
|
561
682
|
}
|
|
562
683
|
|
|
563
684
|
declare class FormFilterField extends AbstractEditor {
|
|
564
685
|
private readonly formName;
|
|
565
686
|
private readonly name;
|
|
566
|
-
constructor(parentCssSelector: string, formName: string, name: string, driver
|
|
687
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver: WebDriver);
|
|
567
688
|
/**
|
|
568
689
|
* Возвращает значение в поле
|
|
569
690
|
* @example
|
|
@@ -624,7 +745,7 @@ declare class FormFilterField extends AbstractEditor {
|
|
|
624
745
|
declare class PanelFilterField extends AbstractEditor {
|
|
625
746
|
private readonly formName;
|
|
626
747
|
private readonly name;
|
|
627
|
-
constructor(parentCssSelector: string, formName: string, name: string, driver
|
|
748
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver: WebDriver);
|
|
628
749
|
/**
|
|
629
750
|
* Возвращает значение в поле
|
|
630
751
|
* @example
|
|
@@ -686,7 +807,7 @@ declare class FilterPanel extends AbstractElement {
|
|
|
686
807
|
private readonly _formName;
|
|
687
808
|
private get filterPanelSelector();
|
|
688
809
|
private filterPanelButtons;
|
|
689
|
-
constructor(formName: string, driver
|
|
810
|
+
constructor(formName: string, driver: WebDriver);
|
|
690
811
|
/**
|
|
691
812
|
* Возвращает фильтр на панели фильтрации
|
|
692
813
|
* @returns {PanelFilterField}
|
|
@@ -701,7 +822,7 @@ declare class FilterPanel extends AbstractElement {
|
|
|
701
822
|
}
|
|
702
823
|
|
|
703
824
|
declare class HeaderFilterField extends AbstractEditor {
|
|
704
|
-
constructor(parentCssSelector: string, formName: string, name: string, driver
|
|
825
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver: WebDriver);
|
|
705
826
|
getValue(): Promise<any>;
|
|
706
827
|
setValue(value: any): Promise<void>;
|
|
707
828
|
clear(): Promise<void>;
|
|
@@ -711,7 +832,7 @@ declare class HeaderFilterField extends AbstractEditor {
|
|
|
711
832
|
interface IFilterOperations {
|
|
712
833
|
parentCssSelector: string;
|
|
713
834
|
filterTestID: string;
|
|
714
|
-
driver
|
|
835
|
+
driver: WebDriver;
|
|
715
836
|
}
|
|
716
837
|
declare class FilterOperation extends AbstractElementWithParent {
|
|
717
838
|
private readonly _testId;
|
|
@@ -727,7 +848,7 @@ declare class ColumnFilter extends AbstractElement {
|
|
|
727
848
|
private readonly _formName;
|
|
728
849
|
private readonly _name;
|
|
729
850
|
private _column;
|
|
730
|
-
constructor(formName: string, name: string, column: Column, driver
|
|
851
|
+
constructor(formName: string, name: string, column: Column, driver: WebDriver);
|
|
731
852
|
private getApplyButton;
|
|
732
853
|
private getCancelButton;
|
|
733
854
|
protected apply(): Promise<void>;
|
|
@@ -793,6 +914,8 @@ declare class ColumnFilter extends AbstractElement {
|
|
|
793
914
|
declare class ListForm extends Form {
|
|
794
915
|
protected headerCssSelector: string;
|
|
795
916
|
protected fixedTableContentCssSelector: string;
|
|
917
|
+
protected tableContentCssSelector: string;
|
|
918
|
+
protected contextMenuCssSelector: string;
|
|
796
919
|
constructor(driver: WebDriver);
|
|
797
920
|
/**
|
|
798
921
|
* Находит таблицу
|
|
@@ -848,12 +971,13 @@ declare class ReportForm extends FormEdit {
|
|
|
848
971
|
|
|
849
972
|
declare class DialogButton extends AbstractButton implements Button {
|
|
850
973
|
private readonly text;
|
|
851
|
-
constructor(parentCssSelector: string, text: string, driver
|
|
974
|
+
constructor(parentCssSelector: string, text: string, driver: WebDriver);
|
|
852
975
|
getElement(): Promise<WebElement>;
|
|
853
976
|
protected buttonNotDisplayedError(): string;
|
|
977
|
+
getTitle(): Promise<string>;
|
|
854
978
|
}
|
|
855
979
|
declare class Dialog extends AbstractElement {
|
|
856
|
-
constructor(driver
|
|
980
|
+
constructor(driver: WebDriver);
|
|
857
981
|
private get titleSelector();
|
|
858
982
|
private get textSelector();
|
|
859
983
|
private get buttonsSelector();
|
|
@@ -862,4 +986,4 @@ declare class Dialog extends AbstractElement {
|
|
|
862
986
|
button(text: string): DialogButton;
|
|
863
987
|
}
|
|
864
988
|
|
|
865
|
-
export { AbstractPage, ControlClass, Dialog, Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, LoginPage, NumberEditor, PanelFilterField, ReportForm, SubsystemsPanel, TextEditor, TreeView, byTestId, byTestIdCssSelector, click, config, createDriver, editorFactory, elementIsNotPresent, readonlyLocator, signIn, wait, waitElementIsVisible };
|
|
989
|
+
export { AbstractPage, ControlClass, Dialog, type Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, LoginPage, NumberEditor, PanelFilterField, ReportForm, SubsystemsPanel, TextEditor, TreeView, byTestId, byTestIdCssSelector, click, config, contextMenu, createDriver, editorFactory, elementIsNotPresent, readonlyLocator, signIn, safeWait as wait, waitElementIsClickable, waitElementIsVisible };
|