d5-testing-library 1.8.0-alpha.9 → 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-R3BWDLN3.mjs → chunk-32KSAOFJ.mjs} +171 -147
- package/dist/{chunk-VPTIEIX5.mjs → chunk-75FRHQCI.mjs} +3 -2
- package/dist/{chunk-4JWY3XDX.mjs → chunk-S62QEWWA.mjs} +444 -121
- package/dist/{chunk-XQTIDP34.mjs → chunk-XGIXXZD6.mjs} +3 -3
- package/dist/cjs/d5-testing-library.cjs +776 -325
- package/dist/{d5-testing-library.d.ts → d5-testing-library.d.mts} +194 -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-ELCXSD63.mjs +0 -7
- package/dist/ListForm-A7HQKGCR.mjs +0 -7
- package/dist/TreeView-ANBLGS27.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,17 +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;
|
|
544
|
-
constructor(parentCssSelector
|
|
631
|
+
constructor({ parentCssSelector, contextMenuCssSelector, tableContentCssSelector, headerCssSelector, fixedTableContentCssSelector, formName, driver }: ConstructorParams);
|
|
545
632
|
private getColumnBy;
|
|
633
|
+
/**
|
|
634
|
+
* Отримати рядок по індексу.
|
|
635
|
+
* @param index починається з 0
|
|
636
|
+
*/
|
|
546
637
|
getRowByIndex(index: number): Row;
|
|
638
|
+
/**
|
|
639
|
+
* @param index починається з 0
|
|
640
|
+
*/
|
|
547
641
|
getColumnByIndex(index: number): Column;
|
|
548
642
|
getColumnByTitle: (title: string) => Column;
|
|
549
643
|
getColumnByName: (name: string) => Column;
|
|
644
|
+
/**
|
|
645
|
+
* Вибрати рядок по індексу.
|
|
646
|
+
* @param index починається з 0
|
|
647
|
+
*/
|
|
550
648
|
selectRowByIndex(index: number): Promise<void>;
|
|
551
649
|
getRows(): Promise<Row[]>;
|
|
552
650
|
getColumns(): Promise<Column[]>;
|
|
@@ -559,12 +657,34 @@ declare class Table extends AbstractElementWithParent {
|
|
|
559
657
|
* expect(await form.field('Name').getValue()).toBe('test value');
|
|
560
658
|
*/
|
|
561
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;
|
|
562
682
|
}
|
|
563
683
|
|
|
564
684
|
declare class FormFilterField extends AbstractEditor {
|
|
565
685
|
private readonly formName;
|
|
566
686
|
private readonly name;
|
|
567
|
-
constructor(parentCssSelector: string, formName: string, name: string, driver
|
|
687
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver: WebDriver);
|
|
568
688
|
/**
|
|
569
689
|
* Возвращает значение в поле
|
|
570
690
|
* @example
|
|
@@ -625,7 +745,7 @@ declare class FormFilterField extends AbstractEditor {
|
|
|
625
745
|
declare class PanelFilterField extends AbstractEditor {
|
|
626
746
|
private readonly formName;
|
|
627
747
|
private readonly name;
|
|
628
|
-
constructor(parentCssSelector: string, formName: string, name: string, driver
|
|
748
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver: WebDriver);
|
|
629
749
|
/**
|
|
630
750
|
* Возвращает значение в поле
|
|
631
751
|
* @example
|
|
@@ -687,7 +807,7 @@ declare class FilterPanel extends AbstractElement {
|
|
|
687
807
|
private readonly _formName;
|
|
688
808
|
private get filterPanelSelector();
|
|
689
809
|
private filterPanelButtons;
|
|
690
|
-
constructor(formName: string, driver
|
|
810
|
+
constructor(formName: string, driver: WebDriver);
|
|
691
811
|
/**
|
|
692
812
|
* Возвращает фильтр на панели фильтрации
|
|
693
813
|
* @returns {PanelFilterField}
|
|
@@ -702,7 +822,7 @@ declare class FilterPanel extends AbstractElement {
|
|
|
702
822
|
}
|
|
703
823
|
|
|
704
824
|
declare class HeaderFilterField extends AbstractEditor {
|
|
705
|
-
constructor(parentCssSelector: string, formName: string, name: string, driver
|
|
825
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver: WebDriver);
|
|
706
826
|
getValue(): Promise<any>;
|
|
707
827
|
setValue(value: any): Promise<void>;
|
|
708
828
|
clear(): Promise<void>;
|
|
@@ -712,7 +832,7 @@ declare class HeaderFilterField extends AbstractEditor {
|
|
|
712
832
|
interface IFilterOperations {
|
|
713
833
|
parentCssSelector: string;
|
|
714
834
|
filterTestID: string;
|
|
715
|
-
driver
|
|
835
|
+
driver: WebDriver;
|
|
716
836
|
}
|
|
717
837
|
declare class FilterOperation extends AbstractElementWithParent {
|
|
718
838
|
private readonly _testId;
|
|
@@ -728,7 +848,7 @@ declare class ColumnFilter extends AbstractElement {
|
|
|
728
848
|
private readonly _formName;
|
|
729
849
|
private readonly _name;
|
|
730
850
|
private _column;
|
|
731
|
-
constructor(formName: string, name: string, column: Column, driver
|
|
851
|
+
constructor(formName: string, name: string, column: Column, driver: WebDriver);
|
|
732
852
|
private getApplyButton;
|
|
733
853
|
private getCancelButton;
|
|
734
854
|
protected apply(): Promise<void>;
|
|
@@ -795,6 +915,7 @@ declare class ListForm extends Form {
|
|
|
795
915
|
protected headerCssSelector: string;
|
|
796
916
|
protected fixedTableContentCssSelector: string;
|
|
797
917
|
protected tableContentCssSelector: string;
|
|
918
|
+
protected contextMenuCssSelector: string;
|
|
798
919
|
constructor(driver: WebDriver);
|
|
799
920
|
/**
|
|
800
921
|
* Находит таблицу
|
|
@@ -850,12 +971,13 @@ declare class ReportForm extends FormEdit {
|
|
|
850
971
|
|
|
851
972
|
declare class DialogButton extends AbstractButton implements Button {
|
|
852
973
|
private readonly text;
|
|
853
|
-
constructor(parentCssSelector: string, text: string, driver
|
|
974
|
+
constructor(parentCssSelector: string, text: string, driver: WebDriver);
|
|
854
975
|
getElement(): Promise<WebElement>;
|
|
855
976
|
protected buttonNotDisplayedError(): string;
|
|
977
|
+
getTitle(): Promise<string>;
|
|
856
978
|
}
|
|
857
979
|
declare class Dialog extends AbstractElement {
|
|
858
|
-
constructor(driver
|
|
980
|
+
constructor(driver: WebDriver);
|
|
859
981
|
private get titleSelector();
|
|
860
982
|
private get textSelector();
|
|
861
983
|
private get buttonsSelector();
|
|
@@ -864,4 +986,4 @@ declare class Dialog extends AbstractElement {
|
|
|
864
986
|
button(text: string): DialogButton;
|
|
865
987
|
}
|
|
866
988
|
|
|
867
|
-
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 };
|