[ACA-4474]Add checkWidgetsAreVisible method

* Add checkWidgetsAreVisible method

* Add checkNoFileIsAttachedToWidgets()
This commit is contained in:
Cristina Jalba 2021-06-07 13:18:08 +03:00 committed by GitHub
parent 91d813e6f1
commit acf4b26d74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -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);

View File

@ -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));