mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3596] Fix e2e due to process header properties changes (#5873)
* [ACA-3596] Fix e2e due to process header properties changes * Change pages structure * Move the build demoshell as last step and exclude for PR * move more pages * change testing pkg * better JSON import * update script * move CLOUD in the right place * some logs and not used methods * retrycout Co-authored-by: maurizio vitale <maurizio.vitale@alfresco.com> Co-authored-by: Eugenio Romano <eugenio.romano@alfresco.com> Co-authored-by: Eugenio Romano <eromano@users.noreply.github.com>
This commit is contained in:
154
e2e/core/pages/dialog/create-library-dialog.page.ts
Normal file
154
e2e/core/pages/dialog/create-library-dialog.page.ts
Normal file
@@ -0,0 +1,154 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, browser, protractor } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class CreateLibraryDialogPage {
|
||||
libraryDialog = element(by.css('[role="dialog"]'));
|
||||
libraryTitle = element(by.css('.adf-library-dialog>h2'));
|
||||
libraryNameField = element(by.css('input[formcontrolname="title"]'));
|
||||
libraryIdField = element(by.css('input[formcontrolname="id"]'));
|
||||
libraryDescriptionField = element(by.css('textarea[formcontrolname="description"]'));
|
||||
publicRadioButton = element(by.css('[data-automation-id="PUBLIC"]>label'));
|
||||
privateRadioButton = element(by.css('[data-automation-id="PRIVATE"]>label'));
|
||||
moderatedRadioButton = element(by.css('[data-automation-id="MODERATED"]>label'));
|
||||
cancelButton = element(by.css('button[data-automation-id="cancel-library-id"]'));
|
||||
createButton = element(by.css('button[data-automation-id="create-library-id"]'));
|
||||
errorMessage = element(by.css('.mat-dialog-content .mat-error'));
|
||||
errorMessages = element.all(by.css('.mat-dialog-content .mat-error'));
|
||||
libraryNameHint = element(by.css('adf-library-dialog .mat-hint'));
|
||||
|
||||
async getSelectedRadio(): Promise<string> {
|
||||
const radio = element(by.css('.mat-radio-button[class*="checked"]'));
|
||||
return BrowserActions.getText(radio);
|
||||
}
|
||||
|
||||
async waitForDialogToOpen(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.libraryDialog);
|
||||
}
|
||||
|
||||
async waitForDialogToClose(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.libraryDialog);
|
||||
}
|
||||
|
||||
async isDialogOpen(): Promise<any> {
|
||||
return browser.isElementPresent(this.libraryDialog);
|
||||
}
|
||||
|
||||
async getTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.libraryTitle);
|
||||
}
|
||||
|
||||
async getLibraryIdText(): Promise<string> {
|
||||
return this.libraryIdField.getAttribute('value');
|
||||
}
|
||||
|
||||
async isErrorMessageDisplayed(): Promise<boolean> {
|
||||
return this.errorMessage.isDisplayed();
|
||||
}
|
||||
|
||||
async getErrorMessage(): Promise<string> {
|
||||
return BrowserActions.getText(this.errorMessage);
|
||||
}
|
||||
|
||||
async getErrorMessages(position: number): Promise<string> {
|
||||
return BrowserActions.getText(this.errorMessages.get(position));
|
||||
}
|
||||
|
||||
async waitForLibraryNameHint(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.libraryNameHint);
|
||||
}
|
||||
|
||||
async getLibraryNameHint(): Promise<string> {
|
||||
return BrowserActions.getText(this.libraryNameHint);
|
||||
}
|
||||
|
||||
async isNameDisplayed(): Promise<boolean> {
|
||||
return this.libraryNameField.isDisplayed();
|
||||
}
|
||||
|
||||
async isLibraryIdDisplayed(): Promise<boolean> {
|
||||
return this.libraryIdField.isDisplayed();
|
||||
}
|
||||
|
||||
async isDescriptionDisplayed(): Promise<boolean> {
|
||||
return this.libraryDescriptionField.isDisplayed();
|
||||
}
|
||||
|
||||
async isPublicDisplayed(): Promise<boolean> {
|
||||
return this.publicRadioButton.isDisplayed();
|
||||
}
|
||||
|
||||
async isModeratedDisplayed(): Promise<boolean> {
|
||||
return this.moderatedRadioButton.isDisplayed();
|
||||
}
|
||||
|
||||
async isPrivateDisplayed(): Promise<boolean> {
|
||||
return this.privateRadioButton.isDisplayed();
|
||||
}
|
||||
|
||||
async isCreateEnabled(): Promise<boolean> {
|
||||
return this.createButton.isEnabled();
|
||||
}
|
||||
|
||||
async isCancelEnabled(): Promise<boolean> {
|
||||
return this.cancelButton.isEnabled();
|
||||
}
|
||||
|
||||
async clickCreate(): Promise<void> {
|
||||
await BrowserActions.click(this.createButton);
|
||||
}
|
||||
|
||||
async clickCancel(): Promise<void> {
|
||||
await BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
|
||||
async typeLibraryName(libraryName: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.libraryNameField, libraryName);
|
||||
}
|
||||
|
||||
async typeLibraryId(libraryId: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.libraryIdField, libraryId);
|
||||
}
|
||||
|
||||
async typeLibraryDescription(libraryDescription: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.libraryDescriptionField, libraryDescription);
|
||||
}
|
||||
|
||||
async clearLibraryName(): Promise<void> {
|
||||
await this.libraryNameField.clear();
|
||||
await this.libraryNameField.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
|
||||
}
|
||||
|
||||
async clearLibraryId(): Promise<void> {
|
||||
await this.libraryIdField.clear();
|
||||
await this.libraryIdField.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
|
||||
}
|
||||
|
||||
async selectPublic(): Promise<void> {
|
||||
await BrowserActions.click(this.publicRadioButton);
|
||||
}
|
||||
|
||||
async selectPrivate(): Promise<void> {
|
||||
await BrowserActions.click(this.privateRadioButton);
|
||||
}
|
||||
|
||||
async selectModerated(): Promise<void> {
|
||||
await BrowserActions.click(this.moderatedRadioButton);
|
||||
}
|
||||
}
|
90
e2e/core/pages/dialog/folder-dialog.page.ts
Normal file
90
e2e/core/pages/dialog/folder-dialog.page.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class FolderDialogPage {
|
||||
folderDialog = element(by.css('adf-folder-dialog'));
|
||||
folderNameField = this.folderDialog.element(by.id('adf-folder-name-input'));
|
||||
folderDescriptionField = this.folderDialog.element(by.id('adf-folder-description-input'));
|
||||
createUpdateButton = this.folderDialog.element(by.id('adf-folder-create-button'));
|
||||
cancelButton = this.folderDialog.element(by.id('adf-folder-cancel-button'));
|
||||
folderTitle = this.folderDialog.element((by.css('h2.mat-dialog-title')));
|
||||
validationMessage = this.folderDialog.element(by.css('div.mat-form-field-subscript-wrapper mat-hint span'));
|
||||
|
||||
async getDialogTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.folderTitle);
|
||||
}
|
||||
|
||||
async checkFolderDialogIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.folderDialog);
|
||||
}
|
||||
|
||||
async checkFolderDialogIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.folderDialog);
|
||||
}
|
||||
|
||||
async clickOnCreateUpdateButton(): Promise<void> {
|
||||
await BrowserActions.click(this.createUpdateButton);
|
||||
}
|
||||
|
||||
async checkCreateUpdateBtnIsDisabled(): Promise<void> {
|
||||
await BrowserActions.checkIsDisabled(this.createUpdateButton);
|
||||
}
|
||||
|
||||
async clickOnCancelButton(): Promise<void> {
|
||||
await BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
|
||||
async addFolderName(folderName): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.folderNameField, folderName);
|
||||
}
|
||||
|
||||
async addFolderDescription(folderDescription): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.folderDescriptionField, folderDescription);
|
||||
}
|
||||
|
||||
async getFolderName(): Promise<string> {
|
||||
return this.folderNameField.getAttribute('value');
|
||||
}
|
||||
|
||||
async getValidationMessage(): Promise<string> {
|
||||
return BrowserActions.getText(this.validationMessage);
|
||||
}
|
||||
|
||||
async checkValidationMessageIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.validationMessage);
|
||||
}
|
||||
|
||||
getFolderNameField(): ElementFinder {
|
||||
return this.folderNameField;
|
||||
}
|
||||
|
||||
getFolderDescriptionField(): ElementFinder {
|
||||
return this.folderDescriptionField;
|
||||
}
|
||||
|
||||
async checkCreateUpdateBtnIsEnabled(): Promise<void> {
|
||||
await this.createUpdateButton.isEnabled();
|
||||
}
|
||||
|
||||
async checkCancelBtnIsEnabled(): Promise<void> {
|
||||
await this.cancelButton.isEnabled();
|
||||
}
|
||||
|
||||
}
|
124
e2e/core/pages/dialog/share-dialog.page.ts
Normal file
124
e2e/core/pages/dialog/share-dialog.page.ts
Normal file
@@ -0,0 +1,124 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility, TogglePage, BrowserActions, DateTimePickerPage } from '@alfresco/adf-testing';
|
||||
import moment = require('moment');
|
||||
|
||||
export class ShareDialogPage {
|
||||
|
||||
togglePage = new TogglePage();
|
||||
dateTimePickerPage = new DateTimePickerPage();
|
||||
shareDialog = element(by.css('adf-share-dialog'));
|
||||
dialogTitle = element.all(by.css('[data-automation-id="adf-share-dialog-title"]')).first();
|
||||
shareToggle = element(by.css('[data-automation-id="adf-share-toggle"] label'));
|
||||
expireToggle = element(by.css(`[data-automation-id="adf-expire-toggle"] label`));
|
||||
shareToggleChecked = element(by.css('mat-dialog-container mat-slide-toggle.mat-checked'));
|
||||
shareLink = element(by.css('[data-automation-id="adf-share-link"]'));
|
||||
closeButton = element(by.css('button[data-automation-id="adf-share-dialog-close"]'));
|
||||
copySharedLinkButton = element(by.css('.adf-input-action'));
|
||||
expirationDateInput = element(by.css('input[formcontrolname="time"]'));
|
||||
confirmationDialog = element(by.css('adf-confirm-dialog'));
|
||||
confirmationCancelButton = element(by.id('adf-confirm-cancel'));
|
||||
confirmationRemoveButton = element(by.id('adf-confirm-accept'));
|
||||
|
||||
async checkDialogIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.dialogTitle);
|
||||
}
|
||||
|
||||
async clickUnShareFile() {
|
||||
await this.togglePage.enableToggle(this.shareToggle);
|
||||
}
|
||||
|
||||
async clickExpireToggle() {
|
||||
await this.togglePage.enableToggle(this.expireToggle);
|
||||
}
|
||||
|
||||
async clickConfirmationDialogCancelButton(): Promise<void> {
|
||||
await BrowserActions.click(this.confirmationCancelButton);
|
||||
}
|
||||
|
||||
async clickConfirmationDialogRemoveButton(): Promise<void> {
|
||||
await BrowserActions.click(this.confirmationRemoveButton);
|
||||
}
|
||||
|
||||
async checkShareLinkIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.shareLink);
|
||||
}
|
||||
|
||||
async getShareLink(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.shareLink);
|
||||
return this.shareLink.getAttribute('value');
|
||||
}
|
||||
|
||||
async clickCloseButton(): Promise<void> {
|
||||
await BrowserActions.click(this.closeButton);
|
||||
}
|
||||
|
||||
async clickShareLinkButton(): Promise<void> {
|
||||
await BrowserActions.click(this.copySharedLinkButton);
|
||||
}
|
||||
|
||||
async shareToggleButtonIsChecked(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.shareToggleChecked);
|
||||
}
|
||||
|
||||
async dialogIsClosed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsStale(this.shareDialog);
|
||||
}
|
||||
|
||||
async clickDateTimePickerButton(): Promise<void> {
|
||||
await this.dateTimePickerPage.clickDateTimePicker();
|
||||
}
|
||||
|
||||
async calendarTodayDayIsDisabled(): Promise<void> {
|
||||
const tomorrow = moment().add(1, 'days').format('D');
|
||||
|
||||
if (tomorrow !== '1') {
|
||||
await this.dateTimePickerPage.checkCalendarTodayDayIsDisabled();
|
||||
}
|
||||
}
|
||||
|
||||
async setDefaultDay(): Promise<void> {
|
||||
const tomorrow = moment().add(1, 'days').format('D');
|
||||
await this.dateTimePickerPage.setDate(tomorrow);
|
||||
}
|
||||
|
||||
async setDefaultHour(): Promise<void> {
|
||||
await this.dateTimePickerPage.dateTime.setDefaultEnabledHour();
|
||||
}
|
||||
|
||||
async setDefaultMinutes() {
|
||||
await this.dateTimePickerPage.dateTime.setDefaultEnabledMinutes();
|
||||
}
|
||||
|
||||
async dateTimePickerDialogIsClosed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsStale(element(by.css('mat-datetimepicker-content')));
|
||||
}
|
||||
|
||||
async getExpirationDate(): Promise<string> {
|
||||
return this.expirationDateInput.getAttribute('value');
|
||||
}
|
||||
|
||||
async expirationDateInputHasValue(value): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementHasValue(this.expirationDateInput, value);
|
||||
}
|
||||
|
||||
async confirmationDialogIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.confirmationDialog);
|
||||
}
|
||||
}
|
165
e2e/core/pages/dialog/upload-dialog.page.ts
Normal file
165
e2e/core/pages/dialog/upload-dialog.page.ts
Normal file
@@ -0,0 +1,165 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class UploadDialogPage {
|
||||
|
||||
closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
|
||||
dialog = element(by.css('div[id="upload-dialog"]'));
|
||||
minimizedDialog = element(by.css('div[class*="upload-dialog--minimized"]'));
|
||||
uploadedStatusIcon = by.css('mat-icon[class*="status--done"]');
|
||||
cancelledStatusIcon = by.css('div[class*="status--cancelled"]');
|
||||
errorStatusIcon = by.css('div[class*="status--error"] mat-icon');
|
||||
errorTooltip = element(by.css('div.mat-tooltip'));
|
||||
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
|
||||
title = element(by.css('span[class*="upload-dialog__title"]'));
|
||||
minimizeButton = element(by.css('mat-icon[title="Minimize"]'));
|
||||
maximizeButton = element(by.css('mat-icon[title="Maximize"]'));
|
||||
canUploadConfirmationTitle = element(by.css('.upload-dialog__confirmation--title'));
|
||||
canUploadConfirmationDescription = element(by.css('.upload-dialog__confirmation--text'));
|
||||
confirmationDialogNoButton = element(by.partialButtonText('No'));
|
||||
confirmationDialogYesButton = element(by.partialButtonText('Yes'));
|
||||
cancelUploadsElement = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]')));
|
||||
cancelUploadInProgressButton = element(by.css('div[data-automation-id="cancel-upload-progress"]'));
|
||||
|
||||
async clickOnCloseButton(): Promise<void> {
|
||||
await this.checkCloseButtonIsDisplayed();
|
||||
await BrowserActions.clickExecuteScript('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]');
|
||||
}
|
||||
|
||||
async checkCloseButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.closeButton);
|
||||
}
|
||||
|
||||
async dialogIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.dialog);
|
||||
}
|
||||
|
||||
async dialogIsMinimized(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.minimizedDialog);
|
||||
}
|
||||
|
||||
async dialogIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.dialog);
|
||||
}
|
||||
|
||||
getRowsByName(content: string): ElementFinder {
|
||||
return element.all(by.css(`div[class*='uploading-row'] span[title="${content}"]`)).first();
|
||||
}
|
||||
|
||||
getRowByRowName(content: string) {
|
||||
const rows = this.getRowsByName(content);
|
||||
return rows.element(this.rowByRowName);
|
||||
}
|
||||
|
||||
async fileIsUploaded(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon));
|
||||
}
|
||||
|
||||
async fileIsError(content: string) {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.errorStatusIcon));
|
||||
}
|
||||
|
||||
async filesAreUploaded(content: string[]): Promise<void> {
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
await this.fileIsUploaded(content[i]);
|
||||
}
|
||||
}
|
||||
|
||||
async fileIsNotDisplayedInDialog(content: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`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 = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon), 10000);
|
||||
}
|
||||
|
||||
async removeUploadedFile(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon));
|
||||
const elementRow = await this.getRowByRowName(content);
|
||||
await BrowserActions.click(elementRow.element(this.uploadedStatusIcon));
|
||||
|
||||
}
|
||||
|
||||
async getTitleText(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.title);
|
||||
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];
|
||||
}
|
||||
|
||||
async numberOfInitialFilesUploaded(): Promise<string> {
|
||||
const text = await this.getTitleText();
|
||||
return text.split('Uploaded ')[1].split(' / ')[1];
|
||||
}
|
||||
|
||||
async minimizeUploadDialog(): Promise<void> {
|
||||
await BrowserActions.click(this.minimizeButton);
|
||||
}
|
||||
|
||||
async maximizeUploadDialog(): Promise<void> {
|
||||
await BrowserActions.click(this.maximizeButton);
|
||||
}
|
||||
|
||||
async displayTooltip(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(this.errorStatusIcon));
|
||||
await browser.actions().mouseMove(element(this.errorStatusIcon)).perform();
|
||||
}
|
||||
|
||||
async getTooltip(): Promise<string> {
|
||||
return BrowserActions.getText(this.errorTooltip);
|
||||
}
|
||||
}
|
129
e2e/core/pages/dialog/upload-toggles.page.ts
Normal file
129
e2e/core/pages/dialog/upload-toggles.page.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { BrowserActions, BrowserVisibility, TogglePage } from '@alfresco/adf-testing';
|
||||
|
||||
export class UploadTogglesPage {
|
||||
|
||||
togglePage = new TogglePage();
|
||||
multipleFileUploadToggle = element(by.id('adf-multiple-upload-switch'));
|
||||
uploadFolderToggle = element(by.css('#adf-folder-upload-switch'));
|
||||
extensionFilterToggle = element(by.id('adf-extension-filter-upload-switch'));
|
||||
maxSizeToggle = element(by.id('adf-max-size-filter-upload-switch'));
|
||||
versioningToggle = element(by.id('adf-version-upload-switch'));
|
||||
extensionAcceptedField = element(by.css('input[data-automation-id="accepted-files-type"]'));
|
||||
maxSizeField = element(by.css('input[data-automation-id="max-files-size"]'));
|
||||
disableUploadCheckbox = element(by.css('[id="adf-disable-upload"]'));
|
||||
|
||||
async enableMultipleFileUpload(): Promise<void> {
|
||||
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
|
||||
await this.togglePage.enableToggle(this.multipleFileUploadToggle);
|
||||
}
|
||||
|
||||
async disableMultipleFileUpload(): Promise<void> {
|
||||
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
|
||||
await this.togglePage.disableToggle(this.multipleFileUploadToggle);
|
||||
}
|
||||
|
||||
async enableFolderUpload(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.uploadFolderToggle);
|
||||
}
|
||||
|
||||
async checkFolderUploadToggleIsEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const enabledFolderUpload = element(by.css('mat-slide-toggle[id="adf-folder-upload-switch"][class*="mat-checked"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledFolderUpload);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async checkMultipleFileUploadToggleIsEnabled(): Promise<void> {
|
||||
const enabledToggle = element(by.css('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
async checkMaxSizeToggleIsEnabled(): Promise<void> {
|
||||
const enabledToggle = element(by.css('mat-slide-toggle[id="adf-max-size-filter-upload-switch"][class*="mat-checked"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
async checkVersioningToggleIsEnabled(): Promise<void> {
|
||||
const enabledToggle = element(by.css('mat-slide-toggle[id="adf-version-upload-switch"][class*="mat-checked"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
async disableFolderUpload(): Promise<void> {
|
||||
await this.togglePage.disableToggle(this.uploadFolderToggle);
|
||||
}
|
||||
async checkFolderUploadToggleIsNotEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const inactiveToggleFolder = element(by.css('#adf-folder-upload-switch .mat-slide-toggle-label'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(inactiveToggleFolder);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async enableExtensionFilter(): Promise<void> {
|
||||
await browser.executeScript('arguments[0].scrollIntoView()', this.extensionFilterToggle);
|
||||
await this.togglePage.enableToggle(this.extensionFilterToggle);
|
||||
}
|
||||
|
||||
async disableExtensionFilter(): Promise<void> {
|
||||
await browser.executeScript('arguments[0].scrollIntoView()', this.extensionFilterToggle);
|
||||
await this.togglePage.disableToggle(this.extensionFilterToggle);
|
||||
}
|
||||
|
||||
async enableMaxSize(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.maxSizeToggle);
|
||||
}
|
||||
|
||||
async disableMaxSize(): Promise<void> {
|
||||
await this.togglePage.disableToggle(this.maxSizeToggle);
|
||||
}
|
||||
|
||||
async enableVersioning(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.versioningToggle);
|
||||
}
|
||||
|
||||
async disableVersioning(): Promise<void> {
|
||||
await this.togglePage.disableToggle(this.versioningToggle);
|
||||
}
|
||||
|
||||
async clickCheckboxDisableUpload(): Promise<void> {
|
||||
await BrowserActions.click(this.disableUploadCheckbox);
|
||||
}
|
||||
|
||||
async addExtension(extension: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.extensionAcceptedField);
|
||||
await this.extensionAcceptedField.sendKeys(',' + extension);
|
||||
}
|
||||
|
||||
async addMaxSize(size): Promise<void> {
|
||||
await this.clearText();
|
||||
await this.maxSizeField.sendKeys(size);
|
||||
}
|
||||
|
||||
async clearText(): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.maxSizeField, '');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user