d5-testing-library 2.0.0-alpha.0 → 2.0.0-alpha.2
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-I63LWQEH.mjs +6 -0
- package/dist/ListForm-NEBCZD4X.mjs +6 -0
- package/dist/TreeView-T3PIDSZQ.mjs +6 -0
- package/dist/chunk-75NROWLM.mjs +6193 -0
- package/dist/cjs/d5-testing-library.cjs +1175 -1473
- package/dist/cjs/d5-testing-library.d.ts +126 -160
- package/dist/d5-testing-library.d.mts +126 -160
- package/dist/d5-testing-library.legacy-esm.js +14 -3174
- package/dist/d5-testing-library.mjs +14 -3174
- package/package.json +3 -16
- package/dist/FormEdit-VFV53QIZ.mjs +0 -7
- package/dist/ListForm-KIHLT7EU.mjs +0 -7
- package/dist/TreeView-TFBZB2UK.mjs +0 -8
- package/dist/chunk-EFNMD3S7.mjs +0 -22
- package/dist/chunk-GVYXH7L3.mjs +0 -75
- package/dist/chunk-RPSLW2WB.mjs +0 -1722
- package/dist/chunk-TSE33S3X.mjs +0 -1555
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
import * as playwright_core from 'playwright-core';
|
|
3
3
|
|
|
4
|
-
type DriverType = typeof Browser;
|
|
5
|
-
type BrowserList = DriverType[keyof DriverType];
|
|
6
4
|
type IConfig = {
|
|
7
5
|
auth: {
|
|
8
|
-
host: string;
|
|
9
6
|
login: string;
|
|
10
7
|
password: string;
|
|
11
8
|
};
|
|
12
|
-
timeout: number;
|
|
13
|
-
browser: BrowserList;
|
|
14
|
-
headless?: 'true' | 'false';
|
|
15
9
|
};
|
|
16
10
|
declare function config(cfg?: IConfig): IConfig;
|
|
17
11
|
|
|
18
12
|
declare abstract class AbstractElement {
|
|
19
|
-
|
|
13
|
+
page: Page;
|
|
20
14
|
protected elementCssSelector: string;
|
|
21
|
-
protected constructor(
|
|
15
|
+
protected constructor(page: Page, elementCssSelector?: string);
|
|
22
16
|
protected getFullCssSelector(): string;
|
|
23
17
|
protected joinRelativeCssSelectors(selectors: string[]): string;
|
|
24
|
-
|
|
18
|
+
getLocator(): Locator;
|
|
25
19
|
getAttribute(attr: string): Promise<string>;
|
|
26
20
|
getClasses(): Promise<string>;
|
|
27
21
|
getDataTestId(): Promise<string>;
|
|
@@ -30,8 +24,7 @@ declare abstract class AbstractElement {
|
|
|
30
24
|
|
|
31
25
|
declare abstract class AbstractPage extends AbstractElement {
|
|
32
26
|
protected url: string;
|
|
33
|
-
|
|
34
|
-
constructor(driver: WebDriver);
|
|
27
|
+
constructor(page: Page);
|
|
35
28
|
private prependHash;
|
|
36
29
|
protected goToUrl(url: string): Promise<void>;
|
|
37
30
|
protected get path(): string;
|
|
@@ -40,16 +33,12 @@ declare abstract class AbstractPage extends AbstractElement {
|
|
|
40
33
|
}
|
|
41
34
|
|
|
42
35
|
declare class LoginPage extends AbstractPage {
|
|
43
|
-
usernameField: By;
|
|
44
|
-
passwordField: By;
|
|
45
|
-
loginButton: By;
|
|
46
36
|
locate(): Promise<void>;
|
|
47
37
|
get path(): string;
|
|
48
38
|
enterUsername(username: string): Promise<void>;
|
|
49
39
|
enterPassword(password: string): Promise<void>;
|
|
50
40
|
clickLoginButton(): Promise<void>;
|
|
51
41
|
loginWith(username: string, password: string): Promise<void>;
|
|
52
|
-
authorize(): Promise<void>;
|
|
53
42
|
}
|
|
54
43
|
|
|
55
44
|
declare const byTestIdCssSelector: (testId: string, element?: string) => string;
|
|
@@ -58,75 +47,46 @@ declare const byTestIdCssSelector: (testId: string, element?: string) => string;
|
|
|
58
47
|
*
|
|
59
48
|
* @param {string} testId - The test ID of the element.
|
|
60
49
|
* @param {string} [element='div'] - The HTML tag name of the element (optional).
|
|
61
|
-
* @returns {
|
|
50
|
+
* @returns {string} - Path string.
|
|
62
51
|
*/
|
|
63
|
-
declare const byTestId: (testId: string, element?: string) =>
|
|
52
|
+
declare const byTestId: (testId: string, element?: string) => string;
|
|
64
53
|
declare const readonlyLocator = "readonly";
|
|
65
54
|
declare const disabledLocator = "disabled";
|
|
66
55
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* If no browser parameter is provided, it uses the default browser specified in the configuration.
|
|
70
|
-
* The default timeout is also set based on the configuration.
|
|
71
|
-
*
|
|
72
|
-
* @param {BrowserList} browser - The browser to create the WebDriver instance for.
|
|
73
|
-
* @returns {Promise<WebDriver>} A promise that resolves to the WebDriver instance.
|
|
74
|
-
*/
|
|
75
|
-
declare const createDriver: (browser?: BrowserList) => Promise<WebDriver>;
|
|
76
|
-
|
|
77
|
-
declare const elementIsNotPresent: (locator: By) => Condition<boolean>;
|
|
78
|
-
|
|
79
|
-
type WithElement$1 = {
|
|
80
|
-
element: WebElement;
|
|
81
|
-
};
|
|
82
|
-
type WithBy$1 = {
|
|
83
|
-
by: By;
|
|
84
|
-
};
|
|
85
|
-
type Args$1 = {
|
|
86
|
-
timeout?: number;
|
|
87
|
-
errorMessage?: string;
|
|
88
|
-
driver: WebDriver;
|
|
89
|
-
};
|
|
90
|
-
type ArgsWithElement$1 = Args$1 & WithElement$1;
|
|
91
|
-
type ArgsWithWithBy$1 = Args$1 & WithBy$1;
|
|
92
|
-
declare function waitElementIsVisible(args: ArgsWithElement$1): Promise<void>;
|
|
93
|
-
declare function waitElementIsVisible(args: ArgsWithWithBy$1): Promise<void>;
|
|
94
|
-
|
|
95
|
-
type WithElement = {
|
|
96
|
-
element: WebElement;
|
|
97
|
-
};
|
|
98
|
-
type WithBy = {
|
|
99
|
-
by: By;
|
|
56
|
+
type WithLocator = {
|
|
57
|
+
locator: Locator;
|
|
100
58
|
};
|
|
101
59
|
type Args = {
|
|
102
60
|
timeout?: number;
|
|
103
61
|
errorMessage?: string;
|
|
104
|
-
driver: WebDriver;
|
|
105
62
|
};
|
|
106
|
-
type
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
63
|
+
type ArgsWithWithLocator = Args & WithLocator;
|
|
64
|
+
/**
|
|
65
|
+
* Waits until a specified web element is visible within a given timeout.
|
|
66
|
+
*
|
|
67
|
+
* @param {ArgsWithWithLocator} params - The parameters for the wait function.
|
|
68
|
+
* @param {number} [params.timeout] - The maximum time to wait for the element to be visible, in milliseconds. If not provided, the default timeout is used.
|
|
69
|
+
* @param {Locator} [params.locator] - The locator of the element to wait for.
|
|
70
|
+
* @returns {Promise<void>} A promise that resolves when the element becomes visible.
|
|
71
|
+
*/
|
|
72
|
+
declare function waitElementIsVisible({ timeout, locator }: ArgsWithWithLocator): Promise<void>;
|
|
110
73
|
|
|
111
|
-
interface
|
|
112
|
-
condition: (
|
|
74
|
+
interface PlaywrightWaitParams {
|
|
75
|
+
condition: () => Promise<boolean>;
|
|
113
76
|
timeout?: number;
|
|
114
77
|
errorMessage?: string;
|
|
115
|
-
|
|
78
|
+
page: Page;
|
|
116
79
|
}
|
|
117
|
-
declare function safeWait(condition: WaiteParams['condition'], driver: WebDriver, errorMessage?: string, timeout?: number): Promise<void>;
|
|
118
|
-
|
|
119
|
-
declare function signIn(driver?: WebDriver): Promise<WebDriver>;
|
|
120
|
-
|
|
121
80
|
/**
|
|
122
|
-
*
|
|
81
|
+
* Safely waits for a condition using Playwright, catching any errors and continuing to wait.
|
|
123
82
|
*
|
|
124
|
-
* @param {
|
|
125
|
-
* @param {
|
|
126
|
-
* @
|
|
83
|
+
* @param {function} condition - A function that returns a promise resolving to a boolean indicating if the condition is met.
|
|
84
|
+
* @param {Page} page - The Playwright page instance to use.
|
|
85
|
+
* @param {string} [errorMessage] - The error message to display if the wait times out.
|
|
86
|
+
* @param {number} [timeout] - The maximum time to wait for the condition, in milliseconds.
|
|
87
|
+
* @returns {Promise<void>} A promise that resolves when the condition is met or rejects if timeout occurs.
|
|
127
88
|
*/
|
|
128
|
-
declare
|
|
129
|
-
declare const contextMenu: (webElement: WebElement, driver: WebDriver) => Promise<void>;
|
|
89
|
+
declare function wait(condition: PlaywrightWaitParams['condition'], page: Page, errorMessage?: string, timeout?: number): Promise<void>;
|
|
130
90
|
|
|
131
91
|
interface Editor {
|
|
132
92
|
setValue(value: any): Promise<void>;
|
|
@@ -157,7 +117,7 @@ interface ClearStrategy {
|
|
|
157
117
|
|
|
158
118
|
declare abstract class AbstractElementWithParent extends AbstractElement {
|
|
159
119
|
protected parentCssSelector: string;
|
|
160
|
-
constructor(parentCssSelector: string, elementCssSelector: string,
|
|
120
|
+
constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
161
121
|
protected getFullCssSelector(): string;
|
|
162
122
|
isReadonly(): Promise<boolean>;
|
|
163
123
|
isDisabled(): Promise<boolean>;
|
|
@@ -167,8 +127,8 @@ declare abstract class AbstractDXEditorWithInput extends AbstractElementWithPare
|
|
|
167
127
|
private clearStrategy;
|
|
168
128
|
protected setClearStrategy(strategy: ClearStrategy): void;
|
|
169
129
|
protected getInputCssSelector(): string;
|
|
170
|
-
|
|
171
|
-
protected getInputValue(): Promise<string>;
|
|
130
|
+
getInputLocator(): Locator;
|
|
131
|
+
protected getInputValue(): Promise<string | null>;
|
|
172
132
|
protected setInputValue(value: string): Promise<void>;
|
|
173
133
|
clear(): Promise<void>;
|
|
174
134
|
abstract setValue(value: any): Promise<void>;
|
|
@@ -176,35 +136,35 @@ declare abstract class AbstractDXEditorWithInput extends AbstractElementWithPare
|
|
|
176
136
|
}
|
|
177
137
|
|
|
178
138
|
declare class TextEditor extends AbstractDXEditorWithInput {
|
|
179
|
-
constructor(parentCssSelector: string, elementCssSelector: string,
|
|
139
|
+
constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
180
140
|
getValue(): Promise<string | null>;
|
|
181
141
|
setValue(value: string): Promise<void>;
|
|
182
142
|
}
|
|
183
143
|
|
|
184
144
|
declare class NumberEditor extends AbstractDXEditorWithInput {
|
|
185
|
-
constructor(parentCssSelector: string, elementCssSelector: string,
|
|
145
|
+
constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
186
146
|
getValue(): Promise<number | null>;
|
|
187
147
|
setValue(value: any): Promise<void>;
|
|
188
148
|
}
|
|
189
149
|
|
|
190
|
-
declare const editorFactory: (parentCssSelector: string, elementCssSelector: string,
|
|
150
|
+
declare const editorFactory: (parentCssSelector: string, elementCssSelector: string, page: Page) => Promise<Editor>;
|
|
191
151
|
|
|
192
152
|
interface ISubsystemItem {
|
|
193
|
-
|
|
194
|
-
bySelector:
|
|
153
|
+
page: Page;
|
|
154
|
+
bySelector: string;
|
|
195
155
|
}
|
|
196
156
|
declare class SubsystemItem {
|
|
197
157
|
private readonly bySelector;
|
|
198
|
-
private readonly
|
|
199
|
-
constructor({
|
|
200
|
-
getElement():
|
|
158
|
+
private readonly page;
|
|
159
|
+
constructor({ page, bySelector }: ISubsystemItem);
|
|
160
|
+
getElement(): playwright_core.Locator;
|
|
201
161
|
getTitle(): Promise<string>;
|
|
202
162
|
click(): Promise<void>;
|
|
203
163
|
}
|
|
204
164
|
|
|
205
165
|
declare class SubsystemsPanel extends AbstractElement {
|
|
206
166
|
private header;
|
|
207
|
-
constructor(
|
|
167
|
+
constructor(page: Page);
|
|
208
168
|
headerTitle(): Promise<string>;
|
|
209
169
|
protected getSearchComponent(): TextEditor;
|
|
210
170
|
/**
|
|
@@ -252,33 +212,36 @@ declare class SubsystemsPanel extends AbstractElement {
|
|
|
252
212
|
interface Button {
|
|
253
213
|
click(): Promise<void>;
|
|
254
214
|
isDisabled(): Promise<boolean>;
|
|
255
|
-
|
|
215
|
+
isVisible(): Promise<boolean>;
|
|
256
216
|
getTitle(): Promise<string>;
|
|
257
217
|
isPressed?(): Promise<boolean>;
|
|
218
|
+
getLocator(): Locator;
|
|
258
219
|
}
|
|
259
220
|
declare abstract class AbstractButton extends AbstractElementWithParent implements Button {
|
|
260
|
-
protected constructor(parentCssSelector: string, elementCssSelector: string,
|
|
221
|
+
protected constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
261
222
|
protected abstract buttonNotDisplayedError(): string;
|
|
223
|
+
protected get button(): Locator;
|
|
224
|
+
getLocator(): Locator;
|
|
262
225
|
click(): Promise<void>;
|
|
263
226
|
isDisabled(): Promise<boolean>;
|
|
264
|
-
|
|
227
|
+
isVisible(): Promise<boolean>;
|
|
265
228
|
isPressed(): Promise<boolean>;
|
|
266
229
|
abstract getTitle(): Promise<string>;
|
|
267
230
|
}
|
|
268
231
|
|
|
269
232
|
declare abstract class DXButton extends AbstractButton {
|
|
270
|
-
protected getText(): Promise<string>;
|
|
233
|
+
protected getText(): Promise<string | null>;
|
|
271
234
|
}
|
|
272
235
|
|
|
273
236
|
declare class FormButton extends DXButton {
|
|
274
237
|
private readonly name;
|
|
275
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
238
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
276
239
|
protected buttonNotDisplayedError(): string;
|
|
277
240
|
getTitle(): Promise<string>;
|
|
278
241
|
}
|
|
279
242
|
|
|
280
243
|
interface Group<TItem = unknown> {
|
|
281
|
-
|
|
244
|
+
isVisible(): Promise<boolean>;
|
|
282
245
|
click?(): Promise<void>;
|
|
283
246
|
itemClick?(name: string): Promise<void>;
|
|
284
247
|
item?(name: string): TItem;
|
|
@@ -287,14 +250,14 @@ interface Group<TItem = unknown> {
|
|
|
287
250
|
|
|
288
251
|
declare class FormGroup extends AbstractElementWithParent implements Group {
|
|
289
252
|
private groupInstance;
|
|
290
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
253
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
291
254
|
private initInstance;
|
|
292
255
|
/**
|
|
293
256
|
* Возвращает булевое значение доступна ли группа
|
|
294
257
|
* @example
|
|
295
|
-
* expect(await tableList.group('MainSuperPanel').
|
|
258
|
+
* expect(await tableList.group('MainSuperPanel').isVisible();
|
|
296
259
|
*/
|
|
297
|
-
|
|
260
|
+
isVisible(): Promise<boolean>;
|
|
298
261
|
/**
|
|
299
262
|
* Клик по элементам группы.
|
|
300
263
|
* Метод работает если у группы есть дочерние элементы, например элементы аккордеона или вкладки таб панели.
|
|
@@ -317,11 +280,11 @@ declare class FormGroup extends AbstractElementWithParent implements Group {
|
|
|
317
280
|
isActive(): Promise<boolean>;
|
|
318
281
|
}
|
|
319
282
|
|
|
320
|
-
declare class AbstractForm extends AbstractPage {
|
|
283
|
+
declare abstract class AbstractForm extends AbstractPage {
|
|
321
284
|
protected containerCssSelector: string;
|
|
322
285
|
private _formName;
|
|
323
|
-
protected
|
|
324
|
-
protected
|
|
286
|
+
protected get container(): Locator;
|
|
287
|
+
protected constructor(page: Page);
|
|
325
288
|
set formName(name: string);
|
|
326
289
|
get formName(): string;
|
|
327
290
|
/**
|
|
@@ -349,7 +312,7 @@ interface SubFormOptions {
|
|
|
349
312
|
}
|
|
350
313
|
declare abstract class Form extends AbstractForm {
|
|
351
314
|
protected popupContainerCssSelector: string;
|
|
352
|
-
protected constructor(
|
|
315
|
+
protected constructor(page: Page);
|
|
353
316
|
protected isModal(): Promise<boolean>;
|
|
354
317
|
protected isFullScreen(): Promise<boolean>;
|
|
355
318
|
/**
|
|
@@ -358,6 +321,7 @@ declare abstract class Form extends AbstractForm {
|
|
|
358
321
|
* const listForm = new MyForm();
|
|
359
322
|
* //...
|
|
360
323
|
* expect(await listForm.getTitleText()).toBe('MyFormTitle');
|
|
324
|
+
* Получение заголовка на форме
|
|
361
325
|
*/
|
|
362
326
|
getTitleText(): Promise<string>;
|
|
363
327
|
protected setSubFormMode(): void;
|
|
@@ -370,19 +334,20 @@ declare abstract class Form extends AbstractForm {
|
|
|
370
334
|
* expect(await form.subForm(name));
|
|
371
335
|
*/
|
|
372
336
|
subForm(name: string, options?: SubFormOptions): Promise<unknown>;
|
|
337
|
+
protected getContainerElement(): Locator;
|
|
373
338
|
}
|
|
374
339
|
|
|
375
340
|
declare class EditorButton extends AbstractElementWithParent {
|
|
376
341
|
private readonly name;
|
|
377
|
-
constructor(parentCssSelector: string, name: string,
|
|
342
|
+
constructor(parentCssSelector: string, name: string, page: Page);
|
|
378
343
|
protected buttonNotDisplayedError(): string;
|
|
379
344
|
click(): Promise<void>;
|
|
380
|
-
|
|
345
|
+
isVisible(): Promise<boolean>;
|
|
381
346
|
}
|
|
382
347
|
|
|
383
348
|
declare class AbstractEditor extends AbstractElementWithParent implements Editor {
|
|
384
349
|
protected editor: Editor;
|
|
385
|
-
constructor(parentCssSelector: string, elementCssSelector: string,
|
|
350
|
+
constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
386
351
|
protected initEditor(): Promise<void>;
|
|
387
352
|
/**
|
|
388
353
|
* Возвращает значение в поле
|
|
@@ -425,12 +390,12 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
425
390
|
*/
|
|
426
391
|
isDisabled(): Promise<boolean>;
|
|
427
392
|
/**
|
|
428
|
-
* Возвращает значение true|false в зависимости
|
|
393
|
+
* Возвращает значение true|false в зависимости isVisible поле или нет
|
|
429
394
|
* @example
|
|
430
|
-
* expect(await formEdit.field('NumberFld').
|
|
431
|
-
* expect(await formEdit.field('TextFld').
|
|
395
|
+
* expect(await formEdit.field('NumberFld').isVisible()).toBe(true);
|
|
396
|
+
* expect(await formEdit.field('TextFld').isVisible()).toBe(false);
|
|
432
397
|
*/
|
|
433
|
-
|
|
398
|
+
isVisible(): Promise<boolean>;
|
|
434
399
|
/**
|
|
435
400
|
* Находит кнопку на поле по имени
|
|
436
401
|
* @example
|
|
@@ -442,13 +407,13 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
442
407
|
}
|
|
443
408
|
|
|
444
409
|
declare class FormField extends AbstractEditor {
|
|
445
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
410
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
446
411
|
}
|
|
447
412
|
|
|
448
413
|
declare class FormEdit extends Form {
|
|
449
414
|
saveButtonId: string;
|
|
450
415
|
closeButtonId: string;
|
|
451
|
-
constructor(
|
|
416
|
+
constructor(page: Page);
|
|
452
417
|
private getButtonCssSelector;
|
|
453
418
|
/**
|
|
454
419
|
* Находит поле формы редактирования по имени
|
|
@@ -485,36 +450,35 @@ declare class FormEdit extends Form {
|
|
|
485
450
|
}
|
|
486
451
|
|
|
487
452
|
declare abstract class AbstractDropDownMenuList extends AbstractElementWithParent {
|
|
488
|
-
protected abstract getButtonNameBy(name: string):
|
|
489
|
-
protected abstract getButtonTitleBy(name: string):
|
|
490
|
-
protected buttonNotDisplayedError(name: string): string;
|
|
453
|
+
protected abstract getButtonNameBy(name: string): string;
|
|
454
|
+
protected abstract getButtonTitleBy(name: string): string;
|
|
491
455
|
private clickItemBy;
|
|
492
456
|
private getElementByPath;
|
|
493
457
|
clickButton(name: string | string[]): Promise<void>;
|
|
494
458
|
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
495
|
-
getMenuItemElementByTitle(title: string | string[]): Promise<
|
|
496
|
-
getMenuItemElementByName(name: string | string[]): Promise<
|
|
459
|
+
getMenuItemElementByTitle(title: string | string[]): Promise<Locator>;
|
|
460
|
+
getMenuItemElementByName(name: string | string[]): Promise<Locator>;
|
|
497
461
|
isVisible(): Promise<boolean>;
|
|
498
462
|
}
|
|
499
463
|
|
|
500
464
|
declare abstract class AbstractDropDownMenuButton extends AbstractElementWithParent {
|
|
501
465
|
private readonly _list;
|
|
502
|
-
protected constructor(parentCssSelector: string, elementCssSelector: string, list: AbstractDropDownMenuList,
|
|
466
|
+
protected constructor(parentCssSelector: string, elementCssSelector: string, list: AbstractDropDownMenuList, page: Page);
|
|
503
467
|
protected openDropdownMenu(): Promise<void>;
|
|
504
468
|
clickButton(name: string | string[]): Promise<void>;
|
|
505
469
|
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
506
|
-
getMenuItemElementByTitle(title: string | string[]): Promise<
|
|
507
|
-
getMenuItemElementByName(name: string | string[]): Promise<
|
|
470
|
+
getMenuItemElementByTitle(title: string | string[]): Promise<Locator>;
|
|
471
|
+
getMenuItemElementByName(name: string | string[]): Promise<Locator>;
|
|
508
472
|
}
|
|
509
473
|
|
|
510
474
|
declare class ToolbarMenu extends AbstractDropDownMenuButton {
|
|
511
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
475
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
512
476
|
private checkNameValue;
|
|
513
477
|
private checkTitleValue;
|
|
514
478
|
private buttonByName;
|
|
515
479
|
private buttonByTitle;
|
|
516
|
-
|
|
517
|
-
|
|
480
|
+
buttonIsVisible(name: string | string[]): Promise<boolean>;
|
|
481
|
+
buttonByTitleIsVisible(title: string | string[]): Promise<boolean>;
|
|
518
482
|
buttonTitle(name: string | string[]): Promise<string>;
|
|
519
483
|
buttonIsDisabled(name: string | string[]): Promise<boolean>;
|
|
520
484
|
buttonByTitleIsDisabled(title: string | string[]): Promise<boolean>;
|
|
@@ -526,11 +490,11 @@ declare class ToolbarItem extends AbstractElementWithParent implements Button {
|
|
|
526
490
|
private _button;
|
|
527
491
|
private readonly _formName;
|
|
528
492
|
private readonly _itemName;
|
|
529
|
-
constructor(parentCssSelector: string, formName: string, itemName: string,
|
|
493
|
+
constructor(parentCssSelector: string, formName: string, itemName: string, page: Page);
|
|
530
494
|
private init;
|
|
531
495
|
click(): Promise<void>;
|
|
532
496
|
isDisabled(): Promise<boolean>;
|
|
533
|
-
|
|
497
|
+
isVisible(): Promise<boolean>;
|
|
534
498
|
isPressed(): Promise<boolean>;
|
|
535
499
|
getTitle(): Promise<string>;
|
|
536
500
|
get menu(): ToolbarMenu;
|
|
@@ -538,15 +502,15 @@ declare class ToolbarItem extends AbstractElementWithParent implements Button {
|
|
|
538
502
|
|
|
539
503
|
declare class Cell extends AbstractElementWithParent {
|
|
540
504
|
private _index;
|
|
541
|
-
private getCellIndex;
|
|
542
|
-
constructor(parentCssSelector: string, getCellIndex: () => Promise<number>,
|
|
505
|
+
private readonly getCellIndex;
|
|
506
|
+
constructor(parentCssSelector: string, getCellIndex: () => Promise<number>, page: Page, index?: number);
|
|
543
507
|
private set index(value);
|
|
544
508
|
private getBooleanValue;
|
|
545
509
|
private getTagsValue;
|
|
546
510
|
private getNumberValue;
|
|
547
511
|
private getDateValue;
|
|
548
|
-
|
|
549
|
-
getValue(): Promise<string | number | 1 | 0 | string[] | Date | Date[]>;
|
|
512
|
+
element(): Promise<Locator>;
|
|
513
|
+
getValue(): Promise<string | number | 1 | 0 | string[] | Date | Date[] | null>;
|
|
550
514
|
getIndex(): number;
|
|
551
515
|
}
|
|
552
516
|
|
|
@@ -556,17 +520,17 @@ interface ConstructorParams$1 {
|
|
|
556
520
|
name?: string;
|
|
557
521
|
caption?: string;
|
|
558
522
|
index?: number;
|
|
559
|
-
|
|
523
|
+
page: Page;
|
|
560
524
|
}
|
|
561
525
|
declare class Column extends AbstractElementWithParent {
|
|
562
526
|
private _index;
|
|
563
527
|
private _caption;
|
|
564
528
|
private _name;
|
|
565
529
|
protected headerCssSelector: string | undefined;
|
|
566
|
-
constructor({ parentCssSelector, headerCssSelector, name, caption, index,
|
|
530
|
+
constructor({ parentCssSelector, headerCssSelector, name, caption, index, page }: ConstructorParams$1);
|
|
567
531
|
private set index(value);
|
|
568
532
|
private get index();
|
|
569
|
-
|
|
533
|
+
element(): Promise<Locator>;
|
|
570
534
|
private getColumnHeaderIndexBy;
|
|
571
535
|
private getIndexByCaption;
|
|
572
536
|
private getIndexByName;
|
|
@@ -585,10 +549,10 @@ declare class Row extends AbstractElementWithParent {
|
|
|
585
549
|
* @param parentCssSelector
|
|
586
550
|
* @param fixedTableContentCssSelector
|
|
587
551
|
* @param index починається з 0 (в getCssRowByIndexSelector додається +1)
|
|
588
|
-
* @param
|
|
552
|
+
* @param page
|
|
589
553
|
* @param getColumnBy
|
|
590
554
|
*/
|
|
591
|
-
constructor(parentCssSelector: string, fixedTableContentCssSelector: string, index: number,
|
|
555
|
+
constructor(parentCssSelector: string, fixedTableContentCssSelector: string, index: number, page: Page, getColumnBy?: (_: {
|
|
592
556
|
title?: string;
|
|
593
557
|
name?: string;
|
|
594
558
|
}) => Column);
|
|
@@ -611,19 +575,19 @@ declare abstract class DXContextMenuList extends AbstractDropDownMenuList {
|
|
|
611
575
|
/**
|
|
612
576
|
* @param parentCssSelector
|
|
613
577
|
* @param classNames - Список класів. Починається з крапки
|
|
614
|
-
* @param
|
|
578
|
+
* @param page
|
|
615
579
|
*/
|
|
616
|
-
protected constructor(parentCssSelector: string, classNames: string,
|
|
617
|
-
protected getButtonTitleBy(title: string):
|
|
580
|
+
protected constructor(parentCssSelector: string, classNames: string, page: Page);
|
|
581
|
+
protected getButtonTitleBy(title: string): string;
|
|
618
582
|
isVisible(): Promise<boolean>;
|
|
619
583
|
}
|
|
620
584
|
|
|
621
585
|
declare class ContextMenu extends DXContextMenuList {
|
|
622
586
|
private readonly _formName;
|
|
623
|
-
private _initFn
|
|
624
|
-
constructor(cssClass: string, formName: string,
|
|
587
|
+
private _initFn?;
|
|
588
|
+
constructor(cssClass: string, formName: string, page: Page);
|
|
625
589
|
setInit(cb: () => Promise<void>): this;
|
|
626
|
-
protected getButtonNameBy(name: string):
|
|
590
|
+
protected getButtonNameBy(name: string): string;
|
|
627
591
|
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
628
592
|
clickButton(name: string | string[]): Promise<void>;
|
|
629
593
|
}
|
|
@@ -635,7 +599,7 @@ interface ConstructorParams {
|
|
|
635
599
|
contextMenuCssSelector: string;
|
|
636
600
|
tableContentCssSelector: string;
|
|
637
601
|
formName: string;
|
|
638
|
-
|
|
602
|
+
page: Page;
|
|
639
603
|
}
|
|
640
604
|
declare class Table extends AbstractElementWithParent {
|
|
641
605
|
protected formName: string;
|
|
@@ -643,7 +607,7 @@ declare class Table extends AbstractElementWithParent {
|
|
|
643
607
|
protected contextMenuCssSelector: string;
|
|
644
608
|
protected fixedTableContentCssSelector: string;
|
|
645
609
|
protected tableContentCssSelector: string;
|
|
646
|
-
constructor({ parentCssSelector, contextMenuCssSelector, tableContentCssSelector, headerCssSelector, fixedTableContentCssSelector, formName,
|
|
610
|
+
constructor({ parentCssSelector, contextMenuCssSelector, tableContentCssSelector, headerCssSelector, fixedTableContentCssSelector, formName, page }: ConstructorParams);
|
|
647
611
|
private getColumnBy;
|
|
648
612
|
/**
|
|
649
613
|
* Отримати рядок по індексу.
|
|
@@ -654,8 +618,8 @@ declare class Table extends AbstractElementWithParent {
|
|
|
654
618
|
* @param index починається з 0
|
|
655
619
|
*/
|
|
656
620
|
getColumnByIndex(index: number): Column;
|
|
657
|
-
getColumnByTitle
|
|
658
|
-
getColumnByName
|
|
621
|
+
getColumnByTitle(title: string): Column;
|
|
622
|
+
getColumnByName(name: string): Column;
|
|
659
623
|
/**
|
|
660
624
|
* Вибрати рядок по індексу.
|
|
661
625
|
* @param index починається з 0
|
|
@@ -667,10 +631,10 @@ declare class Table extends AbstractElementWithParent {
|
|
|
667
631
|
* @param indexes починається з 0
|
|
668
632
|
*/
|
|
669
633
|
selectRowsByIndexes(indexes: number[]): Promise<void>;
|
|
670
|
-
protected getRowElements(
|
|
634
|
+
protected getRowElements(): Locator;
|
|
671
635
|
getRows(): Promise<Row[]>;
|
|
672
636
|
getColumns(): Promise<Column[]>;
|
|
673
|
-
element():
|
|
637
|
+
element(): Locator;
|
|
674
638
|
/**
|
|
675
639
|
* Находит поле когда форма находится в состоянии редактирования
|
|
676
640
|
* @example
|
|
@@ -710,7 +674,7 @@ declare class Table extends AbstractElementWithParent {
|
|
|
710
674
|
* @returns {Promise<string>} Повертає значення комірки
|
|
711
675
|
*
|
|
712
676
|
* @example
|
|
713
|
-
* const table = new Table(
|
|
677
|
+
* const table = new Table(page);
|
|
714
678
|
*
|
|
715
679
|
* // Отримання значення комірки 'Name' в першому рядку (індекс 0)
|
|
716
680
|
* const cellValue = await table.getCellValueByCellName('Name', 0);
|
|
@@ -723,7 +687,7 @@ declare class Table extends AbstractElementWithParent {
|
|
|
723
687
|
* @returns {Promise<boolean>} Повертає true, якщо таблиця порожня, false - якщо містить рядки
|
|
724
688
|
*
|
|
725
689
|
* @example
|
|
726
|
-
* const table = new Table(
|
|
690
|
+
* const table = new Table(page);
|
|
727
691
|
*
|
|
728
692
|
* // Перевірка чи порожня таблиця
|
|
729
693
|
* const empty = await table.isEmpty();
|
|
@@ -739,7 +703,7 @@ declare class Table extends AbstractElementWithParent {
|
|
|
739
703
|
* @throws {Error} Викидає помилку, якщо очікування перевищує тайм-аут
|
|
740
704
|
*
|
|
741
705
|
* @example
|
|
742
|
-
* const table = new Table(
|
|
706
|
+
* const table = new Table(page);
|
|
743
707
|
*
|
|
744
708
|
* // Очікування, поки таблиця не стане порожньою
|
|
745
709
|
* await table.waitRowsCount(0);
|
|
@@ -754,7 +718,7 @@ declare class Table extends AbstractElementWithParent {
|
|
|
754
718
|
declare class FormFilterField extends AbstractEditor {
|
|
755
719
|
private readonly formName;
|
|
756
720
|
private readonly name;
|
|
757
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
721
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
758
722
|
/**
|
|
759
723
|
* Возвращает значение в поле
|
|
760
724
|
* @example
|
|
@@ -817,7 +781,7 @@ declare class FormFilterField extends AbstractEditor {
|
|
|
817
781
|
declare class PanelFilterField extends AbstractEditor {
|
|
818
782
|
private readonly formName;
|
|
819
783
|
private readonly name;
|
|
820
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
784
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
821
785
|
/**
|
|
822
786
|
* Возвращает значение в поле
|
|
823
787
|
* @example
|
|
@@ -881,7 +845,7 @@ declare class FilterPanel extends AbstractElement {
|
|
|
881
845
|
private readonly _formName;
|
|
882
846
|
private get filterPanelSelector();
|
|
883
847
|
private filterPanelButtons;
|
|
884
|
-
constructor(formName: string,
|
|
848
|
+
constructor(formName: string, page: Page);
|
|
885
849
|
/**
|
|
886
850
|
* Возвращает фильтр на панели фильтрации
|
|
887
851
|
* @returns {PanelFilterField}
|
|
@@ -896,7 +860,7 @@ declare class FilterPanel extends AbstractElement {
|
|
|
896
860
|
}
|
|
897
861
|
|
|
898
862
|
declare class HeaderFilterField extends AbstractEditor {
|
|
899
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
863
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
900
864
|
getValue(): Promise<any>;
|
|
901
865
|
setValue(value: any): Promise<void>;
|
|
902
866
|
clear(): Promise<void>;
|
|
@@ -908,11 +872,12 @@ declare class HeaderFilterField extends AbstractEditor {
|
|
|
908
872
|
interface IFilterOperations {
|
|
909
873
|
parentCssSelector: string;
|
|
910
874
|
filterTestID: string;
|
|
911
|
-
|
|
875
|
+
page: Page;
|
|
912
876
|
}
|
|
913
877
|
declare class FilterOperation extends AbstractElementWithParent {
|
|
914
878
|
private readonly _testId;
|
|
915
|
-
constructor({ parentCssSelector, filterTestID,
|
|
879
|
+
constructor({ parentCssSelector, filterTestID, page }: IFilterOperations);
|
|
880
|
+
private popup;
|
|
916
881
|
private initOperationWidget;
|
|
917
882
|
setOperation(operationName: string): Promise<void>;
|
|
918
883
|
getOperation(): Promise<any>;
|
|
@@ -920,15 +885,16 @@ declare class FilterOperation extends AbstractElementWithParent {
|
|
|
920
885
|
getIsBlank(): Promise<boolean>;
|
|
921
886
|
}
|
|
922
887
|
|
|
923
|
-
declare class ColumnFilter
|
|
888
|
+
declare class ColumnFilter {
|
|
924
889
|
private readonly _formName;
|
|
925
890
|
private readonly _name;
|
|
926
|
-
private _column;
|
|
927
|
-
|
|
891
|
+
private readonly _column;
|
|
892
|
+
private readonly page;
|
|
893
|
+
constructor(formName: string, name: string, column: Column, page: Page);
|
|
928
894
|
private getApplyButton;
|
|
929
895
|
private getCancelButton;
|
|
930
|
-
|
|
931
|
-
|
|
896
|
+
private apply;
|
|
897
|
+
private cancel;
|
|
932
898
|
protected initFilter(): Promise<HeaderFilterField>;
|
|
933
899
|
/**
|
|
934
900
|
* Возвращает значение в поле
|
|
@@ -972,7 +938,7 @@ declare class ColumnFilter extends AbstractElement {
|
|
|
972
938
|
* @example
|
|
973
939
|
* expect(await form.columnFilter('NumberFld').getOperation()).toBe("=");
|
|
974
940
|
*/
|
|
975
|
-
getOperation(): Promise<
|
|
941
|
+
getOperation(): Promise<string>;
|
|
976
942
|
/**
|
|
977
943
|
* Устанавливает операцию 'isblank' для фильтра
|
|
978
944
|
* @example
|
|
@@ -994,7 +960,7 @@ declare class ListForm extends Form {
|
|
|
994
960
|
protected fixedTableContentCssSelector: string;
|
|
995
961
|
protected tableContentCssSelector: string;
|
|
996
962
|
protected contextMenuCssSelector: string;
|
|
997
|
-
constructor(
|
|
963
|
+
constructor(page: Page);
|
|
998
964
|
/**
|
|
999
965
|
* Находит таблицу
|
|
1000
966
|
* @example
|
|
@@ -1032,11 +998,11 @@ declare class ListForm extends Form {
|
|
|
1032
998
|
}
|
|
1033
999
|
|
|
1034
1000
|
declare class TreeView extends ListForm {
|
|
1035
|
-
constructor(
|
|
1001
|
+
constructor(page: Page);
|
|
1036
1002
|
}
|
|
1037
1003
|
|
|
1038
1004
|
declare class ReportForm extends FormEdit {
|
|
1039
|
-
constructor(
|
|
1005
|
+
constructor(page: Page);
|
|
1040
1006
|
/**
|
|
1041
1007
|
* Знаходить поле/фільтр у формі репорту за ім'ям
|
|
1042
1008
|
* @example
|
|
@@ -1049,13 +1015,13 @@ declare class ReportForm extends FormEdit {
|
|
|
1049
1015
|
|
|
1050
1016
|
declare class DialogButton extends AbstractButton implements Button {
|
|
1051
1017
|
private readonly text;
|
|
1052
|
-
constructor(parentCssSelector: string, text: string,
|
|
1053
|
-
|
|
1018
|
+
constructor(parentCssSelector: string, text: string, page: Page);
|
|
1019
|
+
getLocator(): Locator;
|
|
1054
1020
|
protected buttonNotDisplayedError(): string;
|
|
1055
1021
|
getTitle(): Promise<string>;
|
|
1056
1022
|
}
|
|
1057
1023
|
declare class Dialog extends AbstractElement {
|
|
1058
|
-
constructor(
|
|
1024
|
+
constructor(page: Page);
|
|
1059
1025
|
private get titleSelector();
|
|
1060
1026
|
private get textSelector();
|
|
1061
1027
|
private get buttonsSelector();
|
|
@@ -1066,4 +1032,4 @@ declare class Dialog extends AbstractElement {
|
|
|
1066
1032
|
|
|
1067
1033
|
declare function ApiRequest(objectName: string, operation: string): any;
|
|
1068
1034
|
|
|
1069
|
-
export { AbstractPage, ApiRequest, ControlClass, Dialog, type Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, LoginPage, NumberEditor, PanelFilterField, ReportForm, SubsystemsPanel, TextEditor, TreeView, byTestId, byTestIdCssSelector,
|
|
1035
|
+
export { AbstractPage, ApiRequest, ControlClass, Dialog, type Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, LoginPage, NumberEditor, PanelFilterField, ReportForm, SubsystemsPanel, TextEditor, TreeView, byTestId, byTestIdCssSelector, config, disabledLocator, editorFactory, readonlyLocator, wait, waitElementIsVisible };
|