mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-5743] Cleanup Content tests (Demo Shell) (#8799)
* remove unused demo shell api
* remove recent files and cleanup unused api
* cleanup upload dialog page
* [ci:force] dummy commit
* [ci:force] cleanup the toolbar and tooltips
* [ci:force] remove dead code
* [ci:force] remove logger and custom action
* [ci:force] remove custom permission e2e test as already tested by unit
* [ci:force] remove "Start process" from the Content demo as not related to document list
* [ci:force] remove useless divs for selection
* [ci:force] dummy change to trigger CI/CD
* Revert "[ci:force] remove useless divs for selection"
This reverts commit fb3ae0b439
.
* [ci:force] remove e2e for artificial scenario
* [ci:force] cleanup unused navigation bar protractor api
* [ci:force] cleanup unused datatable protractor api
* [ci:force] cleanup unused login protractor api
* [ci:force] fix process cloud demo page selector
This commit is contained in:
@@ -49,7 +49,6 @@ export class ContentServicesPage {
|
||||
|
||||
multipleFileUploadToggle = $('#adf-document-list-enable-drop-files');
|
||||
uploadBorder = $('#document-list-container');
|
||||
contentServices = $('.app-sidenav-link[data-automation-id="Content Services"]');
|
||||
currentFolder = $('div[class*="adf-breadcrumb-item adf-active"] div');
|
||||
createFolderButton = $('button[data-automation-id="create-new-folder"]');
|
||||
editFolderButton = $('button[data-automation-id="edit-folder"]');
|
||||
@@ -60,20 +59,14 @@ export class ContentServicesPage {
|
||||
uploadFileButtonInput = $('input[data-automation-id="upload-single-file"]');
|
||||
uploadMultipleFileButton = $('input[data-automation-id="upload-multiple-files"]');
|
||||
uploadFolderButton = $('input[data-automation-id="uploadFolder"]');
|
||||
errorSnackBar = $('simple-snack-bar[class*="mat-simple-snackbar"]');
|
||||
emptyPagination = $('adf-pagination[class*="adf-pagination__empty"]');
|
||||
dragAndDrop = $$('adf-upload-drag-area div').first();
|
||||
nameHeader = $$('div[data-automation-id="auto_header_content_id_name"] > span').first();
|
||||
sizeHeader = $$('div[data-automation-id="auto_header_content_id_content.sizeInBytes"] > span').first();
|
||||
createdByHeader = $$('div[data-automation-id="auto_header_content_id_createdByUser.displayName"] > span').first();
|
||||
createdHeader = $$('div[data-automation-id="auto_header_content_id_createdAt"] > span').first();
|
||||
recentFiles = $('.app-container-recent');
|
||||
recentFilesExpanded = $('.app-container-recent mat-expansion-panel-header.mat-expanded');
|
||||
recentFilesClosed = $('.app-container-recent mat-expansion-panel-header');
|
||||
recentFileIcon = $('.app-container-recent mat-expansion-panel-header mat-icon');
|
||||
emptyFolder = $('.adf-empty-folder-this-space-is-empty');
|
||||
emptyFolderImage = $('.adf-empty-folder-image');
|
||||
emptyRecent = $('.app-container-recent .app-empty-list__title');
|
||||
gridViewButton = $('button[data-automation-id="document-list-grid-view"]');
|
||||
cardViewContainer = $('div.app-document-list-container div.adf-datatable-card');
|
||||
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
||||
@@ -234,36 +227,6 @@ export class ContentServicesPage {
|
||||
return sorted;
|
||||
}
|
||||
|
||||
async checkRecentFileToBeShowed() {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.recentFiles);
|
||||
}
|
||||
|
||||
async expandRecentFiles(): Promise<void> {
|
||||
await this.checkRecentFileToBeShowed();
|
||||
await this.checkRecentFileToBeClosed();
|
||||
await BrowserActions.click(this.recentFilesClosed);
|
||||
await this.checkRecentFileToBeOpened();
|
||||
}
|
||||
|
||||
async closeRecentFiles(): Promise<void> {
|
||||
await this.checkRecentFileToBeShowed();
|
||||
await this.checkRecentFileToBeOpened();
|
||||
await BrowserActions.click(this.recentFilesExpanded);
|
||||
await this.checkRecentFileToBeClosed();
|
||||
}
|
||||
|
||||
async checkRecentFileToBeClosed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.recentFilesClosed);
|
||||
}
|
||||
|
||||
async checkRecentFileToBeOpened(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.recentFilesExpanded);
|
||||
}
|
||||
|
||||
async getRecentFileIcon(): Promise<string> {
|
||||
return BrowserActions.getText(this.recentFileIcon);
|
||||
}
|
||||
|
||||
// @deprecated prefer waitTillContentLoaded
|
||||
async checkDocumentListElementsAreDisplayed(): Promise<void> {
|
||||
await this.checkAcsContainer();
|
||||
@@ -286,10 +249,6 @@ export class ContentServicesPage {
|
||||
await this.contentList.dataTablePage().waitTillContentLoaded();
|
||||
}
|
||||
|
||||
async clickOnContentServices(): Promise<void> {
|
||||
await BrowserActions.click(this.contentServices);
|
||||
}
|
||||
|
||||
async numberOfResultsDisplayed(): Promise<number> {
|
||||
return this.contentList.dataTablePage().numberOfRows();
|
||||
}
|
||||
@@ -331,10 +290,6 @@ export class ContentServicesPage {
|
||||
return this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.createdBy);
|
||||
}
|
||||
|
||||
async checkListIsSortedBySizeColumn(sortOrder: string): Promise<any> {
|
||||
return this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.size);
|
||||
}
|
||||
|
||||
async sortAndCheckListIsOrderedByAuthor(sortOrder: string): Promise<any> {
|
||||
await this.sortByAuthor(sortOrder);
|
||||
return this.checkListIsSortedByAuthorColumn(sortOrder);
|
||||
@@ -460,11 +415,6 @@ export class ContentServicesPage {
|
||||
return BrowserActions.getAttribute(this.uploadMultipleFileButton, 'title');
|
||||
}
|
||||
|
||||
async getFolderButtonTooltip(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFolderButton);
|
||||
return BrowserActions.getAttribute(this.uploadFolderButton, 'title');
|
||||
}
|
||||
|
||||
async checkUploadButton(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsClickable(this.uploadFileButton);
|
||||
}
|
||||
@@ -473,20 +423,11 @@ export class ContentServicesPage {
|
||||
return this.uploadFileButton.isEnabled();
|
||||
}
|
||||
|
||||
async getErrorMessage(): Promise<string> {
|
||||
return BrowserActions.getText(this.errorSnackBar);
|
||||
}
|
||||
|
||||
async enableInfiniteScrolling(): Promise<void> {
|
||||
const infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
|
||||
await BrowserActions.click(infiniteScrollButton);
|
||||
}
|
||||
|
||||
async enableCustomPermissionMessage(): Promise<void> {
|
||||
const customPermissionMessage = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
|
||||
await BrowserActions.click(customPermissionMessage);
|
||||
}
|
||||
|
||||
async enableMediumTimeFormat(): Promise<void> {
|
||||
const mediumTimeFormat = $('#enableMediumTimeFormat');
|
||||
await BrowserActions.click(mediumTimeFormat);
|
||||
@@ -532,11 +473,6 @@ export class ContentServicesPage {
|
||||
await DropActions.dropFile(this.dragAndDrop, file);
|
||||
}
|
||||
|
||||
async dragAndDropFolder(folderName: string): Promise<void> {
|
||||
await this.checkDragAndDropDIsDisplayed();
|
||||
await DropActions.dropFolder(this.dragAndDrop, folderName);
|
||||
}
|
||||
|
||||
async checkLockIsDisplayedForElement(name): Promise<void> {
|
||||
const lockButton = $(`div.adf-datatable-cell[data-automation-id="${name}"] button`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(lockButton);
|
||||
@@ -546,12 +482,6 @@ export class ContentServicesPage {
|
||||
return this.contentList.dataTablePage().getColumnValueForRow(this.columns.name, file, columnName);
|
||||
}
|
||||
|
||||
async getStyleValueForRowText(rowName, styleName): Promise<string> {
|
||||
const row = $(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
return row.getCssValue(styleName);
|
||||
}
|
||||
|
||||
async checkEmptyFolderTextToBe(text): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyFolder);
|
||||
await expect(await this.emptyFolder.getText()).toContain(text);
|
||||
@@ -561,10 +491,6 @@ export class ContentServicesPage {
|
||||
await expect(await BrowserActions.getAttribute(this.emptyFolderImage, 'src')).toContain(url);
|
||||
}
|
||||
|
||||
async checkEmptyRecentFileIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyRecent);
|
||||
}
|
||||
|
||||
async getRowIconImageUrl(fileName): Promise<string> {
|
||||
const iconRow = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`);
|
||||
return BrowserActions.getAttribute(iconRow, 'src');
|
||||
|
@@ -33,18 +33,10 @@ export class DataTablePage {
|
||||
};
|
||||
|
||||
dataTable: DataTableComponentPage;
|
||||
multiSelect = $(`div[data-automation-id='multiselect'] label > .mat-checkbox-inner-container`);
|
||||
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||
allSelectedRows = $$(`adf-datatable-row[class*='is-selected']`);
|
||||
selectedRowNumber = $(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`);
|
||||
selectAll = $(`div[class*='header'] label`);
|
||||
addRowElement = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
|
||||
replaceRowsElement = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
|
||||
replaceColumnsElement = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
|
||||
createdOnColumn = $(`div[data-automation-id='auto_id_createdOn']`);
|
||||
idColumnHeader = $(`div[data-automation-id='auto_id_id']`);
|
||||
pasteClipboardInput = $(`input[data-automation-id='paste clipboard input']`);
|
||||
|
||||
selectModeDropdown = new DropdownPage($(`mat-select[data-automation-id='datatable-selection-mode']`));
|
||||
|
||||
constructor(data?) {
|
||||
@@ -55,35 +47,6 @@ export class DataTablePage {
|
||||
}
|
||||
}
|
||||
|
||||
async insertFilter(filterText: string): Promise<void> {
|
||||
const inputFilter = $(`#adf-datatable-filter-input`);
|
||||
await BrowserActions.clearSendKeys(inputFilter, filterText);
|
||||
}
|
||||
|
||||
async addRow(): Promise<void> {
|
||||
await BrowserActions.click(this.addRowElement);
|
||||
}
|
||||
|
||||
async replaceRows(id: string): Promise<void> {
|
||||
const rowID = this.dataTable.getCellElementByValue(this.columns.id, id);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(rowID);
|
||||
await BrowserActions.click(this.replaceRowsElement);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(rowID);
|
||||
}
|
||||
|
||||
async replaceColumns(): Promise<void> {
|
||||
await BrowserActions.click(this.replaceColumnsElement);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.createdOnColumn);
|
||||
}
|
||||
|
||||
async clickMultiSelect(): Promise<void> {
|
||||
await BrowserActions.click(this.multiSelect);
|
||||
}
|
||||
|
||||
async clickReset(): Promise<void> {
|
||||
await BrowserActions.click(this.reset);
|
||||
}
|
||||
|
||||
async checkRowIsNotSelected(rowNumber: string): Promise<void> {
|
||||
const isRowSelected = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
|
||||
.element(by.xpath(`ancestor::adf-datatable-row[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`));
|
||||
@@ -94,29 +57,10 @@ export class DataTablePage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectedRowNumber);
|
||||
}
|
||||
|
||||
async checkAllRows(): Promise<void> {
|
||||
await BrowserActions.click(this.selectAll);
|
||||
}
|
||||
|
||||
async checkRowIsChecked(rowNumber: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
|
||||
}
|
||||
|
||||
async checkRowIsNotChecked(rowNumber: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.getRowCheckbox(rowNumber));
|
||||
}
|
||||
|
||||
async getNumberOfSelectedRows(): Promise<number> {
|
||||
return this.allSelectedRows.count();
|
||||
}
|
||||
|
||||
async clickCheckbox(rowNumber: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const checkbox = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
|
||||
.element(by.xpath(`ancestor::adf-datatable-row[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
|
||||
await BrowserActions.click(checkbox);
|
||||
}
|
||||
|
||||
async selectRow(rowNumber: string): Promise<void> {
|
||||
const row = this.dataTable.getCellElementByValue(this.columns.id, rowNumber);
|
||||
await BrowserActions.click(row);
|
||||
@@ -132,32 +76,6 @@ export class DataTablePage {
|
||||
await this.selectModeDropdown.selectDropdownOption(selectionMode);
|
||||
}
|
||||
|
||||
getRowCheckbox(rowNumber: string): ElementFinder {
|
||||
return this.dataTable.getCellElementByValue(this.columns.id, rowNumber).element(by.xpath(`ancestor::adf-datatable-row/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]`));
|
||||
}
|
||||
|
||||
async getCopyContentTooltip(): Promise<string> {
|
||||
return this.dataTable.getCopyContentTooltip();
|
||||
}
|
||||
|
||||
async mouseOverNameColumn(name: string): Promise<void> {
|
||||
await this.dataTable.mouseOverColumn(this.columns.name, name);
|
||||
}
|
||||
|
||||
async mouseOverCreatedByColumn(name: string): Promise<void> {
|
||||
await this.dataTable.mouseOverColumn(this.columns.createdBy, name);
|
||||
}
|
||||
|
||||
async mouseOverIdColumn(name: string): Promise<void> {
|
||||
await this.dataTable.mouseOverColumn(this.columns.id, name);
|
||||
}
|
||||
|
||||
async mouseOverJsonColumn(rowNumber: number): Promise<void> {
|
||||
const cell = this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(cell);
|
||||
await browser.actions().mouseMove(cell).perform();
|
||||
}
|
||||
|
||||
getDropTargetIdColumnCell(rowNumber: number): ElementFinder {
|
||||
return this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.id);
|
||||
}
|
||||
@@ -165,31 +83,4 @@ export class DataTablePage {
|
||||
getDropTargetIdColumnHeader(): ElementFinder {
|
||||
return this.idColumnHeader;
|
||||
}
|
||||
|
||||
async clickOnIdColumn(name: string): Promise<void> {
|
||||
await this.dataTable.clickColumn(this.columns.id, name);
|
||||
}
|
||||
|
||||
async clickOnJsonColumn(rowNumber: number): Promise<void> {
|
||||
await BrowserActions.click(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
|
||||
}
|
||||
|
||||
async clickOnNameColumn(name: string): Promise<void> {
|
||||
await this.dataTable.clickColumn(this.columns.name, name);
|
||||
}
|
||||
|
||||
async clickOnCreatedByColumn(name: string): Promise<void> {
|
||||
await this.dataTable.clickColumn(this.columns.createdBy, name);
|
||||
}
|
||||
|
||||
async pasteClipboard(): Promise<void> {
|
||||
await this.pasteClipboardInput.clear();
|
||||
await BrowserActions.click(this.pasteClipboardInput);
|
||||
await this.pasteClipboardInput.sendKeys(protractor.Key.chord(protractor.Key.SHIFT, protractor.Key.INSERT));
|
||||
}
|
||||
|
||||
async getClipboardInputText(): Promise<string> {
|
||||
const inputValue = await BrowserActions.getInputValue(this.pasteClipboardInput);
|
||||
return inputValue.match(/\d/).toString();
|
||||
}
|
||||
}
|
||||
|
@@ -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];
|
||||
|
@@ -44,16 +44,6 @@ export class UploadTogglesPage {
|
||||
await this.togglePage.enableToggle(this.uploadFolderToggle);
|
||||
}
|
||||
|
||||
async checkFolderUploadToggleIsEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const enabledFolderUpload = $('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 = $('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
@@ -69,19 +59,6 @@ export class UploadTogglesPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
async disableFolderUpload(): Promise<void> {
|
||||
await this.togglePage.disableToggle(this.uploadFolderToggle);
|
||||
}
|
||||
async checkFolderUploadToggleIsNotEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const inactiveToggleFolder = $('#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);
|
||||
@@ -125,5 +102,4 @@ export class UploadTogglesPage {
|
||||
async clearText(): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.maxSizeField, '');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@ import { $, browser, by, element } from 'protractor';
|
||||
import { TogglePage, BrowserActions, BrowserVisibility, LoginPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class LoginShellPage {
|
||||
|
||||
loginURL = browser.baseUrl + '/login';
|
||||
loginSSOPage = new LoginPage();
|
||||
|
||||
@@ -27,17 +26,12 @@ export class LoginShellPage {
|
||||
txtUsername = $('input[id="username"]');
|
||||
txtPassword = $('input[id="password"]');
|
||||
logoImg = $('img[id="adf-login-img-logo"]');
|
||||
successRouteTxt = $('input[data-automation-id="adf-success-route"]');
|
||||
logoTxt = $('input[data-automation-id="adf-url-logo"]');
|
||||
usernameError = $('span[data-automation-id="username-error"]');
|
||||
passwordError = $('span[data-automation-id="password-required"]');
|
||||
loginError = $('.adf-login-error-message');
|
||||
usernameInactive = $('input[id="username"][class*="ng-invalid"]');
|
||||
passwordInactive = $('input[id="password"][class*="ng-invalid"]');
|
||||
adfLogo = $('.adf-img-logo');
|
||||
|
||||
usernameHighlighted = $('input[id="username"][aria-invalid="true"]');
|
||||
passwordHighlighted = $('input[id="password"][aria-invalid="true"]');
|
||||
signInButton = $('#login-button');
|
||||
showPasswordElement = $('button[data-automation-id="show_password"]');
|
||||
hidePasswordElement = $('button[data-automation-id="hide_password"]');
|
||||
@@ -46,7 +40,6 @@ export class LoginShellPage {
|
||||
register = $('#adf-login-action-right');
|
||||
footerSwitch = $('#switch4');
|
||||
rememberMeSwitch = $('#adf-toggle-show-rememberme');
|
||||
successRouteSwitch = $('#adf-toggle-show-successRoute');
|
||||
logoSwitch = $('#adf-toggle-logo');
|
||||
header = $('#adf-header');
|
||||
settingsIcon = element(by.cssContainingText('a[data-automation-id="settings"] mat-icon', 'settings'));
|
||||
@@ -84,18 +77,6 @@ export class LoginShellPage {
|
||||
return BrowserActions.getText(this.usernameError);
|
||||
}
|
||||
|
||||
async getPasswordTooltip(): Promise<string> {
|
||||
return BrowserActions.getText(this.passwordError);
|
||||
}
|
||||
|
||||
async getLoginError(): Promise<string> {
|
||||
return BrowserActions.getText(this.loginError);
|
||||
}
|
||||
|
||||
async checkLoginErrorIsDisplayed(loginError: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementHasText(this.loginError, loginError);
|
||||
}
|
||||
|
||||
async checkLoginImgURL(): Promise<string> {
|
||||
return BrowserActions.getAttribute(this.logoImg, 'src');
|
||||
}
|
||||
@@ -104,29 +85,15 @@ export class LoginShellPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.usernameInactive);
|
||||
}
|
||||
|
||||
async checkPasswordInactive(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.passwordInactive);
|
||||
}
|
||||
|
||||
async checkUsernameHighlighted(): Promise<void> {
|
||||
await BrowserActions.click(this.adfLogo);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.usernameHighlighted);
|
||||
}
|
||||
|
||||
async checkPasswordHighlighted(): Promise<void> {
|
||||
await BrowserActions.click(this.adfLogo);
|
||||
await browser.sleep(900000);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.passwordHighlighted);
|
||||
}
|
||||
|
||||
async checkUsernameTooltipIsNotVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.usernameError);
|
||||
}
|
||||
|
||||
async checkPasswordTooltipIsNotVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.passwordError);
|
||||
}
|
||||
|
||||
async getSignInButtonIsEnabled(): Promise<boolean> {
|
||||
return this.signInButton.isEnabled();
|
||||
}
|
||||
@@ -191,18 +158,10 @@ export class LoginShellPage {
|
||||
await this.togglePage.disableToggle(this.rememberMeSwitch);
|
||||
}
|
||||
|
||||
async enableSuccessRouteSwitch(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.successRouteSwitch);
|
||||
}
|
||||
|
||||
async enableLogoSwitch(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.logoSwitch);
|
||||
}
|
||||
|
||||
async enterSuccessRoute(route: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.successRouteTxt, route);
|
||||
}
|
||||
|
||||
async enterLogo(logo: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.logoTxt, logo);
|
||||
}
|
||||
|
@@ -20,21 +20,12 @@ import { $, browser, ElementFinder } from 'protractor';
|
||||
import { ProcessServicesPage } from '../../process-services/pages/process-services.page';
|
||||
|
||||
export class NavigationBarPage {
|
||||
|
||||
linkListContainer = $('.app-sidenav-linklist');
|
||||
linkMenuChildrenContainer = $('.nestedMenu');
|
||||
dataTableNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Datatable"]');
|
||||
dataTableCopyContentButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Copy Content"]');
|
||||
dataTableDragAndDropButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Drag and Drop"]');
|
||||
processServicesNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="App"]');
|
||||
processServicesCloudHomeButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Home"]');
|
||||
themeButton = $('button[data-automation-id="theme menu"]');
|
||||
themeMenuContent = $('div[class*="mat-menu-panel"]');
|
||||
appTitle = $('.adf-app-title');
|
||||
menuButton = $('button[data-automation-id="adf-menu-icon"]');
|
||||
formButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Form"]');
|
||||
peopleGroupCloudButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="People/Group Cloud"]');
|
||||
serviceTaskListButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Service Task List"]');
|
||||
logoutSection = $('div[data-automation-id="adf-logout-section"]');
|
||||
personalFiles = $('div [title="Personal Files"]');
|
||||
|
||||
@@ -61,10 +52,6 @@ export class NavigationBarPage {
|
||||
await this.clickNavigationBarItem('Content Services', this.personalFiles);
|
||||
}
|
||||
|
||||
async clickHeaderDataButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Header Data');
|
||||
}
|
||||
|
||||
async clickTaskListButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Task List');
|
||||
}
|
||||
@@ -87,18 +74,6 @@ export class NavigationBarPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToPeopleGroupCloudPage(): Promise<void> {
|
||||
await this.clickProcessCloudButton();
|
||||
await BrowserActions.click(this.peopleGroupCloudButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToServiceTaskListCloudPage(): Promise<void> {
|
||||
await this.clickProcessCloudButton();
|
||||
await BrowserActions.click(this.serviceTaskListButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
private async clickProcessServicesButton() {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItemLocator('Process Services'), this.linkMenuChildrenContainer);
|
||||
@@ -117,10 +92,6 @@ export class NavigationBarPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async clickLoginButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Login');
|
||||
}
|
||||
|
||||
async clickTrashcanButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Trashcan');
|
||||
}
|
||||
@@ -146,12 +117,6 @@ export class NavigationBarPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToCopyContentDatatable(): Promise<void> {
|
||||
await this.clickDataTable();
|
||||
await BrowserActions.click(this.dataTableCopyContentButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async clickTagButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Tag');
|
||||
}
|
||||
@@ -160,14 +125,6 @@ export class NavigationBarPage {
|
||||
await this.clickNavigationBarItem('Social');
|
||||
}
|
||||
|
||||
async clickSettingsButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Settings');
|
||||
}
|
||||
|
||||
async clickConfigEditorButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Configuration Editor');
|
||||
}
|
||||
|
||||
async clickOverlayViewerButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Overlay Viewer');
|
||||
}
|
||||
@@ -176,14 +133,6 @@ export class NavigationBarPage {
|
||||
await this.clickNavigationBarItem('Tree View');
|
||||
}
|
||||
|
||||
async clickIconsButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('Icons');
|
||||
}
|
||||
|
||||
async clickAboutButton(): Promise<void> {
|
||||
await this.clickNavigationBarItem('About');
|
||||
}
|
||||
|
||||
async clickLogoutButton(): Promise<void> {
|
||||
Logger.log('Logout');
|
||||
try {
|
||||
@@ -196,58 +145,11 @@ export class NavigationBarPage {
|
||||
}
|
||||
}
|
||||
|
||||
async clickThemeButton(): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(this.themeButton);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.themeMenuContent);
|
||||
}
|
||||
|
||||
async clickOnSpecificThemeButton(themeName): Promise<void> {
|
||||
const themeElement = $(`button[data-automation-id="${themeName}"]`);
|
||||
await BrowserActions.click(themeElement);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async openContentServicesFolder(folderId): Promise<void> {
|
||||
await BrowserActions.getUrl(`${browser.baseUrl}/files/${folderId}`);
|
||||
}
|
||||
|
||||
async checkMenuButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.menuButton);
|
||||
}
|
||||
|
||||
async checkMenuButtonIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.menuButton);
|
||||
}
|
||||
|
||||
async checkToolbarColor(color: string): Promise<void> {
|
||||
const toolbarColor = $(`mat-toolbar[class*="mat-${color}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(toolbarColor);
|
||||
}
|
||||
|
||||
async clickAppLogo(logoTitle: string): Promise<void> {
|
||||
const appLogo = $('a[title="' + logoTitle + '"]');
|
||||
await BrowserActions.click(appLogo);
|
||||
}
|
||||
|
||||
async clickAppLogoText(): Promise<void> {
|
||||
await BrowserActions.click(this.appTitle);
|
||||
}
|
||||
|
||||
async checkLogoTooltip(logoTooltipTitle: string): Promise<void> {
|
||||
const logoTooltip = $('a[title="' + logoTooltipTitle + '"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(logoTooltip);
|
||||
}
|
||||
|
||||
async openViewer(nodeId: string): Promise<void> {
|
||||
await BrowserActions.getUrl(browser.baseUrl + `/files(overlay:files/${nodeId}/view`);
|
||||
}
|
||||
|
||||
async goToSite(site): Promise<void> {
|
||||
await BrowserActions.getUrl(browser.baseUrl + `/files/${site.entry.guid}/display/list`);
|
||||
}
|
||||
|
||||
async scrollTo(el: ElementFinder): Promise<void> {
|
||||
await browser.executeScript(`return arguments[0].scrollTop = arguments[1].offsetTop`, this.linkListContainer.getWebElement(), el.getWebElement());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user