d5-testing-library 2.0.0-alpha.0 → 2.0.0-alpha.10
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/README.md +1 -1
- package/dist/FormEdit-QX5S7TDU.mjs +6 -0
- package/dist/ListForm-4DCCOHKJ.mjs +6 -0
- package/dist/TreeView-RDCA3LGU.mjs +6 -0
- package/dist/chunk-GSTA5R4B.mjs +6383 -0
- package/dist/cjs/d5-testing-library.cjs +1377 -1469
- package/dist/cjs/d5-testing-library.d.ts +154 -165
- package/dist/d5-testing-library.d.mts +154 -165
- 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,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Locator, Page } 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
|
-
declare abstract class AbstractElement {
|
|
19
|
-
|
|
12
|
+
declare abstract class AbstractElement<TLocator extends Locator | Promise<Locator> = Locator> {
|
|
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
|
+
protected syncLocator(): Locator;
|
|
19
|
+
getLocator(): TLocator;
|
|
25
20
|
getAttribute(attr: string): Promise<string>;
|
|
26
21
|
getClasses(): Promise<string>;
|
|
27
22
|
getDataTestId(): Promise<string>;
|
|
@@ -30,8 +25,7 @@ declare abstract class AbstractElement {
|
|
|
30
25
|
|
|
31
26
|
declare abstract class AbstractPage extends AbstractElement {
|
|
32
27
|
protected url: string;
|
|
33
|
-
|
|
34
|
-
constructor(driver: WebDriver);
|
|
28
|
+
constructor(page: Page);
|
|
35
29
|
private prependHash;
|
|
36
30
|
protected goToUrl(url: string): Promise<void>;
|
|
37
31
|
protected get path(): string;
|
|
@@ -40,16 +34,12 @@ declare abstract class AbstractPage extends AbstractElement {
|
|
|
40
34
|
}
|
|
41
35
|
|
|
42
36
|
declare class LoginPage extends AbstractPage {
|
|
43
|
-
usernameField: By;
|
|
44
|
-
passwordField: By;
|
|
45
|
-
loginButton: By;
|
|
46
37
|
locate(): Promise<void>;
|
|
47
38
|
get path(): string;
|
|
48
39
|
enterUsername(username: string): Promise<void>;
|
|
49
40
|
enterPassword(password: string): Promise<void>;
|
|
50
41
|
clickLoginButton(): Promise<void>;
|
|
51
42
|
loginWith(username: string, password: string): Promise<void>;
|
|
52
|
-
authorize(): Promise<void>;
|
|
53
43
|
}
|
|
54
44
|
|
|
55
45
|
declare const byTestIdCssSelector: (testId: string, element?: string) => string;
|
|
@@ -58,75 +48,46 @@ declare const byTestIdCssSelector: (testId: string, element?: string) => string;
|
|
|
58
48
|
*
|
|
59
49
|
* @param {string} testId - The test ID of the element.
|
|
60
50
|
* @param {string} [element='div'] - The HTML tag name of the element (optional).
|
|
61
|
-
* @returns {
|
|
51
|
+
* @returns {string} - Path string.
|
|
62
52
|
*/
|
|
63
|
-
declare const byTestId: (testId: string, element?: string) =>
|
|
53
|
+
declare const byTestId: (testId: string, element?: string) => string;
|
|
64
54
|
declare const readonlyLocator = "readonly";
|
|
65
55
|
declare const disabledLocator = "disabled";
|
|
66
56
|
|
|
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;
|
|
57
|
+
type WithLocator = {
|
|
58
|
+
locator: Locator;
|
|
100
59
|
};
|
|
101
60
|
type Args = {
|
|
102
61
|
timeout?: number;
|
|
103
62
|
errorMessage?: string;
|
|
104
|
-
driver: WebDriver;
|
|
105
63
|
};
|
|
106
|
-
type
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
64
|
+
type ArgsWithWithLocator = Args & WithLocator;
|
|
65
|
+
/**
|
|
66
|
+
* Waits until a specified web element is visible within a given timeout.
|
|
67
|
+
*
|
|
68
|
+
* @param {ArgsWithWithLocator} params - The parameters for the wait function.
|
|
69
|
+
* @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.
|
|
70
|
+
* @param {Locator} [params.locator] - The locator of the element to wait for.
|
|
71
|
+
* @returns {Promise<void>} A promise that resolves when the element becomes visible.
|
|
72
|
+
*/
|
|
73
|
+
declare function waitElementIsVisible({ timeout, locator }: ArgsWithWithLocator): Promise<void>;
|
|
110
74
|
|
|
111
|
-
interface
|
|
112
|
-
condition: (
|
|
75
|
+
interface PlaywrightWaitParams {
|
|
76
|
+
condition: () => Promise<boolean>;
|
|
113
77
|
timeout?: number;
|
|
114
78
|
errorMessage?: string;
|
|
115
|
-
|
|
79
|
+
page: Page;
|
|
116
80
|
}
|
|
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
81
|
/**
|
|
122
|
-
*
|
|
82
|
+
* Safely waits for a condition using Playwright, catching any errors and continuing to wait.
|
|
123
83
|
*
|
|
124
|
-
* @param {
|
|
125
|
-
* @param {
|
|
126
|
-
* @
|
|
84
|
+
* @param {function} condition - A function that returns a promise resolving to a boolean indicating if the condition is met.
|
|
85
|
+
* @param {Page} page - The Playwright page instance to use.
|
|
86
|
+
* @param {string} [errorMessage] - The error message to display if the wait times out.
|
|
87
|
+
* @param {number} [timeout] - The maximum time to wait for the condition, in milliseconds.
|
|
88
|
+
* @returns {Promise<void>} A promise that resolves when the condition is met or rejects if timeout occurs.
|
|
127
89
|
*/
|
|
128
|
-
declare
|
|
129
|
-
declare const contextMenu: (webElement: WebElement, driver: WebDriver) => Promise<void>;
|
|
90
|
+
declare function wait(condition: PlaywrightWaitParams['condition'], page: Page, errorMessage?: string, timeout?: number): Promise<void>;
|
|
130
91
|
|
|
131
92
|
interface Editor {
|
|
132
93
|
setValue(value: any): Promise<void>;
|
|
@@ -135,6 +96,7 @@ interface Editor {
|
|
|
135
96
|
clear?(): Promise<void>;
|
|
136
97
|
isReadonly?(): Promise<boolean>;
|
|
137
98
|
isDisabled?(): Promise<boolean>;
|
|
99
|
+
download?(): Promise<string>;
|
|
138
100
|
}
|
|
139
101
|
declare enum ControlClass {
|
|
140
102
|
Text = "text-control",
|
|
@@ -148,16 +110,17 @@ declare enum ControlClass {
|
|
|
148
110
|
SingleDateRange = "single-date-range-control",
|
|
149
111
|
BooleanSelector = "buttons-group",
|
|
150
112
|
ButtonGroup = "button-group-field",
|
|
151
|
-
HeaderFilterDictionary = "header-filter-dictionary"
|
|
113
|
+
HeaderFilterDictionary = "header-filter-dictionary",
|
|
114
|
+
FileUploader = "file-uploader"
|
|
152
115
|
}
|
|
153
116
|
|
|
154
117
|
interface ClearStrategy {
|
|
155
118
|
clear(editor: Editor): Promise<void>;
|
|
156
119
|
}
|
|
157
120
|
|
|
158
|
-
declare abstract class AbstractElementWithParent extends AbstractElement {
|
|
121
|
+
declare abstract class AbstractElementWithParent<TLocator extends Locator | Promise<Locator> = Locator> extends AbstractElement<TLocator> {
|
|
159
122
|
protected parentCssSelector: string;
|
|
160
|
-
constructor(parentCssSelector: string, elementCssSelector: string,
|
|
123
|
+
constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
161
124
|
protected getFullCssSelector(): string;
|
|
162
125
|
isReadonly(): Promise<boolean>;
|
|
163
126
|
isDisabled(): Promise<boolean>;
|
|
@@ -167,8 +130,8 @@ declare abstract class AbstractDXEditorWithInput extends AbstractElementWithPare
|
|
|
167
130
|
private clearStrategy;
|
|
168
131
|
protected setClearStrategy(strategy: ClearStrategy): void;
|
|
169
132
|
protected getInputCssSelector(): string;
|
|
170
|
-
|
|
171
|
-
protected getInputValue(): Promise<string>;
|
|
133
|
+
getInputLocator(): Locator;
|
|
134
|
+
protected getInputValue(): Promise<string | null>;
|
|
172
135
|
protected setInputValue(value: string): Promise<void>;
|
|
173
136
|
clear(): Promise<void>;
|
|
174
137
|
abstract setValue(value: any): Promise<void>;
|
|
@@ -176,35 +139,35 @@ declare abstract class AbstractDXEditorWithInput extends AbstractElementWithPare
|
|
|
176
139
|
}
|
|
177
140
|
|
|
178
141
|
declare class TextEditor extends AbstractDXEditorWithInput {
|
|
179
|
-
constructor(parentCssSelector: string, elementCssSelector: string,
|
|
142
|
+
constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
180
143
|
getValue(): Promise<string | null>;
|
|
181
144
|
setValue(value: string): Promise<void>;
|
|
182
145
|
}
|
|
183
146
|
|
|
184
147
|
declare class NumberEditor extends AbstractDXEditorWithInput {
|
|
185
|
-
constructor(parentCssSelector: string, elementCssSelector: string,
|
|
148
|
+
constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
186
149
|
getValue(): Promise<number | null>;
|
|
187
150
|
setValue(value: any): Promise<void>;
|
|
188
151
|
}
|
|
189
152
|
|
|
190
|
-
declare const editorFactory: (parentCssSelector: string, elementCssSelector: string,
|
|
153
|
+
declare const editorFactory: (parentCssSelector: string, elementCssSelector: string, page: Page) => Promise<Editor>;
|
|
191
154
|
|
|
192
155
|
interface ISubsystemItem {
|
|
193
|
-
|
|
194
|
-
bySelector:
|
|
156
|
+
page: Page;
|
|
157
|
+
bySelector: string;
|
|
195
158
|
}
|
|
196
159
|
declare class SubsystemItem {
|
|
197
160
|
private readonly bySelector;
|
|
198
|
-
private readonly
|
|
199
|
-
constructor({
|
|
200
|
-
getElement():
|
|
161
|
+
private readonly page;
|
|
162
|
+
constructor({ page, bySelector }: ISubsystemItem);
|
|
163
|
+
getElement(): playwright_core.Locator;
|
|
201
164
|
getTitle(): Promise<string>;
|
|
202
165
|
click(): Promise<void>;
|
|
203
166
|
}
|
|
204
167
|
|
|
205
168
|
declare class SubsystemsPanel extends AbstractElement {
|
|
206
169
|
private header;
|
|
207
|
-
constructor(
|
|
170
|
+
constructor(page: Page);
|
|
208
171
|
headerTitle(): Promise<string>;
|
|
209
172
|
protected getSearchComponent(): TextEditor;
|
|
210
173
|
/**
|
|
@@ -252,33 +215,36 @@ declare class SubsystemsPanel extends AbstractElement {
|
|
|
252
215
|
interface Button {
|
|
253
216
|
click(): Promise<void>;
|
|
254
217
|
isDisabled(): Promise<boolean>;
|
|
255
|
-
|
|
218
|
+
isVisible(): Promise<boolean>;
|
|
256
219
|
getTitle(): Promise<string>;
|
|
257
220
|
isPressed?(): Promise<boolean>;
|
|
221
|
+
getLocator(): Locator;
|
|
258
222
|
}
|
|
259
223
|
declare abstract class AbstractButton extends AbstractElementWithParent implements Button {
|
|
260
|
-
protected constructor(parentCssSelector: string, elementCssSelector: string,
|
|
224
|
+
protected constructor(parentCssSelector: string, elementCssSelector: string, page: Page);
|
|
261
225
|
protected abstract buttonNotDisplayedError(): string;
|
|
226
|
+
protected get button(): Locator;
|
|
227
|
+
getLocator(): Locator;
|
|
262
228
|
click(): Promise<void>;
|
|
263
229
|
isDisabled(): Promise<boolean>;
|
|
264
|
-
|
|
230
|
+
isVisible(): Promise<boolean>;
|
|
265
231
|
isPressed(): Promise<boolean>;
|
|
266
232
|
abstract getTitle(): Promise<string>;
|
|
267
233
|
}
|
|
268
234
|
|
|
269
235
|
declare abstract class DXButton extends AbstractButton {
|
|
270
|
-
protected getText(): Promise<string>;
|
|
236
|
+
protected getText(): Promise<string | null>;
|
|
271
237
|
}
|
|
272
238
|
|
|
273
239
|
declare class FormButton extends DXButton {
|
|
274
240
|
private readonly name;
|
|
275
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
241
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
276
242
|
protected buttonNotDisplayedError(): string;
|
|
277
243
|
getTitle(): Promise<string>;
|
|
278
244
|
}
|
|
279
245
|
|
|
280
246
|
interface Group<TItem = unknown> {
|
|
281
|
-
|
|
247
|
+
isVisible(): Promise<boolean>;
|
|
282
248
|
click?(): Promise<void>;
|
|
283
249
|
itemClick?(name: string): Promise<void>;
|
|
284
250
|
item?(name: string): TItem;
|
|
@@ -287,14 +253,14 @@ interface Group<TItem = unknown> {
|
|
|
287
253
|
|
|
288
254
|
declare class FormGroup extends AbstractElementWithParent implements Group {
|
|
289
255
|
private groupInstance;
|
|
290
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
256
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
291
257
|
private initInstance;
|
|
292
258
|
/**
|
|
293
259
|
* Возвращает булевое значение доступна ли группа
|
|
294
260
|
* @example
|
|
295
|
-
* expect(await tableList.group('MainSuperPanel').
|
|
261
|
+
* expect(await tableList.group('MainSuperPanel').isVisible();
|
|
296
262
|
*/
|
|
297
|
-
|
|
263
|
+
isVisible(): Promise<boolean>;
|
|
298
264
|
/**
|
|
299
265
|
* Клик по элементам группы.
|
|
300
266
|
* Метод работает если у группы есть дочерние элементы, например элементы аккордеона или вкладки таб панели.
|
|
@@ -317,11 +283,11 @@ declare class FormGroup extends AbstractElementWithParent implements Group {
|
|
|
317
283
|
isActive(): Promise<boolean>;
|
|
318
284
|
}
|
|
319
285
|
|
|
320
|
-
declare class AbstractForm extends AbstractPage {
|
|
286
|
+
declare abstract class AbstractForm extends AbstractPage {
|
|
321
287
|
protected containerCssSelector: string;
|
|
322
288
|
private _formName;
|
|
323
|
-
protected
|
|
324
|
-
protected
|
|
289
|
+
protected get container(): Locator;
|
|
290
|
+
protected constructor(page: Page);
|
|
325
291
|
set formName(name: string);
|
|
326
292
|
get formName(): string;
|
|
327
293
|
/**
|
|
@@ -349,7 +315,7 @@ interface SubFormOptions {
|
|
|
349
315
|
}
|
|
350
316
|
declare abstract class Form extends AbstractForm {
|
|
351
317
|
protected popupContainerCssSelector: string;
|
|
352
|
-
protected constructor(
|
|
318
|
+
protected constructor(page: Page);
|
|
353
319
|
protected isModal(): Promise<boolean>;
|
|
354
320
|
protected isFullScreen(): Promise<boolean>;
|
|
355
321
|
/**
|
|
@@ -358,6 +324,7 @@ declare abstract class Form extends AbstractForm {
|
|
|
358
324
|
* const listForm = new MyForm();
|
|
359
325
|
* //...
|
|
360
326
|
* expect(await listForm.getTitleText()).toBe('MyFormTitle');
|
|
327
|
+
* Получение заголовка на форме
|
|
361
328
|
*/
|
|
362
329
|
getTitleText(): Promise<string>;
|
|
363
330
|
protected setSubFormMode(): void;
|
|
@@ -370,19 +337,26 @@ declare abstract class Form extends AbstractForm {
|
|
|
370
337
|
* expect(await form.subForm(name));
|
|
371
338
|
*/
|
|
372
339
|
subForm(name: string, options?: SubFormOptions): Promise<unknown>;
|
|
340
|
+
protected getContainerElement(): Locator;
|
|
373
341
|
}
|
|
374
342
|
|
|
375
343
|
declare class EditorButton extends AbstractElementWithParent {
|
|
376
344
|
private readonly name;
|
|
377
|
-
constructor(parentCssSelector: string, name: string,
|
|
345
|
+
constructor(parentCssSelector: string, name: string, page: Page);
|
|
378
346
|
protected buttonNotDisplayedError(): string;
|
|
379
347
|
click(): Promise<void>;
|
|
380
|
-
|
|
348
|
+
isVisible(): Promise<boolean>;
|
|
381
349
|
}
|
|
382
350
|
|
|
383
351
|
declare class AbstractEditor extends AbstractElementWithParent implements Editor {
|
|
384
352
|
protected editor: Editor;
|
|
385
|
-
|
|
353
|
+
protected _titleCssSelector: string;
|
|
354
|
+
constructor({ parentCssSelector, elementCssSelector, titleCssSelector, page }: {
|
|
355
|
+
parentCssSelector: string;
|
|
356
|
+
elementCssSelector: string;
|
|
357
|
+
titleCssSelector: string;
|
|
358
|
+
page: Page;
|
|
359
|
+
});
|
|
386
360
|
protected initEditor(): Promise<void>;
|
|
387
361
|
/**
|
|
388
362
|
* Возвращает значение в поле
|
|
@@ -425,12 +399,12 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
425
399
|
*/
|
|
426
400
|
isDisabled(): Promise<boolean>;
|
|
427
401
|
/**
|
|
428
|
-
* Возвращает значение true|false в зависимости
|
|
402
|
+
* Возвращает значение true|false в зависимости isVisible поле или нет
|
|
429
403
|
* @example
|
|
430
|
-
* expect(await formEdit.field('NumberFld').
|
|
431
|
-
* expect(await formEdit.field('TextFld').
|
|
404
|
+
* expect(await formEdit.field('NumberFld').isVisible()).toBe(true);
|
|
405
|
+
* expect(await formEdit.field('TextFld').isVisible()).toBe(false);
|
|
432
406
|
*/
|
|
433
|
-
|
|
407
|
+
isVisible(): Promise<boolean>;
|
|
434
408
|
/**
|
|
435
409
|
* Находит кнопку на поле по имени
|
|
436
410
|
* @example
|
|
@@ -439,16 +413,30 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
439
413
|
* await form.field('Name').button('editorButton).click()
|
|
440
414
|
*/
|
|
441
415
|
button(name: string): EditorButton;
|
|
416
|
+
/**
|
|
417
|
+
* Повертає загловок едітора
|
|
418
|
+
* @example
|
|
419
|
+
* expect(await formEdit.field('NumberFld').title()).toBe('Title1');
|
|
420
|
+
* expect(await formEdit.field('TextFld').title()).toBe('Title2`);
|
|
421
|
+
*/
|
|
422
|
+
title(): Promise<string>;
|
|
423
|
+
/**
|
|
424
|
+
* Вивантажує файл і повертає назву файла. Доступний тільки для поля FileUploader.
|
|
425
|
+
* @example
|
|
426
|
+
* const fileName = await formEdit.field('FileField').downloadFile();
|
|
427
|
+
* expect(filename()).toBe('file.pdf');
|
|
428
|
+
*/
|
|
429
|
+
download(): Promise<string>;
|
|
442
430
|
}
|
|
443
431
|
|
|
444
432
|
declare class FormField extends AbstractEditor {
|
|
445
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
433
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
446
434
|
}
|
|
447
435
|
|
|
448
436
|
declare class FormEdit extends Form {
|
|
449
437
|
saveButtonId: string;
|
|
450
438
|
closeButtonId: string;
|
|
451
|
-
constructor(
|
|
439
|
+
constructor(page: Page);
|
|
452
440
|
private getButtonCssSelector;
|
|
453
441
|
/**
|
|
454
442
|
* Находит поле формы редактирования по имени
|
|
@@ -485,36 +473,35 @@ declare class FormEdit extends Form {
|
|
|
485
473
|
}
|
|
486
474
|
|
|
487
475
|
declare abstract class AbstractDropDownMenuList extends AbstractElementWithParent {
|
|
488
|
-
protected abstract getButtonNameBy(name: string):
|
|
489
|
-
protected abstract getButtonTitleBy(name: string):
|
|
490
|
-
protected buttonNotDisplayedError(name: string): string;
|
|
476
|
+
protected abstract getButtonNameBy(name: string): string;
|
|
477
|
+
protected abstract getButtonTitleBy(name: string): string;
|
|
491
478
|
private clickItemBy;
|
|
492
479
|
private getElementByPath;
|
|
493
480
|
clickButton(name: string | string[]): Promise<void>;
|
|
494
481
|
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
495
|
-
getMenuItemElementByTitle(title: string | string[]): Promise<
|
|
496
|
-
getMenuItemElementByName(name: string | string[]): Promise<
|
|
482
|
+
getMenuItemElementByTitle(title: string | string[]): Promise<Locator>;
|
|
483
|
+
getMenuItemElementByName(name: string | string[]): Promise<Locator>;
|
|
497
484
|
isVisible(): Promise<boolean>;
|
|
498
485
|
}
|
|
499
486
|
|
|
500
487
|
declare abstract class AbstractDropDownMenuButton extends AbstractElementWithParent {
|
|
501
488
|
private readonly _list;
|
|
502
|
-
protected constructor(parentCssSelector: string, elementCssSelector: string, list: AbstractDropDownMenuList,
|
|
489
|
+
protected constructor(parentCssSelector: string, elementCssSelector: string, list: AbstractDropDownMenuList, page: Page);
|
|
503
490
|
protected openDropdownMenu(): Promise<void>;
|
|
504
491
|
clickButton(name: string | string[]): Promise<void>;
|
|
505
492
|
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
506
|
-
getMenuItemElementByTitle(title: string | string[]): Promise<
|
|
507
|
-
getMenuItemElementByName(name: string | string[]): Promise<
|
|
493
|
+
getMenuItemElementByTitle(title: string | string[]): Promise<Locator>;
|
|
494
|
+
getMenuItemElementByName(name: string | string[]): Promise<Locator>;
|
|
508
495
|
}
|
|
509
496
|
|
|
510
497
|
declare class ToolbarMenu extends AbstractDropDownMenuButton {
|
|
511
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
498
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
512
499
|
private checkNameValue;
|
|
513
500
|
private checkTitleValue;
|
|
514
501
|
private buttonByName;
|
|
515
502
|
private buttonByTitle;
|
|
516
|
-
|
|
517
|
-
|
|
503
|
+
buttonIsVisible(name: string | string[]): Promise<boolean>;
|
|
504
|
+
buttonByTitleIsVisible(title: string | string[]): Promise<boolean>;
|
|
518
505
|
buttonTitle(name: string | string[]): Promise<string>;
|
|
519
506
|
buttonIsDisabled(name: string | string[]): Promise<boolean>;
|
|
520
507
|
buttonByTitleIsDisabled(title: string | string[]): Promise<boolean>;
|
|
@@ -526,27 +513,27 @@ declare class ToolbarItem extends AbstractElementWithParent implements Button {
|
|
|
526
513
|
private _button;
|
|
527
514
|
private readonly _formName;
|
|
528
515
|
private readonly _itemName;
|
|
529
|
-
constructor(parentCssSelector: string, formName: string, itemName: string,
|
|
516
|
+
constructor(parentCssSelector: string, formName: string, itemName: string, page: Page);
|
|
530
517
|
private init;
|
|
531
518
|
click(): Promise<void>;
|
|
532
519
|
isDisabled(): Promise<boolean>;
|
|
533
|
-
|
|
520
|
+
isVisible(): Promise<boolean>;
|
|
534
521
|
isPressed(): Promise<boolean>;
|
|
535
522
|
getTitle(): Promise<string>;
|
|
536
523
|
get menu(): ToolbarMenu;
|
|
537
524
|
}
|
|
538
525
|
|
|
539
|
-
declare class Cell extends AbstractElementWithParent {
|
|
526
|
+
declare class Cell extends AbstractElementWithParent<Promise<Locator>> {
|
|
540
527
|
private _index;
|
|
541
|
-
private getCellIndex;
|
|
542
|
-
constructor(parentCssSelector: string, getCellIndex: () => Promise<number>,
|
|
528
|
+
private readonly getCellIndex;
|
|
529
|
+
constructor(parentCssSelector: string, getCellIndex: () => Promise<number>, page: Page, index?: number);
|
|
543
530
|
private set index(value);
|
|
544
531
|
private getBooleanValue;
|
|
545
532
|
private getTagsValue;
|
|
546
533
|
private getNumberValue;
|
|
547
534
|
private getDateValue;
|
|
548
|
-
|
|
549
|
-
getValue(): Promise<string | number | 1 | 0 | string[] | Date | Date[]>;
|
|
535
|
+
getLocator(): Promise<Locator>;
|
|
536
|
+
getValue(): Promise<string | number | 1 | 0 | string[] | Date | Date[] | null>;
|
|
550
537
|
getIndex(): number;
|
|
551
538
|
}
|
|
552
539
|
|
|
@@ -556,17 +543,17 @@ interface ConstructorParams$1 {
|
|
|
556
543
|
name?: string;
|
|
557
544
|
caption?: string;
|
|
558
545
|
index?: number;
|
|
559
|
-
|
|
546
|
+
page: Page;
|
|
560
547
|
}
|
|
561
|
-
declare class Column extends AbstractElementWithParent {
|
|
548
|
+
declare class Column extends AbstractElementWithParent<Promise<Locator>> {
|
|
562
549
|
private _index;
|
|
563
550
|
private _caption;
|
|
564
551
|
private _name;
|
|
565
552
|
protected headerCssSelector: string | undefined;
|
|
566
|
-
constructor({ parentCssSelector, headerCssSelector, name, caption, index,
|
|
553
|
+
constructor({ parentCssSelector, headerCssSelector, name, caption, index, page }: ConstructorParams$1);
|
|
567
554
|
private set index(value);
|
|
568
555
|
private get index();
|
|
569
|
-
|
|
556
|
+
getLocator(): Promise<Locator>;
|
|
570
557
|
private getColumnHeaderIndexBy;
|
|
571
558
|
private getIndexByCaption;
|
|
572
559
|
private getIndexByName;
|
|
@@ -585,10 +572,10 @@ declare class Row extends AbstractElementWithParent {
|
|
|
585
572
|
* @param parentCssSelector
|
|
586
573
|
* @param fixedTableContentCssSelector
|
|
587
574
|
* @param index починається з 0 (в getCssRowByIndexSelector додається +1)
|
|
588
|
-
* @param
|
|
575
|
+
* @param page
|
|
589
576
|
* @param getColumnBy
|
|
590
577
|
*/
|
|
591
|
-
constructor(parentCssSelector: string, fixedTableContentCssSelector: string, index: number,
|
|
578
|
+
constructor(parentCssSelector: string, fixedTableContentCssSelector: string, index: number, page: Page, getColumnBy?: (_: {
|
|
592
579
|
title?: string;
|
|
593
580
|
name?: string;
|
|
594
581
|
}) => Column);
|
|
@@ -611,19 +598,19 @@ declare abstract class DXContextMenuList extends AbstractDropDownMenuList {
|
|
|
611
598
|
/**
|
|
612
599
|
* @param parentCssSelector
|
|
613
600
|
* @param classNames - Список класів. Починається з крапки
|
|
614
|
-
* @param
|
|
601
|
+
* @param page
|
|
615
602
|
*/
|
|
616
|
-
protected constructor(parentCssSelector: string, classNames: string,
|
|
617
|
-
protected getButtonTitleBy(title: string):
|
|
603
|
+
protected constructor(parentCssSelector: string, classNames: string, page: Page);
|
|
604
|
+
protected getButtonTitleBy(title: string): string;
|
|
618
605
|
isVisible(): Promise<boolean>;
|
|
619
606
|
}
|
|
620
607
|
|
|
621
608
|
declare class ContextMenu extends DXContextMenuList {
|
|
622
609
|
private readonly _formName;
|
|
623
|
-
private _initFn
|
|
624
|
-
constructor(cssClass: string, formName: string,
|
|
610
|
+
private _initFn?;
|
|
611
|
+
constructor(cssClass: string, formName: string, page: Page);
|
|
625
612
|
setInit(cb: () => Promise<void>): this;
|
|
626
|
-
protected getButtonNameBy(name: string):
|
|
613
|
+
protected getButtonNameBy(name: string): string;
|
|
627
614
|
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
628
615
|
clickButton(name: string | string[]): Promise<void>;
|
|
629
616
|
}
|
|
@@ -635,7 +622,7 @@ interface ConstructorParams {
|
|
|
635
622
|
contextMenuCssSelector: string;
|
|
636
623
|
tableContentCssSelector: string;
|
|
637
624
|
formName: string;
|
|
638
|
-
|
|
625
|
+
page: Page;
|
|
639
626
|
}
|
|
640
627
|
declare class Table extends AbstractElementWithParent {
|
|
641
628
|
protected formName: string;
|
|
@@ -643,7 +630,7 @@ declare class Table extends AbstractElementWithParent {
|
|
|
643
630
|
protected contextMenuCssSelector: string;
|
|
644
631
|
protected fixedTableContentCssSelector: string;
|
|
645
632
|
protected tableContentCssSelector: string;
|
|
646
|
-
constructor({ parentCssSelector, contextMenuCssSelector, tableContentCssSelector, headerCssSelector, fixedTableContentCssSelector, formName,
|
|
633
|
+
constructor({ parentCssSelector, contextMenuCssSelector, tableContentCssSelector, headerCssSelector, fixedTableContentCssSelector, formName, page }: ConstructorParams);
|
|
647
634
|
private getColumnBy;
|
|
648
635
|
/**
|
|
649
636
|
* Отримати рядок по індексу.
|
|
@@ -654,8 +641,8 @@ declare class Table extends AbstractElementWithParent {
|
|
|
654
641
|
* @param index починається з 0
|
|
655
642
|
*/
|
|
656
643
|
getColumnByIndex(index: number): Column;
|
|
657
|
-
getColumnByTitle
|
|
658
|
-
getColumnByName
|
|
644
|
+
getColumnByTitle(title: string): Column;
|
|
645
|
+
getColumnByName(name: string): Column;
|
|
659
646
|
/**
|
|
660
647
|
* Вибрати рядок по індексу.
|
|
661
648
|
* @param index починається з 0
|
|
@@ -667,10 +654,10 @@ declare class Table extends AbstractElementWithParent {
|
|
|
667
654
|
* @param indexes починається з 0
|
|
668
655
|
*/
|
|
669
656
|
selectRowsByIndexes(indexes: number[]): Promise<void>;
|
|
670
|
-
protected getRowElements(
|
|
657
|
+
protected getRowElements(): Locator;
|
|
671
658
|
getRows(): Promise<Row[]>;
|
|
672
659
|
getColumns(): Promise<Column[]>;
|
|
673
|
-
element():
|
|
660
|
+
element(): Locator;
|
|
674
661
|
/**
|
|
675
662
|
* Находит поле когда форма находится в состоянии редактирования
|
|
676
663
|
* @example
|
|
@@ -710,7 +697,7 @@ declare class Table extends AbstractElementWithParent {
|
|
|
710
697
|
* @returns {Promise<string>} Повертає значення комірки
|
|
711
698
|
*
|
|
712
699
|
* @example
|
|
713
|
-
* const table = new Table(
|
|
700
|
+
* const table = new Table(page);
|
|
714
701
|
*
|
|
715
702
|
* // Отримання значення комірки 'Name' в першому рядку (індекс 0)
|
|
716
703
|
* const cellValue = await table.getCellValueByCellName('Name', 0);
|
|
@@ -723,7 +710,7 @@ declare class Table extends AbstractElementWithParent {
|
|
|
723
710
|
* @returns {Promise<boolean>} Повертає true, якщо таблиця порожня, false - якщо містить рядки
|
|
724
711
|
*
|
|
725
712
|
* @example
|
|
726
|
-
* const table = new Table(
|
|
713
|
+
* const table = new Table(page);
|
|
727
714
|
*
|
|
728
715
|
* // Перевірка чи порожня таблиця
|
|
729
716
|
* const empty = await table.isEmpty();
|
|
@@ -739,7 +726,7 @@ declare class Table extends AbstractElementWithParent {
|
|
|
739
726
|
* @throws {Error} Викидає помилку, якщо очікування перевищує тайм-аут
|
|
740
727
|
*
|
|
741
728
|
* @example
|
|
742
|
-
* const table = new Table(
|
|
729
|
+
* const table = new Table(page);
|
|
743
730
|
*
|
|
744
731
|
* // Очікування, поки таблиця не стане порожньою
|
|
745
732
|
* await table.waitRowsCount(0);
|
|
@@ -754,7 +741,7 @@ declare class Table extends AbstractElementWithParent {
|
|
|
754
741
|
declare class FormFilterField extends AbstractEditor {
|
|
755
742
|
private readonly formName;
|
|
756
743
|
private readonly name;
|
|
757
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
744
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
758
745
|
/**
|
|
759
746
|
* Возвращает значение в поле
|
|
760
747
|
* @example
|
|
@@ -817,7 +804,7 @@ declare class FormFilterField extends AbstractEditor {
|
|
|
817
804
|
declare class PanelFilterField extends AbstractEditor {
|
|
818
805
|
private readonly formName;
|
|
819
806
|
private readonly name;
|
|
820
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
807
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
821
808
|
/**
|
|
822
809
|
* Возвращает значение в поле
|
|
823
810
|
* @example
|
|
@@ -881,7 +868,7 @@ declare class FilterPanel extends AbstractElement {
|
|
|
881
868
|
private readonly _formName;
|
|
882
869
|
private get filterPanelSelector();
|
|
883
870
|
private filterPanelButtons;
|
|
884
|
-
constructor(formName: string,
|
|
871
|
+
constructor(formName: string, page: Page);
|
|
885
872
|
/**
|
|
886
873
|
* Возвращает фильтр на панели фильтрации
|
|
887
874
|
* @returns {PanelFilterField}
|
|
@@ -896,7 +883,7 @@ declare class FilterPanel extends AbstractElement {
|
|
|
896
883
|
}
|
|
897
884
|
|
|
898
885
|
declare class HeaderFilterField extends AbstractEditor {
|
|
899
|
-
constructor(parentCssSelector: string, formName: string, name: string,
|
|
886
|
+
constructor(parentCssSelector: string, formName: string, name: string, page: Page);
|
|
900
887
|
getValue(): Promise<any>;
|
|
901
888
|
setValue(value: any): Promise<void>;
|
|
902
889
|
clear(): Promise<void>;
|
|
@@ -908,11 +895,12 @@ declare class HeaderFilterField extends AbstractEditor {
|
|
|
908
895
|
interface IFilterOperations {
|
|
909
896
|
parentCssSelector: string;
|
|
910
897
|
filterTestID: string;
|
|
911
|
-
|
|
898
|
+
page: Page;
|
|
912
899
|
}
|
|
913
900
|
declare class FilterOperation extends AbstractElementWithParent {
|
|
914
901
|
private readonly _testId;
|
|
915
|
-
constructor({ parentCssSelector, filterTestID,
|
|
902
|
+
constructor({ parentCssSelector, filterTestID, page }: IFilterOperations);
|
|
903
|
+
private popup;
|
|
916
904
|
private initOperationWidget;
|
|
917
905
|
setOperation(operationName: string): Promise<void>;
|
|
918
906
|
getOperation(): Promise<any>;
|
|
@@ -920,15 +908,16 @@ declare class FilterOperation extends AbstractElementWithParent {
|
|
|
920
908
|
getIsBlank(): Promise<boolean>;
|
|
921
909
|
}
|
|
922
910
|
|
|
923
|
-
declare class ColumnFilter
|
|
911
|
+
declare class ColumnFilter {
|
|
924
912
|
private readonly _formName;
|
|
925
913
|
private readonly _name;
|
|
926
|
-
private _column;
|
|
927
|
-
|
|
914
|
+
private readonly _column;
|
|
915
|
+
private readonly page;
|
|
916
|
+
constructor(formName: string, name: string, column: Column, page: Page);
|
|
928
917
|
private getApplyButton;
|
|
929
918
|
private getCancelButton;
|
|
930
|
-
|
|
931
|
-
|
|
919
|
+
private apply;
|
|
920
|
+
private cancel;
|
|
932
921
|
protected initFilter(): Promise<HeaderFilterField>;
|
|
933
922
|
/**
|
|
934
923
|
* Возвращает значение в поле
|
|
@@ -972,7 +961,7 @@ declare class ColumnFilter extends AbstractElement {
|
|
|
972
961
|
* @example
|
|
973
962
|
* expect(await form.columnFilter('NumberFld').getOperation()).toBe("=");
|
|
974
963
|
*/
|
|
975
|
-
getOperation(): Promise<
|
|
964
|
+
getOperation(): Promise<string>;
|
|
976
965
|
/**
|
|
977
966
|
* Устанавливает операцию 'isblank' для фильтра
|
|
978
967
|
* @example
|
|
@@ -994,7 +983,7 @@ declare class ListForm extends Form {
|
|
|
994
983
|
protected fixedTableContentCssSelector: string;
|
|
995
984
|
protected tableContentCssSelector: string;
|
|
996
985
|
protected contextMenuCssSelector: string;
|
|
997
|
-
constructor(
|
|
986
|
+
constructor(page: Page);
|
|
998
987
|
/**
|
|
999
988
|
* Находит таблицу
|
|
1000
989
|
* @example
|
|
@@ -1032,11 +1021,11 @@ declare class ListForm extends Form {
|
|
|
1032
1021
|
}
|
|
1033
1022
|
|
|
1034
1023
|
declare class TreeView extends ListForm {
|
|
1035
|
-
constructor(
|
|
1024
|
+
constructor(page: Page);
|
|
1036
1025
|
}
|
|
1037
1026
|
|
|
1038
1027
|
declare class ReportForm extends FormEdit {
|
|
1039
|
-
constructor(
|
|
1028
|
+
constructor(page: Page);
|
|
1040
1029
|
/**
|
|
1041
1030
|
* Знаходить поле/фільтр у формі репорту за ім'ям
|
|
1042
1031
|
* @example
|
|
@@ -1049,13 +1038,13 @@ declare class ReportForm extends FormEdit {
|
|
|
1049
1038
|
|
|
1050
1039
|
declare class DialogButton extends AbstractButton implements Button {
|
|
1051
1040
|
private readonly text;
|
|
1052
|
-
constructor(parentCssSelector: string, text: string,
|
|
1053
|
-
|
|
1041
|
+
constructor(parentCssSelector: string, text: string, page: Page);
|
|
1042
|
+
getLocator(): Locator;
|
|
1054
1043
|
protected buttonNotDisplayedError(): string;
|
|
1055
1044
|
getTitle(): Promise<string>;
|
|
1056
1045
|
}
|
|
1057
1046
|
declare class Dialog extends AbstractElement {
|
|
1058
|
-
constructor(
|
|
1047
|
+
constructor(page: Page);
|
|
1059
1048
|
private get titleSelector();
|
|
1060
1049
|
private get textSelector();
|
|
1061
1050
|
private get buttonsSelector();
|
|
@@ -1066,4 +1055,4 @@ declare class Dialog extends AbstractElement {
|
|
|
1066
1055
|
|
|
1067
1056
|
declare function ApiRequest(objectName: string, operation: string): any;
|
|
1068
1057
|
|
|
1069
|
-
export { AbstractPage, ApiRequest, ControlClass, Dialog, type Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, LoginPage, NumberEditor, PanelFilterField, ReportForm, SubsystemsPanel, TextEditor, TreeView, byTestId, byTestIdCssSelector,
|
|
1058
|
+
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 };
|