mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
fix e2e tests and cleanup e2e typings (#5770)
* cleanup e2e typings * fix e2e tests
This commit is contained in:
@@ -15,25 +15,25 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, CardTextItemPage, DropdownPage, CardBooleanItemPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class CardViewComponentPage {
|
||||
|
||||
addButton: ElementFinder = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
||||
nameCardTextItem: CardTextItemPage = new CardTextItemPage('name');
|
||||
booleanCardBooleanItem: CardBooleanItemPage = new CardBooleanItemPage('boolean');
|
||||
intField: ElementFinder = element(by.css(`input[data-automation-id='card-textitem-editinput-int']`));
|
||||
floatField: ElementFinder = element(by.css(`input[data-automation-id='card-textitem-editinput-float']`));
|
||||
valueInputField: ElementFinder = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
|
||||
nameInputField: ElementFinder = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
|
||||
consoleLog: ElementFinder = element(by.className('app-console'));
|
||||
deleteButton: ElementFinder = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
||||
resetButton: ElementFinder = element(by.css(`#adf-reset-card-log`));
|
||||
editableSwitch: ElementFinder = element(by.id('app-toggle-editable'));
|
||||
clearDateSwitch: ElementFinder = element(by.id('app-toggle-clear-date'));
|
||||
noneOptionSwitch: ElementFinder = element(by.id('app-toggle-none-option'));
|
||||
clickableField: ElementFinder = element(by.css(`[data-automation-id="card-textitem-toggle-click"]`));
|
||||
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']`));
|
||||
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"]`));
|
||||
|
||||
selectDropdown = new DropdownPage(element(by.css('mat-select[data-automation-class="select-box"]')));
|
||||
|
||||
@@ -66,18 +66,18 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async clickOnIntField(): Promise<void> {
|
||||
const toggleText: ElementFinder = element(by.css('div[data-automation-id="card-textitem-toggle-int"]'));
|
||||
const toggleText = element(by.css('div[data-automation-id="card-textitem-toggle-int"]'));
|
||||
await BrowserActions.click(toggleText);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.intField);
|
||||
}
|
||||
|
||||
async clickOnIntClearIcon(): Promise<void> {
|
||||
const clearIcon: ElementFinder = element(by.css('button[data-automation-id="card-textitem-reset-int"]'));
|
||||
const clearIcon = element(by.css('button[data-automation-id="card-textitem-reset-int"]'));
|
||||
await BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
async clickOnIntSaveIcon(): Promise<void> {
|
||||
const saveIcon: ElementFinder = element(by.css('button[data-automation-id="card-textitem-update-int"]'));
|
||||
const saveIcon = element(by.css('button[data-automation-id="card-textitem-update-int"]'));
|
||||
await BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
@@ -86,28 +86,28 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
getIntFieldText(): Promise<string> {
|
||||
const textField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
|
||||
const textField = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorInt(): Promise<string> {
|
||||
const errorElement: ElementFinder = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
async clickOnFloatField(): Promise<void> {
|
||||
const toggleText: ElementFinder = element(by.css('div[data-automation-id="card-textitem-toggle-float"]'));
|
||||
const toggleText = element(by.css('div[data-automation-id="card-textitem-toggle-float"]'));
|
||||
await BrowserActions.click(toggleText);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.floatField);
|
||||
}
|
||||
|
||||
async clickOnFloatClearIcon(): Promise<void> {
|
||||
const clearIcon: ElementFinder = element(by.css(`button[data-automation-id="card-textitem-reset-float"]`));
|
||||
const clearIcon = element(by.css(`button[data-automation-id="card-textitem-reset-float"]`));
|
||||
await BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
async clickOnFloatSaveIcon(): Promise<void> {
|
||||
const saveIcon: ElementFinder = element(by.css(`button[data-automation-id="card-textitem-update-float"]`));
|
||||
const saveIcon = element(by.css(`button[data-automation-id="card-textitem-update-float"]`));
|
||||
await BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
@@ -116,12 +116,12 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
getFloatFieldText(): Promise<string> {
|
||||
const textField: ElementFinder = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
|
||||
const textField = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorFloat(): Promise<string> {
|
||||
const errorElement: ElementFinder = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async isErrorNotDisplayed(): Promise<boolean> {
|
||||
const errorElement: ElementFinder = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(errorElement);
|
||||
return true;
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, TabsPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementArrayFinder, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
|
||||
export class CommentsPage {
|
||||
|
||||
tabsPage: TabsPage = new TabsPage();
|
||||
numberOfComments: ElementFinder = element(by.id('comment-header'));
|
||||
commentUserIcon: ElementArrayFinder = element.all(by.id('comment-user-icon'));
|
||||
commentUserName: ElementArrayFinder = element.all(by.id('comment-user'));
|
||||
commentMessage: ElementArrayFinder = element.all(by.id('comment-message'));
|
||||
commentTime: ElementArrayFinder = element.all(by.id('comment-time'));
|
||||
commentInput: ElementFinder = element(by.id('comment-input'));
|
||||
addCommentButton: ElementFinder = element(by.css("[data-automation-id='comments-input-add']"));
|
||||
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']"));
|
||||
|
||||
async getTotalNumberOfComments(): Promise<string> {
|
||||
return BrowserActions.getText(this.numberOfComments);
|
||||
@@ -37,16 +37,16 @@ export class CommentsPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.commentUserIcon.first());
|
||||
}
|
||||
|
||||
getUserName(position): Promise<string> {
|
||||
getUserName(position: number): Promise<string> {
|
||||
return BrowserActions.getText(this.commentUserName.get(position));
|
||||
}
|
||||
|
||||
getMessage(position): Promise<string> {
|
||||
getMessage(position: number): Promise<string> {
|
||||
return BrowserActions.getText(this.commentMessage.get(position));
|
||||
|
||||
}
|
||||
|
||||
getTime(position): Promise<string> {
|
||||
getTime(position: number): Promise<string> {
|
||||
return BrowserActions.getText(this.commentTime.get(position));
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export class CommentsPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.commentInput);
|
||||
}
|
||||
|
||||
async addComment(comment): Promise<void> {
|
||||
async addComment(comment: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.commentInput, comment);
|
||||
await BrowserActions.click(this.addCommentButton);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { DropActions, BrowserActions, BrowserVisibility, DateUtil, DocumentListPage, TogglePage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { $$, browser, by, element, ElementFinder, ElementArrayFinder, 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';
|
||||
@@ -33,60 +33,60 @@ export class ContentServicesPage {
|
||||
created: 'Created'
|
||||
};
|
||||
|
||||
contentList: DocumentListPage = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
|
||||
togglePage: TogglePage = new TogglePage();
|
||||
createFolderDialog: FolderDialogPage = new FolderDialogPage();
|
||||
createLibraryDialog: CreateLibraryDialogPage = new CreateLibraryDialogPage();
|
||||
contentList = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
|
||||
togglePage = new TogglePage();
|
||||
createFolderDialog = new FolderDialogPage();
|
||||
createLibraryDialog = new CreateLibraryDialogPage();
|
||||
|
||||
multipleFileUploadToggle: ElementFinder = element(by.id('adf-document-list-enable-drop-files'));
|
||||
uploadBorder: ElementFinder = element(by.id('document-list-container'));
|
||||
contentServices: ElementFinder = element(by.css('.app-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"]'));
|
||||
deleteNodesButton: ElementFinder = element(by.css('button[data-automation-id="delete-toolbar-button"]'));
|
||||
createLibraryButton: ElementFinder = element(by.css('button[data-automation-id="create-new-library"]'));
|
||||
activeBreadcrumb: ElementFinder = element(by.css('div[class*="active"]'));
|
||||
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 = by.css('div[class*="--text adf-full-width"] span');
|
||||
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.all(by.css('div[data-automation-id="auto_id_name"] > span')).first();
|
||||
sizeHeader: ElementFinder = element.all(by.css('div[data-automation-id="auto_id_content.sizeInBytes"] > span')).first();
|
||||
createdByHeader: ElementFinder = element.all(by.css('div[data-automation-id="auto_id_createdByUser.displayName"] > span')).first();
|
||||
createdHeader: ElementFinder = element.all(by.css('div[data-automation-id="auto_id_createdAt"] > span')).first();
|
||||
recentFiles: ElementFinder = element(by.css('.app-container-recent'));
|
||||
recentFilesExpanded: ElementFinder = element(by.css('.app-container-recent mat-expansion-panel-header.mat-expanded'));
|
||||
recentFilesClosed: ElementFinder = element(by.css('.app-container-recent mat-expansion-panel-header'));
|
||||
recentFileIcon: ElementFinder = element(by.css('.app-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('.app-container-recent .app-empty-list__title'));
|
||||
gridViewButton: ElementFinder = element(by.css('button[data-automation-id="document-list-grid-view"]'));
|
||||
cardViewContainer: ElementFinder = element(by.css('div.app-document-list-container div.adf-datatable-card'));
|
||||
shareNodeButton: ElementFinder = element(by.cssContainingText('mat-icon', ' share '));
|
||||
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'));
|
||||
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
||||
nameColumnHeader = 'name';
|
||||
createdByColumnHeader = 'createdByUser.displayName';
|
||||
createdColumnHeader = 'createdAt';
|
||||
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"]'));
|
||||
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) '));
|
||||
selectAllCheckbox: ElementFinder = element.all(by.css('.adf-checkbox-sr-only')).first();
|
||||
selectionModeDropdown: ElementFinder = element(by.css('.mat-select[aria-label="Selection Mode"]'));
|
||||
selectedNodesList: ElementArrayFinder = element.all(by.css('.app-content-service-settings li'));
|
||||
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"]'));
|
||||
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) '));
|
||||
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"]')));
|
||||
@@ -96,12 +96,12 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async checkContextActionIsVisible(actionName) {
|
||||
const actionButton: ElementFinder = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
}
|
||||
|
||||
async isContextActionEnabled(actionName): Promise<boolean> {
|
||||
const actionButton: ElementFinder = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
return actionButton.isEnabled();
|
||||
}
|
||||
@@ -125,7 +125,7 @@ export class ContentServicesPage {
|
||||
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']`));
|
||||
const disabledDelete = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async clickHyperlinkNavigationToggle(): Promise<void> {
|
||||
const hyperlinkToggle: ElementFinder = element(by.cssContainingText('.mat-slide-toggle-content', 'Hyperlink navigation'));
|
||||
const hyperlinkToggle = element(by.cssContainingText('.mat-slide-toggle-content', 'Hyperlink navigation'));
|
||||
await BrowserActions.click(hyperlinkToggle);
|
||||
}
|
||||
|
||||
@@ -477,22 +477,22 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async enableInfiniteScrolling(): Promise<void> {
|
||||
const infiniteScrollButton: ElementFinder = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
|
||||
const infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
|
||||
await BrowserActions.click(infiniteScrollButton);
|
||||
}
|
||||
|
||||
async enableCustomPermissionMessage(): Promise<void> {
|
||||
const customPermissionMessage: ElementFinder = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
|
||||
const customPermissionMessage = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
|
||||
await BrowserActions.click(customPermissionMessage);
|
||||
}
|
||||
|
||||
async enableMediumTimeFormat(): Promise<void> {
|
||||
const mediumTimeFormat: ElementFinder = element(by.css('#enableMediumTimeFormat'));
|
||||
const mediumTimeFormat = element(by.css('#enableMediumTimeFormat'));
|
||||
await BrowserActions.click(mediumTimeFormat);
|
||||
}
|
||||
|
||||
async enableThumbnails(): Promise<void> {
|
||||
const thumbnailSlide: ElementFinder = element(by.id('adf-thumbnails-upload-switch'));
|
||||
const thumbnailSlide = element(by.id('adf-thumbnails-upload-switch'));
|
||||
await BrowserActions.click(thumbnailSlide);
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getDocumentListRowNumber(): Promise<number> {
|
||||
const documentList: ElementFinder = element(by.css('adf-upload-drag-area adf-document-list'));
|
||||
const documentList = element(by.css('adf-upload-drag-area adf-document-list'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(documentList);
|
||||
return $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
|
||||
}
|
||||
@@ -537,7 +537,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async checkLockIsDisplayedForElement(name): Promise<void> {
|
||||
const lockButton: ElementFinder = element(by.css(`div.adf-datatable-cell[data-automation-id="${name}"] button`));
|
||||
const lockButton = element(by.css(`div.adf-datatable-cell[data-automation-id="${name}"] button`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(lockButton);
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
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}"]`));
|
||||
const row = element(by.css(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
return row.getCssValue(styleName);
|
||||
}
|
||||
@@ -566,7 +566,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getRowIconImageUrl(fileName): Promise<string> {
|
||||
const iconRow: ElementFinder = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
|
||||
const iconRow = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(iconRow);
|
||||
return iconRow.getAttribute('src');
|
||||
}
|
||||
@@ -590,12 +590,12 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getDocumentCardIconForElement(elementName): Promise<string> {
|
||||
const elementIcon: ElementFinder = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
|
||||
const elementIcon = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
|
||||
return elementIcon.getAttribute('src');
|
||||
}
|
||||
|
||||
async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise<void> {
|
||||
const elementProperty: ElementFinder = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`));
|
||||
const elementProperty = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementProperty);
|
||||
}
|
||||
|
||||
@@ -605,15 +605,15 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async checkMenuIsShowedForElementIndex(elementIndex): Promise<void> {
|
||||
const elementMenu: ElementFinder = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`));
|
||||
const elementMenu = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementMenu);
|
||||
}
|
||||
|
||||
async navigateToCardFolder(folderName): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const folderCard: ElementFinder = element(by.css(`.app-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`));
|
||||
const folderCard = element(by.css(`.app-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`));
|
||||
const folderSelected = 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();
|
||||
}
|
||||
@@ -656,12 +656,12 @@ export class ContentServicesPage {
|
||||
await BrowserActions.click(this.selectAllCheckbox);
|
||||
}
|
||||
|
||||
getRowByName(rowName): ElementFinder {
|
||||
getRowByName(rowName: string): ElementFinder {
|
||||
return this.contentList.dataTable.getRow(this.columns.name, rowName);
|
||||
}
|
||||
|
||||
async selectFolder(folderName: string): Promise<void> {
|
||||
const folderSelected: ElementFinder = element(by.css(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`));
|
||||
const folderSelected = element(by.css(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(folderSelected);
|
||||
await BrowserActions.click(folderSelected);
|
||||
}
|
||||
@@ -682,13 +682,13 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async selectItemWithCheckbox(itemName: string): Promise<void> {
|
||||
const item: ElementFinder = element(by.css(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`));
|
||||
const item = element(by.css(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(item);
|
||||
await BrowserActions.clickScript(item);
|
||||
}
|
||||
|
||||
async unSelectItemWithCheckbox(itemName: string): Promise<void> {
|
||||
const item: ElementFinder = element(by.css(`adf-datatable-row[aria-label="${itemName} selected"] mat-checkbox .mat-checkbox-input`));
|
||||
const item = element(by.css(`adf-datatable-row[aria-label="${itemName} selected"] mat-checkbox .mat-checkbox-input`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(item);
|
||||
await BrowserActions.click(item);
|
||||
}
|
||||
|
||||
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserActions, DropdownPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class BreadCrumbDropdownPage {
|
||||
|
||||
breadCrumb: ElementFinder = element(by.css(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`));
|
||||
breadCrumb = element(by.css(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`));
|
||||
parentFolder = this.breadCrumb.element(by.css(`button[data-automation-id='dropdown-breadcrumb-trigger']`));
|
||||
currentFolder = this.breadCrumb.element(by.css(`div span[data-automation-id="current-folder"]`));
|
||||
|
||||
breadCrumbDropdown = new DropdownPage(element.all(by.css(`div[class*='mat-select-panel']`)).first());
|
||||
|
||||
async choosePath(pathName): Promise<void> {
|
||||
async choosePath(pathName: string): Promise<void> {
|
||||
await this.breadCrumbDropdown.selectOption(pathName);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, ElementFinder, ElementArrayFinder, protractor } from 'protractor';
|
||||
import { element, by, protractor } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class TreeViewPage {
|
||||
|
||||
treeViewTitle: ElementFinder = element(by.cssContainingText('app-tree-view div', 'TREE VIEW TEST'));
|
||||
nodeIdInput: ElementFinder = element(by.css('input[placeholder="Node Id"]'));
|
||||
noNodeMessage: ElementFinder = element(by.id('adf-tree-view-missing-node'));
|
||||
nodesOnPage: ElementArrayFinder = element.all(by.css('mat-tree-node'));
|
||||
treeViewTitle = element(by.cssContainingText('app-tree-view div', 'TREE VIEW TEST'));
|
||||
nodeIdInput = element(by.css('input[placeholder="Node Id"]'));
|
||||
noNodeMessage = element(by.id('adf-tree-view-missing-node'));
|
||||
nodesOnPage = element.all(by.css('mat-tree-node'));
|
||||
|
||||
async checkTreeViewTitleIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.treeViewTitle);
|
||||
@@ -34,28 +34,28 @@ export class TreeViewPage {
|
||||
return this.nodeIdInput.getAttribute('value');
|
||||
}
|
||||
|
||||
async clickNode(nodeName): Promise<void> {
|
||||
const node: ElementFinder = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"] button'));
|
||||
async clickNode(nodeName: string): Promise<void> {
|
||||
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"] button'));
|
||||
await BrowserActions.click(node);
|
||||
}
|
||||
|
||||
async checkNodeIsDisplayedAsClosed(nodeName): Promise<void> {
|
||||
const node: ElementFinder = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="false"]'));
|
||||
async checkNodeIsDisplayedAsClosed(nodeName: string): Promise<void> {
|
||||
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="false"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(node);
|
||||
}
|
||||
|
||||
async checkNodeIsDisplayedAsOpen(nodeName): Promise<void> {
|
||||
const node: ElementFinder = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="true"]'));
|
||||
async checkNodeIsDisplayedAsOpen(nodeName: string): Promise<void> {
|
||||
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="true"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(node);
|
||||
}
|
||||
|
||||
async checkClickedNodeName(nodeName): Promise<void> {
|
||||
const clickedNode: ElementFinder = element(by.cssContainingText('span', ' CLICKED NODE: ' + nodeName + ''));
|
||||
async checkClickedNodeName(nodeName: string): Promise<void> {
|
||||
const clickedNode = element(by.cssContainingText('span', ' CLICKED NODE: ' + nodeName + ''));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(clickedNode);
|
||||
}
|
||||
|
||||
async checkNodeIsNotDisplayed(nodeName): Promise<void> {
|
||||
const node: ElementFinder = element(by.id('' + nodeName + '-tree-child-node'));
|
||||
async checkNodeIsNotDisplayed(nodeName: string): Promise<void> {
|
||||
const node = element(by.id('' + nodeName + '-tree-child-node'));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(node);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ export class TreeViewPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.noNodeMessage);
|
||||
}
|
||||
|
||||
async addNodeId(nodeId): Promise<void> {
|
||||
async addNodeId(nodeId: string): Promise<void> {
|
||||
await BrowserActions.click(this.nodeIdInput);
|
||||
await BrowserActions.clearSendKeys(this.nodeIdInput, nodeId);
|
||||
await this.nodeIdInput.sendKeys('a');
|
||||
@@ -76,11 +76,11 @@ export class TreeViewPage {
|
||||
}
|
||||
|
||||
async checkErrorMessageIsDisplayed(): Promise<void> {
|
||||
const clickedNode: ElementFinder = element(by.cssContainingText('span', 'An Error Occurred '));
|
||||
const clickedNode = element(by.cssContainingText('span', 'An Error Occurred '));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(clickedNode);
|
||||
}
|
||||
|
||||
async getTotalNodes() {
|
||||
async getTotalNodes(): Promise<number> {
|
||||
return this.nodesOnPage.count();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,23 +15,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor, ElementFinder } from 'protractor';
|
||||
|
||||
import { element, by, protractor } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class HeaderPage {
|
||||
|
||||
checkBox: ElementFinder = element(by.cssContainingText('.mat-checkbox-label', 'Show menu button'));
|
||||
headerColor: ElementFinder = element(by.css('option[value="primary"]'));
|
||||
titleInput: ElementFinder = element(by.css('input[name="title"]'));
|
||||
iconInput: ElementFinder = element(by.css('input[placeholder="URL path"]'));
|
||||
hexColorInput: ElementFinder = element(by.css('input[placeholder="hex color code"]'));
|
||||
logoHyperlinkInput: ElementFinder = element(by.css('input[placeholder="Redirect URL"]'));
|
||||
logoTooltipInput: ElementFinder = element(by.css('input[placeholder="Tooltip text"]'));
|
||||
positionStart: ElementFinder = element.all(by.css('mat-radio-button[value="start"]')).first();
|
||||
positionEnd: ElementFinder = element.all(by.css('mat-radio-button[value="end"]')).first();
|
||||
sideBarPositionRight: ElementFinder = element(by.css('mat-sidenav.mat-drawer.mat-sidenav.mat-drawer-end'));
|
||||
sideBarPositionLeft: ElementFinder = element(by.css('mat-sidenav.mat-drawer.mat-sidenav'));
|
||||
checkBox = element(by.cssContainingText('.mat-checkbox-label', 'Show menu button'));
|
||||
headerColor = element(by.css('option[value="primary"]'));
|
||||
titleInput = element(by.css('input[name="title"]'));
|
||||
iconInput = element(by.css('input[placeholder="URL path"]'));
|
||||
hexColorInput = element(by.css('input[placeholder="hex color code"]'));
|
||||
logoHyperlinkInput = element(by.css('input[placeholder="Redirect URL"]'));
|
||||
logoTooltipInput = element(by.css('input[placeholder="Tooltip text"]'));
|
||||
positionStart = element.all(by.css('mat-radio-button[value="start"]')).first();
|
||||
positionEnd = element.all(by.css('mat-radio-button[value="end"]')).first();
|
||||
sideBarPositionRight = element(by.css('mat-sidenav.mat-drawer.mat-sidenav.mat-drawer-end'));
|
||||
sideBarPositionLeft = element(by.css('mat-sidenav.mat-drawer.mat-sidenav'));
|
||||
|
||||
async checkShowMenuCheckBoxIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.checkBox);
|
||||
@@ -50,32 +49,32 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
async clickShowMenuButton(): Promise<void> {
|
||||
const checkBox: ElementFinder = element(by.css('mat-checkbox'));
|
||||
const checkBox = element(by.css('mat-checkbox'));
|
||||
await BrowserActions.click(checkBox.get(0));
|
||||
}
|
||||
|
||||
async changeHeaderColor(color): Promise<void> {
|
||||
const headerColor: ElementFinder = element(by.css('option[value="' + color + '"]'));
|
||||
async changeHeaderColor(color: string): Promise<void> {
|
||||
const headerColor = element(by.css('option[value="' + color + '"]'));
|
||||
await BrowserActions.click(headerColor);
|
||||
}
|
||||
|
||||
async checkAppTitle(name): Promise<void> {
|
||||
const title: ElementFinder = element(by.cssContainingText('.adf-app-title', name));
|
||||
async checkAppTitle(name: string): Promise<void> {
|
||||
const title = element(by.cssContainingText('.adf-app-title', name));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(title);
|
||||
}
|
||||
|
||||
async addTitle(title): Promise<void> {
|
||||
async addTitle(title: string): Promise<void> {
|
||||
await BrowserActions.click(this.titleInput);
|
||||
await BrowserActions.clearSendKeys(this.titleInput, title);
|
||||
await this.titleInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async checkIconIsDisplayed(url): Promise<void> {
|
||||
const icon: ElementFinder = element(by.css('img[src="' + url + '"]'));
|
||||
async checkIconIsDisplayed(url: string): Promise<void> {
|
||||
const icon = element(by.css('img[src="' + url + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(icon);
|
||||
}
|
||||
|
||||
async addIcon(url): Promise<void> {
|
||||
async addIcon(url: string): Promise<void> {
|
||||
await BrowserActions.click(this.iconInput);
|
||||
await BrowserActions.clearSendKeys(this.iconInput, url);
|
||||
await this.iconInput.sendKeys(protractor.Key.ENTER);
|
||||
@@ -93,19 +92,19 @@ export class HeaderPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoTooltipInput);
|
||||
}
|
||||
|
||||
async addHexCodeColor(hexCode): Promise<void> {
|
||||
async addHexCodeColor(hexCode: string): Promise<void> {
|
||||
await BrowserActions.click(this.hexColorInput);
|
||||
await this.hexColorInput.sendKeys(hexCode);
|
||||
await this.hexColorInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async addLogoHyperlink(hyperlink): Promise<void> {
|
||||
async addLogoHyperlink(hyperlink: string): Promise<void> {
|
||||
await BrowserActions.click(this.logoHyperlinkInput);
|
||||
await this.logoHyperlinkInput.sendKeys(hyperlink);
|
||||
await this.logoHyperlinkInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async addLogoTooltip(tooltip): Promise<void> {
|
||||
async addLogoTooltip(tooltip: string): Promise<void> {
|
||||
await BrowserActions.click(this.logoTooltipInput);
|
||||
await this.logoTooltipInput.sendKeys(tooltip);
|
||||
await this.logoTooltipInput.sendKeys(protractor.Key.ENTER);
|
||||
|
||||
@@ -23,7 +23,7 @@ export class InfinitePaginationPage {
|
||||
rootElement: ElementFinder;
|
||||
loadMoreButton;
|
||||
|
||||
constructor(rootElement: ElementFinder = element.all(by.css('adf-infinite-pagination')).first()) {
|
||||
constructor(rootElement = element.all(by.css('adf-infinite-pagination')).first()) {
|
||||
this.rootElement = rootElement;
|
||||
this.loadMoreButton = this.rootElement.element(by.css('button[data-automation-id="adf-infinite-pagination-button"]'));
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
import { NavigationBarPage } from '../navigation-bar.page';
|
||||
|
||||
const source = {
|
||||
@@ -36,10 +36,10 @@ const column = {
|
||||
};
|
||||
|
||||
export class CustomSourcesPage {
|
||||
dataTable: DataTableComponentPage = new DataTableComponentPage();
|
||||
navigationBarPage: NavigationBarPage = new NavigationBarPage();
|
||||
dataTable = new DataTableComponentPage();
|
||||
navigationBarPage = new NavigationBarPage();
|
||||
|
||||
toolbar: ElementFinder = element(by.css('app-custom-sources .adf-toolbar-title'));
|
||||
toolbar = element(by.css('app-custom-sources .adf-toolbar-title'));
|
||||
selectModeDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="custom-sources-select"]')));
|
||||
|
||||
async waitForToolbarToBeVisible(): Promise<void> {
|
||||
@@ -63,15 +63,15 @@ export class CustomSourcesPage {
|
||||
await this.selectModeDropdown.selectDropdownOption(source.sharedLinks);
|
||||
}
|
||||
|
||||
checkRowIsDisplayed(rowName): Promise<void> {
|
||||
checkRowIsDisplayed(rowName: string): Promise<void> {
|
||||
return this.dataTable.checkContentIsDisplayed('Name', rowName);
|
||||
}
|
||||
|
||||
checkRowIsNotDisplayed(rowName): Promise<void> {
|
||||
checkRowIsNotDisplayed(rowName: string): Promise<void> {
|
||||
return this.dataTable.checkContentIsNotDisplayed('Name', rowName);
|
||||
}
|
||||
|
||||
async getStatusCell(rowName): Promise<string> {
|
||||
async getStatusCell(rowName: string): Promise<string> {
|
||||
const cell = this.dataTable.getCellByRowContentAndColumn('Name', rowName, column.status);
|
||||
return BrowserActions.getText(cell);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element, ElementArrayFinder, ElementFinder, protractor } from 'protractor';
|
||||
import { browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
|
||||
export class DataTablePage {
|
||||
|
||||
@@ -33,17 +33,17 @@ export class DataTablePage {
|
||||
};
|
||||
|
||||
dataTable: DataTableComponentPage;
|
||||
multiSelect: ElementFinder = element(by.css(`div[data-automation-id='multiselect'] label > div[class='mat-checkbox-inner-container']`));
|
||||
reset: ElementFinder = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||
allSelectedRows: ElementArrayFinder = element.all(by.css(`adf-datatable-row[class*='is-selected']`));
|
||||
selectedRowNumber: ElementFinder = element(by.css(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`));
|
||||
selectAll: ElementFinder = element(by.css(`div[class*='header'] label`));
|
||||
addRowElement: ElementFinder = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
|
||||
replaceRowsElement: ElementFinder = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
|
||||
replaceColumnsElement: ElementFinder = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
|
||||
createdOnColumn: ElementFinder = element(by.css(`div[data-automation-id='auto_id_createdOn']`));
|
||||
idColumnHeader: ElementFinder = element(by.css(`div[data-automation-id='auto_id_id']`));
|
||||
pasteClipboardInput: ElementFinder = element(by.css(`input[data-automation-id='paste clipboard input']`));
|
||||
multiSelect = element(by.css(`div[data-automation-id='multiselect'] label > div[class='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`));
|
||||
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']`));
|
||||
|
||||
selectModeDropdown = new DropdownPage(element(by.css(`mat-select[data-automation-id='datatable-selection-mode']`)));
|
||||
|
||||
@@ -55,8 +55,8 @@ export class DataTablePage {
|
||||
}
|
||||
}
|
||||
|
||||
async insertFilter(filterText): Promise<void> {
|
||||
const inputFilter: ElementFinder = element(by.css(`#adf-datatable-filter-input`));
|
||||
async insertFilter(filterText: string): Promise<void> {
|
||||
const inputFilter = element(by.css(`#adf-datatable-filter-input`));
|
||||
await BrowserActions.clearSendKeys(inputFilter, filterText);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ export class DataTablePage {
|
||||
await BrowserActions.click(this.addRowElement);
|
||||
}
|
||||
|
||||
async replaceRows(id): Promise<void> {
|
||||
async replaceRows(id: string): Promise<void> {
|
||||
const rowID = this.dataTable.getCellElementByValue(this.columns.id, id);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(rowID);
|
||||
await BrowserActions.click(this.replaceRowsElement);
|
||||
@@ -128,7 +128,7 @@ export class DataTablePage {
|
||||
await browser.actions().sendKeys(protractor.Key.NULL).perform();
|
||||
}
|
||||
|
||||
async selectSelectionMode(selectionMode): Promise<void> {
|
||||
async selectSelectionMode(selectionMode: string): Promise<void> {
|
||||
await this.selectModeDropdown.selectDropdownOption(selectionMode);
|
||||
}
|
||||
|
||||
@@ -174,11 +174,11 @@ export class DataTablePage {
|
||||
await BrowserActions.click(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
|
||||
}
|
||||
|
||||
async clickOnNameColumn(name): Promise<void> {
|
||||
async clickOnNameColumn(name: string): Promise<void> {
|
||||
await this.dataTable.clickColumn(this.columns.name, name);
|
||||
}
|
||||
|
||||
async clickOnCreatedByColumn(name): Promise<void> {
|
||||
async clickOnCreatedByColumn(name: string): Promise<void> {
|
||||
await this.dataTable.clickColumn(this.columns.createdBy, name);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,41 +15,41 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element, ElementFinder } from 'protractor';
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { TogglePage, BrowserActions, BrowserVisibility, LoginSSOPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class LoginPage {
|
||||
|
||||
loginURL: string = browser.baseUrl + '/login';
|
||||
loginURL = browser.baseUrl + '/login';
|
||||
|
||||
loginSSOPage: LoginSSOPage = new LoginSSOPage();
|
||||
loginSSOPage = new LoginSSOPage();
|
||||
|
||||
togglePage: TogglePage = new TogglePage();
|
||||
txtUsername: ElementFinder = element(by.css('input[id="username"]'));
|
||||
txtPassword: ElementFinder = element(by.css('input[id="password"]'));
|
||||
logoImg: ElementFinder = element(by.css('img[id="adf-login-img-logo"]'));
|
||||
successRouteTxt: ElementFinder = element(by.css('input[data-automation-id="adf-success-route"]'));
|
||||
logoTxt: ElementFinder = element(by.css('input[data-automation-id="adf-url-logo"]'));
|
||||
usernameTooltip: ElementFinder = element(by.css('span[data-automation-id="username-error"]'));
|
||||
passwordTooltip: ElementFinder = element(by.css('span[data-automation-id="password-required"]'));
|
||||
loginTooltip: ElementFinder = element(by.css('span[class="adf-login-error-message"]'));
|
||||
usernameInactive: ElementFinder = element(by.css('input[id="username"][aria-invalid="false"]'));
|
||||
passwordInactive: ElementFinder = element(by.css('input[id="password"][aria-invalid="false"]'));
|
||||
adfLogo: ElementFinder = element(by.css('img[class="adf-img-logo ng-star-inserted"]'));
|
||||
usernameHighlighted: ElementFinder = element(by.css('input[id="username"][aria-invalid="true"]'));
|
||||
passwordHighlighted: ElementFinder = element(by.css('input[id="password"][aria-invalid="true"]'));
|
||||
signInButton: ElementFinder = element(by.id('login-button'));
|
||||
showPasswordElement: ElementFinder = element(by.css('button[data-automation-id="show_password"]'));
|
||||
hidePasswordElement: ElementFinder = element(by.css('button[data-automation-id="hide_password"]'));
|
||||
rememberMe: ElementFinder = element(by.css('mat-checkbox[id="adf-login-remember"]'));
|
||||
needHelp: ElementFinder = element(by.css('div[id="adf-login-action-left"]'));
|
||||
register: ElementFinder = element(by.css('div[id="adf-login-action-right"]'));
|
||||
footerSwitch: ElementFinder = element(by.id('switch4'));
|
||||
rememberMeSwitch: ElementFinder = element(by.id('adf-toggle-show-rememberme'));
|
||||
successRouteSwitch: ElementFinder = element(by.id('adf-toggle-show-successRoute'));
|
||||
logoSwitch: ElementFinder = element(by.id('adf-toggle-logo'));
|
||||
header: ElementFinder = element(by.id('adf-header'));
|
||||
settingsIcon: ElementFinder = element(by.cssContainingText('a[data-automation-id="settings"] mat-icon', 'settings'));
|
||||
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"]'));
|
||||
usernameTooltip = element(by.css('span[data-automation-id="username-error"]'));
|
||||
passwordTooltip = element(by.css('span[data-automation-id="password-required"]'));
|
||||
loginTooltip = element(by.css('span[class="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('img[class="adf-img-logo ng-star-inserted"]'));
|
||||
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.css('div[id="adf-login-action-left"]'));
|
||||
register = element(by.css('div[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'));
|
||||
settingsIcon = element(by.cssContainingText('a[data-automation-id="settings"] mat-icon', 'settings'));
|
||||
sidenavLayout = element(by.css(`[data-automation-id="sidenav-layout"]`));
|
||||
|
||||
async goToLoginPage(): Promise<void> {
|
||||
@@ -62,11 +62,11 @@ export class LoginPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
}
|
||||
|
||||
async enterUsername(username): Promise<void> {
|
||||
async enterUsername(username: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.txtUsername, username);
|
||||
}
|
||||
|
||||
async enterPassword(password): Promise<void> {
|
||||
async enterPassword(password: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.txtPassword, password);
|
||||
}
|
||||
|
||||
@@ -195,11 +195,11 @@ export class LoginPage {
|
||||
await this.togglePage.enableToggle(this.logoSwitch);
|
||||
}
|
||||
|
||||
async enterSuccessRoute(route): Promise<void> {
|
||||
async enterSuccessRoute(route: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.successRouteTxt, route);
|
||||
}
|
||||
|
||||
async enterLogo(logo): Promise<void> {
|
||||
async enterLogo(logo: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.logoTxt, logo);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
export class MonacoExtensionPage {
|
||||
|
||||
monacoPlugin: ElementFinder = element(by.cssContainingText('mat-row > mat-cell', 'monaco plugin'));
|
||||
monacoPlugin = element(by.cssContainingText('mat-row > mat-cell', 'monaco plugin'));
|
||||
|
||||
async checkMonacoPluginIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.monacoPlugin);
|
||||
|
||||
@@ -15,20 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser, ElementFinder } from 'protractor';
|
||||
import { element, by, browser } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, DropdownPage, SnackbarPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class NotificationDemoPage {
|
||||
|
||||
snackbarPage = new SnackbarPage();
|
||||
|
||||
messageField: ElementFinder = element(by.css('input[data-automation-id="notification-message"]'));
|
||||
durationField: ElementFinder = element(by.css('input[data-automation-id="notification-duration"]'));
|
||||
actionToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="notification-action-toggle"]'));
|
||||
notificationSnackBar: ElementFinder = element.all(by.css('simple-snack-bar')).first();
|
||||
actionOutput: ElementFinder = element(by.css('div[data-automation-id="notification-action-output"]'));
|
||||
notificationsPage: ElementFinder = element(by.css('.app-sidenav-link[data-automation-id="Notifications"]'));
|
||||
notificationConfig: ElementFinder = element(by.css('p[data-automation-id="notification-custom-object"]'));
|
||||
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"]'));
|
||||
|
||||
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"]')));
|
||||
@@ -58,28 +58,28 @@ export class NotificationDemoPage {
|
||||
await this.snackbarPage.waitForSnackBarToClose();
|
||||
}
|
||||
|
||||
async enterMessageField(text): Promise<void> {
|
||||
async enterMessageField(text: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.messageField, text);
|
||||
}
|
||||
|
||||
async enterDurationField(time): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.durationField, time);
|
||||
async enterDurationField(time: number): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.durationField, time.toString());
|
||||
}
|
||||
|
||||
async selectHorizontalPosition(selectItem): Promise<void> {
|
||||
async selectHorizontalPosition(selectItem: string): Promise<void> {
|
||||
await this.horizontalPositionDropdown.selectDropdownOption(selectItem);
|
||||
}
|
||||
|
||||
async selectVerticalPosition(selectItem): Promise<void> {
|
||||
async selectVerticalPosition(selectItem: string): Promise<void> {
|
||||
await this.verticalPositionDropdown.selectDropdownOption(selectItem);
|
||||
}
|
||||
|
||||
async selectDirection(selectItem): Promise<void> {
|
||||
async selectDirection(selectItem: string): Promise<void> {
|
||||
await this.directionDropdown.selectDropdownOption(selectItem);
|
||||
}
|
||||
|
||||
async clickNotificationButton(): Promise<void> {
|
||||
const button: ElementFinder = element(by.css('button[data-automation-id="notification-custom-config-button"]'));
|
||||
const button = element(by.css('button[data-automation-id="notification-custom-config-button"]'));
|
||||
await BrowserActions.click(button);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, ConfigEditorPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
|
||||
export class FormDemoPage {
|
||||
|
||||
formCloudEditor: ElementFinder = element.all(by.css('.mat-tab-list .mat-tab-label')).get(1);
|
||||
formCloudRender: ElementFinder = element.all(by.css('.mat-tab-list .mat-tab-label')).get(0);
|
||||
formCloudEditor = element.all(by.css('.mat-tab-list .mat-tab-label')).get(1);
|
||||
formCloudRender = element.all(by.css('.mat-tab-list .mat-tab-label')).get(0);
|
||||
|
||||
configEditorPage = new ConfigEditorPage();
|
||||
|
||||
@@ -33,7 +33,7 @@ export class FormDemoPage {
|
||||
await BrowserActions.click(this.formCloudRender);
|
||||
}
|
||||
|
||||
async setConfigToEditor(text): Promise<void> {
|
||||
async setConfigToEditor(text: string): Promise<void> {
|
||||
const configEditor = element(by.id('adf-form-config-editor'));
|
||||
const form = element(by.css('adf-form'));
|
||||
await this.goToEditor();
|
||||
|
||||
@@ -15,30 +15,30 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class PeopleGroupCloudComponentPage {
|
||||
|
||||
peopleCloudSingleSelectionChecked: ElementFinder = element(by.css('mat-radio-button[data-automation-id="app-people-single-mode"][class*="mat-radio-checked"]'));
|
||||
peopleCloudMultipleSelectionChecked: ElementFinder = element(by.css('mat-radio-button[data-automation-id="app-people-multiple-mode"][class*="mat-radio-checked"]'));
|
||||
peopleCloudSingleSelection: ElementFinder = element(by.css('mat-radio-button[data-automation-id="app-people-single-mode"]'));
|
||||
peopleCloudMultipleSelection: ElementFinder = element(by.css('mat-radio-button[data-automation-id="app-people-multiple-mode"]'));
|
||||
peopleCloudFilterRole: ElementFinder = element(by.css('mat-radio-button[data-automation-id="app-people-filter-role"]'));
|
||||
groupCloudSingleSelection: ElementFinder = element(by.css('mat-radio-button[data-automation-id="app-group-single-mode"]'));
|
||||
groupCloudMultipleSelection: ElementFinder = element(by.css('mat-radio-button[data-automation-id="app-group-multiple-mode"]'));
|
||||
groupCloudFilterRole: ElementFinder = element(by.css('mat-radio-button[data-automation-id="app-group-filter-role"]'));
|
||||
peopleRoleInput: ElementFinder = element(by.css('input[data-automation-id="app-people-roles-input"]'));
|
||||
peopleAppInput: ElementFinder = element(by.css('input[data-automation-id="app-people-app-input"]'));
|
||||
peoplePreselect: ElementFinder = element(by.css('input[data-automation-id="app-people-preselect-input"]'));
|
||||
groupRoleInput: ElementFinder = element(by.css('input[data-automation-id="app-group-roles-input"]'));
|
||||
groupAppInput: ElementFinder = element(by.css('input[data-automation-id="app-group-app-input"]'));
|
||||
peopleCloudComponentTitle: ElementFinder = element(by.cssContainingText('mat-card-title', 'People Cloud Component'));
|
||||
groupCloudComponentTitle: ElementFinder = element(by.cssContainingText('mat-card-title', 'Groups Cloud Component'));
|
||||
preselectValidation: ElementFinder = element.all(by.css('mat-checkbox.app-preselect-value')).first();
|
||||
preselectValidationStatus: ElementFinder = element.all(by.css('mat-checkbox.app-preselect-value label input')).first();
|
||||
peopleFilterByAppName: ElementFinder = element(by.css('.app-people-control-options mat-radio-button[value="appName"]'));
|
||||
groupFilterByAppName: ElementFinder = element(by.css('.app-groups-control-options mat-radio-button[value="appName"]'));
|
||||
peopleCloudSingleSelectionChecked = element(by.css('mat-radio-button[data-automation-id="app-people-single-mode"][class*="mat-radio-checked"]'));
|
||||
peopleCloudMultipleSelectionChecked = element(by.css('mat-radio-button[data-automation-id="app-people-multiple-mode"][class*="mat-radio-checked"]'));
|
||||
peopleCloudSingleSelection = element(by.css('mat-radio-button[data-automation-id="app-people-single-mode"]'));
|
||||
peopleCloudMultipleSelection = element(by.css('mat-radio-button[data-automation-id="app-people-multiple-mode"]'));
|
||||
peopleCloudFilterRole = element(by.css('mat-radio-button[data-automation-id="app-people-filter-role"]'));
|
||||
groupCloudSingleSelection = element(by.css('mat-radio-button[data-automation-id="app-group-single-mode"]'));
|
||||
groupCloudMultipleSelection = element(by.css('mat-radio-button[data-automation-id="app-group-multiple-mode"]'));
|
||||
groupCloudFilterRole = element(by.css('mat-radio-button[data-automation-id="app-group-filter-role"]'));
|
||||
peopleRoleInput = element(by.css('input[data-automation-id="app-people-roles-input"]'));
|
||||
peopleAppInput = element(by.css('input[data-automation-id="app-people-app-input"]'));
|
||||
peoplePreselect = element(by.css('input[data-automation-id="app-people-preselect-input"]'));
|
||||
groupRoleInput = element(by.css('input[data-automation-id="app-group-roles-input"]'));
|
||||
groupAppInput = element(by.css('input[data-automation-id="app-group-app-input"]'));
|
||||
peopleCloudComponentTitle = element(by.cssContainingText('mat-card-title', 'People Cloud Component'));
|
||||
groupCloudComponentTitle = element(by.cssContainingText('mat-card-title', 'Groups Cloud Component'));
|
||||
preselectValidation = element.all(by.css('mat-checkbox.app-preselect-value')).first();
|
||||
preselectValidationStatus = element.all(by.css('mat-checkbox.app-preselect-value label input')).first();
|
||||
peopleFilterByAppName = element(by.css('.app-people-control-options mat-radio-button[value="appName"]'));
|
||||
groupFilterByAppName = element(by.css('.app-groups-control-options mat-radio-button[value="appName"]'));
|
||||
|
||||
async checkPeopleCloudComponentTitleIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudComponentTitle);
|
||||
@@ -76,11 +76,11 @@ export class PeopleGroupCloudComponentPage {
|
||||
await BrowserActions.click(this.groupCloudFilterRole);
|
||||
}
|
||||
|
||||
async enterPeopleRoles(roles): Promise<void> {
|
||||
async enterPeopleRoles(roles: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.peopleRoleInput, roles);
|
||||
}
|
||||
|
||||
async enterPeoplePreselect(preselect): Promise<void> {
|
||||
async enterPeoplePreselect(preselect: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.peoplePreselect, preselect);
|
||||
}
|
||||
|
||||
@@ -117,11 +117,11 @@ export class PeopleGroupCloudComponentPage {
|
||||
await BrowserActions.click(this.groupFilterByAppName);
|
||||
}
|
||||
|
||||
async enterPeopleAppName(appName): Promise<void> {
|
||||
async enterPeopleAppName(appName: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.peopleAppInput, appName);
|
||||
}
|
||||
|
||||
async enterGroupAppName(appName): Promise<void> {
|
||||
async enterGroupAppName(appName: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.groupAppInput, appName);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, EditProcessFilterCloudComponentPage, ProcessFiltersCloudComponentPage, ProcessListCloudComponentPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
|
||||
export class ProcessCloudDemoPage {
|
||||
|
||||
createButton: ElementFinder = element(by.css('button[data-automation-id="create-button"'));
|
||||
newProcessButton: ElementFinder = element(by.css('button[data-automation-id="btn-start-process"]'));
|
||||
createButton = element(by.css('button[data-automation-id="create-button"'));
|
||||
newProcessButton = element(by.css('button[data-automation-id="btn-start-process"]'));
|
||||
|
||||
processListCloud = new ProcessListCloudComponentPage();
|
||||
editProcessFilterCloud = new EditProcessFilterCloudComponentPage();
|
||||
|
||||
@@ -16,20 +16,20 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { by, element, protractor } from 'protractor';
|
||||
|
||||
export class ProcessListDemoPage {
|
||||
|
||||
appIdInput: ElementFinder = element(by.css('input[data-automation-id="app-id"]'));
|
||||
resetButton: ElementFinder = element(by.cssContainingText('button span', 'Reset'));
|
||||
emptyProcessContent: ElementFinder = element(by.css('div[class="adf-empty-content"]'));
|
||||
processDefinitionInput: ElementFinder = element(by.css('input[data-automation-id="process-definition-id"]'));
|
||||
processInstanceInput: ElementFinder = element(by.css('input[data-automation-id="process-instance-id"]'));
|
||||
appIdInput = element(by.css('input[data-automation-id="app-id"]'));
|
||||
resetButton = element(by.cssContainingText('button span', 'Reset'));
|
||||
emptyProcessContent = element(by.css('div[class="adf-empty-content"]'));
|
||||
processDefinitionInput = element(by.css('input[data-automation-id="process-definition-id"]'));
|
||||
processInstanceInput = element(by.css('input[data-automation-id="process-instance-id"]'));
|
||||
|
||||
stateDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="state"')));
|
||||
sortDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="sort"')));
|
||||
|
||||
dataTable: DataTableComponentPage = new DataTableComponentPage();
|
||||
dataTable = new DataTableComponentPage();
|
||||
|
||||
getDisplayedProcessesNames(): Promise<any> {
|
||||
return this.dataTable.getAllRowsColumnValues('Name');
|
||||
@@ -55,7 +55,7 @@ export class ProcessListDemoPage {
|
||||
}
|
||||
|
||||
async checkErrorMessageIsDisplayed(error): Promise<void> {
|
||||
const errorMessage: ElementFinder = element(by.cssContainingText('mat-error', error));
|
||||
const errorMessage = element(by.cssContainingText('mat-error', error));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(errorMessage);
|
||||
}
|
||||
|
||||
@@ -63,11 +63,11 @@ export class ProcessListDemoPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.emptyProcessContent);
|
||||
}
|
||||
|
||||
async checkProcessIsNotDisplayed(processName): Promise<void> {
|
||||
async checkProcessIsNotDisplayed(processName: string): Promise<void> {
|
||||
await this.dataTable.checkContentIsNotDisplayed('Name', processName);
|
||||
}
|
||||
|
||||
async checkProcessIsDisplayed(processName): Promise<void> {
|
||||
async checkProcessIsDisplayed(processName: string): Promise<void> {
|
||||
await this.dataTable.checkContentIsDisplayed('Name', processName);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,16 +16,16 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions } from '@alfresco/adf-testing';
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
import { TaskFiltersPage } from '../../process-services/task-filters.page';
|
||||
|
||||
export class TaskFiltersDemoPage {
|
||||
|
||||
myTasks: ElementFinder = element(by.css('button[data-automation-id="My Tasks_filter"]'));
|
||||
queuedTask: ElementFinder = element(by.css('button[data-automation-id="Queued Tasks_filter"]'));
|
||||
completedTask: ElementFinder = element(by.css('button[data-automation-id="Completed Tasks_filter"]'));
|
||||
involvedTask: ElementFinder = element(by.css('button[data-automation-id="Involved Tasks_filter"]'));
|
||||
activeFilter: ElementFinder = element(by.css('adf-task-filters .adf-active'));
|
||||
myTasks = element(by.css('button[data-automation-id="My Tasks_filter"]'));
|
||||
queuedTask = element(by.css('button[data-automation-id="Queued Tasks_filter"]'));
|
||||
completedTask = element(by.css('button[data-automation-id="Completed Tasks_filter"]'));
|
||||
involvedTask = element(by.css('button[data-automation-id="Involved Tasks_filter"]'));
|
||||
activeFilter = element(by.css('adf-task-filters .adf-active'));
|
||||
|
||||
myTasksFilter(): TaskFiltersPage {
|
||||
return new TaskFiltersPage(this.myTasks);
|
||||
@@ -43,7 +43,7 @@ export class TaskFiltersDemoPage {
|
||||
return new TaskFiltersPage(this.involvedTask);
|
||||
}
|
||||
|
||||
customTaskFilter(filterName): TaskFiltersPage {
|
||||
customTaskFilter(filterName: string): TaskFiltersPage {
|
||||
return new TaskFiltersPage(element(by.css(`button[data-automation-id="${filterName}_filter"]`)));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,26 +16,26 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DropdownPage, PaginationPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
import { TasksListPage } from '../../process-services/tasks-list.page';
|
||||
|
||||
export class TaskListDemoPage {
|
||||
|
||||
taskListPage: TasksListPage = new TasksListPage();
|
||||
appId: ElementFinder = element(by.css("input[data-automation-id='appId input']"));
|
||||
itemsPerPage: ElementFinder = element(by.css("input[data-automation-id='items per page']"));
|
||||
itemsPerPageForm: ElementFinder = element(by.css("mat-form-field[data-automation-id='items per page']"));
|
||||
processDefinitionId: ElementFinder = element(by.css("input[data-automation-id='process definition id']"));
|
||||
processInstanceId: ElementFinder = element(by.css("input[data-automation-id='process instance id']"));
|
||||
page: ElementFinder = element(by.css("input[data-automation-id='page']"));
|
||||
pageForm: ElementFinder = element(by.css("mat-form-field[data-automation-id='page']"));
|
||||
taskName: ElementFinder = element(by.css("input[data-automation-id='task name']"));
|
||||
resetButton: ElementFinder = element(by.css("div[class='app-reset-button'] button"));
|
||||
dueBefore: ElementFinder = element(by.css("input[data-automation-id='due before']"));
|
||||
dueAfter: ElementFinder = element(by.css("input[data-automation-id='due after']"));
|
||||
taskId: ElementFinder = element(by.css("input[data-automation-id='task id']"));
|
||||
appId = element(by.css("input[data-automation-id='appId input']"));
|
||||
itemsPerPage = element(by.css("input[data-automation-id='items per page']"));
|
||||
itemsPerPageForm = element(by.css("mat-form-field[data-automation-id='items per page']"));
|
||||
processDefinitionId = element(by.css("input[data-automation-id='process definition id']"));
|
||||
processInstanceId = element(by.css("input[data-automation-id='process instance id']"));
|
||||
page = element(by.css("input[data-automation-id='page']"));
|
||||
pageForm = element(by.css("mat-form-field[data-automation-id='page']"));
|
||||
taskName = element(by.css("input[data-automation-id='task name']"));
|
||||
resetButton = element(by.css("div[class='app-reset-button'] button"));
|
||||
dueBefore = element(by.css("input[data-automation-id='due before']"));
|
||||
dueAfter = element(by.css("input[data-automation-id='due after']"));
|
||||
taskId = element(by.css("input[data-automation-id='task id']"));
|
||||
|
||||
stateDropDownArrow: ElementFinder = element(by.css("mat-form-field[data-automation-id='state']"));
|
||||
stateDropDownArrow = element(by.css("mat-form-field[data-automation-id='state']"));
|
||||
stateDropdown = new DropdownPage(this.stateDropDownArrow);
|
||||
|
||||
taskList(): TasksListPage {
|
||||
@@ -46,7 +46,7 @@ export class TaskListDemoPage {
|
||||
return new PaginationPage();
|
||||
}
|
||||
|
||||
async typeAppId(input): Promise<void> {
|
||||
async typeAppId(input: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.appId, input);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export class TaskListDemoPage {
|
||||
return this.appId.getAttribute('value');
|
||||
}
|
||||
|
||||
async typeTaskId(input): Promise<void> {
|
||||
async typeTaskId(input: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.taskId, input);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ export class TaskListDemoPage {
|
||||
return this.taskId.getAttribute('value');
|
||||
}
|
||||
|
||||
async typeTaskName(input): Promise<void> {
|
||||
async typeTaskName(input: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.taskName, input);
|
||||
}
|
||||
|
||||
@@ -77,11 +77,11 @@ export class TaskListDemoPage {
|
||||
return this.taskName.getAttribute('value');
|
||||
}
|
||||
|
||||
async typeItemsPerPage(input): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.itemsPerPage, input);
|
||||
async typeItemsPerPage(input: number): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.itemsPerPage, input.toString());
|
||||
}
|
||||
|
||||
async typeProcessDefinitionId(input): Promise<void> {
|
||||
async typeProcessDefinitionId(input: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.processDefinitionId, input);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ export class TaskListDemoPage {
|
||||
return this.processInstanceId.getAttribute('value');
|
||||
}
|
||||
|
||||
async typeProcessInstanceId(input): Promise<void> {
|
||||
async typeProcessInstanceId(input: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.processInstanceId, input);
|
||||
}
|
||||
|
||||
@@ -105,8 +105,8 @@ export class TaskListDemoPage {
|
||||
return BrowserActions.getText(errorMessage);
|
||||
}
|
||||
|
||||
async typePage(input): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.page, input);
|
||||
async typePage(input: number): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.page, input.toString());
|
||||
}
|
||||
|
||||
async getPage(): Promise<string> {
|
||||
@@ -120,11 +120,11 @@ export class TaskListDemoPage {
|
||||
return BrowserActions.getText(errorMessage);
|
||||
}
|
||||
|
||||
async typeDueAfter(input): Promise<void> {
|
||||
async typeDueAfter(input: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.dueAfter, input);
|
||||
}
|
||||
|
||||
async typeDueBefore(input): Promise<void> {
|
||||
async typeDueBefore(input: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.dueBefore, input);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ export class TaskListDemoPage {
|
||||
await BrowserActions.click(this.resetButton);
|
||||
}
|
||||
|
||||
async selectState(state): Promise<void> {
|
||||
async selectState(state: string): Promise<void> {
|
||||
await this.stateDropdown.selectDropdownOption(state);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser, ElementFinder, ElementArrayFinder } from 'protractor';
|
||||
import { element, by, browser } from 'protractor';
|
||||
import {
|
||||
TogglePage,
|
||||
TaskFiltersCloudComponentPage,
|
||||
@@ -27,31 +27,31 @@ import {
|
||||
|
||||
export class TasksCloudDemoPage {
|
||||
|
||||
createButton: ElementFinder = element(by.css('button[data-automation-id="create-button"'));
|
||||
newTaskButton: ElementFinder = element(by.css('button[data-automation-id="btn-start-task"]'));
|
||||
settingsButton: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
|
||||
appButton: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'App')).first();
|
||||
displayTaskDetailsToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="taskDetailsRedirection"]'));
|
||||
displayProcessDetailsToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="processDetailsRedirection"]'));
|
||||
actionMenuToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="actionmenu"]'));
|
||||
contextMenuToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="contextmenu"]'));
|
||||
multiSelectionToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="multiSelection"]'));
|
||||
testingModeToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="testingMode"]'));
|
||||
selectedRows: ElementFinder = element(by.xpath("//div[text()=' Selected Rows: ']"));
|
||||
noOfSelectedRows: ElementArrayFinder = element.all(by.xpath("//div[text()=' Selected Rows: ']//li"));
|
||||
addActionTitle: ElementFinder = element(by.cssContainingText('.mat-card-title', 'Add Action'));
|
||||
keyInputField: ElementFinder = element(by.css('input[placeholder="Key"]'));
|
||||
titleInputField: ElementFinder = element(by.css('input[placeholder="Title"]'));
|
||||
iconInputField: ElementFinder = element(by.css('input[placeholder="Icon"]'));
|
||||
addActionButton: ElementFinder = element(by.cssContainingText('button span', 'Add'));
|
||||
disableCheckbox: ElementFinder = element(by.css(`mat-checkbox[formcontrolname='disabled']`));
|
||||
visibleCheckbox: ElementFinder = element(by.css(`mat-checkbox[formcontrolname='visible']`));
|
||||
createButton = element(by.css('button[data-automation-id="create-button"'));
|
||||
newTaskButton = element(by.css('button[data-automation-id="btn-start-task"]'));
|
||||
settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
|
||||
appButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'App')).first();
|
||||
displayTaskDetailsToggle = element(by.css('mat-slide-toggle[data-automation-id="taskDetailsRedirection"]'));
|
||||
displayProcessDetailsToggle = element(by.css('mat-slide-toggle[data-automation-id="processDetailsRedirection"]'));
|
||||
actionMenuToggle = element(by.css('mat-slide-toggle[data-automation-id="actionmenu"]'));
|
||||
contextMenuToggle = element(by.css('mat-slide-toggle[data-automation-id="contextmenu"]'));
|
||||
multiSelectionToggle = element(by.css('mat-slide-toggle[data-automation-id="multiSelection"]'));
|
||||
testingModeToggle = element(by.css('mat-slide-toggle[data-automation-id="testingMode"]'));
|
||||
selectedRows = element(by.xpath("//div[text()=' Selected Rows: ']"));
|
||||
noOfSelectedRows = element.all(by.xpath("//div[text()=' Selected Rows: ']//li"));
|
||||
addActionTitle = element(by.cssContainingText('.mat-card-title', 'Add Action'));
|
||||
keyInputField = element(by.css('input[placeholder="Key"]'));
|
||||
titleInputField = element(by.css('input[placeholder="Title"]'));
|
||||
iconInputField = element(by.css('input[placeholder="Icon"]'));
|
||||
addActionButton = element(by.cssContainingText('button span', 'Add'));
|
||||
disableCheckbox = element(by.css(`mat-checkbox[formcontrolname='disabled']`));
|
||||
visibleCheckbox = element(by.css(`mat-checkbox[formcontrolname='visible']`));
|
||||
|
||||
modeDropdown = new DropdownPage(element(by.css('mat-form-field[data-automation-id="selectionMode"]')));
|
||||
|
||||
togglePage: TogglePage = new TogglePage();
|
||||
togglePage = new TogglePage();
|
||||
|
||||
editTaskFilterCloud: EditTaskFilterCloudComponentPage = new EditTaskFilterCloudComponentPage();
|
||||
editTaskFilterCloud = new EditTaskFilterCloudComponentPage();
|
||||
|
||||
taskFilterCloudComponent = new TaskFiltersCloudComponentPage();
|
||||
|
||||
@@ -103,7 +103,7 @@ export class TasksCloudDemoPage {
|
||||
await BrowserActions.click(this.appButton);
|
||||
}
|
||||
|
||||
async selectSelectionMode(mode): Promise<void> {
|
||||
async selectSelectionMode(mode: string): Promise<void> {
|
||||
await this.modeDropdown.clickDropdown();
|
||||
await this.modeDropdown.selectOption(mode);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ export class TasksCloudDemoPage {
|
||||
|
||||
async getSelectedTaskRowText(rowNo: string): Promise<string> {
|
||||
await this.checkSelectedRowsIsDisplayed();
|
||||
const row: ElementFinder = element(by.xpath(`//div[text()=' Selected Rows: ']//li[${rowNo}]`));
|
||||
const row = element(by.xpath(`//div[text()=' Selected Rows: ']//li[${rowNo}]`));
|
||||
return BrowserActions.getText(row);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
import { BrowserActions, BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
export class SocialPage {
|
||||
|
||||
nodeIdField: ElementFinder = element(by.css(`input[id="nodeId"]`));
|
||||
nodeIdField = element(by.css(`input[id="nodeId"]`));
|
||||
|
||||
async getNodeIdFieldValue(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.nodeIdField);
|
||||
|
||||
@@ -15,26 +15,26 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, browser, protractor, ElementFinder, ElementArrayFinder } from 'protractor';
|
||||
import { by, element, browser, protractor } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class CreateLibraryDialogPage {
|
||||
libraryDialog: ElementFinder = element(by.css('[role="dialog"]'));
|
||||
libraryTitle: ElementFinder = element(by.css('.adf-library-dialog>h2'));
|
||||
libraryNameField: ElementFinder = element(by.css('input[formcontrolname="title"]'));
|
||||
libraryIdField: ElementFinder = element(by.css('input[formcontrolname="id"]'));
|
||||
libraryDescriptionField: ElementFinder = element(by.css('textarea[formcontrolname="description"]'));
|
||||
publicRadioButton: ElementFinder = element(by.css('[data-automation-id="PUBLIC"]>label'));
|
||||
privateRadioButton: ElementFinder = element(by.css('[data-automation-id="PRIVATE"]>label'));
|
||||
moderatedRadioButton: ElementFinder = element(by.css('[data-automation-id="MODERATED"]>label'));
|
||||
cancelButton: ElementFinder = element(by.css('button[data-automation-id="cancel-library-id"]'));
|
||||
createButton: ElementFinder = element(by.css('button[data-automation-id="create-library-id"]'));
|
||||
errorMessage: ElementFinder = element(by.css('.mat-dialog-content .mat-error'));
|
||||
errorMessages: ElementArrayFinder = element.all(by.css('.mat-dialog-content .mat-error'));
|
||||
libraryNameHint: ElementFinder = element(by.css('adf-library-dialog .mat-hint'));
|
||||
libraryDialog = element(by.css('[role="dialog"]'));
|
||||
libraryTitle = element(by.css('.adf-library-dialog>h2'));
|
||||
libraryNameField = element(by.css('input[formcontrolname="title"]'));
|
||||
libraryIdField = element(by.css('input[formcontrolname="id"]'));
|
||||
libraryDescriptionField = element(by.css('textarea[formcontrolname="description"]'));
|
||||
publicRadioButton = element(by.css('[data-automation-id="PUBLIC"]>label'));
|
||||
privateRadioButton = element(by.css('[data-automation-id="PRIVATE"]>label'));
|
||||
moderatedRadioButton = element(by.css('[data-automation-id="MODERATED"]>label'));
|
||||
cancelButton = element(by.css('button[data-automation-id="cancel-library-id"]'));
|
||||
createButton = element(by.css('button[data-automation-id="create-library-id"]'));
|
||||
errorMessage = element(by.css('.mat-dialog-content .mat-error'));
|
||||
errorMessages = element.all(by.css('.mat-dialog-content .mat-error'));
|
||||
libraryNameHint = element(by.css('adf-library-dialog .mat-hint'));
|
||||
|
||||
async getSelectedRadio(): Promise<string> {
|
||||
const radio: ElementFinder = element(by.css('.mat-radio-button[class*="checked"]'));
|
||||
const radio = element(by.css('.mat-radio-button[class*="checked"]'));
|
||||
return BrowserActions.getText(radio);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export class CreateLibraryDialogPage {
|
||||
return BrowserActions.getText(this.errorMessage);
|
||||
}
|
||||
|
||||
async getErrorMessages(position): Promise<string> {
|
||||
async getErrorMessages(position: number): Promise<string> {
|
||||
return BrowserActions.getText(this.errorMessages.get(position));
|
||||
}
|
||||
|
||||
@@ -122,11 +122,11 @@ export class CreateLibraryDialogPage {
|
||||
await BrowserActions.clearSendKeys(this.libraryNameField, libraryName);
|
||||
}
|
||||
|
||||
async typeLibraryId(libraryId): Promise<void> {
|
||||
async typeLibraryId(libraryId: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.libraryIdField, libraryId);
|
||||
}
|
||||
|
||||
async typeLibraryDescription(libraryDescription): Promise<void> {
|
||||
async typeLibraryDescription(libraryDescription: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.libraryDescriptionField, libraryDescription);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ import { by, element, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class FolderDialogPage {
|
||||
folderDialog: ElementFinder = element(by.css('adf-folder-dialog'));
|
||||
folderNameField: ElementFinder = this.folderDialog.element(by.id('adf-folder-name-input'));
|
||||
folderDescriptionField: ElementFinder = this.folderDialog.element(by.id('adf-folder-description-input'));
|
||||
createUpdateButton: ElementFinder = this.folderDialog.element(by.id('adf-folder-create-button'));
|
||||
cancelButton: ElementFinder = this.folderDialog.element(by.id('adf-folder-cancel-button'));
|
||||
folderTitle: ElementFinder = this.folderDialog.element((by.css('h2.mat-dialog-title')));
|
||||
validationMessage: ElementFinder = this.folderDialog.element(by.css('div.mat-form-field-subscript-wrapper mat-hint span'));
|
||||
folderDialog = element(by.css('adf-folder-dialog'));
|
||||
folderNameField = this.folderDialog.element(by.id('adf-folder-name-input'));
|
||||
folderDescriptionField = this.folderDialog.element(by.id('adf-folder-description-input'));
|
||||
createUpdateButton = this.folderDialog.element(by.id('adf-folder-create-button'));
|
||||
cancelButton = this.folderDialog.element(by.id('adf-folder-cancel-button'));
|
||||
folderTitle = this.folderDialog.element((by.css('h2.mat-dialog-title')));
|
||||
validationMessage = this.folderDialog.element(by.css('div.mat-form-field-subscript-wrapper mat-hint span'));
|
||||
|
||||
async getDialogTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.folderTitle);
|
||||
|
||||
@@ -15,19 +15,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element, ElementFinder, Locator, protractor } from 'protractor';
|
||||
import { browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class SearchDialogPage {
|
||||
|
||||
searchIcon: ElementFinder = element(by.css(`button[class*='adf-search-button']`));
|
||||
searchBar: ElementFinder = element(by.css(`adf-search-control input`));
|
||||
searchBarExpanded: ElementFinder = element(by.css(`adf-search-control mat-form-field[class*="mat-focused"] input`));
|
||||
noResultMessage: ElementFinder = element(by.css(`p[class*='adf-search-fixed-text']`));
|
||||
rowsAuthor: Locator = by.css(`div[class='mat-list-text'] p[class*='adf-search-fixed-text']`);
|
||||
completeName: Locator = by.css(`h4[class*='adf-search-fixed-text']`);
|
||||
highlightName: Locator = by.css(`.adf-highlight`);
|
||||
searchDialog: ElementFinder = element(by.css(`mat-list[id='autocomplete-search-result-list']`));
|
||||
searchIcon = element(by.css(`button[class*='adf-search-button']`));
|
||||
searchBar = element(by.css(`adf-search-control input`));
|
||||
searchBarExpanded = element(by.css(`adf-search-control mat-form-field[class*="mat-focused"] input`));
|
||||
noResultMessage = element(by.css(`p[class*='adf-search-fixed-text']`));
|
||||
rowsAuthor = by.css(`div[class='mat-list-text'] p[class*='adf-search-fixed-text']`);
|
||||
completeName = by.css(`h4[class*='adf-search-fixed-text']`);
|
||||
highlightName = by.css(`.adf-highlight`);
|
||||
searchDialog = element(by.css(`mat-list[id='autocomplete-search-result-list']`));
|
||||
|
||||
async pressDownArrowAndEnter(): Promise<void> {
|
||||
await element(by.css(`adf-search-control div input`)).sendKeys(protractor.Key.ARROW_DOWN);
|
||||
@@ -58,40 +58,40 @@ export class SearchDialogPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.noResultMessage);
|
||||
}
|
||||
|
||||
async enterText(text): Promise<void> {
|
||||
async enterText(text: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
||||
await this.searchBar.sendKeys(text);
|
||||
}
|
||||
|
||||
async enterTextAndPressEnter(text): Promise<void> {
|
||||
async enterTextAndPressEnter(text: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
||||
await this.searchBar.sendKeys(text);
|
||||
await this.searchBar.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async resultTableContainsRow(name): Promise<void> {
|
||||
async resultTableContainsRow(name: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchDialog);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.getRowByRowName(name));
|
||||
}
|
||||
|
||||
async clickOnSpecificRow(name): Promise<void> {
|
||||
async clickOnSpecificRow(name: string): Promise<void> {
|
||||
await this.resultTableContainsRow(name);
|
||||
await BrowserActions.click(this.getRowByRowName(name));
|
||||
}
|
||||
|
||||
getRowByRowName(name): ElementFinder {
|
||||
getRowByRowName(name: string): ElementFinder {
|
||||
return element(by.css(`mat-list-item[data-automation-id='autocomplete_for_${name}']`));
|
||||
}
|
||||
|
||||
async getSpecificRowsHighlightName(name): Promise<string> {
|
||||
async getSpecificRowsHighlightName(name: string): Promise<string> {
|
||||
return BrowserActions.getText(this.getRowByRowName(name).element(this.highlightName));
|
||||
}
|
||||
|
||||
async getSpecificRowsCompleteName(name): Promise<string> {
|
||||
async getSpecificRowsCompleteName(name: string): Promise<string> {
|
||||
return BrowserActions.getText(this.getRowByRowName(name).element(this.completeName));
|
||||
}
|
||||
|
||||
async getSpecificRowsAuthor(name): Promise<string> {
|
||||
async getSpecificRowsAuthor(name: string): Promise<string> {
|
||||
return BrowserActions.getText(this.getRowByRowName(name).element(this.rowsAuthor));
|
||||
}
|
||||
|
||||
|
||||
@@ -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: ElementFinder = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
|
||||
dialog: ElementFinder = element(by.css('div[id="upload-dialog"]'));
|
||||
minimizedDialog: ElementFinder = 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"]');
|
||||
closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
|
||||
dialog = element(by.css('div[id="upload-dialog"]'));
|
||||
minimizedDialog = element(by.css('div[class*="upload-dialog--minimized"]'));
|
||||
uploadedStatusIcon = by.css('mat-icon[class*="status--done"]');
|
||||
cancelledStatusIcon = by.css('div[class*="status--cancelled"]');
|
||||
errorStatusIcon = by.css('div[class*="status--error"] mat-icon');
|
||||
errorTooltip: ElementFinder = element(by.css('div.mat-tooltip'));
|
||||
errorTooltip = element(by.css('div.mat-tooltip'));
|
||||
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
|
||||
title: ElementFinder = element(by.css('span[class*="upload-dialog__title"]'));
|
||||
minimizeButton: ElementFinder = element(by.css('mat-icon[title="Minimize"]'));
|
||||
maximizeButton: ElementFinder = element(by.css('mat-icon[title="Maximize"]'));
|
||||
canUploadConfirmationTitle: ElementFinder = element(by.css('p[class="upload-dialog__confirmation--title"]'));
|
||||
canUploadConfirmationDescription: ElementFinder = element(by.css('p[class="upload-dialog__confirmation--text"]'));
|
||||
confirmationDialogNoButton: ElementFinder = element(by.partialButtonText('No'));
|
||||
confirmationDialogYesButton: ElementFinder = element(by.partialButtonText('Yes'));
|
||||
cancelUploadsElement: ElementFinder = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]')));
|
||||
cancelUploadInProgressButton: ElementFinder = element(by.css('div[data-automation-id="cancel-upload-progress"]'));
|
||||
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('p[class="upload-dialog__confirmation--title"]'));
|
||||
canUploadConfirmationDescription = element(by.css('p[class="upload-dialog__confirmation--text"]'));
|
||||
confirmationDialogNoButton = element(by.partialButtonText('No'));
|
||||
confirmationDialogYesButton = element(by.partialButtonText('Yes'));
|
||||
cancelUploadsElement = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]')));
|
||||
cancelUploadInProgressButton = element(by.css('div[data-automation-id="cancel-upload-progress"]'));
|
||||
|
||||
async clickOnCloseButton(): Promise<void> {
|
||||
await this.checkCloseButtonIsDisplayed();
|
||||
@@ -59,32 +59,32 @@ export class UploadDialogPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.dialog);
|
||||
}
|
||||
|
||||
getRowsByName(content): ElementFinder {
|
||||
getRowsByName(content: string): ElementFinder {
|
||||
return element.all(by.css(`div[class*='uploading-row'] span[title="${content}"]`)).first();
|
||||
}
|
||||
|
||||
getRowByRowName(content) {
|
||||
getRowByRowName(content: string) {
|
||||
const rows = this.getRowsByName(content);
|
||||
return rows.element(this.rowByRowName);
|
||||
}
|
||||
|
||||
async fileIsUploaded(content): Promise<void> {
|
||||
async fileIsUploaded(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon));
|
||||
}
|
||||
|
||||
async fileIsError(content) {
|
||||
async fileIsError(content: string) {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.errorStatusIcon));
|
||||
}
|
||||
|
||||
async filesAreUploaded(content): Promise<void> {
|
||||
async filesAreUploaded(content: string[]): Promise<void> {
|
||||
for (let i = 0; i < content.length; i++) {
|
||||
await this.fileIsUploaded(content[i]);
|
||||
}
|
||||
}
|
||||
|
||||
async fileIsNotDisplayedInDialog(content): Promise<void> {
|
||||
async fileIsNotDisplayedInDialog(content: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`div[class*='uploading-row'] span[title="${content}"]`)));
|
||||
}
|
||||
|
||||
@@ -100,12 +100,12 @@ export class UploadDialogPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.cancelUploadInProgressButton);
|
||||
}
|
||||
|
||||
async fileIsCancelled(content): Promise<void> {
|
||||
async fileIsCancelled(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon), 10000);
|
||||
}
|
||||
|
||||
async removeUploadedFile(content): Promise<void> {
|
||||
async removeUploadedFile(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon));
|
||||
const elementRow = await this.getRowByRowName(content);
|
||||
|
||||
@@ -15,20 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element, ElementFinder } from 'protractor';
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { BrowserActions, BrowserVisibility, TogglePage } from '@alfresco/adf-testing';
|
||||
|
||||
export class UploadTogglesPage {
|
||||
|
||||
togglePage: TogglePage = new TogglePage();
|
||||
multipleFileUploadToggle: ElementFinder = element(by.id('adf-multiple-upload-switch'));
|
||||
uploadFolderToggle: ElementFinder = element(by.css('#adf-folder-upload-switch'));
|
||||
extensionFilterToggle: ElementFinder = element(by.id('adf-extension-filter-upload-switch'));
|
||||
maxSizeToggle: ElementFinder = element(by.id('adf-max-size-filter-upload-switch'));
|
||||
versioningToggle: ElementFinder = element(by.id('adf-version-upload-switch'));
|
||||
extensionAcceptedField: ElementFinder = element(by.css('input[data-automation-id="accepted-files-type"]'));
|
||||
maxSizeField: ElementFinder = element(by.css('input[data-automation-id="max-files-size"]'));
|
||||
disableUploadCheckbox: ElementFinder = element(by.css('[id="adf-disable-upload"]'));
|
||||
togglePage = new TogglePage();
|
||||
multipleFileUploadToggle = element(by.id('adf-multiple-upload-switch'));
|
||||
uploadFolderToggle = element(by.css('#adf-folder-upload-switch'));
|
||||
extensionFilterToggle = element(by.id('adf-extension-filter-upload-switch'));
|
||||
maxSizeToggle = element(by.id('adf-max-size-filter-upload-switch'));
|
||||
versioningToggle = element(by.id('adf-version-upload-switch'));
|
||||
extensionAcceptedField = element(by.css('input[data-automation-id="accepted-files-type"]'));
|
||||
maxSizeField = element(by.css('input[data-automation-id="max-files-size"]'));
|
||||
disableUploadCheckbox = element(by.css('[id="adf-disable-upload"]'));
|
||||
|
||||
async enableMultipleFileUpload(): Promise<void> {
|
||||
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
|
||||
@@ -46,7 +46,7 @@ export class UploadTogglesPage {
|
||||
|
||||
async checkFolderUploadToggleIsEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const enabledFolderUpload: ElementFinder = element(by.css('mat-slide-toggle[id="adf-folder-upload-switch"][class*="mat-checked"]'));
|
||||
const enabledFolderUpload = element(by.css('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: ElementFinder = element(by.css('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]'));
|
||||
const enabledToggle = element(by.css('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
async checkMaxSizeToggleIsEnabled(): Promise<void> {
|
||||
const enabledToggle: ElementFinder = element(by.css('mat-slide-toggle[id="adf-max-size-filter-upload-switch"][class*="mat-checked"]'));
|
||||
const enabledToggle = element(by.css('mat-slide-toggle[id="adf-max-size-filter-upload-switch"][class*="mat-checked"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
async checkVersioningToggleIsEnabled(): Promise<void> {
|
||||
const enabledToggle: ElementFinder = element(by.css('mat-slide-toggle[id="adf-version-upload-switch"][class*="mat-checked"]'));
|
||||
const enabledToggle = element(by.css('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: ElementFinder = element(by.css('#adf-folder-upload-switch .mat-slide-toggle-label'));
|
||||
const inactiveToggleFolder = element(by.css('#adf-folder-upload-switch .mat-slide-toggle-label'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(inactiveToggleFolder);
|
||||
return true;
|
||||
} catch {
|
||||
@@ -112,7 +112,7 @@ export class UploadTogglesPage {
|
||||
await BrowserActions.click(this.disableUploadCheckbox);
|
||||
}
|
||||
|
||||
async addExtension(extension): Promise<void> {
|
||||
async addExtension(extension: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.extensionAcceptedField);
|
||||
await this.extensionAcceptedField.sendKeys(',' + extension);
|
||||
}
|
||||
|
||||
@@ -19,15 +19,15 @@ import { browser, by, element, ElementFinder } from 'protractor';
|
||||
|
||||
export class IconsPage {
|
||||
|
||||
locateCustomIcon(name): ElementFinder {
|
||||
locateCustomIcon(name: string): ElementFinder {
|
||||
return element(by.css(`adf-icon[value='${name}'] svg`));
|
||||
}
|
||||
|
||||
locateLigatureIcon(name): ElementFinder {
|
||||
locateLigatureIcon(name: string): ElementFinder {
|
||||
return element(by.css(`adf-icon[value='${name}'] .material-icons`));
|
||||
}
|
||||
|
||||
async isCustomIconDisplayed(name) {
|
||||
async isCustomIconDisplayed(name: string) {
|
||||
const present = await browser.isElementPresent(this.locateCustomIcon(name));
|
||||
if (present) {
|
||||
return this.locateCustomIcon(name).isDisplayed();
|
||||
@@ -36,7 +36,7 @@ export class IconsPage {
|
||||
}
|
||||
}
|
||||
|
||||
async isLigatureIconDisplayed(name) {
|
||||
async isLigatureIconDisplayed(name: string) {
|
||||
const present = await browser.isElementPresent(this.locateLigatureIcon(name));
|
||||
if (present) {
|
||||
return this.locateLigatureIcon(name).isDisplayed();
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class LockFilePage {
|
||||
|
||||
cancelButton: ElementFinder = element(by.css('button[data-automation-id="lock-dialog-btn-cancel"]'));
|
||||
saveButton: ElementFinder = element(by.cssContainingText('button span', 'Save'));
|
||||
lockFileCheckboxText: ElementFinder = element(by.cssContainingText('mat-checkbox label span', ' Lock file '));
|
||||
lockFileCheckbox: ElementFinder = element(by.css('mat-checkbox[data-automation-id="adf-lock-node-checkbox"]'));
|
||||
allowOwnerCheckbox: ElementFinder = element(by.cssContainingText('mat-checkbox[class*="adf-lock-file-name"] span', ' Allow the owner to modify this file '));
|
||||
cancelButton = element(by.css('button[data-automation-id="lock-dialog-btn-cancel"]'));
|
||||
saveButton = element(by.cssContainingText('button span', 'Save'));
|
||||
lockFileCheckboxText = element(by.cssContainingText('mat-checkbox label span', ' Lock file '));
|
||||
lockFileCheckbox = element(by.css('mat-checkbox[data-automation-id="adf-lock-node-checkbox"]'));
|
||||
allowOwnerCheckbox = element(by.cssContainingText('mat-checkbox[class*="adf-lock-file-name"] span', ' Allow the owner to modify this file '));
|
||||
|
||||
async checkLockFileCheckboxIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.lockFileCheckboxText);
|
||||
|
||||
@@ -15,38 +15,38 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder, Key, protractor } from 'protractor';
|
||||
import { by, element, Key, protractor } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class MetadataViewPage {
|
||||
|
||||
title: ElementFinder = element(by.css(`div[info-drawer-title]`));
|
||||
expandedAspect: ElementFinder = element(by.css(`mat-expansion-panel-header[aria-expanded='true']`));
|
||||
title = element(by.css(`div[info-drawer-title]`));
|
||||
expandedAspect = element(by.css(`mat-expansion-panel-header[aria-expanded='true']`));
|
||||
aspectTitle = by.css(`mat-panel-title`);
|
||||
name: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-name']`));
|
||||
creator: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-createdByUser.displayName']`));
|
||||
createdDate: ElementFinder = element(by.css(`span[data-automation-id='card-dateitem-createdAt'] span`));
|
||||
modifier: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-modifiedByUser.displayName']`));
|
||||
modifiedDate: ElementFinder = element(by.css(`span[data-automation-id='card-dateitem-modifiedAt'] span`));
|
||||
mimetypeName: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-content.mimeTypeName']`));
|
||||
size: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-content.sizeInBytes']`));
|
||||
description: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:description']`));
|
||||
author: ElementFinder = element(by.css(`[data-automation-id='card-textitem-value-properties.cm:author']`));
|
||||
titleProperty: ElementFinder = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`));
|
||||
editIcon: ElementFinder = element(by.css(`button[data-automation-id='meta-data-card-toggle-edit']`));
|
||||
informationButton: ElementFinder = element(by.css(`button[data-automation-id='meta-data-card-toggle-expand']`));
|
||||
informationSpan: ElementFinder = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label']`));
|
||||
informationIcon: ElementFinder = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label'] ~ mat-icon`));
|
||||
displayEmptySwitch: ElementFinder = element(by.id(`adf-metadata-empty`));
|
||||
readonlySwitch: ElementFinder = element(by.id(`adf-metadata-readonly`));
|
||||
multiSwitch: ElementFinder = element(by.id(`adf-metadata-multi`));
|
||||
presetSwitch: ElementFinder = element(by.id('adf-toggle-custom-preset'));
|
||||
defaultPropertiesSwitch: ElementFinder = element(by.id('adf-metadata-default-properties'));
|
||||
closeButton: ElementFinder = element(by.cssContainingText('button.mat-button span', 'Close'));
|
||||
displayAspect: ElementFinder = element(by.css(`input[placeholder='Display Aspect']`));
|
||||
applyAspect: ElementFinder = element(by.cssContainingText(`button span.mat-button-wrapper`, 'Apply Aspect'));
|
||||
saveMetadataButton: ElementFinder = element(by.css(`[data-automation-id='save-metadata']`));
|
||||
resetMetadataButton: ElementFinder = element(by.css(`[data-automation-id='reset-metadata']`));
|
||||
name = element(by.css(`[data-automation-id='card-textitem-value-name']`));
|
||||
creator = element(by.css(`[data-automation-id='card-textitem-value-createdByUser.displayName']`));
|
||||
createdDate = element(by.css(`span[data-automation-id='card-dateitem-createdAt'] span`));
|
||||
modifier = element(by.css(`[data-automation-id='card-textitem-value-modifiedByUser.displayName']`));
|
||||
modifiedDate = element(by.css(`span[data-automation-id='card-dateitem-modifiedAt'] span`));
|
||||
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'));
|
||||
closeButton = element(by.cssContainingText('button.mat-button span', 'Close'));
|
||||
displayAspect = element(by.css(`input[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']`));
|
||||
|
||||
async getTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.title);
|
||||
@@ -129,7 +129,7 @@ export class MetadataViewPage {
|
||||
}
|
||||
|
||||
async clickOnPropertiesTab(): Promise<void> {
|
||||
const propertiesTab: ElementFinder = element(by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`));
|
||||
const propertiesTab = element(by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`));
|
||||
await BrowserActions.click(propertiesTab);
|
||||
}
|
||||
|
||||
@@ -138,70 +138,70 @@ export class MetadataViewPage {
|
||||
}
|
||||
|
||||
async editPropertyIconIsDisplayed(propertyName: string) {
|
||||
const editPropertyIcon: ElementFinder = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon'));
|
||||
const editPropertyIcon = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon'));
|
||||
await BrowserVisibility.waitUntilElementIsPresent(editPropertyIcon);
|
||||
}
|
||||
|
||||
async clickResetButton(): Promise<void> {
|
||||
const clearPropertyIcon: ElementFinder = element(by.css('button[data-automation-id="reset-metadata"]'));
|
||||
const clearPropertyIcon = element(by.css('button[data-automation-id="reset-metadata"]'));
|
||||
await BrowserActions.click(clearPropertyIcon);
|
||||
}
|
||||
|
||||
async enterPropertyText(propertyName: string, text: string | number): Promise<void> {
|
||||
const textField: ElementFinder = element(by.css('input[data-automation-id="card-textitem-value-' + propertyName + '"]'));
|
||||
const textField = element(by.css('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: ElementFinder = element(by.css('input[data-automation-id="adf-text-custom-preset"]'));
|
||||
const presetField = element(by.css('input[data-automation-id="adf-text-custom-preset"]'));
|
||||
await BrowserActions.clearSendKeys(presetField, text.toString());
|
||||
await presetField.sendKeys(protractor.Key.ENTER);
|
||||
const applyButton: ElementFinder = element(by.css('button[id="adf-metadata-aplly"]'));
|
||||
const applyButton = element(by.css('button[id="adf-metadata-aplly"]'));
|
||||
await BrowserActions.click(applyButton);
|
||||
}
|
||||
|
||||
async enterDescriptionText(text: string): Promise<void> {
|
||||
const textField: ElementFinder = element(by.css('textarea[data-automation-id="card-textitem-value-properties.cm:description"]'));
|
||||
const textField = element(by.css('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: ElementFinder = element(by.css('[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]'));
|
||||
const textField = element(by.css('[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]'));
|
||||
|
||||
return BrowserActions.getInputValue(textField);
|
||||
}
|
||||
|
||||
async getPropertyIconTooltip(propertyName: string): Promise<string> {
|
||||
const editPropertyIcon: ElementFinder = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon'));
|
||||
const editPropertyIcon = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon'));
|
||||
return editPropertyIcon.getAttribute('title');
|
||||
}
|
||||
|
||||
async clickMetadataGroup(groupName: string): Promise<void> {
|
||||
const group: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
await BrowserActions.click(group);
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsPresent(groupName: string): Promise<void> {
|
||||
const group: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(group);
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsNotPresent(groupName: string): Promise<void> {
|
||||
const group: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(group);
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsExpand(groupName: string): Promise<void> {
|
||||
const group: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(group);
|
||||
await expect(await group.getAttribute('class')).toContain('mat-expanded');
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsNotExpand(groupName: string): Promise<void> {
|
||||
const group: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
await BrowserVisibility.waitUntilElementIsPresent(group);
|
||||
await expect(await group.getAttribute('class')).not.toContain('mat-expanded');
|
||||
}
|
||||
@@ -212,12 +212,12 @@ export class MetadataViewPage {
|
||||
}
|
||||
|
||||
async checkPropertyIsVisible(propertyName: string, type: string): Promise<void> {
|
||||
const property: ElementFinder = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
const property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(property);
|
||||
}
|
||||
|
||||
async checkPropertyIsNotVisible(propertyName: string, type: string): Promise<void> {
|
||||
const property: ElementFinder = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
const property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(property);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,22 +22,22 @@ import { ProcessServicesPage } from './process-services/process-services.page';
|
||||
|
||||
export class NavigationBarPage {
|
||||
|
||||
linkListContainer: ElementFinder = element(by.css('.app-sidenav-linklist'));
|
||||
linkMenuChildrenContainer: ElementFinder = element(by.css('.nestedMenu'));
|
||||
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: ElementFinder = element(by.css('button[data-automation-id="theme menu"]'));
|
||||
themeMenuContent: ElementFinder = element(by.css('div[class*="mat-menu-panel"]'));
|
||||
languageMenuButton: ElementFinder = element(by.css('button[data-automation-id="language-menu-button"]'));
|
||||
appTitle: ElementFinder = element(by.css('.adf-app-title'));
|
||||
menuButton: ElementFinder = element(by.css('button[data-automation-id="adf-menu-icon"]'));
|
||||
themeButton = element(by.css('button[data-automation-id="theme menu"]'));
|
||||
themeMenuContent = element(by.css('div[class*="mat-menu-panel"]'));
|
||||
languageMenuButton = element(by.css('button[data-automation-id="language-menu-button"]'));
|
||||
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"]'));
|
||||
|
||||
async clickNavigationBarItem(title): Promise<void> {
|
||||
async clickNavigationBarItem(title: string): Promise<void> {
|
||||
const menu = element(by.css(`.app-sidenav-link[data-automation-id="${title}"]`));
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(menu);
|
||||
@@ -185,7 +185,7 @@ export class NavigationBarPage {
|
||||
}
|
||||
|
||||
async clickOnSpecificThemeButton(themeName): Promise<void> {
|
||||
const themeElement: ElementFinder = element(by.css(`button[data-automation-id="${themeName}"]`));
|
||||
const themeElement = element(by.css(`button[data-automation-id="${themeName}"]`));
|
||||
await BrowserActions.click(themeElement);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
@@ -201,7 +201,7 @@ export class NavigationBarPage {
|
||||
}
|
||||
|
||||
async chooseLanguage(language): Promise<void> {
|
||||
const buttonLanguage: ElementFinder = element(by.xpath(`//adf-language-menu//button[contains(text(), '${language}')]`));
|
||||
const buttonLanguage = element(by.xpath(`//adf-language-menu//button[contains(text(), '${language}')]`));
|
||||
await BrowserActions.click(buttonLanguage);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
@@ -214,13 +214,13 @@ export class NavigationBarPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.menuButton);
|
||||
}
|
||||
|
||||
async checkToolbarColor(color): Promise<void> {
|
||||
const toolbarColor: ElementFinder = element(by.css(`mat-toolbar[class*="mat-${color}"]`));
|
||||
async checkToolbarColor(color: string): Promise<void> {
|
||||
const toolbarColor = element(by.css(`mat-toolbar[class*="mat-${color}"]`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(toolbarColor);
|
||||
}
|
||||
|
||||
async clickAppLogo(logoTitle): Promise<void> {
|
||||
const appLogo: ElementFinder = element(by.css('a[title="' + logoTitle + '"]'));
|
||||
async clickAppLogo(logoTitle: string): Promise<void> {
|
||||
const appLogo = element(by.css('a[title="' + logoTitle + '"]'));
|
||||
await BrowserActions.click(appLogo);
|
||||
}
|
||||
|
||||
@@ -228,12 +228,12 @@ export class NavigationBarPage {
|
||||
await BrowserActions.click(this.appTitle);
|
||||
}
|
||||
|
||||
async checkLogoTooltip(logoTooltipTitle): Promise<void> {
|
||||
const logoTooltip: ElementFinder = element(by.css('a[title="' + logoTooltipTitle + '"]'));
|
||||
async checkLogoTooltip(logoTooltipTitle: string): Promise<void> {
|
||||
const logoTooltip = element(by.css('a[title="' + logoTooltipTitle + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(logoTooltip);
|
||||
}
|
||||
|
||||
async openViewer(nodeId): Promise<void> {
|
||||
async openViewer(nodeId: string): Promise<void> {
|
||||
await BrowserActions.getUrl(browser.params.testConfig.adf.url + `/files(overlay:files/${nodeId}/view`);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
|
||||
const column = {
|
||||
role: 'Role'
|
||||
@@ -26,16 +26,16 @@ export class PermissionsPage {
|
||||
|
||||
dataTableComponentPage: DataTableComponentPage = new DataTableComponentPage();
|
||||
|
||||
addPermissionButton: ElementFinder = element(by.css("button[data-automation-id='adf-add-permission-button']"));
|
||||
addPermissionDialog: ElementFinder = element(by.css('adf-add-permission-dialog'));
|
||||
searchUserInput: ElementFinder = element(by.id('searchInput'));
|
||||
searchResults: ElementFinder = element(by.css('#adf-add-permission-authority-results #adf-search-results-content'));
|
||||
addButton: ElementFinder = element(by.id('add-permission-dialog-confirm-button'));
|
||||
permissionInheritedButton: ElementFinder = element.all(by.css("div[class='app-inherit_permission_button'] button")).first();
|
||||
noPermissions: ElementFinder = element(by.css('div[id="adf-no-permissions-template"]'));
|
||||
deletePermissionButton: ElementFinder = element(by.css(`button[data-automation-id='adf-delete-permission-button']`));
|
||||
permissionDisplayContainer: ElementFinder = element(by.css(`div[id='adf-permission-display-container']`));
|
||||
closeButton: ElementFinder = element(by.id('add-permission-dialog-close-button'));
|
||||
addPermissionButton = element(by.css("button[data-automation-id='adf-add-permission-button']"));
|
||||
addPermissionDialog = element(by.css('adf-add-permission-dialog'));
|
||||
searchUserInput = element(by.id('searchInput'));
|
||||
searchResults = element(by.css('#adf-add-permission-authority-results #adf-search-results-content'));
|
||||
addButton = element(by.id('add-permission-dialog-confirm-button'));
|
||||
permissionInheritedButton = element.all(by.css("div[class='app-inherit_permission_button'] button")).first();
|
||||
noPermissions = element(by.css('div[id="adf-no-permissions-template"]'));
|
||||
deletePermissionButton = element(by.css(`button[data-automation-id='adf-delete-permission-button']`));
|
||||
permissionDisplayContainer = element(by.css(`div[id='adf-permission-display-container']`));
|
||||
closeButton = element(by.id('add-permission-dialog-close-button'));
|
||||
|
||||
async clickCloseButton(): Promise<void> {
|
||||
await BrowserActions.click(this.closeButton);
|
||||
@@ -57,7 +57,7 @@ export class PermissionsPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchUserInput);
|
||||
}
|
||||
|
||||
async searchUserOrGroup(name): Promise<void> {
|
||||
async searchUserOrGroup(name: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.searchUserInput, name);
|
||||
}
|
||||
|
||||
@@ -65,19 +65,19 @@ export class PermissionsPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchResults);
|
||||
}
|
||||
|
||||
async clickUserOrGroup(name): Promise<void> {
|
||||
const userOrGroupName: ElementFinder = element(by.cssContainingText('mat-list-option .mat-list-text', name));
|
||||
async clickUserOrGroup(name: string): Promise<void> {
|
||||
const userOrGroupName = element(by.cssContainingText('mat-list-option .mat-list-text', name));
|
||||
await BrowserActions.clickScript(userOrGroupName);
|
||||
await BrowserActions.click(this.addButton);
|
||||
}
|
||||
|
||||
async checkUserOrGroupIsAdded(name): Promise<void> {
|
||||
const userOrGroupName: ElementFinder = element(by.css('div[data-automation-id="text_' + name + '"]'));
|
||||
async checkUserOrGroupIsAdded(name: string): Promise<void> {
|
||||
const userOrGroupName = element(by.css('div[data-automation-id="text_' + name + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(userOrGroupName);
|
||||
}
|
||||
|
||||
async checkUserOrGroupIsDeleted(name): Promise<void> {
|
||||
const userOrGroupName: ElementFinder = element(by.css('div[data-automation-id="text_' + name + '"]'));
|
||||
async checkUserOrGroupIsDeleted(name: string): Promise<void> {
|
||||
const userOrGroupName = element(by.css('div[data-automation-id="text_' + name + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(userOrGroupName);
|
||||
}
|
||||
|
||||
@@ -105,12 +105,12 @@ export class PermissionsPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css('[class*="adf-datatable-permission"]')));
|
||||
}
|
||||
|
||||
async getRoleCellValue(rowName): Promise<string> {
|
||||
async getRoleCellValue(rowName: string): Promise<string> {
|
||||
const locator = this.dataTableComponentPage.getCellByRowContentAndColumn('Authority ID', rowName, column.role);
|
||||
return BrowserActions.getText(locator);
|
||||
}
|
||||
|
||||
async clickRoleDropdownByUserOrGroupName(name): Promise<void> {
|
||||
async clickRoleDropdownByUserOrGroupName(name: string): Promise<void> {
|
||||
const row = this.dataTableComponentPage.getRow('Authority ID', name);
|
||||
await BrowserActions.click(row.element(by.id('adf-select-role-permission')));
|
||||
}
|
||||
@@ -119,7 +119,7 @@ export class PermissionsPage {
|
||||
return element.all(by.css('.mat-option-text'));
|
||||
}
|
||||
|
||||
async selectOption(name): Promise<void> {
|
||||
async selectOption(name: string): Promise<void> {
|
||||
await new DropdownPage().selectOption(name);
|
||||
}
|
||||
|
||||
@@ -127,8 +127,8 @@ export class PermissionsPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.permissionDisplayContainer);
|
||||
}
|
||||
|
||||
async checkUserOrGroupIsDisplayed(name): Promise<void> {
|
||||
const userOrGroupName: ElementFinder = element(by.cssContainingText('mat-list-option .mat-list-text', name));
|
||||
async checkUserOrGroupIsDisplayed(name: string): Promise<void> {
|
||||
const userOrGroupName = element(by.cssContainingText('mat-list-option .mat-list-text', name));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(userOrGroupName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor, ElementFinder } from 'protractor';
|
||||
import { element, by, protractor } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class AnalyticsPage {
|
||||
|
||||
toolbarTitleInput: ElementFinder = element(by.css('input[data-automation-id="reportName"]'));
|
||||
toolbarTitleContainer: ElementFinder = element(by.css('adf-toolbar-title'));
|
||||
toolbarTitle: ElementFinder = element(by.xpath('//mat-toolbar/adf-toolbar-title/div/h4'));
|
||||
reportMessage: ElementFinder = element(by.css('div[class="ng-star-inserted"] span'));
|
||||
toolbarTitleInput = element(by.css('input[data-automation-id="reportName"]'));
|
||||
toolbarTitleContainer = element(by.css('adf-toolbar-title'));
|
||||
toolbarTitle = element(by.xpath('//mat-toolbar/adf-toolbar-title/div/h4'));
|
||||
reportMessage = element(by.css('div[class="ng-star-inserted"] span'));
|
||||
|
||||
async getReport(title): Promise<void> {
|
||||
const reportTitle: ElementFinder = element(by.css(`mat-icon[data-automation-id="${title}_filter"]`));
|
||||
async getReport(title: string): Promise<void> {
|
||||
const reportTitle = element(by.css(`mat-icon[data-automation-id="${title}_filter"]`));
|
||||
await BrowserActions.click(reportTitle);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,17 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class AttachFormPage {
|
||||
|
||||
noFormMessage: ElementFinder = element(by.css('.adf-empty-content__title'));
|
||||
attachFormButton: ElementFinder = element(by.id('adf-attach-form-attach-button'));
|
||||
completeButton: ElementFinder = element(by.id('adf-attach-form-complete-button'));
|
||||
formDropdown: ElementFinder = element(by.id('form_id'));
|
||||
cancelButton: ElementFinder = element(by.id('adf-attach-form-cancel-button'));
|
||||
defaultTitle: ElementFinder = element(by.css('mat-card-title[class="mat-card-title mat-card-title"]'));
|
||||
noFormMessage = element(by.css('.adf-empty-content__title'));
|
||||
attachFormButton = element(by.id('adf-attach-form-attach-button'));
|
||||
completeButton = element(by.id('adf-attach-form-complete-button'));
|
||||
formDropdown = element(by.id('form_id'));
|
||||
cancelButton = element(by.id('adf-attach-form-cancel-button'));
|
||||
defaultTitle = element(by.css('mat-card-title[class="mat-card-title mat-card-title"]'));
|
||||
attachFormDropdown = new DropdownPage(element(by.css("div[class='adf-attach-form-row']")));
|
||||
|
||||
async checkNoFormMessageIsDisplayed(): Promise<void> {
|
||||
|
||||
@@ -15,33 +15,33 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor, browser, ElementFinder } from 'protractor';
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
import * as path from 'path';
|
||||
import * as remote from 'selenium-webdriver/remote';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class AttachmentListPage {
|
||||
|
||||
attachFileButton: ElementFinder = element(by.css("input[type='file']"));
|
||||
buttonMenu: ElementFinder = element(by.css("button[data-automation-id='action_menu_0']"));
|
||||
viewButton: ElementFinder = element(by.css("button[data-automation-id*='MENU_ACTIONS.VIEW_CONTENT']"));
|
||||
removeButton: ElementFinder = element(by.css("button[data-automation-id*='MENU_ACTIONS.REMOVE_CONTENT']"));
|
||||
downloadButton: ElementFinder = element(by.css("button[data-automation-id*='MENU_ACTIONS.DOWNLOAD_CONTENT']"));
|
||||
noContentContainer: ElementFinder = element(by.css("div[class*='adf-no-content-container']"));
|
||||
attachFileButton = element(by.css("input[type='file']"));
|
||||
buttonMenu = element(by.css("button[data-automation-id='action_menu_0']"));
|
||||
viewButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.VIEW_CONTENT']"));
|
||||
removeButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.REMOVE_CONTENT']"));
|
||||
downloadButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.DOWNLOAD_CONTENT']"));
|
||||
noContentContainer = element(by.css("div[class*='adf-no-content-container']"));
|
||||
|
||||
async checkEmptyAttachmentList(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.noContentContainer);
|
||||
}
|
||||
|
||||
async clickAttachFileButton(fileLocation): Promise<void> {
|
||||
async clickAttachFileButton(fileLocation: string): Promise<void> {
|
||||
browser.setFileDetector(new remote.FileDetector());
|
||||
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.attachFileButton);
|
||||
await this.attachFileButton.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
|
||||
}
|
||||
|
||||
async checkFileIsAttached(name): Promise<void> {
|
||||
const fileAttached: ElementFinder = element.all(by.css('div[data-automation-id="' + name + '"]')).first();
|
||||
async checkFileIsAttached(name: string): Promise<void> {
|
||||
const fileAttached = element.all(by.css('div[data-automation-id="' + name + '"]')).first();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ export class AttachmentListPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.attachFileButton);
|
||||
}
|
||||
|
||||
async viewFile(name): Promise<void> {
|
||||
async viewFile(name: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(element.all(by.css('div[data-automation-id="' + name + '"]')).first());
|
||||
await BrowserActions.click(this.buttonMenu);
|
||||
@@ -58,7 +58,7 @@ export class AttachmentListPage {
|
||||
await browser.sleep(500);
|
||||
}
|
||||
|
||||
async removeFile(name): Promise<void> {
|
||||
async removeFile(name: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(element.all(by.css('div[data-automation-id="' + name + '"]')).first());
|
||||
await BrowserActions.click(this.buttonMenu);
|
||||
@@ -67,7 +67,7 @@ export class AttachmentListPage {
|
||||
await browser.sleep(500);
|
||||
}
|
||||
|
||||
async downloadFile(name): Promise<void> {
|
||||
async downloadFile(name: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.click(element.all(by.css('div[data-automation-id="' + name + '"]')).first());
|
||||
await BrowserActions.click(this.buttonMenu);
|
||||
@@ -75,16 +75,16 @@ export class AttachmentListPage {
|
||||
await BrowserActions.click(this.downloadButton);
|
||||
}
|
||||
|
||||
async doubleClickFile(name): Promise<void> {
|
||||
async doubleClickFile(name: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.css('div[data-automation-id="' + name + '"]')).first());
|
||||
const fileAttached: ElementFinder = element.all(by.css('div[data-automation-id="' + name + '"]')).first();
|
||||
const fileAttached = element.all(by.css('div[data-automation-id="' + name + '"]')).first();
|
||||
await BrowserActions.click(fileAttached);
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
}
|
||||
|
||||
async checkFileIsRemoved(name): Promise<void> {
|
||||
const fileAttached: ElementFinder = element.all(by.css('div[data-automation-id="' + name + '"]')).first();
|
||||
async checkFileIsRemoved(name: string): Promise<void> {
|
||||
const fileAttached = element.all(by.css('div[data-automation-id="' + name + '"]')).first();
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(fileAttached);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
*/
|
||||
|
||||
import { TogglePage } from '@alfresco/adf-testing';
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
export class AppSettingsTogglesPage {
|
||||
|
||||
togglePage: TogglePage = new TogglePage();
|
||||
togglePage = new TogglePage();
|
||||
|
||||
showDetailsHeaderToggle: ElementFinder = element(by.id('adf-show-header'));
|
||||
showTaskFilterIconsToggle: ElementFinder = element(by.id('adf-show-task-filter-icon'));
|
||||
showProcessFilterIconsToggle: ElementFinder = element(by.id('adf-show-process-filter-icon'));
|
||||
showDetailsHeaderToggle = element(by.id('adf-show-header'));
|
||||
showTaskFilterIconsToggle = element(by.id('adf-show-task-filter-icon'));
|
||||
showProcessFilterIconsToggle = element(by.id('adf-show-process-filter-icon'));
|
||||
|
||||
async enableShowHeader(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.showDetailsHeaderToggle);
|
||||
|
||||
@@ -15,17 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class ChecklistDialog {
|
||||
|
||||
nameField: ElementFinder = element(by.css('input[data-automation-id="checklist-name"]'));
|
||||
addChecklistButton: ElementFinder = element(by.css('button[id="add-check"] span'));
|
||||
closeButton: ElementFinder = element(by.css('button[id="close-check-dialog"] span'));
|
||||
dialogTitle: ElementFinder = element(by.id('add-checklist-title'));
|
||||
nameField = element(by.css('input[data-automation-id="checklist-name"]'));
|
||||
addChecklistButton = element(by.css('button[id="add-check"] span'));
|
||||
closeButton = element(by.css('button[id="close-check-dialog"] span'));
|
||||
dialogTitle = element(by.id('add-checklist-title'));
|
||||
|
||||
async addName(name): Promise<void> {
|
||||
async addName(name: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.nameField, name);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@ import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-t
|
||||
|
||||
export class StartTaskDialogPage {
|
||||
|
||||
name: ElementFinder = element(by.css('input[id="name_id"]'));
|
||||
dueDate: ElementFinder = element(by.css('input[id="date_id"]'));
|
||||
description: ElementFinder = element(by.css('textarea[id="description_id"]'));
|
||||
assignee: ElementFinder = element(by.css('div#people-widget-content input'));
|
||||
startButton: ElementFinder = element(by.css('button[id="button-start"]'));
|
||||
startButtonEnabled: ElementFinder = element(by.css('button[id="button-start"]:not(disabled)'));
|
||||
cancelButton: ElementFinder = element(by.css('button[id="button-cancel"]'));
|
||||
name = element(by.css('input[id="name_id"]'));
|
||||
dueDate = element(by.css('input[id="date_id"]'));
|
||||
description = element(by.css('textarea[id="description_id"]'));
|
||||
assignee = element(by.css('div#people-widget-content input'));
|
||||
startButton = element(by.css('button[id="button-start"]'));
|
||||
startButtonEnabled = element(by.css('button[id="button-start"]:not(disabled)'));
|
||||
cancelButton = element(by.css('button[id="button-cancel"]'));
|
||||
|
||||
selectFormDropdown = new DropdownPage(element(by.css('mat-select[id="form_id"]')));
|
||||
selectAssigneeDropdown = new DropdownPage();
|
||||
@@ -88,7 +88,7 @@ export class StartTaskDialogPage {
|
||||
}
|
||||
|
||||
async checkValidationErrorIsDisplayed(error: string, elementRef = 'mat-error'): Promise<void> {
|
||||
const errorElement: ElementFinder = element(by.cssContainingText(elementRef, error));
|
||||
const errorElement = element(by.cssContainingText(elementRef, error));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(errorElement);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
|
||||
export class FiltersPage {
|
||||
|
||||
activeFilter: ElementFinder = element(by.css('.adf-active'));
|
||||
activeFilter = element(by.css('.adf-active'));
|
||||
dataTable: DataTableComponentPage = new DataTableComponentPage();
|
||||
|
||||
async getActiveFilter(): Promise<string> {
|
||||
@@ -41,7 +41,7 @@ export class FiltersPage {
|
||||
}
|
||||
|
||||
async checkFilterIsHighlighted(filterName: string): Promise<void> {
|
||||
const highlightedFilter: ElementFinder = element(by.css(`.adf-active [data-automation-id='${filterName}_filter']`));
|
||||
const highlightedFilter = element(by.css(`.adf-active [data-automation-id='${filterName}_filter']`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(highlightedFilter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,32 +15,32 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class ProcessDetailsPage {
|
||||
processTitle: ElementFinder = element(by.css('mat-card-title[class="mat-card-title"]'));
|
||||
processDetailsMessage: ElementFinder = element(by.css('adf-process-instance-details div[class="ng-star-inserted"]'));
|
||||
processStatusField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-status"]'));
|
||||
processEndDateField: ElementFinder = element(by.css('span[data-automation-id="card-dateitem-ended"]'));
|
||||
processCategoryField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-category"]'));
|
||||
processBusinessKeyField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-businessKey"]'));
|
||||
processCreatedByField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-assignee"]'));
|
||||
processCreatedField: ElementFinder = element(by.css('span[data-automation-id="card-dateitem-created"]'));
|
||||
processIdField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-id"]'));
|
||||
processDescription: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-description"]'));
|
||||
showDiagramButtonDisabled: ElementFinder = element(by.css('button[id="show-diagram-button"][disabled]'));
|
||||
propertiesList: ElementFinder = element(by.css('div[class="adf-property-list"]'));
|
||||
showDiagramButton: ElementFinder = element(by.id('show-diagram-button'));
|
||||
diagramCanvas: ElementFinder = element(by.css('svg[xmlns="http://www.w3.org/2000/svg"]'));
|
||||
backButton: ElementFinder = element(by.css('app-show-diagram button[class="mat-mini-fab mat-accent"]'));
|
||||
commentInput: ElementFinder = element(by.id('comment-input'));
|
||||
auditLogButton: ElementFinder = element(by.css('button[adf-process-audit]'));
|
||||
auditLogEmptyListMessage: ElementFinder = element(by.css('.app-empty-list-header'));
|
||||
cancelProcessButton: ElementFinder = element(by.css('div[data-automation-id="header-status"] > button'));
|
||||
activeTask: ElementFinder = element(by.css('div[data-automation-id="active-tasks"]'));
|
||||
completedTask: ElementFinder = element(by.css('div[data-automation-id="completed-tasks"]'));
|
||||
taskTitle: ElementFinder = element(by.css('h2[class="adf-activiti-task-details__header"]'));
|
||||
processTitle = element(by.css('mat-card-title[class="mat-card-title"]'));
|
||||
processDetailsMessage = element(by.css('adf-process-instance-details div[class="ng-star-inserted"]'));
|
||||
processStatusField = element(by.css('[data-automation-id="card-textitem-value-status"]'));
|
||||
processEndDateField = element(by.css('span[data-automation-id="card-dateitem-ended"]'));
|
||||
processCategoryField = element(by.css('[data-automation-id="card-textitem-value-category"]'));
|
||||
processBusinessKeyField = element(by.css('[data-automation-id="card-textitem-value-businessKey"]'));
|
||||
processCreatedByField = element(by.css('[data-automation-id="card-textitem-value-assignee"]'));
|
||||
processCreatedField = element(by.css('span[data-automation-id="card-dateitem-created"]'));
|
||||
processIdField = element(by.css('[data-automation-id="card-textitem-value-id"]'));
|
||||
processDescription = element(by.css('[data-automation-id="card-textitem-value-description"]'));
|
||||
showDiagramButtonDisabled = element(by.css('button[id="show-diagram-button"][disabled]'));
|
||||
propertiesList = element(by.css('div[class="adf-property-list"]'));
|
||||
showDiagramButton = element(by.id('show-diagram-button'));
|
||||
diagramCanvas = element(by.css('svg[xmlns="http://www.w3.org/2000/svg"]'));
|
||||
backButton = element(by.css('app-show-diagram button[class="mat-mini-fab mat-accent"]'));
|
||||
commentInput = element(by.id('comment-input'));
|
||||
auditLogButton = element(by.css('button[adf-process-audit]'));
|
||||
auditLogEmptyListMessage = element(by.css('.app-empty-list-header'));
|
||||
cancelProcessButton = element(by.css('div[data-automation-id="header-status"] > button'));
|
||||
activeTask = element(by.css('div[data-automation-id="active-tasks"]'));
|
||||
completedTask = element(by.css('div[data-automation-id="completed-tasks"]'));
|
||||
taskTitle = element(by.css('h2[class="adf-activiti-task-details__header"]'));
|
||||
|
||||
async checkDetailsAreDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.processStatusField);
|
||||
@@ -115,8 +115,8 @@ export class ProcessDetailsPage {
|
||||
await this.commentInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async checkCommentIsDisplayed(comment): Promise<void> {
|
||||
const commentInserted: ElementFinder = element(by.cssContainingText('div[id="comment-message"]', comment));
|
||||
async checkCommentIsDisplayed(comment: string): Promise<void> {
|
||||
const commentInserted = element(by.cssContainingText('div[id="comment-message"]', comment));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(commentInserted);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,23 +16,23 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, StartProcessPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder, Locator } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
|
||||
export class ProcessFiltersPage {
|
||||
|
||||
dataTable = new DataTableComponentPage();
|
||||
runningFilter: ElementFinder = element(by.css('button[data-automation-id="Running_filter"]'));
|
||||
completedFilter: ElementFinder = element(by.css('button[data-automation-id="Completed_filter"]'));
|
||||
allFilter: ElementFinder = element(by.css('button[data-automation-id="All_filter"]'));
|
||||
createProcessButton: ElementFinder = element(by.css('.app-processes-menu button[data-automation-id="create-button"] > span'));
|
||||
newProcessButton: ElementFinder = element(by.css('div > button[data-automation-id="btn-start-process"]'));
|
||||
processesPage: ElementFinder = element(by.css('div[class="app-grid"] > div[class="app-grid-item app-processes-menu"]'));
|
||||
accordionMenu: ElementFinder = element(by.css('.app-processes-menu mat-accordion'));
|
||||
buttonWindow: ElementFinder = element(by.css('div > button[data-automation-id="btn-start-process"] > div'));
|
||||
noContentMessage: ElementFinder = element.all(by.css('div[class="adf-empty-content__title"]')).first();
|
||||
rows: Locator = by.css('adf-process-instance-list div[class="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
||||
tableBody: ElementFinder = element.all(by.css('adf-datatable div[class="adf-datatable-body"]')).first();
|
||||
nameColumn: Locator = by.css('div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"] div[title="Name"] span');
|
||||
runningFilter = element(by.css('button[data-automation-id="Running_filter"]'));
|
||||
completedFilter = element(by.css('button[data-automation-id="Completed_filter"]'));
|
||||
allFilter = element(by.css('button[data-automation-id="All_filter"]'));
|
||||
createProcessButton = element(by.css('.app-processes-menu button[data-automation-id="create-button"] > span'));
|
||||
newProcessButton = element(by.css('div > button[data-automation-id="btn-start-process"]'));
|
||||
processesPage = element(by.css('div[class="app-grid"] > div[class="app-grid-item app-processes-menu"]'));
|
||||
accordionMenu = element(by.css('.app-processes-menu mat-accordion'));
|
||||
buttonWindow = element(by.css('div > button[data-automation-id="btn-start-process"] > div'));
|
||||
noContentMessage = element.all(by.css('div[class="adf-empty-content__title"]')).first();
|
||||
rows = by.css('adf-process-instance-list div[class="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
||||
tableBody = element.all(by.css('adf-datatable div[class="adf-datatable-body"]')).first();
|
||||
nameColumn = by.css('div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"] div[title="Name"] span');
|
||||
processIcon = by.css('adf-icon[data-automation-id="adf-filter-icon"]');
|
||||
|
||||
async startProcess(): Promise<StartProcessPage> {
|
||||
@@ -71,14 +71,14 @@ export class ProcessFiltersPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.noContentMessage);
|
||||
}
|
||||
|
||||
async selectFromProcessList(title): Promise<void> {
|
||||
async selectFromProcessList(title: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const processName: ElementFinder = element.all(by.css(`div[data-automation-id="text_${title}"]`)).first();
|
||||
const processName = element.all(by.css(`div[data-automation-id="text_${title}"]`)).first();
|
||||
await BrowserActions.click(processName);
|
||||
}
|
||||
|
||||
async checkFilterIsHighlighted(filterName): Promise<void> {
|
||||
const processNameHighlighted: ElementFinder = element(by.css(`adf-process-instance-filters .adf-active button[data-automation-id='${filterName}_filter']`));
|
||||
async checkFilterIsHighlighted(filterName: string): Promise<void> {
|
||||
const processNameHighlighted = element(by.css(`adf-process-instance-filters .adf-active button[data-automation-id='${filterName}_filter']`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(processNameHighlighted);
|
||||
}
|
||||
|
||||
@@ -103,26 +103,26 @@ export class ProcessFiltersPage {
|
||||
return this.dataTable.getAllRowsColumnValues('Name');
|
||||
}
|
||||
|
||||
async checkFilterIsDisplayed(name): Promise<void> {
|
||||
const filterName: ElementFinder = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
async checkFilterIsDisplayed(name: string): Promise<void> {
|
||||
const filterName = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||
}
|
||||
|
||||
async checkFilterHasNoIcon(name): Promise<void> {
|
||||
const filterName: ElementFinder = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
async checkFilterHasNoIcon(name: string): Promise<void> {
|
||||
const filterName = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(filterName.element(this.processIcon));
|
||||
}
|
||||
|
||||
async getFilterIcon(name): Promise<string> {
|
||||
const filterName: ElementFinder = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
async getFilterIcon(name: string): Promise<string> {
|
||||
const filterName = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||
const icon = filterName.element(this.processIcon);
|
||||
return BrowserActions.getText(icon);
|
||||
}
|
||||
|
||||
async checkFilterIsNotDisplayed(name): Promise<void> {
|
||||
const filterName: ElementFinder = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
async checkFilterIsNotDisplayed(name: string): Promise<void> {
|
||||
const filterName = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(filterName);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
export class ProcessListPage {
|
||||
|
||||
processListTitle: ElementFinder = element(by.css('div[class="adf-empty-content__title"]'));
|
||||
processInstanceList: ElementFinder = element(by.css('adf-process-instance-list'));
|
||||
processListTitle = element(by.css('div[class="adf-empty-content__title"]'));
|
||||
processInstanceList = element(by.css('adf-process-instance-list'));
|
||||
|
||||
getDisplayedProcessListTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.processListTitle);
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
*/
|
||||
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { element, by, browser, ElementFinder } from 'protractor';
|
||||
import { element, by, browser } from 'protractor';
|
||||
|
||||
export class ProcessServiceTabBarPage {
|
||||
|
||||
tasksButton: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Tasks')).first();
|
||||
processButton: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Process')).first();
|
||||
reportsButton: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Reports')).first();
|
||||
settingsButton: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
|
||||
reportsButtonSelected: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div[aria-selected="true"]', 'Reports')).first();
|
||||
tasksButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Tasks')).first();
|
||||
processButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Process')).first();
|
||||
reportsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Reports')).first();
|
||||
settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
|
||||
reportsButtonSelected = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div[aria-selected="true"]', 'Reports')).first();
|
||||
|
||||
async clickTasksButton(): Promise<void> {
|
||||
await BrowserActions.click(this.tasksButton);
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
|
||||
import { ProcessServiceTabBarPage } from './process-service-tab-bar.page';
|
||||
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { __await } from 'tslib';
|
||||
|
||||
export class ProcessServicesPage {
|
||||
|
||||
apsAppsContainer: ElementFinder = element(by.css('div[class="adf-app-listgrid ng-star-inserted"]'));
|
||||
taskApp: ElementFinder = element(by.css('mat-card[title="Task App"]'));
|
||||
apsAppsContainer = element(by.css('div[class="adf-app-listgrid ng-star-inserted"]'));
|
||||
taskApp = element(by.css('mat-card[title="Task App"]'));
|
||||
iconTypeLocator = by.css('mat-icon[class*="card-logo-icon"]');
|
||||
descriptionLocator = by.css('mat-card-subtitle[class*="subtitle"]');
|
||||
|
||||
@@ -32,8 +32,8 @@ export class ProcessServicesPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.apsAppsContainer);
|
||||
}
|
||||
|
||||
async goToApp(applicationName): Promise<ProcessServiceTabBarPage> {
|
||||
const app: ElementFinder = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
async goToApp(applicationName: string): Promise<ProcessServiceTabBarPage> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
await BrowserActions.click(app);
|
||||
return new ProcessServiceTabBarPage();
|
||||
}
|
||||
@@ -43,33 +43,33 @@ export class ProcessServicesPage {
|
||||
return new ProcessServiceTabBarPage();
|
||||
}
|
||||
|
||||
async getAppIconType(applicationName): Promise<string> {
|
||||
const app: ElementFinder = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
async getAppIconType(applicationName: string): Promise<string> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
const iconType = app.element(this.iconTypeLocator);
|
||||
return BrowserActions.getText(iconType);
|
||||
}
|
||||
|
||||
async getBackgroundColor(applicationName): Promise<string> {
|
||||
const app: ElementFinder = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
async getBackgroundColor(applicationName: string): Promise<string> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
return app.getCssValue('background-color');
|
||||
}
|
||||
|
||||
async getDescription(applicationName): Promise<string> {
|
||||
const app: ElementFinder = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
async getDescription(applicationName: string): Promise<string> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
const description = app.element(this.descriptionLocator);
|
||||
return BrowserActions.getText(description);
|
||||
}
|
||||
|
||||
async checkAppIsNotDisplayed(applicationName): Promise<void> {
|
||||
const app: ElementFinder = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
async checkAppIsNotDisplayed(applicationName: string): Promise<void> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(app);
|
||||
}
|
||||
|
||||
async checkAppIsDisplayed(applicationName): Promise<void> {
|
||||
const app: ElementFinder = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
async checkAppIsDisplayed(applicationName: string): Promise<void> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,55 +16,55 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DropdownPage, TabsPage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element, ElementFinder, Key } from 'protractor';
|
||||
import { browser, by, element, Key } from 'protractor';
|
||||
import { AppSettingsTogglesPage } from './dialog/app-settings-toggles.page';
|
||||
|
||||
export class TaskDetailsPage {
|
||||
|
||||
appSettingsTogglesClass = new AppSettingsTogglesPage();
|
||||
|
||||
formContent: ElementFinder = element(by.css('adf-form'));
|
||||
formNameField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-formName"]'));
|
||||
formNameButton: ElementFinder = element(by.css('[data-automation-id="card-textitem-toggle-formName"]'));
|
||||
assigneeField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-assignee"]'));
|
||||
assigneeButton: ElementFinder = element(by.css('[data-automation-id="card-textitem-toggle-assignee"]'));
|
||||
statusField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-status"]'));
|
||||
categoryField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-category"] '));
|
||||
parentNameField: ElementFinder = element(by.css('span[data-automation-id*="parentName"] span'));
|
||||
parentTaskIdField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-parentTaskId"] '));
|
||||
durationField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-duration"] '));
|
||||
endDateField: ElementFinder = element.all(by.css('span[data-automation-id*="endDate"] span')).first();
|
||||
createdField: ElementFinder = element(by.css('span[data-automation-id="card-dateitem-created"] span'));
|
||||
idField: ElementFinder = element.all(by.css('[data-automation-id="card-textitem-value-id"]')).first();
|
||||
descriptionField: ElementFinder = element(by.css('[data-automation-id="card-textitem-value-description"]'));
|
||||
dueDateField: ElementFinder = element.all(by.css('span[data-automation-id*="dueDate"] span')).first();
|
||||
activitiesTitle: ElementFinder = element(by.css('div[class*="adf-info-drawer-layout-header-title"] div'));
|
||||
commentField: ElementFinder = element(by.id('comment-input'));
|
||||
addCommentButton: ElementFinder = element(by.css('[data-automation-id="comments-input-add"]'));
|
||||
involvePeopleButton: ElementFinder = element(by.css('div[class*="add-people"]'));
|
||||
addPeopleField: ElementFinder = element(by.css('input[data-automation-id="adf-people-search-input"]'));
|
||||
addInvolvedUserButton: ElementFinder = element(by.css('button[id="add-people"] span'));
|
||||
formContent = element(by.css('adf-form'));
|
||||
formNameField = element(by.css('[data-automation-id="card-textitem-value-formName"]'));
|
||||
formNameButton = element(by.css('[data-automation-id="card-textitem-toggle-formName"]'));
|
||||
assigneeField = element(by.css('[data-automation-id="card-textitem-value-assignee"]'));
|
||||
assigneeButton = element(by.css('[data-automation-id="card-textitem-toggle-assignee"]'));
|
||||
statusField = element(by.css('[data-automation-id="card-textitem-value-status"]'));
|
||||
categoryField = element(by.css('[data-automation-id="card-textitem-value-category"] '));
|
||||
parentNameField = element(by.css('span[data-automation-id*="parentName"] span'));
|
||||
parentTaskIdField = element(by.css('[data-automation-id="card-textitem-value-parentTaskId"] '));
|
||||
durationField = element(by.css('[data-automation-id="card-textitem-value-duration"] '));
|
||||
endDateField = element.all(by.css('span[data-automation-id*="endDate"] span')).first();
|
||||
createdField = element(by.css('span[data-automation-id="card-dateitem-created"] span'));
|
||||
idField = element.all(by.css('[data-automation-id="card-textitem-value-id"]')).first();
|
||||
descriptionField = element(by.css('[data-automation-id="card-textitem-value-description"]'));
|
||||
dueDateField = element.all(by.css('span[data-automation-id*="dueDate"] span')).first();
|
||||
activitiesTitle = element(by.css('div[class*="adf-info-drawer-layout-header-title"] div'));
|
||||
commentField = element(by.id('comment-input'));
|
||||
addCommentButton = element(by.css('[data-automation-id="comments-input-add"]'));
|
||||
involvePeopleButton = element(by.css('div[class*="add-people"]'));
|
||||
addPeopleField = element(by.css('input[data-automation-id="adf-people-search-input"]'));
|
||||
addInvolvedUserButton = element(by.css('button[id="add-people"] span'));
|
||||
emailInvolvedUser = by.xpath('following-sibling::div[@class="adf-people-email"]');
|
||||
taskDetailsInfoDrawer: ElementFinder = element(by.tagName('adf-info-drawer'));
|
||||
taskDetailsSection: ElementFinder = element(by.css('div[data-automation-id="app-tasks-details"]'));
|
||||
taskDetailsEmptySection: ElementFinder = element(by.css('div[data-automation-id="adf-tasks-details--empty"]'));
|
||||
completeTask: ElementFinder = element(by.css('button[id="adf-no-form-complete-button"]'));
|
||||
completeFormTask: ElementFinder = element(by.css('button[id="adf-form-complete"]'));
|
||||
taskDetailsTitle: ElementFinder = element(by.css('h2[class="adf-activiti-task-details__header"] span'));
|
||||
auditLogButton: ElementFinder = element(by.css('button[adf-task-audit]'));
|
||||
noPeopleInvolved: ElementFinder = element(by.id('no-people-label'));
|
||||
cancelInvolvePeopleButton: ElementFinder = element(by.id('close-people-search'));
|
||||
involvePeopleHeader: ElementFinder = element(by.css('div[class="adf-search-text-header"]'));
|
||||
removeInvolvedPeople: ElementFinder = element(by.css('button[data-automation-id="Remove"]'));
|
||||
peopleTitle: ElementFinder = element(by.id('people-title'));
|
||||
noFormMessage: ElementFinder = element(by.css('span[id*="no-form-message"]'));
|
||||
cancelAttachForm: ElementFinder = element(by.id('adf-no-form-cancel-button'));
|
||||
attachFormButton: ElementFinder = element(by.id('adf-no-form-attach-form-button'));
|
||||
disabledAttachFormButton: ElementFinder = element(by.css('button[id="adf-no-form-attach-form-button"][disabled]'));
|
||||
removeAttachForm: ElementFinder = element(by.id('adf-attach-form-remove-button'));
|
||||
attachFormName: ElementFinder = element(by.css('span[class="adf-form-title ng-star-inserted"]'));
|
||||
emptyTaskDetails: ElementFinder = element(by.css('adf-task-details > div > div'));
|
||||
priority: ElementFinder = element(by.css('[data-automation-id*="card-textitem-value-priority"]'));
|
||||
taskDetailsInfoDrawer = element(by.tagName('adf-info-drawer'));
|
||||
taskDetailsSection = element(by.css('div[data-automation-id="app-tasks-details"]'));
|
||||
taskDetailsEmptySection = element(by.css('div[data-automation-id="adf-tasks-details--empty"]'));
|
||||
completeTask = element(by.css('button[id="adf-no-form-complete-button"]'));
|
||||
completeFormTask = element(by.css('button[id="adf-form-complete"]'));
|
||||
taskDetailsTitle = element(by.css('h2[class="adf-activiti-task-details__header"] span'));
|
||||
auditLogButton = element(by.css('button[adf-task-audit]'));
|
||||
noPeopleInvolved = element(by.id('no-people-label'));
|
||||
cancelInvolvePeopleButton = element(by.id('close-people-search'));
|
||||
involvePeopleHeader = element(by.css('div[class="adf-search-text-header"]'));
|
||||
removeInvolvedPeople = element(by.css('button[data-automation-id="Remove"]'));
|
||||
peopleTitle = element(by.id('people-title'));
|
||||
noFormMessage = element(by.css('span[id*="no-form-message"]'));
|
||||
cancelAttachForm = element(by.id('adf-no-form-cancel-button'));
|
||||
attachFormButton = element(by.id('adf-no-form-attach-form-button'));
|
||||
disabledAttachFormButton = element(by.css('button[id="adf-no-form-attach-form-button"][disabled]'));
|
||||
removeAttachForm = element(by.id('adf-attach-form-remove-button'));
|
||||
attachFormName = element(by.css('span[class="adf-form-title ng-star-inserted"]'));
|
||||
emptyTaskDetails = element(by.css('adf-task-details > div > div'));
|
||||
priority = element(by.css('[data-automation-id*="card-textitem-value-priority"]'));
|
||||
editableAssignee = element(by.css('[data-automation-id="card-textitem-value-assignee"][class*="clickable"]'));
|
||||
claimElement = element(by.css('[data-automation-id="header-claim-button"]'));
|
||||
releaseElement = element(by.css('[data-automation-id="header-unclaim-button"]'));
|
||||
@@ -261,18 +261,18 @@ export class TaskDetailsPage {
|
||||
await tabsPage.clickTabByTitle('Details');
|
||||
}
|
||||
|
||||
async addComment(comment): Promise<void> {
|
||||
async addComment(comment: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.commentField, comment);
|
||||
await BrowserActions.click(this.addCommentButton);
|
||||
}
|
||||
|
||||
async checkCommentIsDisplayed(comment): Promise<void> {
|
||||
const row: ElementFinder = element(by.cssContainingText('div[id="comment-message"]', comment));
|
||||
async checkCommentIsDisplayed(comment: string): Promise<void> {
|
||||
const row = element(by.cssContainingText('div[id="comment-message"]', comment));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
}
|
||||
|
||||
async checkIsEmptyCommentListDisplayed(): Promise<void> {
|
||||
const emptyList: ElementFinder = element(by.cssContainingText('div[id="comment-header"]', '(0)'));
|
||||
const emptyList = element(by.cssContainingText('div[id="comment-header"]', '(0)'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(emptyList);
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ export class TaskDetailsPage {
|
||||
await BrowserActions.click(this.involvePeopleButton);
|
||||
}
|
||||
|
||||
async typeUser(user): Promise<void> {
|
||||
async typeUser(user: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.addPeopleField, user);
|
||||
}
|
||||
|
||||
@@ -292,8 +292,8 @@ export class TaskDetailsPage {
|
||||
await BrowserActions.click(row);
|
||||
}
|
||||
|
||||
async checkUserIsSelected(user): Promise<void> {
|
||||
const row: ElementFinder = element(by.cssContainingText('div[class*="search-list-container"] div[class*="people-full-name"]', user));
|
||||
async checkUserIsSelected(user: string): Promise<void> {
|
||||
const row = element(by.cssContainingText('div[class*="search-list-container"] div[class*="people-full-name"]', user));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ export class TaskDetailsPage {
|
||||
await BrowserActions.click(this.addInvolvedUserButton);
|
||||
}
|
||||
|
||||
getRowsUser(user) {
|
||||
getRowsUser(user: string) {
|
||||
return element(by.cssContainingText('div[class*="people-full-name"]', user));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
|
||||
export class TasksListPage {
|
||||
|
||||
taskList: ElementFinder = element(by.css('adf-tasklist'));
|
||||
noTasksFound: ElementFinder = element.all(by.css("div[class='adf-empty-content__title']")).first();
|
||||
dataTable: DataTableComponentPage = new DataTableComponentPage(this.taskList);
|
||||
taskList = element(by.css('adf-tasklist'));
|
||||
noTasksFound = element.all(by.css("div[class='adf-empty-content__title']")).first();
|
||||
dataTable = new DataTableComponentPage(this.taskList);
|
||||
|
||||
getDataTable() {
|
||||
getDataTable(): DataTableComponentPage {
|
||||
return this.dataTable;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,22 +21,22 @@ import { TaskDetailsPage } from './task-details.page';
|
||||
import { FiltersPage } from './filters.page';
|
||||
import { ChecklistDialog } from './dialog/create-checklist-dialog.page';
|
||||
import { TasksListPage } from './tasks-list.page';
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, FormFields } from '@alfresco/adf-testing';
|
||||
|
||||
export class TasksPage {
|
||||
|
||||
createButton: ElementFinder = element(by.css('button[data-automation-id="create-button"'));
|
||||
newTaskButton: ElementFinder = element(by.css('button[data-automation-id="btn-start-task"]'));
|
||||
addChecklistButton: ElementFinder = element(by.css('button[class*="adf-add-to-checklist-button"]'));
|
||||
createButton = element(by.css('button[data-automation-id="create-button"'));
|
||||
newTaskButton = element(by.css('button[data-automation-id="btn-start-task"]'));
|
||||
addChecklistButton = element(by.css('button[class*="adf-add-to-checklist-button"]'));
|
||||
rowByRowName = by.xpath('ancestor::mat-chip');
|
||||
checklistContainer = by.css('div[class*="checklist-menu"]');
|
||||
taskTitle = 'h2[class="adf-activiti-task-details__header"] span';
|
||||
rows = by.css('div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"] div[class*="adf-datatable-cell"]');
|
||||
completeButtonNoForm: ElementFinder = element(by.id('adf-no-form-complete-button'));
|
||||
checklistDialog: ElementFinder = element(by.id('checklist-dialog'));
|
||||
checklistNoMessage: ElementFinder = element(by.id('checklist-none-message'));
|
||||
numberOfChecklists: ElementFinder = element(by.css('[data-automation-id="checklist-label"] mat-chip'));
|
||||
completeButtonNoForm = element(by.id('adf-no-form-complete-button'));
|
||||
checklistDialog = element(by.id('checklist-dialog'));
|
||||
checklistNoMessage = element(by.id('checklist-none-message'));
|
||||
numberOfChecklists = element(by.css('[data-automation-id="checklist-label"] mat-chip'));
|
||||
sortByName = by.css('div[data-automation-id="auto_id_name"]');
|
||||
|
||||
async createNewTask(): Promise<StartTaskDialogPage> {
|
||||
@@ -90,7 +90,7 @@ export class TasksPage {
|
||||
}
|
||||
|
||||
getRowsName(name) {
|
||||
const row: ElementFinder = element(this.checklistContainer).element(by.cssContainingText('span', name));
|
||||
const row = element(this.checklistContainer).element(by.cssContainingText('span', name));
|
||||
return row;
|
||||
}
|
||||
|
||||
@@ -105,13 +105,13 @@ export class TasksPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(checklistEle);
|
||||
}
|
||||
|
||||
async checkChecklistIsNotDisplayed(checklist): Promise<void> {
|
||||
async checkChecklistIsNotDisplayed(checklist: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(this.checklistContainer).element(by.cssContainingText('span', checklist)));
|
||||
}
|
||||
|
||||
async checkTaskTitle(taskName): Promise<void> {
|
||||
async checkTaskTitle(taskName: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(this.taskTitle)));
|
||||
const title: ElementFinder = element(by.cssContainingText(this.taskTitle, taskName));
|
||||
const title = element(by.cssContainingText(this.taskTitle, taskName));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(title);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,28 +16,28 @@
|
||||
*/
|
||||
|
||||
import { BrowserVisibility, DateRangeFilterPage, NumberRangeFilterPage, SearchCategoriesPage, SearchCheckListPage, SearchRadioPage, SearchSliderPage, SearchTextPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
|
||||
export class SearchFiltersPage {
|
||||
|
||||
searchCategoriesPage: SearchCategoriesPage = new SearchCategoriesPage();
|
||||
|
||||
searchFilters: ElementFinder = element(by.css('adf-search-filter'));
|
||||
fileTypeFilter: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.TYPE"]'));
|
||||
creatorFilter: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.CREATOR"]'));
|
||||
fileSizeFilter: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.SIZE"]'));
|
||||
nameFilter: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Name"]'));
|
||||
checkListFilter: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Check List"]'));
|
||||
createdDateRangeFilter: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Created Date (range)"]'));
|
||||
typeFilter: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Type"]'));
|
||||
sizeRangeFilter: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Content Size (range)"]'));
|
||||
sizeSliderFilter: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Content Size"]'));
|
||||
facetQueriesDefaultGroup: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_QUERIES.MY_FACET_QUERIES"],' +
|
||||
searchFilters = element(by.css('adf-search-filter'));
|
||||
fileTypeFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.TYPE"]'));
|
||||
creatorFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.CREATOR"]'));
|
||||
fileSizeFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.SIZE"]'));
|
||||
nameFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Name"]'));
|
||||
checkListFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Check List"]'));
|
||||
createdDateRangeFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Created Date (range)"]'));
|
||||
typeFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Type"]'));
|
||||
sizeRangeFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Content Size (range)"]'));
|
||||
sizeSliderFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Content Size"]'));
|
||||
facetQueriesDefaultGroup = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_QUERIES.MY_FACET_QUERIES"],' +
|
||||
'mat-expansion-panel[data-automation-id="expansion-panel-My facet queries"]'));
|
||||
facetQueriesTypeGroup: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Type facet queries"]'));
|
||||
facetQueriesSizeGroup: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Size facet queries"]'));
|
||||
facetIntervalsByCreated: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-The Created"]'));
|
||||
facetIntervalsByModified: ElementFinder = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-TheModified"]'));
|
||||
facetQueriesTypeGroup = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Type facet queries"]'));
|
||||
facetQueriesSizeGroup = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Size facet queries"]'));
|
||||
facetIntervalsByCreated = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-The Created"]'));
|
||||
facetIntervalsByModified = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-TheModified"]'));
|
||||
|
||||
async checkSearchFiltersIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchFilters);
|
||||
@@ -71,7 +71,7 @@ export class SearchFiltersPage {
|
||||
return SearchCategoriesPage.radioFiltersPage(this.typeFilter);
|
||||
}
|
||||
|
||||
async checkCustomFacetFieldLabelIsDisplayed(fieldLabel): Promise<void> {
|
||||
async checkCustomFacetFieldLabelIsDisplayed(fieldLabel: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`mat-expansion-panel[data-automation-id="expansion-panel-${fieldLabel}"]`)));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,17 +16,17 @@
|
||||
*/
|
||||
|
||||
import { BrowserVisibility, DataTableComponentPage, SearchSortingPickerPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { by, element } from 'protractor';
|
||||
import { ContentServicesPage } from './content-services.page';
|
||||
|
||||
export class SearchResultsPage {
|
||||
|
||||
noResultsMessage: ElementFinder = element(by.css('div[class="app-no-result-message"]'));
|
||||
dataTable: DataTableComponentPage = new DataTableComponentPage();
|
||||
searchSortingPicker: SearchSortingPickerPage = new SearchSortingPickerPage();
|
||||
contentServices: ContentServicesPage = new ContentServicesPage();
|
||||
noResultsMessage = element(by.css('div[class="app-no-result-message"]'));
|
||||
dataTable = new DataTableComponentPage();
|
||||
searchSortingPicker = new SearchSortingPickerPage();
|
||||
contentServices = new ContentServicesPage();
|
||||
|
||||
getNodeHighlight(content) {
|
||||
getNodeHighlight(content: string) {
|
||||
return this.dataTable.getCellByRowContentAndColumn('Display name', content, 'Search');
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export class SearchResultsPage {
|
||||
await this.dataTable.tableIsLoaded();
|
||||
}
|
||||
|
||||
async checkContentIsDisplayed(content): Promise<void> {
|
||||
async checkContentIsDisplayed(content: string): Promise<void> {
|
||||
await this.dataTable.checkContentIsDisplayed('Display name', content);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export class SearchResultsPage {
|
||||
return this.dataTable.numberOfRows();
|
||||
}
|
||||
|
||||
async checkContentIsNotDisplayed(content): Promise<void> {
|
||||
async checkContentIsNotDisplayed(content: string): Promise<void> {
|
||||
await this.dataTable.checkContentIsNotDisplayed('Display name', content);
|
||||
}
|
||||
|
||||
@@ -54,11 +54,11 @@ export class SearchResultsPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.noResultsMessage);
|
||||
}
|
||||
|
||||
async navigateToFolder(content): Promise<void> {
|
||||
async navigateToFolder(content: string): Promise<void> {
|
||||
await this.dataTable.doubleClickRow('Display name', content);
|
||||
}
|
||||
|
||||
async deleteContent(content): Promise<void> {
|
||||
async deleteContent(content: string): Promise<void> {
|
||||
await this.contentServices.deleteContent(content);
|
||||
}
|
||||
|
||||
|
||||
+28
-28
@@ -15,25 +15,25 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor, browser, ElementFinder, ElementArrayFinder } from 'protractor';
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class TagPage {
|
||||
|
||||
addTagButton: ElementFinder = element(by.css('button[id="add-tag"]'));
|
||||
insertNodeIdElement: ElementFinder = element(by.css('input[id="nodeId"]'));
|
||||
newTagInput: ElementFinder = element(by.css('input[id="new-tag-text"]'));
|
||||
tagListRow: ElementFinder = element(by.css('adf-tag-node-actions-list mat-list-item'));
|
||||
tagListByNodeIdRow: ElementFinder = element(by.css('adf-tag-node-list mat-chip'));
|
||||
errorMessage: ElementFinder = element(by.css('mat-hint[data-automation-id="errorMessage"]'));
|
||||
addTagButton = element(by.css('button[id="add-tag"]'));
|
||||
insertNodeIdElement = element(by.css('input[id="nodeId"]'));
|
||||
newTagInput = element(by.css('input[id="new-tag-text"]'));
|
||||
tagListRow = element(by.css('adf-tag-node-actions-list mat-list-item'));
|
||||
tagListByNodeIdRow = element(by.css('adf-tag-node-list mat-chip'));
|
||||
errorMessage = element(by.css('mat-hint[data-automation-id="errorMessage"]'));
|
||||
tagListRowLocator = by.css('adf-tag-node-actions-list mat-list-item div');
|
||||
tagListByNodeIdRowLocator = by.css('adf-tag-node-list mat-chip span');
|
||||
tagListContentServicesRowLocator = by.css('div[class*="adf-list-tag"]');
|
||||
showDeleteButton: ElementFinder = element(by.id('adf-remove-button-tag'));
|
||||
showMoreButton: ElementFinder = element(by.css('button[data-automation-id="show-more-tags"]'));
|
||||
showLessButton: ElementFinder = element(by.css('button[data-automation-id="show-fewer-tags"]'));
|
||||
tagsOnPage: ElementArrayFinder = element.all(by.css('div[class*="adf-list-tag"]'));
|
||||
confirmTag: ElementFinder = element(by.id('adf-tag-node-send'));
|
||||
showDeleteButton = element(by.id('adf-remove-button-tag'));
|
||||
showMoreButton = element(by.css('button[data-automation-id="show-more-tags"]'));
|
||||
showLessButton = element(by.css('button[data-automation-id="show-fewer-tags"]'));
|
||||
tagsOnPage = element.all(by.css('div[class*="adf-list-tag"]'));
|
||||
confirmTag = element(by.id('adf-tag-node-send'));
|
||||
|
||||
async getNodeId(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.insertNodeIdElement);
|
||||
@@ -59,13 +59,13 @@ export class TagPage {
|
||||
await BrowserActions.click(this.addTagButton);
|
||||
}
|
||||
|
||||
async deleteTagFromTagListByNodeId(name): Promise<void> {
|
||||
const deleteChip: ElementFinder = element(by.id('tag_chips_delete_' + name));
|
||||
async deleteTagFromTagListByNodeId(name: string): Promise<void> {
|
||||
const deleteChip = element(by.id('tag_chips_delete_' + name));
|
||||
await BrowserActions.click(deleteChip);
|
||||
}
|
||||
|
||||
async deleteTagFromTagList(name): Promise<void> {
|
||||
const deleteChip: ElementFinder = element(by.id('tag_chips_delete_' + name));
|
||||
async deleteTagFromTagList(name: string): Promise<void> {
|
||||
const deleteChip = element(by.id('tag_chips_delete_' + name));
|
||||
await BrowserActions.click(deleteChip);
|
||||
}
|
||||
|
||||
@@ -84,23 +84,23 @@ export class TagPage {
|
||||
return this.addTagButton.isEnabled();
|
||||
}
|
||||
|
||||
async checkTagIsDisplayedInTagList(tagName): Promise<void> {
|
||||
const tag: ElementFinder = element(by.cssContainingText('div[id*="tag_name"]', tagName));
|
||||
async checkTagIsDisplayedInTagList(tagName: string): Promise<void> {
|
||||
const tag = element(by.cssContainingText('div[id*="tag_name"]', tagName));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(tag);
|
||||
}
|
||||
|
||||
async checkTagIsNotDisplayedInTagList(tagName): Promise<void> {
|
||||
const tag: ElementFinder = element(by.cssContainingText('div[id*="tag_name"]', tagName));
|
||||
async checkTagIsNotDisplayedInTagList(tagName: string): Promise<void> {
|
||||
const tag = element(by.cssContainingText('div[id*="tag_name"]', tagName));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(tag);
|
||||
}
|
||||
|
||||
async checkTagIsNotDisplayedInTagListByNodeId(tagName): Promise<void> {
|
||||
const tag: ElementFinder = element(by.cssContainingText('span[id*="tag_name"]', tagName));
|
||||
const tag = element(by.cssContainingText('span[id*="tag_name"]', tagName));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(tag);
|
||||
}
|
||||
|
||||
async checkTagIsDisplayedInTagListByNodeId(tagName): Promise<void> {
|
||||
const tag: ElementFinder = element(by.cssContainingText('span[id*="tag_name"]', tagName));
|
||||
const tag = element(by.cssContainingText('span[id*="tag_name"]', tagName));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(tag);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ export class TagPage {
|
||||
}
|
||||
|
||||
async checkTagIsDisplayedInTagListContentServices(tagName): Promise<void> {
|
||||
const tag: ElementFinder = element(by.cssContainingText('div[class="adf-list-tag"][id*="tag_name"]', tagName));
|
||||
const tag = element(by.cssContainingText('div[class="adf-list-tag"][id*="tag_name"]', tagName));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(tag);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ export class TagPage {
|
||||
}
|
||||
|
||||
async checkListIsSorted(sortOrder, locator): Promise<boolean> {
|
||||
const tagList: ElementArrayFinder = element.all(locator);
|
||||
const tagList = element.all(locator);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(tagList.first());
|
||||
const initialList = [];
|
||||
await tagList.each(async (currentElement) => {
|
||||
@@ -149,13 +149,13 @@ export class TagPage {
|
||||
return initialList.toString() === sortedList.toString();
|
||||
}
|
||||
|
||||
async checkDeleteTagFromTagListByNodeIdIsDisplayed(name): Promise<void> {
|
||||
const deleteChip: ElementFinder = element(by.id('tag_chips_delete_' + name));
|
||||
async checkDeleteTagFromTagListByNodeIdIsDisplayed(name: string): Promise<void> {
|
||||
const deleteChip = element(by.id('tag_chips_delete_' + name));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(deleteChip);
|
||||
}
|
||||
|
||||
async checkDeleteTagFromTagListByNodeIdIsNotDisplayed(name): Promise<void> {
|
||||
const deleteChip: ElementFinder = element(by.id('tag_chips_delete_' + name));
|
||||
async checkDeleteTagFromTagListByNodeIdIsNotDisplayed(name: string): Promise<void> {
|
||||
const deleteChip = element(by.id('tag_chips_delete_' + name));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(deleteChip);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,17 +16,16 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
|
||||
|
||||
import { element, by, ElementFinder, Locator } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
export class TrashcanPage {
|
||||
|
||||
contentList: DocumentListPage = 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: ElementFinder = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
||||
pagination: ElementFinder = element(by.css('adf-pagination'));
|
||||
emptyTrashcan: ElementFinder = element(by.css('adf-empty-content'));
|
||||
restoreButton: ElementFinder = element(by.css(`button[title='Restore']`));
|
||||
contentList = new DocumentListPage(element(by.css('adf-document-list')));
|
||||
rows = 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 div[class="adf-datatable-body"]')).first();
|
||||
pagination = element(by.css('adf-pagination'));
|
||||
emptyTrashcan = element(by.css('adf-empty-content'));
|
||||
restoreButton = element(by.css(`button[title='Restore']`));
|
||||
|
||||
async numberOfResultsDisplayed(): Promise<number> {
|
||||
return element.all(this.rows).count();
|
||||
|
||||
@@ -17,23 +17,23 @@
|
||||
|
||||
import * as path from 'path';
|
||||
import { BrowserActions, BrowserVisibility, TogglePage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element, ElementFinder } from 'protractor';
|
||||
import { browser, by, element } from 'protractor';
|
||||
|
||||
export class VersionManagePage {
|
||||
|
||||
togglePage: TogglePage = new TogglePage();
|
||||
togglePage = new TogglePage();
|
||||
|
||||
showNewVersionButton: ElementFinder = element(by.id('adf-show-version-upload-button'));
|
||||
uploadNewVersionInput: ElementFinder = element(by.css('adf-upload-version-button input[data-automation-id="upload-single-file"]'));
|
||||
uploadNewVersionButton: ElementFinder = element(by.css('adf-upload-version-button'));
|
||||
uploadNewVersionContainer: ElementFinder = element(by.id('adf-new-version-uploader-container'));
|
||||
cancelButton: ElementFinder = element(by.id('adf-new-version-cancel'));
|
||||
majorRadio: ElementFinder = element(by.id('adf-new-version-major'));
|
||||
minorRadio: ElementFinder = element(by.id('adf-new-version-minor'));
|
||||
commentText: ElementFinder = element(by.id('adf-new-version-text-area'));
|
||||
readOnlySwitch: ElementFinder = element(by.id('adf-version-manager-switch-readonly'));
|
||||
downloadSwitch: ElementFinder = element(by.id('adf-version-manager-switch-download'));
|
||||
commentsSwitch: ElementFinder = element(by.id('adf-version-manager-switch-comments'));
|
||||
showNewVersionButton = element(by.id('adf-show-version-upload-button'));
|
||||
uploadNewVersionInput = element(by.css('adf-upload-version-button input[data-automation-id="upload-single-file"]'));
|
||||
uploadNewVersionButton = element(by.css('adf-upload-version-button'));
|
||||
uploadNewVersionContainer = element(by.id('adf-new-version-uploader-container'));
|
||||
cancelButton = element(by.id('adf-new-version-cancel'));
|
||||
majorRadio = element(by.id('adf-new-version-major'));
|
||||
minorRadio = element(by.id('adf-new-version-minor'));
|
||||
commentText = element(by.id('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'));
|
||||
|
||||
async checkUploadNewVersionsButtonIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.showNewVersionButton);
|
||||
@@ -43,48 +43,48 @@ export class VersionManagePage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
|
||||
}
|
||||
|
||||
async uploadNewVersionFile(fileLocation): Promise<void> {
|
||||
async uploadNewVersionFile(fileLocation: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadNewVersionInput);
|
||||
await this.uploadNewVersionInput.sendKeys(path.resolve(path.join(browser.params.testConfig.main.rootPath, fileLocation)));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.showNewVersionButton);
|
||||
}
|
||||
|
||||
async getFileVersionName(version): Promise<string> {
|
||||
const fileElement: ElementFinder = element(by.css(`[id="adf-version-list-item-name-${version}"]`));
|
||||
async getFileVersionName(version: string): Promise<string> {
|
||||
const fileElement = element(by.css(`[id="adf-version-list-item-name-${version}"]`));
|
||||
return BrowserActions.getText(fileElement);
|
||||
}
|
||||
|
||||
async checkFileVersionExist(version): Promise<void> {
|
||||
const fileVersion: ElementFinder = element(by.id(`adf-version-list-item-version-${version}`));
|
||||
async checkFileVersionExist(version: string): Promise<void> {
|
||||
const fileVersion = element(by.id(`adf-version-list-item-version-${version}`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(fileVersion);
|
||||
}
|
||||
|
||||
async checkFileVersionNotExist(version): Promise<void> {
|
||||
const fileVersion: ElementFinder = element(by.id(`adf-version-list-item-version-${version}`));
|
||||
async checkFileVersionNotExist(version: string): Promise<void> {
|
||||
const fileVersion = element(by.id(`adf-version-list-item-version-${version}`));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(fileVersion);
|
||||
}
|
||||
|
||||
async getFileVersionComment(version): Promise<string> {
|
||||
const fileComment: ElementFinder = element(by.id(`adf-version-list-item-comment-${version}`));
|
||||
async getFileVersionComment(version: string): Promise<string> {
|
||||
const fileComment = element(by.id(`adf-version-list-item-comment-${version}`));
|
||||
return BrowserActions.getText(fileComment);
|
||||
}
|
||||
|
||||
async getFileVersionDate(version): Promise<string> {
|
||||
const fileDate: ElementFinder = element(by.id(`adf-version-list-item-date-${version}`));
|
||||
async getFileVersionDate(version: string): Promise<string> {
|
||||
const fileDate = element(by.id(`adf-version-list-item-date-${version}`));
|
||||
return BrowserActions.getText(fileDate);
|
||||
}
|
||||
|
||||
async enterCommentText(text): Promise<void> {
|
||||
async enterCommentText(text: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.commentText, text);
|
||||
}
|
||||
|
||||
async clickMajorChange(): Promise<void> {
|
||||
const radioMajor: ElementFinder = element(by.id(`adf-new-version-major`));
|
||||
const radioMajor = element(by.id(`adf-new-version-major`));
|
||||
await BrowserActions.click(radioMajor);
|
||||
}
|
||||
|
||||
async clickMinorChange(): Promise<void> {
|
||||
const radioMinor: ElementFinder = element(by.id(`adf-new-version-minor`));
|
||||
const radioMinor = element(by.id(`adf-new-version-minor`));
|
||||
await BrowserActions.click(radioMinor);
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ export class VersionManagePage {
|
||||
await this.togglePage.enableToggle(this.commentsSwitch);
|
||||
}
|
||||
|
||||
async clickActionButton(version): Promise<void> {
|
||||
async clickActionButton(version: string): Promise<void> {
|
||||
await BrowserActions.click(element(by.id(`adf-version-list-action-menu-button-${version}`)));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css('.cdk-overlay-container .mat-menu-content')));
|
||||
}
|
||||
@@ -149,31 +149,31 @@ export class VersionManagePage {
|
||||
}
|
||||
|
||||
async closeDisabledActionsMenu(): Promise<void> {
|
||||
const container: ElementFinder = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing'));
|
||||
const container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing'));
|
||||
await BrowserActions.closeDisabledMenu();
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(container);
|
||||
}
|
||||
|
||||
async downloadFileVersion(version): Promise<void> {
|
||||
async downloadFileVersion(version: string): Promise<void> {
|
||||
await this.clickActionButton(version);
|
||||
const downloadButton: ElementFinder = element(by.id(`adf-version-list-action-download-${version}`));
|
||||
const downloadButton = element(by.id(`adf-version-list-action-download-${version}`));
|
||||
await BrowserActions.click(downloadButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(downloadButton);
|
||||
}
|
||||
|
||||
async deleteFileVersion(version): Promise<void> {
|
||||
async deleteFileVersion(version: string): Promise<void> {
|
||||
await this.clickActionButton(version);
|
||||
const deleteButton: ElementFinder = element(by.id(`adf-version-list-action-delete-${version}`));
|
||||
const deleteButton = element(by.id(`adf-version-list-action-delete-${version}`));
|
||||
await BrowserActions.click(deleteButton);
|
||||
}
|
||||
|
||||
async restoreFileVersion(version): Promise<void> {
|
||||
async restoreFileVersion(version: string): Promise<void> {
|
||||
await this.clickActionButton(version);
|
||||
const restoreButton: ElementFinder = element(by.id(`adf-version-list-action-restore-${version}`));
|
||||
const restoreButton = element(by.id(`adf-version-list-action-restore-${version}`));
|
||||
await BrowserActions.click(restoreButton);
|
||||
}
|
||||
|
||||
async checkActionsArePresent(version): Promise<void> {
|
||||
async checkActionsArePresent(version: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.id(`adf-version-list-action-download-${version}`)));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.id(`adf-version-list-action-delete-${version}`)));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.id(`adf-version-list-action-restore-${version}`)));
|
||||
|
||||
@@ -251,7 +251,7 @@ describe('Start Task - Custom App', () => {
|
||||
});
|
||||
|
||||
it('[C286406] Invalid values for items per page', async () => {
|
||||
await taskListSinglePage.typeItemsPerPage('0');
|
||||
await taskListSinglePage.typeItemsPerPage(0);
|
||||
await taskListSinglePage.clickAppId();
|
||||
await expect(await taskListSinglePage.getItemsPerPageFieldErrorMessage()).toEqual('Value must be greater than or equal to 1');
|
||||
});
|
||||
@@ -304,12 +304,12 @@ describe('Start Task - Custom App', () => {
|
||||
});
|
||||
|
||||
it('[C286405] Type invalid values to page field', async () => {
|
||||
await taskListSinglePage.typePage('0');
|
||||
await taskListSinglePage.typePage(0);
|
||||
await taskListSinglePage.clickAppId();
|
||||
await expect(await taskListSinglePage.getPageFieldErrorMessage()).toEqual('Value must be greater than or equal to 1');
|
||||
|
||||
await taskListSinglePage.clickResetButton();
|
||||
await taskListSinglePage.typePage('2');
|
||||
await taskListSinglePage.typePage(2);
|
||||
await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { DataTableComponentPage, DatePickerCalendarPage, DateUtil, LocalStorageUtil, LoginSSOPage } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { browser, ElementFinder } from 'protractor';
|
||||
import { SearchDialogPage } from '../../pages/adf/dialog/search-dialog.page';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigation-bar.page';
|
||||
import { SearchFiltersPage } from '../../pages/adf/search-filters.page';
|
||||
@@ -121,13 +121,13 @@ describe('Search Date Range Filter', () => {
|
||||
|
||||
await searchResults.sortByCreated('ASC');
|
||||
|
||||
const results: any = dataTable.geCellElementDetail('Created');
|
||||
const results = await dataTable.geCellElementDetail('Created') as ElementFinder[];
|
||||
for (const currentResult of results) {
|
||||
const currentDate = currentResult.getAttribute('title');
|
||||
const currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a');
|
||||
const currentDate = await currentResult.getAttribute('title');
|
||||
const currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a');
|
||||
|
||||
await expect(currentDateFormatted <= DateUtil.parse(toDate, 'DD-MM-YY')).toBe(true);
|
||||
await expect(currentDateFormatted >= DateUtil.parse(fromDate, 'DD-MM-YY')).toBe(true);
|
||||
await expect(currentDateFormatted <= DateUtil.parse(toDate, 'DD-MM-YY')).toBe(true);
|
||||
await expect(currentDateFormatted >= DateUtil.parse(fromDate, 'DD-MM-YY')).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import { SearchResultsPage } from '../../pages/adf/search-results.page';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigation-bar.page';
|
||||
import { SearchFiltersPage } from '../../pages/adf/search-filters.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
import { browser, ElementFinder } from 'protractor';
|
||||
import { SearchConfiguration } from '../search.config';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
|
||||
@@ -173,7 +173,7 @@ describe('Search Number Range Filter', () => {
|
||||
await searchResults.tableIsLoaded();
|
||||
await searchResults.sortBySize('DESC');
|
||||
|
||||
const results: any = dataTable.geCellElementDetail('Size');
|
||||
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||
for (const currentResult of results) {
|
||||
try {
|
||||
const currentSize = await currentResult.getAttribute('title');
|
||||
@@ -202,7 +202,7 @@ describe('Search Number Range Filter', () => {
|
||||
await sizeRangeFilter.clickApplyButton();
|
||||
await searchResults.sortBySize('DESC');
|
||||
|
||||
const results: any = dataTable.geCellElementDetail('Size');
|
||||
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||
for (const currentResult of results) {
|
||||
try {
|
||||
const currentSize = await currentResult.getAttribute('title');
|
||||
@@ -218,7 +218,7 @@ describe('Search Number Range Filter', () => {
|
||||
await nameFilter.searchByName('z*');
|
||||
await searchResults.sortBySize('DESC');
|
||||
|
||||
const resultsSize: any = dataTable.geCellElementDetail('Size');
|
||||
const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||
for (const currentResult of resultsSize) {
|
||||
try {
|
||||
const currentSize = await currentResult.getAttribute('title');
|
||||
@@ -229,7 +229,7 @@ describe('Search Number Range Filter', () => {
|
||||
}
|
||||
}
|
||||
|
||||
const resultsDisplay: any = dataTable.geCellElementDetail('Display name');
|
||||
const resultsDisplay = await dataTable.geCellElementDetail('Display name') as ElementFinder[];
|
||||
for (const currentResult of resultsDisplay) {
|
||||
try {
|
||||
const name = await currentResult.getAttribute('title');
|
||||
@@ -269,7 +269,7 @@ describe('Search Number Range Filter', () => {
|
||||
await searchResults.tableIsLoaded();
|
||||
await searchResults.sortBySize('DESC');
|
||||
|
||||
const results: any = dataTable.geCellElementDetail('Size');
|
||||
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||
for (const currentResult of results) {
|
||||
try {
|
||||
const currentSize = await currentResult.getAttribute('title');
|
||||
@@ -311,7 +311,7 @@ describe('Search Number Range Filter', () => {
|
||||
await sizeRangeFilter.clickApplyButton();
|
||||
await searchResults.sortBySize('DESC');
|
||||
|
||||
const results: any = dataTable.geCellElementDetail('Size');
|
||||
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||
for (const currentResult of results) {
|
||||
try {
|
||||
const currentSize = await currentResult.getAttribute('title');
|
||||
@@ -327,7 +327,7 @@ describe('Search Number Range Filter', () => {
|
||||
await expect(await sizeRangeFilter.getFromNumber()).toEqual('');
|
||||
await expect(await sizeRangeFilter.getToNumber()).toEqual('');
|
||||
|
||||
const resultsSize: any = dataTable.geCellElementDetail('Size');
|
||||
const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||
for (const currentResult of resultsSize) {
|
||||
try {
|
||||
const currentSize = await currentResult.getAttribute('title');
|
||||
@@ -415,7 +415,7 @@ describe('Search Number Range Filter', () => {
|
||||
await searchResults.tableIsLoaded();
|
||||
await searchResults.sortByCreated('DESC');
|
||||
|
||||
const results: any = dataTable.geCellElementDetail('Created');
|
||||
const results = await dataTable.geCellElementDetail('Created') as ElementFinder[];
|
||||
for (const currentResult of results) {
|
||||
const currentDate = await currentResult.getAttribute('title');
|
||||
const currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a');
|
||||
|
||||
@@ -28,7 +28,7 @@ import { SearchResultsPage } from '../../pages/adf/search-results.page';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigation-bar.page';
|
||||
import { SearchFiltersPage } from '../../pages/adf/search-filters.page';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { browser } from 'protractor';
|
||||
import { browser, ElementFinder } from 'protractor';
|
||||
import { SearchConfiguration } from '../search.config';
|
||||
import { UsersActions } from '../../actions/users.actions';
|
||||
|
||||
@@ -124,7 +124,7 @@ describe('Search Slider Filter', () => {
|
||||
await searchResults.sortBySize('DESC');
|
||||
await searchResults.tableIsLoaded();
|
||||
|
||||
const results: any = dataTable.geCellElementDetail('Size');
|
||||
const results = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||
for (const currentResult of results) {
|
||||
try {
|
||||
const currentSize = await currentResult.getAttribute('title');
|
||||
@@ -141,7 +141,7 @@ describe('Search Slider Filter', () => {
|
||||
await searchResults.sortBySize('DESC');
|
||||
await searchResults.tableIsLoaded();
|
||||
|
||||
const resultsSize: any = dataTable.geCellElementDetail('Size');
|
||||
const resultsSize = await dataTable.geCellElementDetail('Size') as ElementFinder[];
|
||||
for (const currentResult of resultsSize) {
|
||||
try {
|
||||
const currentSize = await currentResult.getAttribute('title');
|
||||
|
||||
@@ -180,13 +180,13 @@ describe('Search Sorting Picker', () => {
|
||||
|
||||
it('[C277286] Should be able to sort the search results by "Created Date" ASC', async () => {
|
||||
await searchResults.sortByCreated('ASC');
|
||||
const results: any = searchResults.dataTable.geCellElementDetail('Created');
|
||||
const results = await searchResults.dataTable.geCellElementDetail('Created');
|
||||
await expect(contentServices.checkElementsDateSortedAsc(results)).toBe(true);
|
||||
});
|
||||
|
||||
it('[C277287] Should be able to sort the search results by "Created Date" DESC', async () => {
|
||||
await searchResults.sortByCreated('DESC');
|
||||
const results = searchResults.dataTable.geCellElementDetail('Created');
|
||||
const results = await searchResults.dataTable.geCellElementDetail('Created');
|
||||
await expect(contentServices.checkElementsDateSortedDesc(results)).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user