mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4823] added download and show preview for attach cloud widget (#4996)
* [ADF-4823] fixed download and start fixing show preview * [ADF-4823] fixed preview files * [ADF-4823] - added unit test * [ADF-4823] - fixed lint problem * [ADF-4823] - rebased and fixed lint problem * added a new method in BrowserActions to check that the action menu is visible, and using that in the tests. * linting fixes
This commit is contained in:
@@ -23,7 +23,6 @@ import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
export class DocumentListPage {
|
||||
|
||||
rootElement: ElementFinder;
|
||||
actionMenu: ElementFinder = element(by.css('div[role="menu"]'));
|
||||
optionButton: Locator = by.css('button[data-automation-id*="action_menu_"]');
|
||||
tableBody: ElementFinder;
|
||||
dataTable: DataTableComponentPage;
|
||||
@@ -66,12 +65,12 @@ export class DocumentListPage {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const row: ElementFinder = this.dataTable.getRow('Display name', content);
|
||||
await BrowserActions.click(row.element(this.optionButton));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.actionMenu);
|
||||
await BrowserActions.waitUntilActionMenuIsVisible();
|
||||
await browser.sleep(500);
|
||||
}
|
||||
|
||||
async checkActionMenuIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.actionMenu);
|
||||
await BrowserActions.waitUntilActionMenuIsNotVisible();
|
||||
}
|
||||
|
||||
dataTablePage(): DataTableComponentPage {
|
||||
|
@@ -76,8 +76,12 @@ export class AttachFileWidgetCloud {
|
||||
|
||||
async removeFile(fileName: string): Promise<void> {
|
||||
const fileId = await this.getFileId(fileName);
|
||||
const deleteButton = this.widget.element(by.css(`button[id='${fileId}-remove']`));
|
||||
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);
|
||||
}
|
||||
|
||||
async viewFile(name): Promise<void> {
|
||||
|
@@ -26,6 +26,16 @@ export class BrowserActions {
|
||||
await elementFinder.click();
|
||||
}
|
||||
|
||||
static async waitUntilActionMenuIsVisible(): Promise<void> {
|
||||
const actionMenu = element(by.css('div[role="menu"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionMenu);
|
||||
}
|
||||
|
||||
static async waitUntilActionMenuIsNotVisible(): Promise<void> {
|
||||
const actionMenu = element(by.css('div[role="menu"]'));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(actionMenu);
|
||||
}
|
||||
|
||||
static async getUrl(url: string): Promise<any> {
|
||||
return browser.get(url);
|
||||
}
|
||||
|
Reference in New Issue
Block a user