mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Disable control flow e2e ADF (#4954)
* update project script possible different JS-API * first commit no controll flow * second commit no controll flow * third commit no controll flow * 4 commit no controll flow * 5 commit no controll flow * 6 commit no controll flow * 7 commit no controll flow * 8 commit no controll flow * 9 commit no controll flow * 10 commit no controll flow * 11 commit no controll flow * 12 commit no controll flow * 13 commit no controll flow * 14 commit no controll flow * 15 commit no controll flow * 16 commit no controll flow * 17 commit no controll flow * 18 commit no controll flow * 19 commit no controll flow * 20 commit no controll flow * remove wdpromise, protractor promise and deferred promises * - fixed some incorrect “expect” calls - fixed some matchers - removed “return this;” when not needed - added a few more await-s * forgot a file * fix some failing tests * replaced driver calls with browser calls and enabled back waitForAngular * fix rightClick methods and hopefully some tests * fix settings-component * some more fixes for core and content tests * try to fix some more issues * linting * revert some changes, allowing download on headless chrome won’t work with multiple browser instances * fixes for Search tests * try to remove some wait calls * fix build * increase allScriptsTimeout and try another protractor and web driver version * improve navigation methods * some fixes for notification history and login sso * forgot a space * fix packages and enable some screenshots * navigation bar fixes * fix some test * some fixes for notification history and navigation bar use correct visibility method in attachFileWidget test * fix searching and another fix for navigation * try solve sso login * some more fixes * refactor async forEach into for..of * try fix for search tests * resolve rebabse problems * remove install * fix lint * fix core e2e * fix core e2e * fix core e2e * fix ps tests * fix some tests * fix core e2e * fix core e2e * fix core * fix some issues PS * fix core * fix core * fix some ps test * fix rebase issues * remove save * fix url regressed after rebase * fix url regressed after rebase * fix ps and core * fix lint * more parallel e2e ps * fix some ps cloud test * some cloud fix * fix lint * fix some test * remove files to be ignored * out-tsc * improve one cs test * fix candidate base app * fix ps test * remove click function * clean methods alrady present in browser action * try ugly wait * move wait * remove duplicate call * remove underscore * fix after review * fix imports * minor cosmetic fixes * fix comments test
This commit is contained in:
@@ -19,7 +19,7 @@ import { FolderDialog } from './dialog/folderDialog';
|
||||
import { CreateLibraryDialog } from './dialog/createLibraryDialog';
|
||||
import { FormControllersPage } from '@alfresco/adf-testing';
|
||||
import { DropActions } from '../../actions/drop.actions';
|
||||
import { by, element, protractor, $$, browser } from 'protractor';
|
||||
import { by, element, protractor, $$, browser, ElementFinder } from 'protractor';
|
||||
|
||||
import path = require('path');
|
||||
import { BrowserVisibility, DocumentListPage, BrowserActions, DateUtil } from '@alfresco/adf-testing';
|
||||
@@ -35,166 +35,158 @@ export class ContentServicesPage {
|
||||
created: 'Created'
|
||||
};
|
||||
|
||||
contentList = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
|
||||
formControllersPage = new FormControllersPage();
|
||||
multipleFileUploadToggle = element(by.id('adf-document-list-enable-drop-files'));
|
||||
createFolderDialog = new FolderDialog();
|
||||
createLibraryDialog = new CreateLibraryDialog();
|
||||
dragAndDropAction = new DropActions();
|
||||
uploadBorder = element(by.id('document-list-container'));
|
||||
contentServices = element(by.css('.adf-sidenav-link[data-automation-id="Content Services"]'));
|
||||
currentFolder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
|
||||
createFolderButton = element(by.css('button[data-automation-id="create-new-folder"]'));
|
||||
editFolderButton = element(by.css('button[data-automation-id="edit-folder"]'));
|
||||
createLibraryButton = element(by.css('button[data-automation-id="create-new-library"]'));
|
||||
activeBreadcrumb = element(by.css('div[class*="active"]'));
|
||||
contentList: DocumentListPage = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
|
||||
formControllersPage: FormControllersPage = new FormControllersPage();
|
||||
createFolderDialog: FolderDialog = new FolderDialog();
|
||||
createLibraryDialog: CreateLibraryDialog = new CreateLibraryDialog();
|
||||
dragAndDropAction: DropActions = new DropActions();
|
||||
|
||||
multipleFileUploadToggle: ElementFinder = element(by.id('adf-document-list-enable-drop-files'));
|
||||
uploadBorder: ElementFinder = element(by.id('document-list-container'));
|
||||
contentServices: ElementFinder = element(by.css('.adf-sidenav-link[data-automation-id="Content Services"]'));
|
||||
currentFolder: ElementFinder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
|
||||
createFolderButton: ElementFinder = element(by.css('button[data-automation-id="create-new-folder"]'));
|
||||
editFolderButton: ElementFinder = element(by.css('button[data-automation-id="edit-folder"]'));
|
||||
createLibraryButton: ElementFinder = element(by.css('button[data-automation-id="create-new-library"]'));
|
||||
activeBreadcrumb: ElementFinder = element(by.css('div[class*="active"]'));
|
||||
tooltip = by.css('div[class*="--text adf-full-width"] span');
|
||||
uploadFileButton = element(by.css('.adf-upload-button-file-container button'));
|
||||
uploadFileButtonInput = element(by.css('input[data-automation-id="upload-single-file"]'));
|
||||
uploadMultipleFileButton = element(by.css('input[data-automation-id="upload-multiple-files"]'));
|
||||
uploadFolderButton = element(by.css('input[data-automation-id="uploadFolder"]'));
|
||||
errorSnackBar = element(by.css('simple-snack-bar[class*="mat-simple-snackbar"]'));
|
||||
emptyPagination = element(by.css('adf-pagination[class*="adf-pagination__empty"]'));
|
||||
dragAndDrop = element.all(by.css('adf-upload-drag-area div')).first();
|
||||
nameHeader = element(by.css('div[data-automation-id="auto_id_name"] > span'));
|
||||
sizeHeader = element(by.css('div[data-automation-id="auto_id_content.sizeInBytes"] > span'));
|
||||
createdByHeader = element(by.css('div[data-automation-id="auto_id_createdByUser.displayName"] > span'));
|
||||
createdHeader = element(by.css('div[data-automation-id="auto_id_createdAt"] > span'));
|
||||
recentFiles = element(by.css('.adf-container-recent'));
|
||||
recentFilesExpanded = element(by.css('.adf-container-recent mat-expansion-panel-header.mat-expanded'));
|
||||
recentFilesClosed = element(by.css('.adf-container-recent mat-expansion-panel-header'));
|
||||
recentFileIcon = element(by.css('.adf-container-recent mat-expansion-panel-header mat-icon'));
|
||||
documentListSpinner = element(by.css('mat-progress-spinner'));
|
||||
emptyFolder = element(by.css('.adf-empty-folder-this-space-is-empty'));
|
||||
emptyFolderImage = element(by.css('.adf-empty-folder-image'));
|
||||
emptyRecent = element(by.css('.adf-container-recent .adf-empty-list__title'));
|
||||
gridViewButton = element(by.css('button[data-automation-id="document-list-grid-view"]'));
|
||||
cardViewContainer = element(by.css('div.adf-document-list-container div.adf-datatable-card'));
|
||||
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
||||
uploadFileButton: ElementFinder = element(by.css('.adf-upload-button-file-container button'));
|
||||
uploadFileButtonInput: ElementFinder = element(by.css('input[data-automation-id="upload-single-file"]'));
|
||||
uploadMultipleFileButton: ElementFinder = element(by.css('input[data-automation-id="upload-multiple-files"]'));
|
||||
uploadFolderButton: ElementFinder = element(by.css('input[data-automation-id="uploadFolder"]'));
|
||||
errorSnackBar: ElementFinder = element(by.css('simple-snack-bar[class*="mat-simple-snackbar"]'));
|
||||
emptyPagination: ElementFinder = element(by.css('adf-pagination[class*="adf-pagination__empty"]'));
|
||||
dragAndDrop: ElementFinder = element.all(by.css('adf-upload-drag-area div')).first();
|
||||
nameHeader: ElementFinder = element(by.css('div[data-automation-id="auto_id_name"] > span'));
|
||||
sizeHeader: ElementFinder = element(by.css('div[data-automation-id="auto_id_content.sizeInBytes"] > span'));
|
||||
createdByHeader: ElementFinder = element(by.css('div[data-automation-id="auto_id_createdByUser.displayName"] > span'));
|
||||
createdHeader: ElementFinder = element(by.css('div[data-automation-id="auto_id_createdAt"] > span'));
|
||||
recentFiles: ElementFinder = element(by.css('.adf-container-recent'));
|
||||
recentFilesExpanded: ElementFinder = element(by.css('.adf-container-recent mat-expansion-panel-header.mat-expanded'));
|
||||
recentFilesClosed: ElementFinder = element(by.css('.adf-container-recent mat-expansion-panel-header'));
|
||||
recentFileIcon: ElementFinder = element(by.css('.adf-container-recent mat-expansion-panel-header mat-icon'));
|
||||
emptyFolder: ElementFinder = element(by.css('.adf-empty-folder-this-space-is-empty'));
|
||||
emptyFolderImage: ElementFinder = element(by.css('.adf-empty-folder-image'));
|
||||
emptyRecent: ElementFinder = element(by.css('.adf-container-recent .adf-empty-list__title'));
|
||||
gridViewButton: ElementFinder = element(by.css('button[data-automation-id="document-list-grid-view"]'));
|
||||
cardViewContainer: ElementFinder = element(by.css('div.adf-document-list-container div.adf-datatable-card'));
|
||||
shareNodeButton: ElementFinder = element(by.cssContainingText('mat-icon', ' share '));
|
||||
nameColumnHeader = 'name';
|
||||
createdByColumnHeader = 'createdByUser.displayName';
|
||||
createdColumnHeader = 'createdAt';
|
||||
deleteContentElement = element(by.css('button[data-automation-id*="DELETE"]'));
|
||||
metadataAction = element(by.css('button[data-automation-id*="METADATA"]'));
|
||||
versionManagerAction = element(by.css('button[data-automation-id*="VERSIONS"]'));
|
||||
moveContentElement = element(by.css('button[data-automation-id*="MOVE"]'));
|
||||
copyContentElement = element(by.css('button[data-automation-id*="COPY"]'));
|
||||
lockContentElement = element(by.css('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]'));
|
||||
downloadContent = element(by.css('button[data-automation-id*="DOWNLOAD"]'));
|
||||
siteListDropdown = element(by.css(`mat-select[data-automation-id='site-my-files-option']`));
|
||||
downloadButton = element(by.css('button[title="Download"]'));
|
||||
favoriteButton = element(by.css('button[data-automation-id="favorite"]'));
|
||||
markedFavorite = element(by.cssContainingText( 'button[data-automation-id="favorite"] mat-icon', 'star'));
|
||||
notMarkedFavorite = element(by.cssContainingText( 'button[data-automation-id="favorite"] mat-icon', 'star_border'));
|
||||
multiSelectToggle = element(by.cssContainingText('span.mat-slide-toggle-content', ' Multiselect (with checkboxes) '));
|
||||
deleteContentElement: ElementFinder = element(by.css('button[data-automation-id*="DELETE"]'));
|
||||
metadataAction: ElementFinder = element(by.css('button[data-automation-id*="METADATA"]'));
|
||||
versionManagerAction: ElementFinder = element(by.css('button[data-automation-id*="VERSIONS"]'));
|
||||
moveContentElement: ElementFinder = element(by.css('button[data-automation-id*="MOVE"]'));
|
||||
copyContentElement: ElementFinder = element(by.css('button[data-automation-id*="COPY"]'));
|
||||
lockContentElement: ElementFinder = element(by.css('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]'));
|
||||
downloadContent: ElementFinder = element(by.css('button[data-automation-id*="DOWNLOAD"]'));
|
||||
siteListDropdown: ElementFinder = element(by.css(`mat-select[data-automation-id='site-my-files-option']`));
|
||||
downloadButton: ElementFinder = element(by.css('button[title="Download"]'));
|
||||
favoriteButton: ElementFinder = element(by.css('button[data-automation-id="favorite"]'));
|
||||
markedFavorite: ElementFinder = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star'));
|
||||
notMarkedFavorite: ElementFinder = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star_border'));
|
||||
multiSelectToggle: ElementFinder = element(by.cssContainingText('span.mat-slide-toggle-content', ' Multiselect (with checkboxes) '));
|
||||
|
||||
pressContextMenuActionNamed(actionName) {
|
||||
BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
|
||||
async pressContextMenuActionNamed(actionName): Promise<void> {
|
||||
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
|
||||
}
|
||||
|
||||
checkContextActionIsVisible(actionName) {
|
||||
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
return actionButton;
|
||||
async checkContextActionIsVisible(actionName) {
|
||||
const actionButton: ElementFinder = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
}
|
||||
|
||||
checkContentActionIsEnabled(actionName) {
|
||||
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
async isContextActionEnabled(actionName): Promise<boolean> {
|
||||
const actionButton: ElementFinder = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
return actionButton.isEnabled();
|
||||
}
|
||||
|
||||
getDocumentList() {
|
||||
getDocumentList(): DocumentListPage {
|
||||
return this.contentList;
|
||||
}
|
||||
|
||||
closeActionContext() {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
return this;
|
||||
async closeActionContext(): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
}
|
||||
|
||||
checkLockedIcon(content) {
|
||||
return this.contentList.checkLockedIcon(content);
|
||||
async checkLockedIcon(content): Promise<void> {
|
||||
return await this.contentList.checkLockedIcon(content);
|
||||
}
|
||||
|
||||
checkUnlockedIcon(content) {
|
||||
return this.contentList.checkUnlockedIcon(content);
|
||||
async checkUnlockedIcon(content): Promise<void> {
|
||||
return await this.contentList.checkUnlockedIcon(content);
|
||||
}
|
||||
|
||||
checkDeleteIsDisabled(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
const disabledDelete = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
|
||||
async checkDeleteIsDisabled(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
await this.waitForContentOptions();
|
||||
const disabledDelete: ElementFinder = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
|
||||
}
|
||||
|
||||
deleteContent(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
BrowserActions.click(this.deleteContentElement);
|
||||
async deleteContent(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
await this.waitForContentOptions();
|
||||
await BrowserActions.click(this.deleteContentElement);
|
||||
}
|
||||
|
||||
metadataContent(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
BrowserActions.click(this.metadataAction);
|
||||
async metadataContent(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
await this.waitForContentOptions();
|
||||
await BrowserActions.click(this.metadataAction);
|
||||
}
|
||||
|
||||
versionManagerContent(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
BrowserActions.click(this.versionManagerAction);
|
||||
async versionManagerContent(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
await this.waitForContentOptions();
|
||||
await BrowserActions.click(this.versionManagerAction);
|
||||
}
|
||||
|
||||
copyContent(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
BrowserActions.click(this.copyContentElement);
|
||||
async copyContent(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
await BrowserActions.click(this.copyContentElement);
|
||||
}
|
||||
|
||||
lockContent(content) {
|
||||
this.contentList.clickOnActionMenu(content);
|
||||
BrowserActions.click(this.lockContentElement);
|
||||
async lockContent(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
await BrowserActions.click(this.lockContentElement);
|
||||
}
|
||||
|
||||
waitForContentOptions() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.copyContentElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.moveContentElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.deleteContentElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.downloadContent);
|
||||
async waitForContentOptions(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.copyContentElement);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.moveContentElement);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.deleteContentElement);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.downloadContent);
|
||||
}
|
||||
|
||||
clickFileHyperlink(fileName) {
|
||||
async clickFileHyperlink(fileName): Promise<void> {
|
||||
const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName);
|
||||
|
||||
BrowserActions.click(hyperlink);
|
||||
return this;
|
||||
await BrowserActions.click(hyperlink);
|
||||
}
|
||||
|
||||
checkFileHyperlinkIsEnabled(fileName) {
|
||||
async checkFileHyperlinkIsEnabled(fileName): Promise<void> {
|
||||
const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName);
|
||||
BrowserVisibility.waitUntilElementIsVisible(hyperlink);
|
||||
return this;
|
||||
await BrowserVisibility.waitUntilElementIsVisible(hyperlink);
|
||||
}
|
||||
|
||||
clickHyperlinkNavigationToggle() {
|
||||
const hyperlinkToggle = element(by.cssContainingText('.mat-slide-toggle-content', 'Hyperlink navigation'));
|
||||
BrowserActions.click(hyperlinkToggle);
|
||||
return this;
|
||||
async clickHyperlinkNavigationToggle(): Promise<void> {
|
||||
const hyperlinkToggle: ElementFinder = element(by.cssContainingText('.mat-slide-toggle-content', 'Hyperlink navigation'));
|
||||
await BrowserActions.click(hyperlinkToggle);
|
||||
}
|
||||
|
||||
enableDropFilesInAFolder() {
|
||||
this.formControllersPage.enableToggle(this.multipleFileUploadToggle);
|
||||
return this;
|
||||
async enableDropFilesInAFolder(): Promise<void> {
|
||||
await this.formControllersPage.enableToggle(this.multipleFileUploadToggle);
|
||||
}
|
||||
|
||||
disableDropFilesInAFolder() {
|
||||
browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
|
||||
this.formControllersPage.disableToggle(this.multipleFileUploadToggle);
|
||||
return this;
|
||||
async disableDropFilesInAFolder(): Promise<void> {
|
||||
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
|
||||
await this.formControllersPage.disableToggle(this.multipleFileUploadToggle);
|
||||
}
|
||||
|
||||
getElementsDisplayedId() {
|
||||
return this.contentList.dataTablePage().getAllRowsColumnValues(this.columns.nodeId);
|
||||
async getElementsDisplayedId() {
|
||||
return await this.contentList.dataTablePage().getAllRowsColumnValues(this.columns.nodeId);
|
||||
}
|
||||
|
||||
checkElementsDateSortedAsc(elements) {
|
||||
@@ -229,459 +221,393 @@ export class ContentServicesPage {
|
||||
return sorted;
|
||||
}
|
||||
|
||||
getContentList() {
|
||||
return this.contentList;
|
||||
async checkRecentFileToBeShowed() {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.recentFiles);
|
||||
}
|
||||
|
||||
checkRecentFileToBeShowed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.recentFiles);
|
||||
async expandRecentFiles(): Promise<void> {
|
||||
await this.checkRecentFileToBeShowed();
|
||||
await this.checkRecentFileToBeClosed();
|
||||
await BrowserActions.click(this.recentFilesClosed);
|
||||
await this.checkRecentFileToBeOpened();
|
||||
}
|
||||
|
||||
expandRecentFiles() {
|
||||
this.checkRecentFileToBeShowed();
|
||||
this.checkRecentFileToBeClosed();
|
||||
BrowserActions.click(this.recentFilesClosed);
|
||||
this.checkRecentFileToBeOpened();
|
||||
async closeRecentFiles(): Promise<void> {
|
||||
await this.checkRecentFileToBeShowed();
|
||||
await this.checkRecentFileToBeOpened();
|
||||
await BrowserActions.click(this.recentFilesExpanded);
|
||||
await this.checkRecentFileToBeClosed();
|
||||
}
|
||||
|
||||
closeRecentFiles() {
|
||||
this.checkRecentFileToBeShowed();
|
||||
this.checkRecentFileToBeOpened();
|
||||
BrowserActions.click(this.recentFilesExpanded);
|
||||
this.checkRecentFileToBeClosed();
|
||||
async checkRecentFileToBeClosed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.recentFilesClosed);
|
||||
}
|
||||
|
||||
checkRecentFileToBeClosed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.recentFilesClosed);
|
||||
async checkRecentFileToBeOpened(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.recentFilesExpanded);
|
||||
}
|
||||
|
||||
checkRecentFileToBeOpened() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.recentFilesExpanded);
|
||||
async getRecentFileIcon(): Promise<string> {
|
||||
return await BrowserActions.getText(this.recentFileIcon);
|
||||
}
|
||||
|
||||
async getRecentFileIcon() {
|
||||
return BrowserActions.getText(this.recentFileIcon);
|
||||
async checkAcsContainer(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.uploadBorder);
|
||||
}
|
||||
|
||||
checkAcsContainer() {
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.uploadBorder);
|
||||
}
|
||||
|
||||
async waitForTableBody() {
|
||||
async waitForTableBody(): Promise<void> {
|
||||
await this.contentList.waitForTableBody();
|
||||
}
|
||||
|
||||
goToDocumentList() {
|
||||
async goToDocumentList(): Promise<void> {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
return this;
|
||||
await navigationBarPage.clickContentServicesButton();
|
||||
}
|
||||
|
||||
clickOnContentServices() {
|
||||
BrowserActions.click(this.contentServices);
|
||||
async clickOnContentServices(): Promise<void> {
|
||||
await BrowserActions.click(this.contentServices);
|
||||
}
|
||||
|
||||
numberOfResultsDisplayed() {
|
||||
return this.contentList.dataTablePage().numberOfRows();
|
||||
async numberOfResultsDisplayed(): Promise<number> {
|
||||
return await this.contentList.dataTablePage().numberOfRows();
|
||||
}
|
||||
|
||||
currentFolderName() {
|
||||
const deferred = protractor.promise.defer();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.currentFolder);
|
||||
this.currentFolder.getText().then(function (result) {
|
||||
deferred.fulfill(result);
|
||||
});
|
||||
return deferred.promise;
|
||||
async currentFolderName(): Promise<string> {
|
||||
return await BrowserActions.getText(this.currentFolder);
|
||||
}
|
||||
|
||||
getAllRowsNameColumn() {
|
||||
return this.contentList.getAllRowsColumnValues(this.columns.name);
|
||||
async getAllRowsNameColumn(): Promise<any> {
|
||||
return await this.contentList.getAllRowsColumnValues(this.columns.name);
|
||||
}
|
||||
|
||||
sortByName(sortOrder: string) {
|
||||
return this.contentList.dataTable.sortByColumn(sortOrder, this.nameColumnHeader);
|
||||
async sortByName(sortOrder: string): Promise<any> {
|
||||
await this.contentList.dataTable.sortByColumn(sortOrder, this.nameColumnHeader);
|
||||
}
|
||||
|
||||
sortByAuthor(sortOrder: string) {
|
||||
return this.contentList.dataTable.sortByColumn(sortOrder, this.createdByColumnHeader);
|
||||
async sortByAuthor(sortOrder: string): Promise<any> {
|
||||
await this.contentList.dataTable.sortByColumn(sortOrder, this.createdByColumnHeader);
|
||||
}
|
||||
|
||||
sortByCreated(sortOrder: string) {
|
||||
return this.contentList.dataTable.sortByColumn(sortOrder, this.createdColumnHeader);
|
||||
async sortByCreated(sortOrder: string): Promise<any> {
|
||||
await this.contentList.dataTable.sortByColumn(sortOrder, this.createdColumnHeader);
|
||||
}
|
||||
|
||||
sortAndCheckListIsOrderedByName(sortOrder: string) {
|
||||
this.sortByName(sortOrder);
|
||||
const deferred = protractor.promise.defer();
|
||||
this.checkListIsSortedByNameColumn(sortOrder).then((result) => {
|
||||
deferred.fulfill(result);
|
||||
});
|
||||
return deferred.promise;
|
||||
async sortAndCheckListIsOrderedByName(sortOrder: string): Promise<any> {
|
||||
await this.sortByName(sortOrder);
|
||||
return await this.checkListIsSortedByNameColumn(sortOrder);
|
||||
}
|
||||
|
||||
async checkListIsSortedByNameColumn(sortOrder: string) {
|
||||
async checkListIsSortedByNameColumn(sortOrder: string): Promise<any> {
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.name);
|
||||
}
|
||||
|
||||
async checkListIsSortedByCreatedColumn(sortOrder: string) {
|
||||
async checkListIsSortedByCreatedColumn(sortOrder: string): Promise<any> {
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.created);
|
||||
}
|
||||
|
||||
async checkListIsSortedByAuthorColumn(sortOrder: string) {
|
||||
async checkListIsSortedByAuthorColumn(sortOrder: string): Promise<any> {
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.createdBy);
|
||||
}
|
||||
|
||||
async checkListIsSortedBySizeColumn(sortOrder: string) {
|
||||
async checkListIsSortedBySizeColumn(sortOrder: string): Promise<any> {
|
||||
return await this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.size);
|
||||
}
|
||||
|
||||
sortAndCheckListIsOrderedByAuthor(sortOrder: string) {
|
||||
this.sortByAuthor(sortOrder);
|
||||
const deferred = protractor.promise.defer();
|
||||
this.checkListIsSortedByAuthorColumn(sortOrder).then((result) => {
|
||||
deferred.fulfill(result);
|
||||
});
|
||||
return deferred.promise;
|
||||
async sortAndCheckListIsOrderedByAuthor(sortOrder: string): Promise<any> {
|
||||
await this.sortByAuthor(sortOrder);
|
||||
return await this.checkListIsSortedByAuthorColumn(sortOrder);
|
||||
}
|
||||
|
||||
sortAndCheckListIsOrderedByCreated(sortOrder: string) {
|
||||
this.sortByCreated(sortOrder);
|
||||
const deferred = protractor.promise.defer();
|
||||
this.checkListIsSortedByCreatedColumn(sortOrder).then((result) => {
|
||||
deferred.fulfill(result);
|
||||
});
|
||||
return deferred.promise;
|
||||
async sortAndCheckListIsOrderedByCreated(sortOrder: string): Promise<any> {
|
||||
await this.sortByCreated(sortOrder);
|
||||
return await this.checkListIsSortedByCreatedColumn(sortOrder);
|
||||
}
|
||||
|
||||
doubleClickRow(nodeName) {
|
||||
this.contentList.doubleClickRow(nodeName);
|
||||
return this;
|
||||
async doubleClickRow(nodeName): Promise<void> {
|
||||
await this.contentList.doubleClickRow(nodeName);
|
||||
}
|
||||
|
||||
clickOnCreateNewFolder() {
|
||||
BrowserActions.click(this.createFolderButton);
|
||||
return this;
|
||||
async clickOnCreateNewFolder(): Promise<void> {
|
||||
await BrowserActions.click(this.createFolderButton);
|
||||
}
|
||||
|
||||
clickOnFavoriteButton() {
|
||||
BrowserActions.click(this.favoriteButton);
|
||||
return this;
|
||||
async clickOnFavoriteButton(): Promise<void> {
|
||||
await BrowserActions.click(this.favoriteButton);
|
||||
}
|
||||
|
||||
checkIsMarkedFavorite() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.markedFavorite);
|
||||
return this;
|
||||
async checkIsMarkedFavorite(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.markedFavorite);
|
||||
}
|
||||
|
||||
checkIsNotMarkedFavorite() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.notMarkedFavorite);
|
||||
return this;
|
||||
async checkIsNotMarkedFavorite(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.notMarkedFavorite);
|
||||
}
|
||||
|
||||
clickOnEditFolder() {
|
||||
BrowserActions.click(this.editFolderButton);
|
||||
return this;
|
||||
async clickOnEditFolder(): Promise<void> {
|
||||
await BrowserActions.click(this.editFolderButton);
|
||||
}
|
||||
|
||||
checkEditFolderButtonIsEnabled() {
|
||||
async isEditFolderButtonEnabled(): Promise<boolean> {
|
||||
return this.editFolderButton.isEnabled();
|
||||
}
|
||||
|
||||
openCreateLibraryDialog() {
|
||||
BrowserActions.click(this.createLibraryButton);
|
||||
this.createLibraryDialog.waitForDialogToOpen();
|
||||
return this.createLibraryDialog;
|
||||
async openCreateLibraryDialog(): Promise<void> {
|
||||
await BrowserActions.click(this.createLibraryButton);
|
||||
await this.createLibraryDialog.waitForDialogToOpen();
|
||||
}
|
||||
|
||||
createNewFolder(folder) {
|
||||
this.clickOnCreateNewFolder();
|
||||
this.createFolderDialog.addFolderName(folder);
|
||||
browser.sleep(200);
|
||||
this.createFolderDialog.clickOnCreateUpdateButton();
|
||||
return this;
|
||||
async createNewFolder(folder): Promise<void> {
|
||||
await this.clickOnCreateNewFolder();
|
||||
await this.createFolderDialog.addFolderName(folder);
|
||||
await this.createFolderDialog.clickOnCreateUpdateButton();
|
||||
}
|
||||
|
||||
checkContentIsDisplayed(content) {
|
||||
this.contentList.dataTablePage().checkContentIsDisplayed(this.columns.name, content);
|
||||
return this;
|
||||
async checkContentIsDisplayed(content): Promise<void> {
|
||||
await this.contentList.dataTablePage().checkContentIsDisplayed(this.columns.name, content);
|
||||
}
|
||||
|
||||
checkContentsAreDisplayed(content) {
|
||||
async checkContentsAreDisplayed(content): Promise<void> {
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
this.checkContentIsDisplayed(content[i]);
|
||||
await this.checkContentIsDisplayed(content[i]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
checkContentIsNotDisplayed(content) {
|
||||
this.contentList.dataTablePage().checkContentIsNotDisplayed(this.columns.name, content);
|
||||
return this;
|
||||
async checkContentIsNotDisplayed(content): Promise<void> {
|
||||
await this.contentList.dataTablePage().checkContentIsNotDisplayed(this.columns.name, content);
|
||||
}
|
||||
|
||||
getActiveBreadcrumb() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.activeBreadcrumb);
|
||||
return this.activeBreadcrumb.getAttribute('title');
|
||||
async getActiveBreadcrumb(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.activeBreadcrumb);
|
||||
return await this.activeBreadcrumb.getAttribute('title');
|
||||
}
|
||||
|
||||
uploadFile(fileLocation) {
|
||||
this.checkUploadButton();
|
||||
this.uploadFileButtonInput.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
|
||||
this.checkUploadButton();
|
||||
return this;
|
||||
async uploadFile(fileLocation): Promise<void> {
|
||||
await this.checkUploadButton();
|
||||
await this.uploadFileButtonInput.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
|
||||
await this.checkUploadButton();
|
||||
}
|
||||
|
||||
uploadMultipleFile(files) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.uploadMultipleFileButton);
|
||||
async uploadMultipleFile(files): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
|
||||
let allFiles = path.resolve(path.join(browser.params.testConfig.main.rootPath, files[0]));
|
||||
for (let i = 1; i < files.length; i++) {
|
||||
allFiles = allFiles + '\n' + path.resolve(path.join(browser.params.testConfig.main.rootPath, files[i]));
|
||||
}
|
||||
this.uploadMultipleFileButton.sendKeys(allFiles);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.uploadMultipleFileButton);
|
||||
return this;
|
||||
await this.uploadMultipleFileButton.sendKeys(allFiles);
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
|
||||
}
|
||||
|
||||
uploadFolder(folder) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
|
||||
this.uploadFolderButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, folder)));
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
|
||||
return this;
|
||||
async uploadFolder(folder): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
|
||||
await this.uploadFolderButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, folder)));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
|
||||
}
|
||||
|
||||
getSingleFileButtonTooltip() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.uploadFileButton);
|
||||
return this.uploadFileButtonInput.getAttribute('title');
|
||||
async getSingleFileButtonTooltip(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFileButton);
|
||||
return await this.uploadFileButtonInput.getAttribute('title');
|
||||
}
|
||||
|
||||
getMultipleFileButtonTooltip() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.uploadMultipleFileButton);
|
||||
return this.uploadMultipleFileButton.getAttribute('title');
|
||||
async getMultipleFileButtonTooltip(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadMultipleFileButton);
|
||||
return await this.uploadMultipleFileButton.getAttribute('title');
|
||||
}
|
||||
|
||||
getFolderButtonTooltip() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.uploadFolderButton);
|
||||
return this.uploadFolderButton.getAttribute('title');
|
||||
async getFolderButtonTooltip(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFolderButton);
|
||||
return await this.uploadFolderButton.getAttribute('title');
|
||||
}
|
||||
|
||||
checkUploadButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.uploadFileButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.uploadFileButton);
|
||||
return this;
|
||||
async checkUploadButton(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsClickable(this.uploadFileButton);
|
||||
}
|
||||
|
||||
uploadButtonIsEnabled() {
|
||||
return this.uploadFileButton.isEnabled();
|
||||
async uploadButtonIsEnabled(): Promise<boolean> {
|
||||
return await this.uploadFileButton.isEnabled();
|
||||
}
|
||||
|
||||
getErrorMessage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.errorSnackBar);
|
||||
const deferred = protractor.promise.defer();
|
||||
this.errorSnackBar.getText().then(function (text) {
|
||||
deferred.fulfill(text);
|
||||
});
|
||||
return deferred.promise;
|
||||
async getErrorMessage(): Promise<string> {
|
||||
return BrowserActions.getText(this.errorSnackBar);
|
||||
}
|
||||
|
||||
enableInfiniteScrolling() {
|
||||
const infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
|
||||
BrowserActions.click(infiniteScrollButton);
|
||||
return this;
|
||||
async enableInfiniteScrolling(): Promise<void> {
|
||||
const infiniteScrollButton: ElementFinder = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
|
||||
await BrowserActions.click(infiniteScrollButton);
|
||||
}
|
||||
|
||||
enableCustomPermissionMessage() {
|
||||
const customPermissionMessage = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
|
||||
BrowserActions.click(customPermissionMessage);
|
||||
return this;
|
||||
async enableCustomPermissionMessage(): Promise<void> {
|
||||
const customPermissionMessage: ElementFinder = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
|
||||
await BrowserActions.click(customPermissionMessage);
|
||||
}
|
||||
|
||||
enableMediumTimeFormat() {
|
||||
const mediumTimeFormat = element(by.css('#enableMediumTimeFormat'));
|
||||
BrowserActions.click(mediumTimeFormat);
|
||||
return this;
|
||||
async enableMediumTimeFormat(): Promise<void> {
|
||||
const mediumTimeFormat: ElementFinder = element(by.css('#enableMediumTimeFormat'));
|
||||
await BrowserActions.click(mediumTimeFormat);
|
||||
}
|
||||
|
||||
enableThumbnails() {
|
||||
const thumbnailSlide = element(by.id('adf-thumbnails-upload-switch'));
|
||||
BrowserActions.click(thumbnailSlide);
|
||||
return this;
|
||||
async enableThumbnails(): Promise<void> {
|
||||
const thumbnailSlide: ElementFinder = element(by.id('adf-thumbnails-upload-switch'));
|
||||
await BrowserActions.click(thumbnailSlide);
|
||||
}
|
||||
|
||||
checkPaginationIsNotDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.emptyPagination);
|
||||
async checkPaginationIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyPagination);
|
||||
}
|
||||
|
||||
getDocumentListRowNumber() {
|
||||
const documentList = element(by.css('adf-upload-drag-area adf-document-list'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(documentList);
|
||||
return $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
|
||||
async getDocumentListRowNumber(): Promise<number> {
|
||||
const documentList: ElementFinder = element(by.css('adf-upload-drag-area adf-document-list'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(documentList);
|
||||
return await $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
|
||||
}
|
||||
|
||||
checkColumnNameHeader() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.nameHeader);
|
||||
async checkColumnNameHeader(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.nameHeader);
|
||||
}
|
||||
|
||||
checkColumnSizeHeader() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.sizeHeader);
|
||||
async checkColumnSizeHeader(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.sizeHeader);
|
||||
}
|
||||
|
||||
checkColumnCreatedByHeader() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.createdByHeader);
|
||||
async checkColumnCreatedByHeader(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.createdByHeader);
|
||||
}
|
||||
|
||||
checkColumnCreatedHeader() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.createdHeader);
|
||||
async checkColumnCreatedHeader(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.createdHeader);
|
||||
}
|
||||
|
||||
checkDragAndDropDIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dragAndDrop);
|
||||
async checkDragAndDropDIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.dragAndDrop);
|
||||
}
|
||||
|
||||
dragAndDropFile(file) {
|
||||
this.checkDragAndDropDIsDisplayed();
|
||||
this.dragAndDropAction.dropFile(this.dragAndDrop, file);
|
||||
async dragAndDropFile(file): Promise<void> {
|
||||
await this.checkDragAndDropDIsDisplayed();
|
||||
await this.dragAndDropAction.dropFile(this.dragAndDrop, file);
|
||||
}
|
||||
|
||||
dragAndDropFolder(folder) {
|
||||
this.checkDragAndDropDIsDisplayed();
|
||||
this.dragAndDropAction.dropFolder(this.dragAndDrop, folder);
|
||||
async dragAndDropFolder(folder): Promise<void> {
|
||||
await this.checkDragAndDropDIsDisplayed();
|
||||
await this.dragAndDropAction.dropFolder(this.dragAndDrop, folder);
|
||||
}
|
||||
|
||||
checkLockIsDisplayedForElement(name) {
|
||||
const lockButton = element(by.css(`div.adf-datatable-cell[data-automation-id="${name}"] button`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(lockButton);
|
||||
async checkLockIsDisplayedForElement(name): Promise<void> {
|
||||
const lockButton: ElementFinder = element(by.css(`div.adf-datatable-cell[data-automation-id="${name}"] button`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(lockButton);
|
||||
}
|
||||
|
||||
getColumnValueForRow(file, columnName) {
|
||||
return this.contentList.dataTablePage().getColumnValueForRow(this.columns.name, file, columnName);
|
||||
async getColumnValueForRow(file, columnName): Promise<string> {
|
||||
return await this.contentList.dataTablePage().getColumnValueForRow(this.columns.name, file, columnName);
|
||||
}
|
||||
|
||||
async getStyleValueForRowText(rowName, styleName) {
|
||||
const row = element(by.css(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
return row.getCssValue(styleName);
|
||||
async getStyleValueForRowText(rowName, styleName): Promise<string> {
|
||||
const row: ElementFinder = element(by.css(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
return await row.getCssValue(styleName);
|
||||
}
|
||||
|
||||
checkSpinnerIsShowed() {
|
||||
BrowserVisibility.waitUntilElementIsPresent(this.documentListSpinner);
|
||||
async checkEmptyFolderTextToBe(text): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyFolder);
|
||||
await expect(await this.emptyFolder.getText()).toContain(text);
|
||||
}
|
||||
|
||||
checkEmptyFolderTextToBe(text) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.emptyFolder);
|
||||
expect(this.emptyFolder.getText()).toContain(text);
|
||||
async checkEmptyFolderImageUrlToContain(url): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyFolderImage);
|
||||
await expect(await this.emptyFolderImage.getAttribute('src')).toContain(url);
|
||||
}
|
||||
|
||||
checkEmptyFolderImageUrlToContain(url) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.emptyFolderImage);
|
||||
expect(this.emptyFolderImage.getAttribute('src')).toContain(url);
|
||||
async checkEmptyRecentFileIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyRecent);
|
||||
}
|
||||
|
||||
checkEmptyRecentFileIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.emptyRecent);
|
||||
async getRowIconImageUrl(fileName): Promise<string> {
|
||||
const iconRow: ElementFinder = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(iconRow);
|
||||
return await iconRow.getAttribute('src');
|
||||
}
|
||||
|
||||
checkIconForRowIsDisplayed(fileName) {
|
||||
const iconRow = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(iconRow);
|
||||
return iconRow;
|
||||
async checkGridViewButtonIsVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.gridViewButton);
|
||||
}
|
||||
|
||||
async getRowIconImageUrl(fileName) {
|
||||
const iconRow = this.checkIconForRowIsDisplayed(fileName);
|
||||
return iconRow.getAttribute('src');
|
||||
async clickGridViewButton(): Promise<void> {
|
||||
await this.checkGridViewButtonIsVisible();
|
||||
await BrowserActions.click(this.gridViewButton);
|
||||
}
|
||||
|
||||
checkGridViewButtonIsVisible() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.gridViewButton);
|
||||
async checkCardViewContainerIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.cardViewContainer);
|
||||
}
|
||||
|
||||
clickGridViewButton() {
|
||||
this.checkGridViewButtonIsVisible();
|
||||
BrowserActions.click(this.gridViewButton);
|
||||
async getCardElementShowedInPage(): Promise<number> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.cardViewContainer);
|
||||
return $$('div.adf-document-list-container div.adf-datatable-card div.adf-cell-value img').count();
|
||||
}
|
||||
|
||||
checkCardViewContainerIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.cardViewContainer);
|
||||
async getDocumentCardIconForElement(elementName): Promise<string> {
|
||||
const elementIcon: ElementFinder = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
|
||||
return await elementIcon.getAttribute('src');
|
||||
}
|
||||
|
||||
getCardElementShowedInPage() {
|
||||
this.checkCardViewContainerIsDisplayed();
|
||||
const actualCards = $$('div.adf-document-list-container div.adf-datatable-card div.adf-cell-value img').count();
|
||||
return actualCards;
|
||||
async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise<void> {
|
||||
const elementProperty: ElementFinder = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementProperty);
|
||||
}
|
||||
|
||||
getDocumentCardIconForElement(elementName) {
|
||||
const elementIcon = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
|
||||
return elementIcon.getAttribute('src');
|
||||
}
|
||||
|
||||
checkDocumentCardPropertyIsShowed(elementName, propertyName) {
|
||||
const elementProperty = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(elementProperty);
|
||||
}
|
||||
|
||||
getAttributeValueForElement(elementName, propertyName) {
|
||||
async getAttributeValueForElement(elementName, propertyName): Promise<string> {
|
||||
const elementSize = element(by.css(`.adf-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`));
|
||||
return BrowserActions.getText(elementSize);
|
||||
return await BrowserActions.getText(elementSize);
|
||||
}
|
||||
|
||||
checkMenuIsShowedForElementIndex(elementIndex) {
|
||||
const elementMenu = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(elementMenu);
|
||||
async checkMenuIsShowedForElementIndex(elementIndex): Promise<void> {
|
||||
const elementMenu: ElementFinder = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementMenu);
|
||||
}
|
||||
|
||||
navigateToCardFolder(folderName) {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
const folderCard = element(by.css(`.adf-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`));
|
||||
folderCard.click();
|
||||
const folderSelected = element(by.css(`.adf-datatable-row.adf-is-selected div[data-automation-id="${folderName}"].adf-datatable-cell--image`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(folderSelected);
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
async navigateToCardFolder(folderName): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const folderCard: ElementFinder = element(by.css(`.adf-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`));
|
||||
await BrowserActions.click(folderCard);
|
||||
const folderSelected: ElementFinder = element(by.css(`.adf-datatable-row.adf-is-selected div[data-automation-id="${folderName}"].adf-datatable-cell--image`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(folderSelected);
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
}
|
||||
|
||||
getGridViewSortingDropdown() {
|
||||
const sortingDropdown = element(by.css('mat-select[data-automation-id="grid-view-sorting"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(sortingDropdown);
|
||||
return sortingDropdown;
|
||||
async selectGridSortingFromDropdown(sortingChosen): Promise<void> {
|
||||
const sortingDropdown: ElementFinder = element(by.css('mat-select[data-automation-id="grid-view-sorting"]'));
|
||||
await BrowserActions.click(sortingDropdown);
|
||||
const optionToClick: ElementFinder = element(by.css(`mat-option[data-automation-id="grid-view-sorting-${sortingChosen}"]`));
|
||||
await BrowserActions.click(optionToClick);
|
||||
}
|
||||
|
||||
selectGridSortingFromDropdown(sortingChosen) {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
const dropdownSorting = this.getGridViewSortingDropdown();
|
||||
BrowserActions.click(dropdownSorting);
|
||||
const optionToClick = element(by.css(`mat-option[data-automation-id="grid-view-sorting-${sortingChosen}"]`));
|
||||
BrowserActions.click(optionToClick);
|
||||
}
|
||||
|
||||
checkRowIsDisplayed(rowName) {
|
||||
async checkRowIsDisplayed(rowName): Promise<void> {
|
||||
const row = this.contentList.dataTablePage().getCellElementByValue(this.columns.name, rowName);
|
||||
BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
}
|
||||
|
||||
clickShareButton() {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
BrowserActions.click(this.shareNodeButton);
|
||||
async clickShareButton(): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(this.shareNodeButton);
|
||||
}
|
||||
|
||||
checkSelectedSiteIsDisplayed(siteName) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.siteListDropdown.element(by.cssContainingText('.mat-select-value-text span', siteName)));
|
||||
async checkSelectedSiteIsDisplayed(siteName): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.siteListDropdown.element(by.cssContainingText('.mat-select-value-text span', siteName)));
|
||||
}
|
||||
|
||||
selectSite(siteName: string) {
|
||||
BrowserActions.clickOnSelectDropdownOption(siteName, this.siteListDropdown);
|
||||
return this;
|
||||
async selectSite(siteName: string): Promise<void> {
|
||||
await BrowserActions.clickOnSelectDropdownOption(siteName, this.siteListDropdown);
|
||||
}
|
||||
|
||||
clickDownloadButton() {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
BrowserActions.click(this.downloadButton);
|
||||
async clickDownloadButton(): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(this.downloadButton);
|
||||
}
|
||||
|
||||
clickMultiSelectToggle() {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
BrowserActions.click(this.multiSelectToggle);
|
||||
async clickMultiSelectToggle() {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(this.multiSelectToggle);
|
||||
}
|
||||
|
||||
getRowByName(rowName) {
|
||||
getRowByName(rowName): ElementFinder {
|
||||
return this.contentList.dataTable.getRow(this.columns.name, rowName);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user