From acf4b26d744c5ef2a5f788e87a051b3d29e8972d Mon Sep 17 00:00:00 2001 From: Cristina Jalba Date: Mon, 7 Jun 2021 13:18:08 +0300 Subject: [PATCH] [ACA-4474]Add checkWidgetsAreVisible method * Add checkWidgetsAreVisible method * Add checkNoFileIsAttachedToWidgets() --- lib/testing/src/lib/core/pages/form/form-fields.ts | 6 ++++++ .../lib/core/pages/form/widgets/attach-file-widget.page.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/testing/src/lib/core/pages/form/form-fields.ts b/lib/testing/src/lib/core/pages/form/form-fields.ts index bd8d4ef0f7e..4bdddd01094 100644 --- a/lib/testing/src/lib/core/pages/form/form-fields.ts +++ b/lib/testing/src/lib/core/pages/form/form-fields.ts @@ -49,6 +49,12 @@ export class FormFields { await BrowserVisibility.waitUntilElementIsVisible(fieldElement); } + async checkWidgetsAreVisible(fieldsId: string[]): Promise { + for (const fieldId of fieldsId) { + await this.checkWidgetIsVisible(fieldId); + } + } + async checkWidgetIsClickable(fieldId: string): Promise { const fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first(); await BrowserVisibility.waitUntilElementIsClickable(fieldElement); diff --git a/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts b/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts index ecc91101db0..5ce95aad08a 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/attach-file-widget.page.ts @@ -47,6 +47,12 @@ export class AttachFileWidgetPage { await BrowserVisibility.waitUntilElementIsNotVisible(fileItem); } + async checkNoFileIsAttachedToWidgets(fieldIds: string[]): Promise { + for (const fieldId of fieldIds) { + await this.checkNoFileIsAttached(fieldId); + } + } + async checkFileIsAttached(fieldId: string, name: string): Promise { const widget = await this.formFields.getWidget(fieldId); const fileAttached = widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));