Skip to content

Commit

Permalink
[ACA-4474]Add checkWidgetsAreVisible method
Browse files Browse the repository at this point in the history
* Add checkWidgetsAreVisible method

* Add checkNoFileIsAttachedToWidgets()
  • Loading branch information
cristinaj committed Jun 7, 2021
1 parent 91d813e commit acf4b26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/testing/src/lib/core/pages/form/form-fields.ts
Expand Up @@ -49,6 +49,12 @@ export class FormFields {
await BrowserVisibility.waitUntilElementIsVisible(fieldElement);
}

async checkWidgetsAreVisible(fieldsId: string[]): Promise<void> {
for (const fieldId of fieldsId) {
await this.checkWidgetIsVisible(fieldId);
}
}

async checkWidgetIsClickable(fieldId: string): Promise<void> {
const fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first();
await BrowserVisibility.waitUntilElementIsClickable(fieldElement);
Expand Down
Expand Up @@ -47,6 +47,12 @@ export class AttachFileWidgetPage {
await BrowserVisibility.waitUntilElementIsNotVisible(fileItem);
}

async checkNoFileIsAttachedToWidgets(fieldIds: string[]): Promise<void> {
for (const fieldId of fieldIds) {
await this.checkNoFileIsAttached(fieldId);
}
}

async checkFileIsAttached(fieldId: string, name: string): Promise<void> {
const widget = await this.formFields.getWidget(fieldId);
const fileAttached = widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
Expand Down

0 comments on commit acf4b26

Please sign in to comment.