mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4823] [e2e] Displaying a file in a form does not work (#5069)
* [ADF-4823] [e2e] Displaying a file in a form does not work * * delete removed * * comments fixed * * e2e fixed * * await removed * * form name fixed * * rebase conflicts * * fixed e2e
This commit is contained in:
@@ -75,23 +75,25 @@ export class AttachFileWidgetCloud {
|
||||
return fileAttached.getAttribute('id');
|
||||
}
|
||||
|
||||
async removeFile(fileName: string): Promise<void> {
|
||||
async clickActionMenu(fileName: string, actionName: string): Promise<void> {
|
||||
const fileId = await this.getFileId(fileName);
|
||||
const optionMenu = this.widget.element(by.css(`button[id='${fileId}-option-menu']`));
|
||||
await BrowserActions.click(optionMenu);
|
||||
await BrowserActions.waitUntilActionMenuIsVisible();
|
||||
const deleteButton = element(by.css(`button#${fileId}-remove`));
|
||||
await BrowserActions.click(deleteButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(deleteButton);
|
||||
const actionButton = element(by.css(`button#${fileId}-${actionName}`));
|
||||
await BrowserActions.click(actionButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(actionButton);
|
||||
}
|
||||
|
||||
async showFile(name): Promise<void> {
|
||||
const fileId = await this.getFileId(name);
|
||||
const optionMenu = this.widget.element(by.css(`button[id='${fileId}-option-menu']`));
|
||||
await BrowserActions.click(optionMenu);
|
||||
await BrowserActions.waitUntilActionMenuIsVisible();
|
||||
const showButton = element(by.css(`button#${fileId}-show-file`));
|
||||
await BrowserActions.click(showButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(showButton);
|
||||
async removeFile(fileName: string): Promise<void> {
|
||||
await this.clickActionMenu(fileName, 'remove');
|
||||
}
|
||||
|
||||
async downloadFile(fileName: string): Promise<void> {
|
||||
await this.clickActionMenu(fileName, 'download-file');
|
||||
}
|
||||
|
||||
async viewFile(fileName: string): Promise<void> {
|
||||
await this.clickActionMenu(fileName, 'show-file');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user