Improve checkFilesAreAttachedToWidget() method (#6943)

* Improve checkFilesAreAttachedToWidget() method

* Add types for the parameters

* exclude test
This commit is contained in:
Iulia Burcă
2021-04-26 12:19:37 +03:00
committed by GitHub
parent a13f2992ec
commit 585a1b6918
2 changed files with 6 additions and 5 deletions

View File

@@ -47,16 +47,16 @@ export class AttachFileWidgetPage {
await BrowserVisibility.waitUntilElementIsNotVisible(fileItem);
}
async checkFileIsAttached(fieldId, name): Promise<void> {
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));
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
}
async checkFilesAreAttachedToWidget(fieldId, name): Promise<void> {
await name.forEach(async fileName => {
async checkFilesAreAttachedToWidget(fieldId: string, names: string[]): Promise<void> {
for (const fileName of names) {
await this.checkFileIsAttached(fieldId, fileName);
});
}
}
async checkFileIsNotAttached(fieldId, name): Promise<void> {