mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
cleanup upload dialog page
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser, ElementFinder, $, $$ } from 'protractor';
|
||||
import { by, browser, ElementFinder, $, $$ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class UploadDialogPage {
|
||||
@@ -31,12 +31,6 @@ export class UploadDialogPage {
|
||||
title = $('span[class*="upload-dialog__title"]');
|
||||
minimizeButton = $('mat-icon[title="Minimize"]');
|
||||
maximizeButton = $('mat-icon[title="Maximize"]');
|
||||
canUploadConfirmationTitle = $('.upload-dialog__confirmation--title');
|
||||
canUploadConfirmationDescription = $('.upload-dialog__confirmation--text');
|
||||
confirmationDialogNoButton = element(by.partialButtonText('No'));
|
||||
confirmationDialogYesButton = element(by.partialButtonText('Yes'));
|
||||
cancelUploadsElement = $('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]');
|
||||
cancelUploadInProgressButton = $('div[data-automation-id="cancel-upload-progress"]');
|
||||
|
||||
async clickOnCloseButton(): Promise<void> {
|
||||
await this.checkCloseButtonIsDisplayed();
|
||||
@@ -76,8 +70,8 @@ export class UploadDialogPage {
|
||||
}
|
||||
|
||||
async filesAreUploaded(content: string[]): Promise<void> {
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
await this.fileIsUploaded(content[i]);
|
||||
for (const item of content) {
|
||||
await this.fileIsUploaded(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,18 +79,6 @@ export class UploadDialogPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible($(`div[class*='uploading-row'] span[title="${content}"]`));
|
||||
}
|
||||
|
||||
async cancelUploads(): Promise<void> {
|
||||
await BrowserActions.click(this.cancelUploadsElement);
|
||||
}
|
||||
|
||||
async cancelProgress(): Promise<void> {
|
||||
await BrowserActions.click(this.cancelUploadInProgressButton);
|
||||
}
|
||||
|
||||
async checkCancelProgressIsVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.cancelUploadInProgressButton);
|
||||
}
|
||||
|
||||
async fileIsCancelled(content: string): Promise<void> {
|
||||
const row: ElementFinder = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
@@ -115,24 +97,6 @@ export class UploadDialogPage {
|
||||
return this.title.getText();
|
||||
}
|
||||
|
||||
async getConfirmationDialogTitleText(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.canUploadConfirmationTitle);
|
||||
return this.canUploadConfirmationTitle.getText();
|
||||
}
|
||||
|
||||
async getConfirmationDialogDescriptionText(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.canUploadConfirmationDescription);
|
||||
return this.canUploadConfirmationDescription.getText();
|
||||
}
|
||||
|
||||
async clickOnConfirmationDialogYesButton(): Promise<void> {
|
||||
await BrowserActions.click(this.confirmationDialogYesButton);
|
||||
}
|
||||
|
||||
async clickOnConfirmationDialogNoButton(): Promise<void> {
|
||||
await BrowserActions.click(this.confirmationDialogNoButton);
|
||||
}
|
||||
|
||||
async numberOfCurrentFilesUploaded(): Promise<string> {
|
||||
const text = await this.getTitleText();
|
||||
return text.split('Uploaded ')[1].split(' / ')[0];
|
||||
|
Reference in New Issue
Block a user