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

@@ -4,5 +4,6 @@
"C279932": "login problem APS not basic", "C279932": "login problem APS not basic",
"C279931": "login problem APS not basic", "C279931": "login problem APS not basic",
"C279930": "login problem APS not basic", "C279930": "login problem APS not basic",
"C593560": "https://alfresco.atlassian.net/browse/ADF-5366" "C593560": "https://alfresco.atlassian.net/browse/ADF-5366",
"C290069": "https://alfresco.atlassian.net/browse/ADF-5387"
} }

View File

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