d5-testing-library 1.3.0 → 1.4.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/cjs/d5-testing-library.cjs +558 -134
- package/dist/d5-testing-library.d.ts +102 -14
- package/dist/d5-testing-library.legacy-esm.js +553 -133
- package/dist/d5-testing-library.mjs +553 -133
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ declare abstract class AbstractElement {
|
|
|
20
20
|
protected elementCssSelector: string;
|
|
21
21
|
protected constructor(driver?: WebDriver, elementCssSelector?: string);
|
|
22
22
|
protected getFullCssSelector(): string;
|
|
23
|
+
protected joinRelativeCssSelectors(selectors: string[]): string;
|
|
23
24
|
getElement(): Promise<WebElement>;
|
|
24
25
|
getAttribute(attr: string): Promise<string>;
|
|
25
26
|
getClasses(): Promise<string>;
|
|
@@ -59,6 +60,7 @@ declare const byTestIdCssSelector: (testId: string, element?: string) => string;
|
|
|
59
60
|
* @returns {By} - The By locator object.
|
|
60
61
|
*/
|
|
61
62
|
declare const byTestId: (testId: string, element?: string) => By;
|
|
63
|
+
declare const readonlyLocator = "readonly";
|
|
62
64
|
|
|
63
65
|
/**
|
|
64
66
|
* Creates a WebDriver instance for the specified browser.
|
|
@@ -124,6 +126,34 @@ declare class SubsystemsPanel extends AbstractElement {
|
|
|
124
126
|
headerTitle(): Promise<string>;
|
|
125
127
|
}
|
|
126
128
|
|
|
129
|
+
declare abstract class AbstractElementWithParent extends AbstractElement {
|
|
130
|
+
protected parentCssSelector: string;
|
|
131
|
+
constructor(parentCssSelector: string, elementCssSelector: string, driver?: WebDriver);
|
|
132
|
+
protected getFullCssSelector(): string;
|
|
133
|
+
isReadonly(): Promise<boolean>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface Button {
|
|
137
|
+
click(): Promise<void>;
|
|
138
|
+
isDisabled(): Promise<boolean>;
|
|
139
|
+
}
|
|
140
|
+
declare abstract class AbstractButton extends AbstractElementWithParent implements Button {
|
|
141
|
+
protected constructor(parentCssSelector: string, elementCssSelector: string, driver?: WebDriver);
|
|
142
|
+
protected abstract buttonNotDisplayedError(): string;
|
|
143
|
+
click(): Promise<void>;
|
|
144
|
+
isDisabled(): Promise<boolean>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
declare abstract class DXButton extends AbstractButton {
|
|
148
|
+
protected getText(): Promise<string>;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare class FormButton extends DXButton {
|
|
152
|
+
private readonly name;
|
|
153
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver?: WebDriver);
|
|
154
|
+
protected buttonNotDisplayedError(): string;
|
|
155
|
+
}
|
|
156
|
+
|
|
127
157
|
declare abstract class AbstractForm extends AbstractPage {
|
|
128
158
|
protected containerCssSelector: string;
|
|
129
159
|
protected containerBy: By;
|
|
@@ -149,12 +179,7 @@ declare abstract class AbstractForm extends AbstractPage {
|
|
|
149
179
|
* expect(await listForm.getTitleText()).toBe('MyFormTitle');
|
|
150
180
|
*/
|
|
151
181
|
getTitleText(): Promise<string>;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
declare abstract class AbstractElementWithParent extends AbstractElement {
|
|
155
|
-
protected parentCssSelector: string;
|
|
156
|
-
constructor(parentCssSelector: string, elementCssSelector: string, driver?: WebDriver);
|
|
157
|
-
protected getFullCssSelector(): string;
|
|
182
|
+
button(name: string): FormButton;
|
|
158
183
|
}
|
|
159
184
|
|
|
160
185
|
interface Editor {
|
|
@@ -162,6 +187,20 @@ interface Editor {
|
|
|
162
187
|
getValue(): Promise<any>;
|
|
163
188
|
remove?(itemText: string): Promise<void>;
|
|
164
189
|
clear?(): Promise<void>;
|
|
190
|
+
isReadonly?(): Promise<boolean>;
|
|
191
|
+
}
|
|
192
|
+
declare enum ControlClass {
|
|
193
|
+
Text = "text-control",
|
|
194
|
+
TextArea = "text-area-control",
|
|
195
|
+
Number = "number-control",
|
|
196
|
+
CheckBox = "check-box",
|
|
197
|
+
Multiselect = "multi-select-control",
|
|
198
|
+
Select = "select-control",
|
|
199
|
+
Switch = "switch-control",
|
|
200
|
+
Date = "date-control",
|
|
201
|
+
SingleDateRange = "single-date-range-control",
|
|
202
|
+
BooleanSelector = "buttons-group",
|
|
203
|
+
ButtonGroup = "button-group-field"
|
|
165
204
|
}
|
|
166
205
|
|
|
167
206
|
interface ClearStrategy {
|
|
@@ -224,6 +263,13 @@ declare class AbstractEditor extends AbstractElementWithParent implements Editor
|
|
|
224
263
|
* await formEdit.field('TagBox').remove('test');
|
|
225
264
|
*/
|
|
226
265
|
remove(itemText: string): Promise<void>;
|
|
266
|
+
/**
|
|
267
|
+
* Возвращает значение true|false в зависимости readOnly поле или нет
|
|
268
|
+
* @example
|
|
269
|
+
* expect(await formEdit.field('NumberFld').isReadonly()).toBe(true);
|
|
270
|
+
* expect(await formEdit.field('TextFld').isReadonly()).toBe(false);
|
|
271
|
+
*/
|
|
272
|
+
isReadonly(): Promise<boolean>;
|
|
227
273
|
}
|
|
228
274
|
|
|
229
275
|
declare class FormField extends AbstractEditor {
|
|
@@ -248,6 +294,7 @@ declare class FormGroup extends AbstractElementWithParent implements Group {
|
|
|
248
294
|
|
|
249
295
|
declare abstract class FormEdit extends AbstractForm {
|
|
250
296
|
saveButtonBy: By;
|
|
297
|
+
closeButtonBy: By;
|
|
251
298
|
protected constructor(driver?: WebDriver);
|
|
252
299
|
/**
|
|
253
300
|
* Находит поле формы редактирования по имени
|
|
@@ -281,20 +328,36 @@ declare abstract class FormEdit extends AbstractForm {
|
|
|
281
328
|
* await formEdit.saveButtonClick();
|
|
282
329
|
*/
|
|
283
330
|
saveButtonClick(): Promise<void>;
|
|
331
|
+
/**
|
|
332
|
+
* Нажатие на кнопку Закрить
|
|
333
|
+
* @example
|
|
334
|
+
* const formEdit = new MyForm();
|
|
335
|
+
* //...
|
|
336
|
+
* await formEdit.closeButtonClick();
|
|
337
|
+
*/
|
|
338
|
+
closeButtonClick(): Promise<void>;
|
|
284
339
|
}
|
|
285
340
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
341
|
+
declare class ToolbarMenu extends AbstractElementWithParent {
|
|
342
|
+
private readonly _formName;
|
|
343
|
+
constructor(parentCssSelector: string, formName: string, name: string, driver?: WebDriver);
|
|
344
|
+
protected toggle(): Promise<void>;
|
|
345
|
+
protected getCssSelectorToButton(name: string): By;
|
|
346
|
+
protected buttonNotDisplayedError(name: string): string;
|
|
347
|
+
protected goToButton(name: string, selector: By): Promise<void>;
|
|
348
|
+
clickButton(name: string | string[]): Promise<void>;
|
|
349
|
+
clickButtonByTitle(title: string | string[]): Promise<void>;
|
|
289
350
|
}
|
|
290
351
|
|
|
291
352
|
declare class ToolbarItem extends AbstractElementWithParent implements Button {
|
|
292
353
|
private _button;
|
|
293
|
-
private
|
|
354
|
+
private readonly _formName;
|
|
355
|
+
private readonly _itemName;
|
|
294
356
|
constructor(parentCssSelector: string, formName: string, itemName: string, driver?: WebDriver);
|
|
295
357
|
private init;
|
|
296
358
|
click(): Promise<void>;
|
|
297
359
|
isDisabled(): Promise<boolean>;
|
|
360
|
+
get menu(): ToolbarMenu;
|
|
298
361
|
}
|
|
299
362
|
|
|
300
363
|
declare class Cell extends AbstractElementWithParent {
|
|
@@ -303,13 +366,15 @@ declare class Cell extends AbstractElementWithParent {
|
|
|
303
366
|
constructor(parentCssSelector: string, getCellIndex: () => Promise<number>, index?: number, driver?: WebDriver);
|
|
304
367
|
private set index(value);
|
|
305
368
|
private getBooleanValue;
|
|
369
|
+
private getTagsValue;
|
|
306
370
|
getElement(): Promise<WebElement>;
|
|
307
|
-
getValue(): Promise<string | 1 | 0>;
|
|
371
|
+
getValue(): Promise<string | 1 | 0 | string[]>;
|
|
308
372
|
getIndex(): number;
|
|
309
373
|
}
|
|
310
374
|
|
|
311
375
|
interface ConstructorParams {
|
|
312
376
|
parentCssSelector: string;
|
|
377
|
+
headerCssSelector?: string;
|
|
313
378
|
name?: string;
|
|
314
379
|
caption?: string;
|
|
315
380
|
index?: number;
|
|
@@ -319,7 +384,8 @@ declare class Column extends AbstractElementWithParent {
|
|
|
319
384
|
private _index;
|
|
320
385
|
private _caption;
|
|
321
386
|
private _name;
|
|
322
|
-
|
|
387
|
+
protected headerCssSelector: string | undefined;
|
|
388
|
+
constructor({ parentCssSelector, headerCssSelector, name, caption, index, driver }: ConstructorParams);
|
|
323
389
|
private set index(value);
|
|
324
390
|
private get index();
|
|
325
391
|
getElement(): Promise<WebElement>;
|
|
@@ -357,7 +423,8 @@ declare class Row extends AbstractElementWithParent {
|
|
|
357
423
|
|
|
358
424
|
declare class Table extends AbstractElementWithParent {
|
|
359
425
|
protected formName: string;
|
|
360
|
-
|
|
426
|
+
protected headerCssSelector: string;
|
|
427
|
+
constructor(parentCssSelector: string, headerCssSelector: string, formName: string, driver?: WebDriver);
|
|
361
428
|
private getColumnBy;
|
|
362
429
|
getRowByIndex(index: number): Row;
|
|
363
430
|
getColumnByIndex(index: number): Column;
|
|
@@ -456,6 +523,7 @@ declare class FilterPanel extends AbstractElement {
|
|
|
456
523
|
}
|
|
457
524
|
|
|
458
525
|
declare abstract class ListForm extends AbstractForm {
|
|
526
|
+
protected headerCssSelector: string;
|
|
459
527
|
protected constructor(driver?: WebDriver);
|
|
460
528
|
/**
|
|
461
529
|
* Находит таблицу
|
|
@@ -500,4 +568,24 @@ declare abstract class ListForm extends AbstractForm {
|
|
|
500
568
|
get filterPanel(): FilterPanel;
|
|
501
569
|
}
|
|
502
570
|
|
|
503
|
-
|
|
571
|
+
declare abstract class TreeView extends ListForm {
|
|
572
|
+
protected constructor(driver?: WebDriver);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
declare class DialogButton extends AbstractButton implements Button {
|
|
576
|
+
private readonly text;
|
|
577
|
+
constructor(parentCssSelector: string, text: string, driver?: WebDriver);
|
|
578
|
+
getElement(): Promise<WebElement>;
|
|
579
|
+
protected buttonNotDisplayedError(): string;
|
|
580
|
+
}
|
|
581
|
+
declare class Dialog extends AbstractElement {
|
|
582
|
+
constructor(driver?: WebDriver);
|
|
583
|
+
private get titleSelector();
|
|
584
|
+
private get textSelector();
|
|
585
|
+
private get buttonsSelector();
|
|
586
|
+
title(): Promise<string>;
|
|
587
|
+
text(): Promise<string>;
|
|
588
|
+
button(text: string): DialogButton;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
export { AbstractPage, ControlClass, Dialog, Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, LoginPage, NumberEditor, PanelFilterField, SubsystemsPanel, TextEditor, TreeView, byTestId, byTestIdCssSelector, click, config, createDriver, editorFactory, elementIsNotPresent, readonlyLocator, signIn, wait, waitElementIsVisible };
|