mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5463] Rework Protractor tests - changes related to element/element… (#7284)
* ADF-5463 Rework Protractor tests - changes related to element/elements and duplication of locators * Fix one which I missed * Remove console.logs * Remove console.logs * Reverse the timeouts * Fixed things TSLint * Remove unused import * Fixed broken tests * Last test fixed
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { $, by, element } from 'protractor';
|
||||
import {
|
||||
BrowserVisibility,
|
||||
BrowserActions,
|
||||
@@ -29,19 +29,19 @@ export class CardViewComponentPage {
|
||||
addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
||||
nameCardTextItem = new CardTextItemPage('name');
|
||||
booleanCardBooleanItem = new CardBooleanItemPage('boolean');
|
||||
intField = element(by.css(`input[data-automation-id='card-textitem-editinput-int']`));
|
||||
floatField = element(by.css(`input[data-automation-id='card-textitem-editinput-float']`));
|
||||
intField = $(`input[data-automation-id='card-textitem-editinput-int']`);
|
||||
floatField = $(`input[data-automation-id='card-textitem-editinput-float']`);
|
||||
valueInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
|
||||
nameInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
|
||||
consoleLog = element(by.className('app-console'));
|
||||
deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
||||
resetButton = element(by.css(`#adf-reset-card-log`));
|
||||
editableSwitch = element(by.id('app-toggle-editable'));
|
||||
clearDateSwitch = element(by.id('app-toggle-clear-date'));
|
||||
noneOptionSwitch = element(by.id('app-toggle-none-option'));
|
||||
clickableField = element(by.css(`[data-automation-id="card-textitem-toggle-click"]`));
|
||||
resetButton = $(`#adf-reset-card-log`);
|
||||
editableSwitch = $('#app-toggle-editable');
|
||||
clearDateSwitch = $('#app-toggle-clear-date');
|
||||
noneOptionSwitch = $('#app-toggle-none-option');
|
||||
clickableField = $(`[data-automation-id="card-textitem-toggle-click"]`);
|
||||
|
||||
selectDropdown = new DropdownPage(element(by.css('mat-select[data-automation-class="select-box"]')));
|
||||
selectDropdown = new DropdownPage($('mat-select[data-automation-class="select-box"]'));
|
||||
|
||||
async clickOnAddButton(): Promise<void> {
|
||||
await BrowserActions.click(this.addButton);
|
||||
@@ -72,18 +72,18 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async clickOnIntField(): Promise<void> {
|
||||
const toggleText = element(by.css('div[data-automation-id="card-textitem-toggle-int"]'));
|
||||
const toggleText = $('div[data-automation-id="card-textitem-toggle-int"]');
|
||||
await BrowserActions.click(toggleText);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.intField);
|
||||
}
|
||||
|
||||
async clickOnIntClearIcon(): Promise<void> {
|
||||
const clearIcon = element(by.css('button[data-automation-id="card-textitem-reset-int"]'));
|
||||
const clearIcon = $('button[data-automation-id="card-textitem-reset-int"]');
|
||||
await BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
async clickOnIntSaveIcon(): Promise<void> {
|
||||
const saveIcon = element(by.css('button[data-automation-id="card-textitem-update-int"]'));
|
||||
const saveIcon = $('button[data-automation-id="card-textitem-update-int"]');
|
||||
await BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
@@ -92,28 +92,28 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
getIntFieldText(): Promise<string> {
|
||||
const textField = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
|
||||
const textField = $('span[data-automation-id="card-textitem-value-int"]');
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorInt(): Promise<string> {
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-int"]');
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
async clickOnFloatField(): Promise<void> {
|
||||
const toggleText = element(by.css('div[data-automation-id="card-textitem-toggle-float"]'));
|
||||
const toggleText = $('div[data-automation-id="card-textitem-toggle-float"]');
|
||||
await BrowserActions.click(toggleText);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.floatField);
|
||||
}
|
||||
|
||||
async clickOnFloatClearIcon(): Promise<void> {
|
||||
const clearIcon = element(by.css(`button[data-automation-id="card-textitem-reset-float"]`));
|
||||
const clearIcon = $(`button[data-automation-id="card-textitem-reset-float"]`);
|
||||
await BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
async clickOnFloatSaveIcon(): Promise<void> {
|
||||
const saveIcon = element(by.css(`button[data-automation-id="card-textitem-update-float"]`));
|
||||
const saveIcon = $(`button[data-automation-id="card-textitem-update-float"]`);
|
||||
await BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
@@ -122,12 +122,12 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
getFloatFieldText(): Promise<string> {
|
||||
const textField = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
|
||||
const textField = $('span[data-automation-id="card-textitem-value-float"]');
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorFloat(): Promise<string> {
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-float"]');
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
getOutputText(index: number): Promise<string> {
|
||||
return BrowserActions.getText(this.consoleLog.all(by.css('p')).get(index));
|
||||
return BrowserActions.getText(this.consoleLog.$$('p').get(index));
|
||||
}
|
||||
|
||||
async deletePairsValues(): Promise<void> {
|
||||
@@ -177,22 +177,22 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async getDateValue(): Promise<string> {
|
||||
const dateValue = element(by.css('span[data-automation-id="card-date-value-date"]'));
|
||||
const dateValue = $('span[data-automation-id="card-date-value-date"]');
|
||||
return dateValue.getText();
|
||||
}
|
||||
|
||||
async getDateTimeValue(): Promise<string> {
|
||||
const dateTimeValue = element(by.css('span[data-automation-id="card-datetime-value-datetime"]'));
|
||||
const dateTimeValue = $('span[data-automation-id="card-datetime-value-datetime"]');
|
||||
return dateTimeValue.getText();
|
||||
}
|
||||
|
||||
async clearDateField(): Promise<void> {
|
||||
const clearDateButton = element(by.css('mat-icon[data-automation-id="datepicker-date-clear-date"]'));
|
||||
const clearDateButton = $('mat-icon[data-automation-id="datepicker-date-clear-date"]');
|
||||
await BrowserActions.click(clearDateButton);
|
||||
}
|
||||
|
||||
async clearDateTimeField(): Promise<void> {
|
||||
const clearDateButton = element(by.css('mat-icon[data-automation-id="datepicker-date-clear-datetime"]'));
|
||||
const clearDateButton = $('mat-icon[data-automation-id="datepicker-date-clear-datetime"]');
|
||||
await BrowserActions.click(clearDateButton);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ export class CardViewComponentPage {
|
||||
const switchClass = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.clearDateSwitch.click();
|
||||
const clearDateChecked = element(by.css('mat-slide-toggle[id="app-toggle-clear-date"][class*="mat-checked"]'));
|
||||
const clearDateChecked = $('mat-slide-toggle[id="app-toggle-clear-date"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(clearDateChecked);
|
||||
}
|
||||
}
|
||||
@@ -209,13 +209,13 @@ export class CardViewComponentPage {
|
||||
const switchClass = await BrowserActions.getAttribute(this.noneOptionSwitch, 'class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.noneOptionSwitch.click();
|
||||
const noneOptionChecked = element(by.css('mat-slide-toggle[id="app-toggle-none-option"][class*="mat-checked"]'));
|
||||
const noneOptionChecked = $('mat-slide-toggle[id="app-toggle-none-option"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(noneOptionChecked);
|
||||
}
|
||||
}
|
||||
|
||||
async isErrorNotDisplayed(): Promise<boolean> {
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-int"]');
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(errorElement);
|
||||
return true;
|
||||
@@ -231,10 +231,10 @@ export class CardViewComponentPage {
|
||||
async updateClickableField(text: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.clickableField);
|
||||
await BrowserActions.click(this.clickableField);
|
||||
const inputField = element(by.css('input[data-automation-id="card-textitem-editinput-click"]'));
|
||||
const inputField = $('input[data-automation-id="card-textitem-editinput-click"]');
|
||||
await BrowserVisibility.waitUntilElementIsPresent(inputField);
|
||||
await BrowserActions.clearSendKeys(inputField, text);
|
||||
const save = element(by.css('[data-automation-id="card-textitem-update-click"]'));
|
||||
const save = $('[data-automation-id="card-textitem-update-click"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(save);
|
||||
await BrowserActions.click(save);
|
||||
}
|
||||
|
@@ -16,18 +16,18 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, TabsPage } from '@alfresco/adf-testing';
|
||||
import { by, element } from 'protractor';
|
||||
import { $, $$ } from 'protractor';
|
||||
|
||||
export class CommentsPage {
|
||||
|
||||
tabsPage = new TabsPage();
|
||||
numberOfComments = element(by.id('comment-header'));
|
||||
commentUserIcon = element.all(by.id('comment-user-icon'));
|
||||
commentUserName = element.all(by.id('comment-user'));
|
||||
commentMessage = element.all(by.id('comment-message'));
|
||||
commentTime = element.all(by.id('comment-time'));
|
||||
commentInput = element(by.id('comment-input'));
|
||||
addCommentButton = element(by.css("[data-automation-id='comments-input-add']"));
|
||||
numberOfComments = $('#comment-header');
|
||||
commentUserIcon = $$('#comment-user-icon');
|
||||
commentUserName = $$('#comment-user');
|
||||
commentMessage = $$('#comment-message');
|
||||
commentTime = $$('#comment-time');
|
||||
commentInput = $('#comment-input');
|
||||
addCommentButton = $("[data-automation-id='comments-input-add']");
|
||||
|
||||
async getTotalNumberOfComments(text: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementHasText(this.numberOfComments, text);
|
||||
|
@@ -25,7 +25,7 @@ import {
|
||||
DropdownPage,
|
||||
Logger
|
||||
} from '@alfresco/adf-testing';
|
||||
import { Locator, $$, browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { $$, browser, by, element, ElementFinder, protractor, $ } from 'protractor';
|
||||
import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page';
|
||||
import { FolderDialogPage } from './dialog/folder-dialog.page';
|
||||
import { NavigationBarPage } from './navigation-bar.page';
|
||||
@@ -42,74 +42,73 @@ export class ContentServicesPage {
|
||||
created: 'Created'
|
||||
};
|
||||
|
||||
contentList = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
|
||||
contentList = new DocumentListPage($$('adf-upload-drag-area adf-document-list').first());
|
||||
togglePage = new TogglePage();
|
||||
createFolderDialog = new FolderDialogPage();
|
||||
createLibraryDialog = new CreateLibraryDialogPage();
|
||||
|
||||
multipleFileUploadToggle = element(by.id('adf-document-list-enable-drop-files'));
|
||||
uploadBorder = element(by.id('document-list-container'));
|
||||
contentServices = element(by.css('.app-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"]'));
|
||||
deleteNodesButton = element(by.css('button[data-automation-id="delete-toolbar-button"]'));
|
||||
createLibraryButton = element(by.css('button[data-automation-id="create-new-library"]'));
|
||||
activeBreadcrumb = element(by.css('div[class*="active"]'));
|
||||
tooltip: Locator = 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.all(by.css('div[data-automation-id="auto_id_name"] > span')).first();
|
||||
sizeHeader = element.all(by.css('div[data-automation-id="auto_id_content.sizeInBytes"] > span')).first();
|
||||
createdByHeader = element.all(by.css('div[data-automation-id="auto_id_createdByUser.displayName"] > span')).first();
|
||||
createdHeader = element.all(by.css('div[data-automation-id="auto_id_createdAt"] > span')).first();
|
||||
recentFiles = element(by.css('.app-container-recent'));
|
||||
recentFilesExpanded = element(by.css('.app-container-recent mat-expansion-panel-header.mat-expanded'));
|
||||
recentFilesClosed = element(by.css('.app-container-recent mat-expansion-panel-header'));
|
||||
recentFileIcon = element(by.css('.app-container-recent mat-expansion-panel-header mat-icon'));
|
||||
emptyFolder = element(by.css('.adf-empty-folder-this-space-is-empty'));
|
||||
emptyFolderImage = element(by.css('.adf-empty-folder-image'));
|
||||
emptyRecent = element(by.css('.app-container-recent .app-empty-list__title'));
|
||||
gridViewButton = element(by.css('button[data-automation-id="document-list-grid-view"]'));
|
||||
cardViewContainer = element(by.css('div.app-document-list-container div.adf-datatable-card'));
|
||||
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"]');
|
||||
deleteNodesButton = $('button[data-automation-id="delete-toolbar-button"]');
|
||||
createLibraryButton = $('button[data-automation-id="create-new-library"]');
|
||||
activeBreadcrumb = $('div[class*="active"]');
|
||||
uploadFileButton = $('.adf-upload-button-file-container button');
|
||||
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_id_name"] > span').first();
|
||||
sizeHeader = $$('div[data-automation-id="auto_id_content.sizeInBytes"] > span').first();
|
||||
createdByHeader = $$('div[data-automation-id="auto_id_createdByUser.displayName"] > span').first();
|
||||
createdHeader = $$('div[data-automation-id="auto_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 '));
|
||||
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"]'));
|
||||
downloadButton = element(by.css('button[title="Download"]'));
|
||||
favoriteButton = element(by.css('button[data-automation-id="favorite"]'));
|
||||
deleteContentElement = $('button[data-automation-id*="DELETE"]');
|
||||
metadataAction = $('button[data-automation-id*="METADATA"]');
|
||||
versionManagerAction = $('button[data-automation-id*="VERSIONS"]');
|
||||
moveContentElement = $('button[data-automation-id*="MOVE"]');
|
||||
copyContentElement = $('button[data-automation-id*="COPY"]');
|
||||
lockContentElement = $('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]');
|
||||
downloadContent = $('button[data-automation-id*="DOWNLOAD"]');
|
||||
downloadButton = $('button[title="Download"]');
|
||||
favoriteButton = $('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.css('[data-automation-id="multiSelectToggle"]'));
|
||||
selectAllCheckbox = element.all(by.css('.adf-checkbox-sr-only')).first();
|
||||
selectionModeDropdown = element(by.css('.mat-select[aria-label="Selection Mode"]'));
|
||||
selectedNodesList = element.all(by.css('.app-content-service-settings li'));
|
||||
siteListDropdown = new DropdownPage(element(by.css(`mat-select[data-automation-id='site-my-files-option']`)));
|
||||
sortingDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="grid-view-sorting"]')));
|
||||
multiSelectToggle = $('[data-automation-id="multiSelectToggle"]');
|
||||
selectAllCheckbox = $$('.adf-checkbox-sr-only').first();
|
||||
selectionModeDropdown = $('.mat-select[aria-label="Selection Mode"]');
|
||||
selectedNodesList = $$('.app-content-service-settings li');
|
||||
siteListDropdown = new DropdownPage($(`mat-select[data-automation-id='site-my-files-option']`));
|
||||
sortingDropdown = new DropdownPage($('mat-select[data-automation-id="grid-view-sorting"]'));
|
||||
|
||||
async pressContextMenuActionNamed(actionName): Promise<void> {
|
||||
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
|
||||
}
|
||||
|
||||
async checkContextActionIsVisible(actionName) {
|
||||
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
const actionButton = $(`button[data-automation-id="context-${actionName}"`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
}
|
||||
|
||||
async isContextActionEnabled(actionName): Promise<boolean> {
|
||||
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
const actionButton = $(`button[data-automation-id="context-${actionName}"`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
return actionButton.isEnabled();
|
||||
}
|
||||
@@ -132,7 +131,7 @@ export class ContentServicesPage {
|
||||
|
||||
async checkDeleteIsDisabled(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
const disabledDelete = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`));
|
||||
const disabledDelete = $(`button[data-automation-id*='DELETE'][disabled='true']`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
|
||||
}
|
||||
|
||||
@@ -489,12 +488,12 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async enableMediumTimeFormat(): Promise<void> {
|
||||
const mediumTimeFormat = element(by.css('#enableMediumTimeFormat'));
|
||||
const mediumTimeFormat = $('#enableMediumTimeFormat');
|
||||
await BrowserActions.click(mediumTimeFormat);
|
||||
}
|
||||
|
||||
async enableThumbnails(): Promise<void> {
|
||||
const thumbnailSlide = element(by.id('adf-thumbnails-upload-switch'));
|
||||
const thumbnailSlide = $('#adf-thumbnails-upload-switch');
|
||||
await BrowserActions.click(thumbnailSlide);
|
||||
}
|
||||
|
||||
@@ -503,7 +502,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getDocumentListRowNumber(): Promise<number> {
|
||||
const documentList = element(by.css('adf-upload-drag-area adf-document-list'));
|
||||
const documentList = $('adf-upload-drag-area adf-document-list');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(documentList);
|
||||
return $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
|
||||
}
|
||||
@@ -539,7 +538,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async checkLockIsDisplayedForElement(name): Promise<void> {
|
||||
const lockButton = element(by.css(`div.adf-datatable-cell[data-automation-id="${name}"] button`));
|
||||
const lockButton = $(`div.adf-datatable-cell[data-automation-id="${name}"] button`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(lockButton);
|
||||
}
|
||||
|
||||
@@ -548,7 +547,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getStyleValueForRowText(rowName, styleName): Promise<string> {
|
||||
const row = element(by.css(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
|
||||
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);
|
||||
}
|
||||
@@ -567,7 +566,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getRowIconImageUrl(fileName): Promise<string> {
|
||||
const iconRow = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
|
||||
const iconRow = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`);
|
||||
return BrowserActions.getAttribute(iconRow, 'src');
|
||||
}
|
||||
|
||||
@@ -590,30 +589,30 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getDocumentCardIconForElement(elementName): Promise<string> {
|
||||
const elementIcon = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
|
||||
const elementIcon = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`);
|
||||
return BrowserActions.getAttribute(elementIcon, 'src');
|
||||
}
|
||||
|
||||
async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise<void> {
|
||||
const elementProperty = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`));
|
||||
const elementProperty = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementProperty);
|
||||
}
|
||||
|
||||
async getAttributeValueForElement(elementName, propertyName): Promise<string> {
|
||||
const elementSize = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`));
|
||||
const elementSize = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`);
|
||||
return BrowserActions.getText(elementSize);
|
||||
}
|
||||
|
||||
async checkMenuIsShowedForElementIndex(elementIndex): Promise<void> {
|
||||
const elementMenu = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`));
|
||||
const elementMenu = $(`button[data-automation-id="action_menu_${elementIndex}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementMenu);
|
||||
}
|
||||
|
||||
async navigateToCardFolder(folderName): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const folderCard = element(by.css(`.app-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`));
|
||||
const folderCard = $(`.app-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`);
|
||||
await BrowserActions.click(folderCard);
|
||||
const folderSelected = element(by.css(`.adf-datatable-row.adf-is-selected div[data-automation-id="${folderName}"].adf-datatable-cell--image`));
|
||||
const folderSelected = $(`.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();
|
||||
}
|
||||
@@ -660,7 +659,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async selectFolder(folderName: string): Promise<void> {
|
||||
const folderSelected = element(by.css(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`));
|
||||
const folderSelected = $(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(folderSelected);
|
||||
await BrowserActions.click(folderSelected);
|
||||
}
|
||||
@@ -681,13 +680,13 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async selectItemWithCheckbox(itemName: string): Promise<void> {
|
||||
const item = element(by.css(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`));
|
||||
const item = $(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(item);
|
||||
await BrowserActions.click(item);
|
||||
}
|
||||
|
||||
async unSelectItemWithCheckbox(itemName: string): Promise<void> {
|
||||
const item = element(by.css(`adf-datatable-row[aria-label="${itemName} selected"] mat-checkbox .mat-checkbox-input`));
|
||||
const item = $(`adf-datatable-row[aria-label="${itemName} selected"] mat-checkbox .mat-checkbox-input`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(item);
|
||||
await BrowserActions.click(item);
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { by, element } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
const source = {
|
||||
@@ -39,8 +39,8 @@ export class CustomSourcesPage {
|
||||
dataTable = new DataTableComponentPage();
|
||||
navigationBarPage = new NavigationBarPage();
|
||||
|
||||
toolbar = element(by.css('app-custom-sources .adf-toolbar-title'));
|
||||
selectModeDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="custom-sources-select"]')));
|
||||
toolbar = $('app-custom-sources .adf-toolbar-title');
|
||||
selectModeDropdown = new DropdownPage($('mat-select[data-automation-id="custom-sources-select"]'));
|
||||
|
||||
async waitForToolbarToBeVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.toolbar);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { $, $$, browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
|
||||
export class DataTablePage {
|
||||
|
||||
@@ -33,30 +33,30 @@ export class DataTablePage {
|
||||
};
|
||||
|
||||
dataTable: DataTableComponentPage;
|
||||
multiSelect = element(by.css(`div[data-automation-id='multiselect'] label > .mat-checkbox-inner-container`));
|
||||
multiSelect = $(`div[data-automation-id='multiselect'] label > .mat-checkbox-inner-container`);
|
||||
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||
allSelectedRows = element.all(by.css(`adf-datatable-row[class*='is-selected']`));
|
||||
selectedRowNumber = element(by.css(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`));
|
||||
selectAll = element(by.css(`div[class*='header'] label`));
|
||||
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 = element(by.css(`div[data-automation-id='auto_id_createdOn']`));
|
||||
idColumnHeader = element(by.css(`div[data-automation-id='auto_id_id']`));
|
||||
pasteClipboardInput = element(by.css(`input[data-automation-id='paste clipboard input']`));
|
||||
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(element(by.css(`mat-select[data-automation-id='datatable-selection-mode']`)));
|
||||
selectModeDropdown = new DropdownPage($(`mat-select[data-automation-id='datatable-selection-mode']`));
|
||||
|
||||
constructor(data?) {
|
||||
if (this.data[data]) {
|
||||
this.dataTable = new DataTableComponentPage(element(by.css(`div[data-automation-id='` + this.data[data] + `']`)));
|
||||
this.dataTable = new DataTableComponentPage($(`div[data-automation-id='` + this.data[data] + `']`));
|
||||
} else {
|
||||
this.dataTable = new DataTableComponentPage(element(by.css(`div[data-automation-id='` + this.data.defaultTable + `']`)));
|
||||
this.dataTable = new DataTableComponentPage($(`div[data-automation-id='` + this.data.defaultTable + `']`));
|
||||
}
|
||||
}
|
||||
|
||||
async insertFilter(filterText: string): Promise<void> {
|
||||
const inputFilter = element(by.css(`#adf-datatable-filter-input`));
|
||||
const inputFilter = $(`#adf-datatable-filter-input`);
|
||||
await BrowserActions.clearSendKeys(inputFilter, filterText);
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { $, $$ } from 'protractor';
|
||||
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||
|
||||
export class CreateLibraryDialogPage {
|
||||
@@ -30,11 +30,11 @@ export class CreateLibraryDialogPage {
|
||||
cancelButton = TestElement.byCss('button[data-automation-id="cancel-library-id"]');
|
||||
createButton = TestElement.byCss('button[data-automation-id="create-library-id"]');
|
||||
errorMessage = TestElement.byCss('.mat-dialog-content .mat-error');
|
||||
errorMessages = element.all(by.css('.mat-dialog-content .mat-error'));
|
||||
errorMessages = $$('.mat-dialog-content .mat-error');
|
||||
libraryNameHint = TestElement.byCss('adf-library-dialog .mat-hint');
|
||||
|
||||
async getSelectedRadio(): Promise<string> {
|
||||
const radio = element(by.css('.mat-radio-button[class*="checked"]'));
|
||||
const radio = $('.mat-radio-button[class*="checked"]');
|
||||
return BrowserActions.getText(radio);
|
||||
}
|
||||
|
||||
|
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { $$, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class FolderDialogPage {
|
||||
|
||||
folderDialog = element.all(by.css('adf-folder-dialog')).first();
|
||||
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'));
|
||||
folderDialog = $$('adf-folder-dialog').first();
|
||||
folderNameField = this.folderDialog.$('#adf-folder-name-input');
|
||||
folderDescriptionField = this.folderDialog.$('#adf-folder-description-input');
|
||||
createUpdateButton = this.folderDialog.$('#adf-folder-create-button');
|
||||
cancelButton = this.folderDialog.$('#adf-folder-cancel-button');
|
||||
folderTitle = this.folderDialog.$('h2.mat-dialog-title');
|
||||
validationMessage = this.folderDialog.$('div.mat-form-field-subscript-wrapper mat-hint span');
|
||||
|
||||
async getDialogTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.folderTitle);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { $$, $ } from 'protractor';
|
||||
import { BrowserVisibility, TogglePage, BrowserActions, DateTimePickerPage } from '@alfresco/adf-testing';
|
||||
import moment = require('moment');
|
||||
|
||||
@@ -23,18 +23,18 @@ 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'));
|
||||
shareDialog = $('adf-share-dialog');
|
||||
dialogTitle = $$('[data-automation-id="adf-share-dialog-title"]').first();
|
||||
shareToggle = $('[data-automation-id="adf-share-toggle"] label');
|
||||
expireToggle = $(`[data-automation-id="adf-expire-toggle"] label`);
|
||||
shareToggleChecked = $('mat-dialog-container mat-slide-toggle.mat-checked');
|
||||
shareLink = $('[data-automation-id="adf-share-link"]');
|
||||
closeButton = $('button[data-automation-id="adf-share-dialog-close"]');
|
||||
copySharedLinkButton = $('.adf-input-action');
|
||||
expirationDateInput = $('input[formcontrolname="time"]');
|
||||
confirmationDialog = $('adf-confirm-dialog');
|
||||
confirmationCancelButton = $('#adf-confirm-cancel');
|
||||
confirmationRemoveButton = $('#adf-confirm-accept');
|
||||
|
||||
async checkDialogIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.dialogTitle);
|
||||
@@ -106,7 +106,7 @@ export class ShareDialogPage {
|
||||
}
|
||||
|
||||
async dateTimePickerDialogIsClosed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsStale(element(by.css('mat-datetimepicker-content')));
|
||||
await BrowserVisibility.waitUntilElementIsStale($('mat-datetimepicker-content'));
|
||||
}
|
||||
|
||||
async getExpirationDate(): Promise<string> {
|
||||
|
@@ -15,28 +15,28 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser, ElementFinder, Locator } from 'protractor';
|
||||
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: Locator = by.css('mat-icon[class*="status--done"]');
|
||||
cancelledStatusIcon: Locator = by.css('div[class*="status--cancelled"]');
|
||||
errorStatusIcon: Locator = by.css('div[class*="status--error"] mat-icon');
|
||||
errorTooltip = element(by.css('div.mat-tooltip'));
|
||||
closeButton = $('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]');
|
||||
dialog = $('div[id="upload-dialog"]');
|
||||
minimizedDialog = $('div[class*="upload-dialog--minimized"]');
|
||||
uploadedStatusIcon = 'mat-icon[class*="status--done"]';
|
||||
cancelledStatusIcon = 'div[class*="status--cancelled"]';
|
||||
errorStatusIcon = 'div[class*="status--error"] mat-icon';
|
||||
errorTooltip = $('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'));
|
||||
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 = 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"]'));
|
||||
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();
|
||||
@@ -59,24 +59,20 @@ export class UploadDialogPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.dialog);
|
||||
}
|
||||
|
||||
getRowsByName(content: string): ElementFinder {
|
||||
return element.all(by.css(`div[class*='uploading-row'] span[title="${content}"]`)).first();
|
||||
}
|
||||
|
||||
async getRowByRowName(content: string): Promise<ElementFinder> {
|
||||
const rows = this.getRowsByName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(rows);
|
||||
return rows.element(this.rowByRowName);
|
||||
const row = await $$(`div[class*='uploading-row'] span[title="${content}"]`).last();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
return row.element(this.rowByRowName);
|
||||
}
|
||||
|
||||
async fileIsUploaded(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon), 60000);
|
||||
const row: ElementFinder = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.uploadedStatusIcon), 10000);
|
||||
}
|
||||
|
||||
async fileIsError(content: string) {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.errorStatusIcon));
|
||||
const row: ElementFinder = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.errorStatusIcon));
|
||||
}
|
||||
|
||||
async filesAreUploaded(content: string[]): Promise<void> {
|
||||
@@ -86,7 +82,7 @@ export class UploadDialogPage {
|
||||
}
|
||||
|
||||
async fileIsNotDisplayedInDialog(content: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`div[class*='uploading-row'] span[title="${content}"]`)));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible($(`div[class*='uploading-row'] span[title="${content}"]`));
|
||||
}
|
||||
|
||||
async cancelUploads(): Promise<void> {
|
||||
@@ -102,16 +98,16 @@ export class UploadDialogPage {
|
||||
}
|
||||
|
||||
async fileIsCancelled(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
const row: ElementFinder = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon), 10000);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.cancelledStatusIcon), 10000);
|
||||
}
|
||||
|
||||
async removeUploadedFile(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon));
|
||||
const row: ElementFinder = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.uploadedStatusIcon));
|
||||
const elementRow = await this.getRowByRowName(content);
|
||||
await BrowserActions.click(elementRow.element(this.uploadedStatusIcon));
|
||||
await BrowserActions.click(elementRow.$(this.uploadedStatusIcon));
|
||||
}
|
||||
|
||||
async getTitleText(): Promise<string> {
|
||||
@@ -156,8 +152,8 @@ export class UploadDialogPage {
|
||||
}
|
||||
|
||||
async displayTooltip(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(this.errorStatusIcon));
|
||||
await browser.actions().mouseMove(element(this.errorStatusIcon)).perform();
|
||||
await BrowserVisibility.waitUntilElementIsVisible($(this.errorStatusIcon));
|
||||
await browser.actions().mouseMove($(this.errorStatusIcon)).perform();
|
||||
}
|
||||
|
||||
async getTooltip(): Promise<string> {
|
||||
|
@@ -15,20 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { $, browser } 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"]'));
|
||||
multipleFileUploadToggle = $('#adf-multiple-upload-switch');
|
||||
uploadFolderToggle = $('#adf-folder-upload-switch');
|
||||
extensionFilterToggle = $('#adf-extension-filter-upload-switch');
|
||||
maxSizeToggle = $('#adf-max-size-filter-upload-switch');
|
||||
versioningToggle = $('#adf-version-upload-switch');
|
||||
extensionAcceptedField = $('input[data-automation-id="accepted-files-type"]');
|
||||
maxSizeField = $('input[data-automation-id="max-files-size"]');
|
||||
disableUploadCheckbox = $('[id="adf-disable-upload"]');
|
||||
|
||||
async enableMultipleFileUpload(): Promise<void> {
|
||||
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
|
||||
@@ -46,7 +46,7 @@ export class UploadTogglesPage {
|
||||
|
||||
async checkFolderUploadToggleIsEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const enabledFolderUpload = element(by.css('mat-slide-toggle[id="adf-folder-upload-switch"][class*="mat-checked"]'));
|
||||
const enabledFolderUpload = $('mat-slide-toggle[id="adf-folder-upload-switch"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledFolderUpload);
|
||||
return true;
|
||||
} catch {
|
||||
@@ -55,17 +55,17 @@ export class UploadTogglesPage {
|
||||
}
|
||||
|
||||
async checkMultipleFileUploadToggleIsEnabled(): Promise<void> {
|
||||
const enabledToggle = element(by.css('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]'));
|
||||
const enabledToggle = $('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"]'));
|
||||
const enabledToggle = $('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"]'));
|
||||
const enabledToggle = $('mat-slide-toggle[id="adf-version-upload-switch"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ export class UploadTogglesPage {
|
||||
}
|
||||
async checkFolderUploadToggleIsNotEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const inactiveToggleFolder = element(by.css('#adf-folder-upload-switch .mat-slide-toggle-label'));
|
||||
const inactiveToggleFolder = $('#adf-folder-upload-switch .mat-slide-toggle-label');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(inactiveToggleFolder);
|
||||
return true;
|
||||
} catch {
|
||||
|
@@ -15,18 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { $, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
export class IconsPage {
|
||||
|
||||
locateCustomIcon(name: string): ElementFinder {
|
||||
return element(by.css(`adf-icon[value='${name}'] svg`));
|
||||
}
|
||||
|
||||
locateLigatureIcon(name: string): ElementFinder {
|
||||
return element(by.css(`adf-icon[value='${name}'] .material-icons`));
|
||||
}
|
||||
locateCustomIcon = (name: string): ElementFinder => $(`adf-icon[value='${name}'] svg`);
|
||||
locateLigatureIcon = (name: string): ElementFinder => $(`adf-icon[value='${name}'] .material-icons`);
|
||||
|
||||
async isCustomIconDisplayed(name: string) {
|
||||
const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateCustomIcon(name));
|
||||
|
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { ElementFinder, $, $$ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class InfinitePaginationPage {
|
||||
|
||||
rootElement: ElementFinder;
|
||||
loadMoreButton;
|
||||
loading = element(by.css('[data-automation-id="adf-infinite-pagination-spinner"]'));
|
||||
loadMoreButton: ElementFinder;
|
||||
loading = $('[data-automation-id="adf-infinite-pagination-spinner"]');
|
||||
|
||||
constructor(rootElement = element.all(by.css('adf-infinite-pagination')).first()) {
|
||||
constructor(rootElement = $$('adf-infinite-pagination').first()) {
|
||||
this.rootElement = rootElement;
|
||||
this.loadMoreButton = this.rootElement.element(by.css('button[data-automation-id="adf-infinite-pagination-button"]'));
|
||||
this.loadMoreButton = this.rootElement.$('button[data-automation-id="adf-infinite-pagination-button"]');
|
||||
}
|
||||
|
||||
async clickLoadMoreButton(): Promise<void> {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { $, browser, by, element } from 'protractor';
|
||||
import { TogglePage, BrowserActions, BrowserVisibility, LoginPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class LoginShellPage {
|
||||
@@ -24,33 +24,33 @@ export class LoginShellPage {
|
||||
loginSSOPage = new LoginPage();
|
||||
|
||||
togglePage = new TogglePage();
|
||||
txtUsername = element(by.css('input[id="username"]'));
|
||||
txtPassword = element(by.css('input[id="password"]'));
|
||||
logoImg = element(by.css('img[id="adf-login-img-logo"]'));
|
||||
successRouteTxt = element(by.css('input[data-automation-id="adf-success-route"]'));
|
||||
logoTxt = element(by.css('input[data-automation-id="adf-url-logo"]'));
|
||||
usernameError = element(by.css('span[data-automation-id="username-error"]'));
|
||||
passwordError = element(by.css('span[data-automation-id="password-required"]'));
|
||||
loginError = element(by.css('.adf-login-error-message'));
|
||||
usernameInactive = element(by.css('input[id="username"][aria-invalid="false"]'));
|
||||
passwordInactive = element(by.css('input[id="password"][aria-invalid="false"]'));
|
||||
adfLogo = element(by.css('.adf-img-logo'));
|
||||
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"][aria-invalid="false"]');
|
||||
passwordInactive = $('input[id="password"][aria-invalid="false"]');
|
||||
adfLogo = $('.adf-img-logo');
|
||||
|
||||
usernameHighlighted = element(by.css('input[id="username"][aria-invalid="true"]'));
|
||||
passwordHighlighted = element(by.css('input[id="password"][aria-invalid="true"]'));
|
||||
signInButton = element(by.id('login-button'));
|
||||
showPasswordElement = element(by.css('button[data-automation-id="show_password"]'));
|
||||
hidePasswordElement = element(by.css('button[data-automation-id="hide_password"]'));
|
||||
rememberMe = element(by.css('mat-checkbox[id="adf-login-remember"]'));
|
||||
needHelp = element(by.id('adf-login-action-left'));
|
||||
register = element(by.id('adf-login-action-right'));
|
||||
footerSwitch = element(by.id('switch4'));
|
||||
rememberMeSwitch = element(by.id('adf-toggle-show-rememberme'));
|
||||
successRouteSwitch = element(by.id('adf-toggle-show-successRoute'));
|
||||
logoSwitch = element(by.id('adf-toggle-logo'));
|
||||
header = element(by.id('adf-header'));
|
||||
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"]');
|
||||
rememberMe = $('mat-checkbox[id="adf-login-remember"]');
|
||||
needHelp = $('#adf-login-action-left');
|
||||
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'));
|
||||
sidenavLayout = element(by.css(`[data-automation-id="sidenav-layout"]`));
|
||||
sidenavLayout = $(`[data-automation-id="sidenav-layout"]`);
|
||||
|
||||
async goToLoginPage(): Promise<void> {
|
||||
await BrowserActions.getUrl(this.loginURL);
|
||||
|
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
export class LogoutPage {
|
||||
|
||||
logoutSection: ElementFinder = element(by.css('div[data-automation-id="adf-logout-section"]'));
|
||||
logoutSection = $('div[data-automation-id="adf-logout-section"]');
|
||||
|
||||
async checkLogoutSectionIsDisplayed() {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
|
||||
|
@@ -15,45 +15,48 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, Key, Locator, protractor } from 'protractor';
|
||||
import { $, by, element, Key, protractor, ElementFinder } from 'protractor';
|
||||
import { BrowserActions, BrowserVisibility, DropdownPage, TestElement, Logger } from '@alfresco/adf-testing';
|
||||
|
||||
export class MetadataViewPage {
|
||||
|
||||
title = element(by.css(`div[info-drawer-title]`));
|
||||
expandedAspect = element(by.css(`mat-expansion-panel-header[aria-expanded='true']`));
|
||||
aspectTitle: Locator = by.css(`mat-panel-title`);
|
||||
name = element(by.css(`[data-automation-id='card-textitem-value-properties.cm:name']`));
|
||||
creator = element(by.css(`[data-automation-id='card-textitem-value-createdByUser.displayName']`));
|
||||
createdDate = element(by.css(`span[data-automation-id='card-dateitem-createdAt']`));
|
||||
modifier = element(by.css(`[data-automation-id='card-textitem-value-modifiedByUser.displayName']`));
|
||||
modifiedDate = element(by.css(`span[data-automation-id='card-dateitem-modifiedAt']`));
|
||||
mimetypeName = element(by.css(`[data-automation-id='card-textitem-value-content.mimeTypeName']`));
|
||||
size = element(by.css(`[data-automation-id='card-textitem-value-content.sizeInBytes']`));
|
||||
description = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:description']`));
|
||||
author = element(by.css(`[data-automation-id='card-textitem-value-properties.cm:author']`));
|
||||
titleProperty = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`));
|
||||
editIcon = element(by.css(`button[data-automation-id='meta-data-card-toggle-edit']`));
|
||||
informationButton = element(by.css(`button[data-automation-id='meta-data-card-toggle-expand']`));
|
||||
informationSpan = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label']`));
|
||||
informationIcon = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label'] ~ mat-icon`));
|
||||
displayEmptySwitch = element(by.id(`adf-metadata-empty`));
|
||||
readonlySwitch = element(by.id(`adf-metadata-readonly`));
|
||||
multiSwitch = element(by.id(`adf-metadata-multi`));
|
||||
presetSwitch = element(by.id('adf-toggle-custom-preset'));
|
||||
defaultPropertiesSwitch = element(by.id('adf-metadata-default-properties'));
|
||||
title = $(`div[info-drawer-title]`);
|
||||
expandedAspect = $(`mat-expansion-panel-header[aria-expanded='true']`);
|
||||
aspectTitle = `mat-panel-title`;
|
||||
name = $(`[data-automation-id='card-textitem-value-properties.cm:name']`);
|
||||
creator = $(`[data-automation-id='card-textitem-value-createdByUser.displayName']`);
|
||||
createdDate = $(`span[data-automation-id='card-dateitem-createdAt']`);
|
||||
modifier = $(`[data-automation-id='card-textitem-value-modifiedByUser.displayName']`);
|
||||
modifiedDate = $(`span[data-automation-id='card-dateitem-modifiedAt']`);
|
||||
mimetypeName = $(`[data-automation-id='card-textitem-value-content.mimeTypeName']`);
|
||||
size = $(`[data-automation-id='card-textitem-value-content.sizeInBytes']`);
|
||||
description = $(`span[data-automation-id='card-textitem-value-properties.cm:description']`);
|
||||
author = $(`[data-automation-id='card-textitem-value-properties.cm:author']`);
|
||||
titleProperty = $(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`);
|
||||
editIcon = $(`button[data-automation-id='meta-data-card-toggle-edit']`);
|
||||
informationButton = $(`button[data-automation-id='meta-data-card-toggle-expand']`);
|
||||
informationSpan = $(`span[data-automation-id='meta-data-card-toggle-expand-label']`);
|
||||
informationIcon = $(`span[data-automation-id='meta-data-card-toggle-expand-label'] ~ mat-icon`);
|
||||
displayEmptySwitch = $(`#adf-metadata-empty`);
|
||||
readonlySwitch = $(`#adf-metadata-readonly`);
|
||||
multiSwitch = $(`#adf-metadata-multi`);
|
||||
presetSwitch = $('#adf-toggle-custom-preset');
|
||||
defaultPropertiesSwitch = $('#adf-metadata-default-properties');
|
||||
closeButton = element(by.cssContainingText('button.mat-button span', 'Close'));
|
||||
displayAspect = element(by.css(`input[data-placeholder='Display Aspect']`));
|
||||
displayAspect = $(`input[data-placeholder='Display Aspect']`);
|
||||
applyAspect = element(by.cssContainingText(`button span.mat-button-wrapper`, 'Apply Aspect'));
|
||||
saveMetadataButton = element(by.css(`[data-automation-id='save-metadata']`));
|
||||
resetMetadataButton = element(by.css(`[data-automation-id='reset-metadata']`));
|
||||
saveMetadataButton = $(`[data-automation-id='save-metadata']`);
|
||||
resetMetadataButton = $(`[data-automation-id='reset-metadata']`);
|
||||
|
||||
private getMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> => $(`mat-expansion-panel[data-automation-id="adf-metadata-group-${groupName}"]`);
|
||||
private getExpandedMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> => $(`mat-expansion-panel[data-automation-id="adf-metadata-group-${groupName}"] > mat-expansion-panel-header`);
|
||||
|
||||
async getTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.title);
|
||||
}
|
||||
|
||||
async getExpandedAspectName(): Promise<string> {
|
||||
return BrowserActions.getText(this.expandedAspect.element(this.aspectTitle));
|
||||
return BrowserActions.getText(this.expandedAspect.$(this.aspectTitle));
|
||||
}
|
||||
|
||||
async getName(): Promise<string> {
|
||||
@@ -138,79 +141,79 @@ export class MetadataViewPage {
|
||||
}
|
||||
|
||||
async editPropertyIconIsDisplayed(propertyName: string) {
|
||||
const editPropertyIcon = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon'));
|
||||
const editPropertyIcon = $('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon');
|
||||
await BrowserVisibility.waitUntilElementIsPresent(editPropertyIcon);
|
||||
}
|
||||
|
||||
async clickResetButton(): Promise<void> {
|
||||
const clearPropertyIcon = element(by.css('button[data-automation-id="reset-metadata"]'));
|
||||
const clearPropertyIcon = $('button[data-automation-id="reset-metadata"]');
|
||||
await BrowserActions.click(clearPropertyIcon);
|
||||
}
|
||||
|
||||
async enterPropertyText(propertyName: string, text: string | number): Promise<void> {
|
||||
const textField = element(by.css('input[data-automation-id="card-textitem-value-' + propertyName + '"]'));
|
||||
const textField = $('input[data-automation-id="card-textitem-value-' + propertyName + '"]');
|
||||
await BrowserActions.clearSendKeys(textField, text.toString());
|
||||
await textField.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async enterPresetText(text: string): Promise<void> {
|
||||
const presetField = element(by.css('input[data-automation-id="adf-text-custom-preset"]'));
|
||||
const presetField = $('input[data-automation-id="adf-text-custom-preset"]');
|
||||
await BrowserActions.clearSendKeys(presetField, text.toString());
|
||||
await presetField.sendKeys(protractor.Key.ENTER);
|
||||
const applyButton = element(by.css('button[id="adf-metadata-aplly"]'));
|
||||
const applyButton = $('button[id="adf-metadata-aplly"]');
|
||||
await BrowserActions.click(applyButton);
|
||||
}
|
||||
|
||||
async enterDescriptionText(text: string): Promise<void> {
|
||||
const textField = element(by.css('textarea[data-automation-id="card-textitem-value-properties.cm:description"]'));
|
||||
const textField = $('textarea[data-automation-id="card-textitem-value-properties.cm:description"]');
|
||||
await BrowserActions.clearSendKeys(textField, text);
|
||||
await textField.sendKeys(Key.TAB);
|
||||
}
|
||||
|
||||
async getPropertyText(propertyName: string, type?: string): Promise<string> {
|
||||
const propertyType = type || 'textitem';
|
||||
const textField = element(by.css('[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]'));
|
||||
const textField = $('[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]');
|
||||
|
||||
return BrowserActions.getInputValue(textField);
|
||||
}
|
||||
|
||||
async getPropertyIconTooltip(propertyName: string): Promise<string> {
|
||||
const editPropertyIcon = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon'));
|
||||
const editPropertyIcon = $('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon');
|
||||
return BrowserActions.getAttribute(editPropertyIcon, 'title');
|
||||
}
|
||||
|
||||
async clickMetadataGroup(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
const group = await this.getMetadataGroupLocator(groupName);
|
||||
await BrowserActions.click(group);
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsPresent(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
const group = await this.getMetadataGroupLocator(groupName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(group);
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsNotPresent(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
const group = await this.getMetadataGroupLocator(groupName);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(group);
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsExpand(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
const group = await this.getExpandedMetadataGroupLocator(groupName);
|
||||
await expect(await BrowserActions.getAttribute(group, 'class')).toContain('mat-expanded');
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsNotExpand(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
const group = await this.getExpandedMetadataGroupLocator(groupName);
|
||||
await expect(await BrowserActions.getAttribute(group, 'class')).not.toContain('mat-expanded');
|
||||
}
|
||||
|
||||
async getMetadataGroupTitle(groupName: string): Promise<string> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title'));
|
||||
const group = $('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title');
|
||||
return BrowserActions.getText(group);
|
||||
}
|
||||
|
||||
async checkPropertyIsVisible(propertyName: string, type: string): Promise<void> {
|
||||
const property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
const property = $('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(property);
|
||||
}
|
||||
|
||||
|
@@ -16,32 +16,34 @@
|
||||
*/
|
||||
|
||||
import { AppListCloudPage, BrowserActions, BrowserVisibility, Logger } from '@alfresco/adf-testing';
|
||||
import { browser, by, element, ElementFinder } from 'protractor';
|
||||
import { $, browser, ElementFinder } from 'protractor';
|
||||
import { ProcessServicesPage } from '../../process-services/pages/process-services.page';
|
||||
|
||||
export class NavigationBarPage {
|
||||
|
||||
linkListContainer = element(by.css('.app-sidenav-linklist'));
|
||||
linkMenuChildrenContainer = element(by.css('.nestedMenu'));
|
||||
dataTableNestedButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Datatable"]'));
|
||||
dataTableCopyContentButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Copy Content"]'));
|
||||
dataTableDragAndDropButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Drag and Drop"]'));
|
||||
processServicesNestedButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="App"]'));
|
||||
processServicesCloudHomeButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Home"]'));
|
||||
themeButton = element(by.css('button[data-automation-id="theme menu"]'));
|
||||
themeMenuContent = element(by.css('div[class*="mat-menu-panel"]'));
|
||||
appTitle = element(by.css('.adf-app-title'));
|
||||
menuButton = element(by.css('button[data-automation-id="adf-menu-icon"]'));
|
||||
formButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Form"]'));
|
||||
peopleGroupCloudButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="People/Group Cloud"]'));
|
||||
serviceTaskListButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Service Task List"]'));
|
||||
logoutSection: ElementFinder = element(by.css('div[data-automation-id="adf-logout-section"]'));
|
||||
personalFiles: ElementFinder = element(by.css('div [title="Personal Files"]'));
|
||||
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"]');
|
||||
|
||||
getMenuItemLocator = (title: string) => $(`.app-sidenav-link[data-automation-id="${title}"]`);
|
||||
|
||||
async clickNavigationBarItem(title: string, untilElementIsVisible?: ElementFinder): Promise<void> {
|
||||
Logger.log(`clickNavigationBarItem ${title}`);
|
||||
|
||||
const menu = element(by.css(`.app-sidenav-link[data-automation-id="${title}"]`));
|
||||
const menu = $(`.app-sidenav-link[data-automation-id="${title}"]`);
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
|
||||
if (untilElementIsVisible) {
|
||||
@@ -69,7 +71,7 @@ export class NavigationBarPage {
|
||||
|
||||
async clickProcessCloudButton() {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItem('Process Cloud'), this.linkMenuChildrenContainer);
|
||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItemLocator('Process Cloud'), this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToProcessServicesCloudPage(): Promise<AppListCloudPage> {
|
||||
@@ -99,11 +101,7 @@ export class NavigationBarPage {
|
||||
|
||||
private async clickProcessServicesButton() {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItem('Process Services'), this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
private getMenuItem(title: string) {
|
||||
return element(by.css(`.app-sidenav-link[data-automation-id="${title}"]`));
|
||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItemLocator('Process Services'), this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToProcessServicesPage(): Promise<ProcessServicesPage> {
|
||||
@@ -205,7 +203,7 @@ export class NavigationBarPage {
|
||||
}
|
||||
|
||||
async clickOnSpecificThemeButton(themeName): Promise<void> {
|
||||
const themeElement = element(by.css(`button[data-automation-id="${themeName}"]`));
|
||||
const themeElement = $(`button[data-automation-id="${themeName}"]`);
|
||||
await BrowserActions.click(themeElement);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
@@ -223,12 +221,12 @@ export class NavigationBarPage {
|
||||
}
|
||||
|
||||
async checkToolbarColor(color: string): Promise<void> {
|
||||
const toolbarColor = element(by.css(`mat-toolbar[class*="mat-${color}"]`));
|
||||
const toolbarColor = $(`mat-toolbar[class*="mat-${color}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(toolbarColor);
|
||||
}
|
||||
|
||||
async clickAppLogo(logoTitle: string): Promise<void> {
|
||||
const appLogo = element(by.css('a[title="' + logoTitle + '"]'));
|
||||
const appLogo = $('a[title="' + logoTitle + '"]');
|
||||
await BrowserActions.click(appLogo);
|
||||
}
|
||||
|
||||
@@ -237,7 +235,7 @@ export class NavigationBarPage {
|
||||
}
|
||||
|
||||
async checkLogoTooltip(logoTooltipTitle: string): Promise<void> {
|
||||
const logoTooltip = element(by.css('a[title="' + logoTooltipTitle + '"]'));
|
||||
const logoTooltip = $('a[title="' + logoTooltipTitle + '"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(logoTooltip);
|
||||
}
|
||||
|
||||
|
@@ -15,24 +15,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
import { element, by, browser, $, $$ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, DropdownPage, SnackbarPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class NotificationDemoPage {
|
||||
|
||||
snackbarPage = new SnackbarPage();
|
||||
|
||||
messageField = element(by.css('input[data-automation-id="notification-message"]'));
|
||||
durationField = element(by.css('input[data-automation-id="notification-duration"]'));
|
||||
actionToggle = element(by.css('mat-slide-toggle[data-automation-id="notification-action-toggle"]'));
|
||||
notificationSnackBar = element.all(by.css('simple-snack-bar')).first();
|
||||
actionOutput = element(by.css('div[data-automation-id="notification-action-output"]'));
|
||||
notificationsPage = element(by.css('.app-sidenav-link[data-automation-id="Notifications"]'));
|
||||
notificationConfig = element(by.css('p[data-automation-id="notification-custom-object"]'));
|
||||
messageField = $('input[data-automation-id="notification-message"]');
|
||||
durationField = $('input[data-automation-id="notification-duration"]');
|
||||
actionToggle = $('mat-slide-toggle[data-automation-id="notification-action-toggle"]');
|
||||
notificationSnackBar = $$('simple-snack-bar').first();
|
||||
actionOutput = $('div[data-automation-id="notification-action-output"]');
|
||||
notificationsPage = $('.app-sidenav-link[data-automation-id="Notifications"]');
|
||||
notificationConfig = $('p[data-automation-id="notification-custom-object"]');
|
||||
|
||||
horizontalPositionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-horizontal-position"]')));
|
||||
verticalPositionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-vertical-position"]')));
|
||||
directionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-direction"]')));
|
||||
horizontalPositionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-horizontal-position"]'));
|
||||
verticalPositionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-vertical-position"]'));
|
||||
directionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-direction"]'));
|
||||
|
||||
async checkNotifyContains(message): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('simple-snack-bar', message)).first());
|
||||
@@ -79,7 +79,7 @@ export class NotificationDemoPage {
|
||||
}
|
||||
|
||||
async clickNotificationButton(): Promise<void> {
|
||||
const button = element(by.css('button[data-automation-id="notification-custom-config-button"]'));
|
||||
const button = $('button[data-automation-id="notification-custom-config-button"]');
|
||||
await BrowserActions.click(button);
|
||||
}
|
||||
|
||||
|
@@ -16,19 +16,19 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
|
||||
import { Locator, element, by, browser } from 'protractor';
|
||||
import { browser, $$, $ } from 'protractor';
|
||||
|
||||
export class TrashcanPage {
|
||||
|
||||
contentList = new DocumentListPage(element(by.css('adf-document-list')));
|
||||
rows: Locator = by.css('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
||||
tableBody = element.all(by.css('adf-document-list .adf-datatable-body')).first();
|
||||
pagination = element(by.css('adf-pagination'));
|
||||
emptyTrashcan = element(by.css('adf-empty-content'));
|
||||
restoreButton = element(by.css(`button[title='Restore']`));
|
||||
contentList = new DocumentListPage($('adf-document-list'));
|
||||
rows = $$('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
||||
tableBody = $$('adf-document-list .adf-datatable-body').first();
|
||||
pagination = $('adf-pagination');
|
||||
emptyTrashcan = $('adf-empty-content');
|
||||
restoreButton = $(`button[title='Restore']`);
|
||||
|
||||
async numberOfResultsDisplayed(): Promise<number> {
|
||||
return element.all(this.rows).count();
|
||||
return this.rows.count();
|
||||
}
|
||||
|
||||
async waitForTableBody(): Promise<void> {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import * as path from 'path';
|
||||
import { BrowserActions, TestElement, TogglePage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { $, browser } from 'protractor';
|
||||
|
||||
export class VersionManagePage {
|
||||
|
||||
@@ -31,9 +31,9 @@ export class VersionManagePage {
|
||||
majorRadio = TestElement.byId('adf-new-version-major');
|
||||
minorRadio = TestElement.byId('adf-new-version-minor');
|
||||
commentText = TestElement.byId('adf-new-version-text-area');
|
||||
readOnlySwitch = element(by.id('adf-version-manager-switch-readonly'));
|
||||
downloadSwitch = element(by.id('adf-version-manager-switch-download'));
|
||||
commentsSwitch = element(by.id('adf-version-manager-switch-comments'));
|
||||
readOnlySwitch = $('#adf-version-manager-switch-readonly');
|
||||
downloadSwitch = $('#adf-version-manager-switch-download');
|
||||
commentsSwitch = $('#adf-version-manager-switch-comments');
|
||||
confirmAccept = TestElement.byId('adf-confirm-accept');
|
||||
confirmCancel = TestElement.byId('adf-confirm-cancel');
|
||||
|
||||
|
Reference in New Issue
Block a user