d5-testing-library 1.3.1 → 1.5.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.
@@ -126,14 +126,64 @@ declare class SubsystemsPanel extends AbstractElement {
126
126
  headerTitle(): Promise<string>;
127
127
  }
128
128
 
129
- declare abstract class AbstractForm extends AbstractPage {
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
+
157
+ interface Group {
158
+ isDisplayed(): Promise<boolean>;
159
+ tabClick(name: string): Promise<void>;
160
+ }
161
+
162
+ declare class FormGroup extends AbstractElementWithParent implements Group {
163
+ editor: Group;
164
+ constructor(parentCssSelector: string, formName: string, name: string, driver?: WebDriver);
165
+ private initEditor;
166
+ /**
167
+ * Возвращает булевое значение доступна ли группа
168
+ * @example
169
+ * expect(await tableList.group('MainSuperPanel').isDisplayed();
170
+ */
171
+ isDisplayed(): Promise<boolean>;
172
+ /**
173
+ * Происходит клик по табе
174
+ * @example
175
+ * expect(await tableList.group('TabPanel').tabClick(tabName);
176
+ */
177
+ tabClick(name: string): Promise<void>;
178
+ }
179
+
180
+ declare class AbstractForm extends AbstractPage {
130
181
  protected containerCssSelector: string;
182
+ private _formName;
131
183
  protected containerBy: By;
132
- protected popupContainerCssSelector: string;
133
- protected constructor(driver?: WebDriver);
134
- protected isModal(): Promise<boolean>;
135
184
  protected getContainerElement: () => selenium_webdriver.WebElementPromise;
136
- protected get formName(): string;
185
+ set formName(name: string);
186
+ get formName(): string;
137
187
  /**
138
188
  * Возвращает true если форма есть в DOM
139
189
  * @example
@@ -143,6 +193,21 @@ declare abstract class AbstractForm extends AbstractPage {
143
193
  * expect(await formEdit.exists()).toBe(true);
144
194
  */
145
195
  exists(): Promise<boolean>;
196
+ button(name: string): FormButton;
197
+ /**
198
+ * Находит группу на форме по имени
199
+ * @example
200
+ * const formEdit = new MyForm();
201
+ * //...
202
+ * expect(await formEdit.group('Name');
203
+ */
204
+ group(name: string): FormGroup;
205
+ }
206
+
207
+ declare abstract class Form extends AbstractForm {
208
+ protected popupContainerCssSelector: string;
209
+ protected constructor(driver: WebDriver);
210
+ protected isModal(): Promise<boolean>;
146
211
  /**
147
212
  * Получение заголовка на формы
148
213
  * @example
@@ -151,13 +216,16 @@ declare abstract class AbstractForm extends AbstractPage {
151
216
  * expect(await listForm.getTitleText()).toBe('MyFormTitle');
152
217
  */
153
218
  getTitleText(): Promise<string>;
154
- }
155
-
156
- declare abstract class AbstractElementWithParent extends AbstractElement {
157
- protected parentCssSelector: string;
158
- constructor(parentCssSelector: string, elementCssSelector: string, driver?: WebDriver);
159
- protected getFullCssSelector(): string;
160
- isReadonly(): Promise<boolean>;
219
+ protected setSubFormMode(): void;
220
+ /**
221
+ * Возвращает сабформу
222
+ * @returns {Promise<ListForm | TreeView | FormEdit>}
223
+ * @example
224
+ * const form = new MyForm();
225
+ * //...
226
+ * expect(await form.subForm(name));
227
+ */
228
+ subForm(name: string): Promise<unknown>;
161
229
  }
162
230
 
163
231
  interface Editor {
@@ -167,6 +235,19 @@ interface Editor {
167
235
  clear?(): Promise<void>;
168
236
  isReadonly?(): Promise<boolean>;
169
237
  }
238
+ declare enum ControlClass {
239
+ Text = "text-control",
240
+ TextArea = "text-area-control",
241
+ Number = "number-control",
242
+ CheckBox = "check-box",
243
+ Multiselect = "multi-select-control",
244
+ Select = "select-control",
245
+ Switch = "switch-control",
246
+ Date = "date-control",
247
+ SingleDateRange = "single-date-range-control",
248
+ BooleanSelector = "buttons-group",
249
+ ButtonGroup = "button-group-field"
250
+ }
170
251
 
171
252
  interface ClearStrategy {
172
253
  clear(editor: Editor): Promise<void>;
@@ -241,26 +322,10 @@ declare class FormField extends AbstractEditor {
241
322
  constructor(parentCssSelector: string, formName: string, name: string, driver?: WebDriver);
242
323
  }
243
324
 
244
- interface Group {
245
- isDisplayed(): Promise<boolean>;
246
- }
247
-
248
- declare class FormGroup extends AbstractElementWithParent implements Group {
249
- editor: Group;
250
- constructor(parentCssSelector: string, formName: string, name: string, driver?: WebDriver);
251
- private initEditor;
252
- /**
253
- * Возвращает булевое значение доступна ли группа
254
- * @example
255
- * expect(await tableList.group('MainSuperPanel').isDisplayed();
256
- */
257
- isDisplayed(): Promise<boolean>;
258
- }
259
-
260
- declare abstract class FormEdit extends AbstractForm {
325
+ declare class FormEdit extends Form {
261
326
  saveButtonBy: By;
262
327
  closeButtonBy: By;
263
- protected constructor(driver?: WebDriver);
328
+ constructor(driver: WebDriver);
264
329
  /**
265
330
  * Находит поле формы редактирования по имени
266
331
  * @example
@@ -277,14 +342,6 @@ declare abstract class FormEdit extends AbstractForm {
277
342
  * await formEdit.isSaveButtonDisabled();
278
343
  */
279
344
  isSaveButtonDisabled(): Promise<boolean>;
280
- /**
281
- * Находит группу формы редактирования по имени
282
- * @example
283
- * const formEdit = new MyForm();
284
- * //...
285
- * expect(await formEdit.group('Name');
286
- */
287
- group(name: string): FormGroup;
288
345
  /**
289
346
  * Нажатие на кнопку Сохранить
290
347
  * @example
@@ -303,24 +360,13 @@ declare abstract class FormEdit extends AbstractForm {
303
360
  closeButtonClick(): Promise<void>;
304
361
  }
305
362
 
306
- interface Button {
307
- click(): Promise<void>;
308
- isDisabled(): Promise<boolean>;
309
- }
310
- declare abstract class AbstractButton extends AbstractElementWithParent implements Button {
311
- protected constructor(parentCssSelector: string, elementCssSelector: string, driver?: WebDriver);
312
- protected abstract buttonNotDisplayedError(): string;
313
- click(): Promise<void>;
314
- isDisabled(): Promise<boolean>;
315
- }
316
-
317
363
  declare class ToolbarMenu extends AbstractElementWithParent {
318
364
  private readonly _formName;
319
365
  constructor(parentCssSelector: string, formName: string, name: string, driver?: WebDriver);
320
- protected toggle(): Promise<void>;
321
- protected getCssSelectorToButton(name: string): By;
322
- protected buttonNotDisplayedError(name: string): string;
323
- protected goToButton(name: string, selector: By): Promise<void>;
366
+ private openDropdownMenu;
367
+ private getCssSelectorToButton;
368
+ private buttonNotDisplayedError;
369
+ private goToButton;
324
370
  clickButton(name: string | string[]): Promise<void>;
325
371
  clickButtonByTitle(title: string | string[]): Promise<void>;
326
372
  }
@@ -342,13 +388,15 @@ declare class Cell extends AbstractElementWithParent {
342
388
  constructor(parentCssSelector: string, getCellIndex: () => Promise<number>, index?: number, driver?: WebDriver);
343
389
  private set index(value);
344
390
  private getBooleanValue;
391
+ private getTagsValue;
345
392
  getElement(): Promise<WebElement>;
346
- getValue(): Promise<string | 1 | 0>;
393
+ getValue(): Promise<string | 1 | 0 | string[]>;
347
394
  getIndex(): number;
348
395
  }
349
396
 
350
397
  interface ConstructorParams {
351
398
  parentCssSelector: string;
399
+ headerCssSelector?: string;
352
400
  name?: string;
353
401
  caption?: string;
354
402
  index?: number;
@@ -358,7 +406,8 @@ declare class Column extends AbstractElementWithParent {
358
406
  private _index;
359
407
  private _caption;
360
408
  private _name;
361
- constructor({ parentCssSelector, name, caption, index, driver }: ConstructorParams);
409
+ protected headerCssSelector: string | undefined;
410
+ constructor({ parentCssSelector, headerCssSelector, name, caption, index, driver }: ConstructorParams);
362
411
  private set index(value);
363
412
  private get index();
364
413
  getElement(): Promise<WebElement>;
@@ -396,7 +445,8 @@ declare class Row extends AbstractElementWithParent {
396
445
 
397
446
  declare class Table extends AbstractElementWithParent {
398
447
  protected formName: string;
399
- constructor(parentCssSelector: string, formName: string, driver?: WebDriver);
448
+ protected headerCssSelector: string;
449
+ constructor(parentCssSelector: string, headerCssSelector: string, formName: string, driver?: WebDriver);
400
450
  private getColumnBy;
401
451
  getRowByIndex(index: number): Row;
402
452
  getColumnByIndex(index: number): Column;
@@ -494,8 +544,9 @@ declare class FilterPanel extends AbstractElement {
494
544
  close(): Promise<void>;
495
545
  }
496
546
 
497
- declare abstract class ListForm extends AbstractForm {
498
- protected constructor(driver?: WebDriver);
547
+ declare class ListForm extends Form {
548
+ protected headerCssSelector: string;
549
+ constructor(driver: WebDriver);
499
550
  /**
500
551
  * Находит таблицу
501
552
  * @example
@@ -504,14 +555,6 @@ declare abstract class ListForm extends AbstractForm {
504
555
  * expect(listForm.table());
505
556
  */
506
557
  table(): Table;
507
- /**
508
- * Находит группу на лист форме по имени
509
- * @example
510
- * const formEdit = new MyForm();
511
- * //...
512
- * expect(await formEdit.group('Name');
513
- */
514
- group(name: string): FormGroup;
515
558
  /**
516
559
  * Находит таблицу
517
560
  * @example
@@ -539,6 +582,10 @@ declare abstract class ListForm extends AbstractForm {
539
582
  get filterPanel(): FilterPanel;
540
583
  }
541
584
 
585
+ declare class TreeView extends ListForm {
586
+ constructor(driver: WebDriver);
587
+ }
588
+
542
589
  declare class DialogButton extends AbstractButton implements Button {
543
590
  private readonly text;
544
591
  constructor(parentCssSelector: string, text: string, driver?: WebDriver);
@@ -555,4 +602,4 @@ declare class Dialog extends AbstractElement {
555
602
  button(text: string): DialogButton;
556
603
  }
557
604
 
558
- export { AbstractPage, Dialog, Editor, FilterPanel, FormEdit, FormField, FormFilterField, ListForm, LoginPage, NumberEditor, PanelFilterField, SubsystemsPanel, TextEditor, byTestId, byTestIdCssSelector, click, config, createDriver, editorFactory, elementIsNotPresent, readonlyLocator, signIn, wait, waitElementIsVisible };
605
+ 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 };