mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5463] Rework Protractor tests - changes related to element/element… (#7284)
* ADF-5463 Rework Protractor tests - changes related to element/elements and duplication of locators * Fix one which I missed * Remove console.logs * Remove console.logs * Reverse the timeouts * Fixed things TSLint * Remove unused import * Fixed broken tests * Last test fixed
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { createApiService,
|
||||
BreadcrumbPage,
|
||||
BreadcrumbDropdownPage,
|
||||
@@ -47,7 +47,7 @@ describe('Document List Component - Actions', () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const infinitePaginationPage = new InfinitePaginationPage(element(by.css('adf-content-node-selector')));
|
||||
const infinitePaginationPage = new InfinitePaginationPage($('adf-content-node-selector'));
|
||||
|
||||
describe('Folder Actions - Copy and Move', () => {
|
||||
const folderModel1 = new FolderModel({ name: StringUtil.generateRandomString() });
|
||||
|
@@ -22,7 +22,7 @@ import {
|
||||
DropdownPage,
|
||||
TestElement
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
export class PermissionsPage {
|
||||
|
||||
@@ -55,7 +55,7 @@ export class PermissionsPage {
|
||||
async clickRoleDropdownByUserOrGroupName(name: string): Promise<void> {
|
||||
const row = this.dataTableComponentPage.getRow('Users and Groups', name);
|
||||
await row.click();
|
||||
await BrowserActions.click(row.element(by.css('[id="adf-select-role-permission"] .mat-select-trigger')));
|
||||
await BrowserActions.click(row.$('[id="adf-select-role-permission"] .mat-select-trigger'));
|
||||
await TestElement.byCss('.mat-select-panel').waitVisible();
|
||||
}
|
||||
|
||||
|
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class SocialPage {
|
||||
|
||||
nodeIdField = element(by.css(`input[id="nodeId"]`));
|
||||
nodeIdField = $(`input[id="nodeId"]`);
|
||||
|
||||
async getNodeIdFieldValue(): Promise<string> {
|
||||
return BrowserActions.getInputValue(this.nodeIdField);
|
||||
|
@@ -15,13 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
import { by, protractor, browser, $, $$ } from 'protractor';
|
||||
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||
|
||||
export class TagPage {
|
||||
|
||||
addTagButton = TestElement.byCss('#add-tag');
|
||||
insertNodeIdElement = element(by.css('input[id="nodeId"]'));
|
||||
insertNodeIdElement = $('input[id="nodeId"]');
|
||||
newTagInput = TestElement.byCss('input[id="new-tag-text"]');
|
||||
tagListRow = TestElement.byCss('adf-tag-node-actions-list mat-list-item');
|
||||
tagListByNodeIdRow = TestElement.byCss('adf-tag-node-list mat-chip');
|
||||
@@ -30,7 +30,7 @@ export class TagPage {
|
||||
showDeleteButton = TestElement.byCss('#adf-remove-button-tag');
|
||||
showMoreButton = TestElement.byCss('button[data-automation-id="show-more-tags"]');
|
||||
showLessButton = TestElement.byCss('button[data-automation-id="show-fewer-tags"]');
|
||||
tagsOnPage = element.all(by.css('div[class*="adf-list-tag"]'));
|
||||
tagsOnPage = $$('div[class*="adf-list-tag"]');
|
||||
confirmTag = TestElement.byCss('#adf-tag-node-send');
|
||||
|
||||
getNodeId(): Promise<string> {
|
||||
|
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor } from 'protractor';
|
||||
import { element, by, protractor, $, $$ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class TreeViewPage {
|
||||
|
||||
treeViewTitle = element(by.cssContainingText('app-tree-view div', 'TREE VIEW TEST'));
|
||||
nodeIdInput = element(by.css('input[data-placeholder="Node Id"]'));
|
||||
noNodeMessage = element(by.id('adf-tree-view-missing-node'));
|
||||
nodesOnPage = element.all(by.css('mat-tree-node'));
|
||||
nodeIdInput = $('input[data-placeholder="Node Id"]');
|
||||
noNodeMessage = $('#adf-tree-view-missing-node');
|
||||
nodesOnPage = $$('mat-tree-node');
|
||||
|
||||
async checkTreeViewTitleIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.treeViewTitle);
|
||||
@@ -34,17 +34,17 @@ export class TreeViewPage {
|
||||
}
|
||||
|
||||
async clickNode(nodeName: string): Promise<void> {
|
||||
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"] button'));
|
||||
const node = $('mat-tree-node[id="' + nodeName + '-tree-child-node"] button');
|
||||
await BrowserActions.click(node);
|
||||
}
|
||||
|
||||
async checkNodeIsDisplayedAsClosed(nodeName: string): Promise<void> {
|
||||
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="false"]'));
|
||||
const node = $('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="false"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(node);
|
||||
}
|
||||
|
||||
async checkNodeIsDisplayedAsOpen(nodeName: string): Promise<void> {
|
||||
const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="true"]'));
|
||||
const node = $('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="true"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(node);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export class TreeViewPage {
|
||||
}
|
||||
|
||||
async checkNodeIsNotDisplayed(nodeName: string): Promise<void> {
|
||||
const node = element(by.id('' + nodeName + '-tree-child-node'));
|
||||
const node = $('#' + nodeName + '-tree-child-node');
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(node);
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { $, by, element } from 'protractor';
|
||||
import {
|
||||
BrowserVisibility,
|
||||
BrowserActions,
|
||||
@@ -29,19 +29,19 @@ export class CardViewComponentPage {
|
||||
addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
||||
nameCardTextItem = new CardTextItemPage('name');
|
||||
booleanCardBooleanItem = new CardBooleanItemPage('boolean');
|
||||
intField = element(by.css(`input[data-automation-id='card-textitem-editinput-int']`));
|
||||
floatField = element(by.css(`input[data-automation-id='card-textitem-editinput-float']`));
|
||||
intField = $(`input[data-automation-id='card-textitem-editinput-int']`);
|
||||
floatField = $(`input[data-automation-id='card-textitem-editinput-float']`);
|
||||
valueInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
|
||||
nameInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
|
||||
consoleLog = element(by.className('app-console'));
|
||||
deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
||||
resetButton = element(by.css(`#adf-reset-card-log`));
|
||||
editableSwitch = element(by.id('app-toggle-editable'));
|
||||
clearDateSwitch = element(by.id('app-toggle-clear-date'));
|
||||
noneOptionSwitch = element(by.id('app-toggle-none-option'));
|
||||
clickableField = element(by.css(`[data-automation-id="card-textitem-toggle-click"]`));
|
||||
resetButton = $(`#adf-reset-card-log`);
|
||||
editableSwitch = $('#app-toggle-editable');
|
||||
clearDateSwitch = $('#app-toggle-clear-date');
|
||||
noneOptionSwitch = $('#app-toggle-none-option');
|
||||
clickableField = $(`[data-automation-id="card-textitem-toggle-click"]`);
|
||||
|
||||
selectDropdown = new DropdownPage(element(by.css('mat-select[data-automation-class="select-box"]')));
|
||||
selectDropdown = new DropdownPage($('mat-select[data-automation-class="select-box"]'));
|
||||
|
||||
async clickOnAddButton(): Promise<void> {
|
||||
await BrowserActions.click(this.addButton);
|
||||
@@ -72,18 +72,18 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async clickOnIntField(): Promise<void> {
|
||||
const toggleText = element(by.css('div[data-automation-id="card-textitem-toggle-int"]'));
|
||||
const toggleText = $('div[data-automation-id="card-textitem-toggle-int"]');
|
||||
await BrowserActions.click(toggleText);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.intField);
|
||||
}
|
||||
|
||||
async clickOnIntClearIcon(): Promise<void> {
|
||||
const clearIcon = element(by.css('button[data-automation-id="card-textitem-reset-int"]'));
|
||||
const clearIcon = $('button[data-automation-id="card-textitem-reset-int"]');
|
||||
await BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
async clickOnIntSaveIcon(): Promise<void> {
|
||||
const saveIcon = element(by.css('button[data-automation-id="card-textitem-update-int"]'));
|
||||
const saveIcon = $('button[data-automation-id="card-textitem-update-int"]');
|
||||
await BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
@@ -92,28 +92,28 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
getIntFieldText(): Promise<string> {
|
||||
const textField = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
|
||||
const textField = $('span[data-automation-id="card-textitem-value-int"]');
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorInt(): Promise<string> {
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-int"]');
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
async clickOnFloatField(): Promise<void> {
|
||||
const toggleText = element(by.css('div[data-automation-id="card-textitem-toggle-float"]'));
|
||||
const toggleText = $('div[data-automation-id="card-textitem-toggle-float"]');
|
||||
await BrowserActions.click(toggleText);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.floatField);
|
||||
}
|
||||
|
||||
async clickOnFloatClearIcon(): Promise<void> {
|
||||
const clearIcon = element(by.css(`button[data-automation-id="card-textitem-reset-float"]`));
|
||||
const clearIcon = $(`button[data-automation-id="card-textitem-reset-float"]`);
|
||||
await BrowserActions.click(clearIcon);
|
||||
}
|
||||
|
||||
async clickOnFloatSaveIcon(): Promise<void> {
|
||||
const saveIcon = element(by.css(`button[data-automation-id="card-textitem-update-float"]`));
|
||||
const saveIcon = $(`button[data-automation-id="card-textitem-update-float"]`);
|
||||
await BrowserActions.click(saveIcon);
|
||||
}
|
||||
|
||||
@@ -122,12 +122,12 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
getFloatFieldText(): Promise<string> {
|
||||
const textField = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
|
||||
const textField = $('span[data-automation-id="card-textitem-value-float"]');
|
||||
return BrowserActions.getText(textField);
|
||||
}
|
||||
|
||||
getErrorFloat(): Promise<string> {
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-float"]');
|
||||
return BrowserActions.getText(errorElement);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
getOutputText(index: number): Promise<string> {
|
||||
return BrowserActions.getText(this.consoleLog.all(by.css('p')).get(index));
|
||||
return BrowserActions.getText(this.consoleLog.$$('p').get(index));
|
||||
}
|
||||
|
||||
async deletePairsValues(): Promise<void> {
|
||||
@@ -177,22 +177,22 @@ export class CardViewComponentPage {
|
||||
}
|
||||
|
||||
async getDateValue(): Promise<string> {
|
||||
const dateValue = element(by.css('span[data-automation-id="card-date-value-date"]'));
|
||||
const dateValue = $('span[data-automation-id="card-date-value-date"]');
|
||||
return dateValue.getText();
|
||||
}
|
||||
|
||||
async getDateTimeValue(): Promise<string> {
|
||||
const dateTimeValue = element(by.css('span[data-automation-id="card-datetime-value-datetime"]'));
|
||||
const dateTimeValue = $('span[data-automation-id="card-datetime-value-datetime"]');
|
||||
return dateTimeValue.getText();
|
||||
}
|
||||
|
||||
async clearDateField(): Promise<void> {
|
||||
const clearDateButton = element(by.css('mat-icon[data-automation-id="datepicker-date-clear-date"]'));
|
||||
const clearDateButton = $('mat-icon[data-automation-id="datepicker-date-clear-date"]');
|
||||
await BrowserActions.click(clearDateButton);
|
||||
}
|
||||
|
||||
async clearDateTimeField(): Promise<void> {
|
||||
const clearDateButton = element(by.css('mat-icon[data-automation-id="datepicker-date-clear-datetime"]'));
|
||||
const clearDateButton = $('mat-icon[data-automation-id="datepicker-date-clear-datetime"]');
|
||||
await BrowserActions.click(clearDateButton);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ export class CardViewComponentPage {
|
||||
const switchClass = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.clearDateSwitch.click();
|
||||
const clearDateChecked = element(by.css('mat-slide-toggle[id="app-toggle-clear-date"][class*="mat-checked"]'));
|
||||
const clearDateChecked = $('mat-slide-toggle[id="app-toggle-clear-date"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(clearDateChecked);
|
||||
}
|
||||
}
|
||||
@@ -209,13 +209,13 @@ export class CardViewComponentPage {
|
||||
const switchClass = await BrowserActions.getAttribute(this.noneOptionSwitch, 'class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.noneOptionSwitch.click();
|
||||
const noneOptionChecked = element(by.css('mat-slide-toggle[id="app-toggle-none-option"][class*="mat-checked"]'));
|
||||
const noneOptionChecked = $('mat-slide-toggle[id="app-toggle-none-option"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(noneOptionChecked);
|
||||
}
|
||||
}
|
||||
|
||||
async isErrorNotDisplayed(): Promise<boolean> {
|
||||
const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||
const errorElement = $('mat-error[data-automation-id="card-textitem-error-int"]');
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(errorElement);
|
||||
return true;
|
||||
@@ -231,10 +231,10 @@ export class CardViewComponentPage {
|
||||
async updateClickableField(text: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.clickableField);
|
||||
await BrowserActions.click(this.clickableField);
|
||||
const inputField = element(by.css('input[data-automation-id="card-textitem-editinput-click"]'));
|
||||
const inputField = $('input[data-automation-id="card-textitem-editinput-click"]');
|
||||
await BrowserVisibility.waitUntilElementIsPresent(inputField);
|
||||
await BrowserActions.clearSendKeys(inputField, text);
|
||||
const save = element(by.css('[data-automation-id="card-textitem-update-click"]'));
|
||||
const save = $('[data-automation-id="card-textitem-update-click"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(save);
|
||||
await BrowserActions.click(save);
|
||||
}
|
||||
|
@@ -16,18 +16,18 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, TabsPage } from '@alfresco/adf-testing';
|
||||
import { by, element } from 'protractor';
|
||||
import { $, $$ } from 'protractor';
|
||||
|
||||
export class CommentsPage {
|
||||
|
||||
tabsPage = new TabsPage();
|
||||
numberOfComments = element(by.id('comment-header'));
|
||||
commentUserIcon = element.all(by.id('comment-user-icon'));
|
||||
commentUserName = element.all(by.id('comment-user'));
|
||||
commentMessage = element.all(by.id('comment-message'));
|
||||
commentTime = element.all(by.id('comment-time'));
|
||||
commentInput = element(by.id('comment-input'));
|
||||
addCommentButton = element(by.css("[data-automation-id='comments-input-add']"));
|
||||
numberOfComments = $('#comment-header');
|
||||
commentUserIcon = $$('#comment-user-icon');
|
||||
commentUserName = $$('#comment-user');
|
||||
commentMessage = $$('#comment-message');
|
||||
commentTime = $$('#comment-time');
|
||||
commentInput = $('#comment-input');
|
||||
addCommentButton = $("[data-automation-id='comments-input-add']");
|
||||
|
||||
async getTotalNumberOfComments(text: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementHasText(this.numberOfComments, text);
|
||||
|
@@ -25,7 +25,7 @@ import {
|
||||
DropdownPage,
|
||||
Logger
|
||||
} from '@alfresco/adf-testing';
|
||||
import { Locator, $$, browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { $$, browser, by, element, ElementFinder, protractor, $ } from 'protractor';
|
||||
import { CreateLibraryDialogPage } from './dialog/create-library-dialog.page';
|
||||
import { FolderDialogPage } from './dialog/folder-dialog.page';
|
||||
import { NavigationBarPage } from './navigation-bar.page';
|
||||
@@ -42,74 +42,73 @@ export class ContentServicesPage {
|
||||
created: 'Created'
|
||||
};
|
||||
|
||||
contentList = new DocumentListPage(element.all(by.css('adf-upload-drag-area adf-document-list')).first());
|
||||
contentList = new DocumentListPage($$('adf-upload-drag-area adf-document-list').first());
|
||||
togglePage = new TogglePage();
|
||||
createFolderDialog = new FolderDialogPage();
|
||||
createLibraryDialog = new CreateLibraryDialogPage();
|
||||
|
||||
multipleFileUploadToggle = element(by.id('adf-document-list-enable-drop-files'));
|
||||
uploadBorder = element(by.id('document-list-container'));
|
||||
contentServices = element(by.css('.app-sidenav-link[data-automation-id="Content Services"]'));
|
||||
currentFolder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
|
||||
createFolderButton = element(by.css('button[data-automation-id="create-new-folder"]'));
|
||||
editFolderButton = element(by.css('button[data-automation-id="edit-folder"]'));
|
||||
deleteNodesButton = element(by.css('button[data-automation-id="delete-toolbar-button"]'));
|
||||
createLibraryButton = element(by.css('button[data-automation-id="create-new-library"]'));
|
||||
activeBreadcrumb = element(by.css('div[class*="active"]'));
|
||||
tooltip: Locator = by.css('div[class*="--text adf-full-width"] span');
|
||||
uploadFileButton = element(by.css('.adf-upload-button-file-container button'));
|
||||
uploadFileButtonInput = element(by.css('input[data-automation-id="upload-single-file"]'));
|
||||
uploadMultipleFileButton = element(by.css('input[data-automation-id="upload-multiple-files"]'));
|
||||
uploadFolderButton = element(by.css('input[data-automation-id="uploadFolder"]'));
|
||||
errorSnackBar = element(by.css('simple-snack-bar[class*="mat-simple-snackbar"]'));
|
||||
emptyPagination = element(by.css('adf-pagination[class*="adf-pagination__empty"]'));
|
||||
dragAndDrop = element.all(by.css('adf-upload-drag-area div')).first();
|
||||
nameHeader = element.all(by.css('div[data-automation-id="auto_id_name"] > span')).first();
|
||||
sizeHeader = element.all(by.css('div[data-automation-id="auto_id_content.sizeInBytes"] > span')).first();
|
||||
createdByHeader = element.all(by.css('div[data-automation-id="auto_id_createdByUser.displayName"] > span')).first();
|
||||
createdHeader = element.all(by.css('div[data-automation-id="auto_id_createdAt"] > span')).first();
|
||||
recentFiles = element(by.css('.app-container-recent'));
|
||||
recentFilesExpanded = element(by.css('.app-container-recent mat-expansion-panel-header.mat-expanded'));
|
||||
recentFilesClosed = element(by.css('.app-container-recent mat-expansion-panel-header'));
|
||||
recentFileIcon = element(by.css('.app-container-recent mat-expansion-panel-header mat-icon'));
|
||||
emptyFolder = element(by.css('.adf-empty-folder-this-space-is-empty'));
|
||||
emptyFolderImage = element(by.css('.adf-empty-folder-image'));
|
||||
emptyRecent = element(by.css('.app-container-recent .app-empty-list__title'));
|
||||
gridViewButton = element(by.css('button[data-automation-id="document-list-grid-view"]'));
|
||||
cardViewContainer = element(by.css('div.app-document-list-container div.adf-datatable-card'));
|
||||
multipleFileUploadToggle = $('#adf-document-list-enable-drop-files');
|
||||
uploadBorder = $('#document-list-container');
|
||||
contentServices = $('.app-sidenav-link[data-automation-id="Content Services"]');
|
||||
currentFolder = $('div[class*="adf-breadcrumb-item adf-active"] div');
|
||||
createFolderButton = $('button[data-automation-id="create-new-folder"]');
|
||||
editFolderButton = $('button[data-automation-id="edit-folder"]');
|
||||
deleteNodesButton = $('button[data-automation-id="delete-toolbar-button"]');
|
||||
createLibraryButton = $('button[data-automation-id="create-new-library"]');
|
||||
activeBreadcrumb = $('div[class*="active"]');
|
||||
uploadFileButton = $('.adf-upload-button-file-container button');
|
||||
uploadFileButtonInput = $('input[data-automation-id="upload-single-file"]');
|
||||
uploadMultipleFileButton = $('input[data-automation-id="upload-multiple-files"]');
|
||||
uploadFolderButton = $('input[data-automation-id="uploadFolder"]');
|
||||
errorSnackBar = $('simple-snack-bar[class*="mat-simple-snackbar"]');
|
||||
emptyPagination = $('adf-pagination[class*="adf-pagination__empty"]');
|
||||
dragAndDrop = $$('adf-upload-drag-area div').first();
|
||||
nameHeader = $$('div[data-automation-id="auto_id_name"] > span').first();
|
||||
sizeHeader = $$('div[data-automation-id="auto_id_content.sizeInBytes"] > span').first();
|
||||
createdByHeader = $$('div[data-automation-id="auto_id_createdByUser.displayName"] > span').first();
|
||||
createdHeader = $$('div[data-automation-id="auto_id_createdAt"] > span').first();
|
||||
recentFiles = $('.app-container-recent');
|
||||
recentFilesExpanded = $('.app-container-recent mat-expansion-panel-header.mat-expanded');
|
||||
recentFilesClosed = $('.app-container-recent mat-expansion-panel-header');
|
||||
recentFileIcon = $('.app-container-recent mat-expansion-panel-header mat-icon');
|
||||
emptyFolder = $('.adf-empty-folder-this-space-is-empty');
|
||||
emptyFolderImage = $('.adf-empty-folder-image');
|
||||
emptyRecent = $('.app-container-recent .app-empty-list__title');
|
||||
gridViewButton = $('button[data-automation-id="document-list-grid-view"]');
|
||||
cardViewContainer = $('div.app-document-list-container div.adf-datatable-card');
|
||||
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
||||
nameColumnHeader = 'name';
|
||||
createdByColumnHeader = 'createdByUser.displayName';
|
||||
createdColumnHeader = 'createdAt';
|
||||
deleteContentElement = element(by.css('button[data-automation-id*="DELETE"]'));
|
||||
metadataAction = element(by.css('button[data-automation-id*="METADATA"]'));
|
||||
versionManagerAction = element(by.css('button[data-automation-id*="VERSIONS"]'));
|
||||
moveContentElement = element(by.css('button[data-automation-id*="MOVE"]'));
|
||||
copyContentElement = element(by.css('button[data-automation-id*="COPY"]'));
|
||||
lockContentElement = element(by.css('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]'));
|
||||
downloadContent = element(by.css('button[data-automation-id*="DOWNLOAD"]'));
|
||||
downloadButton = element(by.css('button[title="Download"]'));
|
||||
favoriteButton = element(by.css('button[data-automation-id="favorite"]'));
|
||||
deleteContentElement = $('button[data-automation-id*="DELETE"]');
|
||||
metadataAction = $('button[data-automation-id*="METADATA"]');
|
||||
versionManagerAction = $('button[data-automation-id*="VERSIONS"]');
|
||||
moveContentElement = $('button[data-automation-id*="MOVE"]');
|
||||
copyContentElement = $('button[data-automation-id*="COPY"]');
|
||||
lockContentElement = $('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]');
|
||||
downloadContent = $('button[data-automation-id*="DOWNLOAD"]');
|
||||
downloadButton = $('button[title="Download"]');
|
||||
favoriteButton = $('button[data-automation-id="favorite"]');
|
||||
markedFavorite = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star'));
|
||||
notMarkedFavorite = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star_border'));
|
||||
multiSelectToggle = element(by.css('[data-automation-id="multiSelectToggle"]'));
|
||||
selectAllCheckbox = element.all(by.css('.adf-checkbox-sr-only')).first();
|
||||
selectionModeDropdown = element(by.css('.mat-select[aria-label="Selection Mode"]'));
|
||||
selectedNodesList = element.all(by.css('.app-content-service-settings li'));
|
||||
siteListDropdown = new DropdownPage(element(by.css(`mat-select[data-automation-id='site-my-files-option']`)));
|
||||
sortingDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="grid-view-sorting"]')));
|
||||
multiSelectToggle = $('[data-automation-id="multiSelectToggle"]');
|
||||
selectAllCheckbox = $$('.adf-checkbox-sr-only').first();
|
||||
selectionModeDropdown = $('.mat-select[aria-label="Selection Mode"]');
|
||||
selectedNodesList = $$('.app-content-service-settings li');
|
||||
siteListDropdown = new DropdownPage($(`mat-select[data-automation-id='site-my-files-option']`));
|
||||
sortingDropdown = new DropdownPage($('mat-select[data-automation-id="grid-view-sorting"]'));
|
||||
|
||||
async pressContextMenuActionNamed(actionName): Promise<void> {
|
||||
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
|
||||
}
|
||||
|
||||
async checkContextActionIsVisible(actionName) {
|
||||
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
const actionButton = $(`button[data-automation-id="context-${actionName}"`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
}
|
||||
|
||||
async isContextActionEnabled(actionName): Promise<boolean> {
|
||||
const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
const actionButton = $(`button[data-automation-id="context-${actionName}"`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||
return actionButton.isEnabled();
|
||||
}
|
||||
@@ -132,7 +131,7 @@ export class ContentServicesPage {
|
||||
|
||||
async checkDeleteIsDisabled(content): Promise<void> {
|
||||
await this.contentList.clickOnActionMenu(content);
|
||||
const disabledDelete = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`));
|
||||
const disabledDelete = $(`button[data-automation-id*='DELETE'][disabled='true']`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
|
||||
}
|
||||
|
||||
@@ -489,12 +488,12 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async enableMediumTimeFormat(): Promise<void> {
|
||||
const mediumTimeFormat = element(by.css('#enableMediumTimeFormat'));
|
||||
const mediumTimeFormat = $('#enableMediumTimeFormat');
|
||||
await BrowserActions.click(mediumTimeFormat);
|
||||
}
|
||||
|
||||
async enableThumbnails(): Promise<void> {
|
||||
const thumbnailSlide = element(by.id('adf-thumbnails-upload-switch'));
|
||||
const thumbnailSlide = $('#adf-thumbnails-upload-switch');
|
||||
await BrowserActions.click(thumbnailSlide);
|
||||
}
|
||||
|
||||
@@ -503,7 +502,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getDocumentListRowNumber(): Promise<number> {
|
||||
const documentList = element(by.css('adf-upload-drag-area adf-document-list'));
|
||||
const documentList = $('adf-upload-drag-area adf-document-list');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(documentList);
|
||||
return $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
|
||||
}
|
||||
@@ -539,7 +538,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async checkLockIsDisplayedForElement(name): Promise<void> {
|
||||
const lockButton = element(by.css(`div.adf-datatable-cell[data-automation-id="${name}"] button`));
|
||||
const lockButton = $(`div.adf-datatable-cell[data-automation-id="${name}"] button`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(lockButton);
|
||||
}
|
||||
|
||||
@@ -548,7 +547,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getStyleValueForRowText(rowName, styleName): Promise<string> {
|
||||
const row = element(by.css(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`));
|
||||
const row = $(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
return row.getCssValue(styleName);
|
||||
}
|
||||
@@ -567,7 +566,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getRowIconImageUrl(fileName): Promise<string> {
|
||||
const iconRow = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`));
|
||||
const iconRow = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`);
|
||||
return BrowserActions.getAttribute(iconRow, 'src');
|
||||
}
|
||||
|
||||
@@ -590,30 +589,30 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async getDocumentCardIconForElement(elementName): Promise<string> {
|
||||
const elementIcon = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`));
|
||||
const elementIcon = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"] img`);
|
||||
return BrowserActions.getAttribute(elementIcon, 'src');
|
||||
}
|
||||
|
||||
async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise<void> {
|
||||
const elementProperty = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`));
|
||||
const elementProperty = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementProperty);
|
||||
}
|
||||
|
||||
async getAttributeValueForElement(elementName, propertyName): Promise<string> {
|
||||
const elementSize = element(by.css(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`));
|
||||
const elementSize = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${elementName}"][title="${propertyName}"] span`);
|
||||
return BrowserActions.getText(elementSize);
|
||||
}
|
||||
|
||||
async checkMenuIsShowedForElementIndex(elementIndex): Promise<void> {
|
||||
const elementMenu = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`));
|
||||
const elementMenu = $(`button[data-automation-id="action_menu_${elementIndex}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementMenu);
|
||||
}
|
||||
|
||||
async navigateToCardFolder(folderName): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const folderCard = element(by.css(`.app-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`));
|
||||
const folderCard = $(`.app-document-list-container div.adf-image-table-cell.adf-datatable-cell[data-automation-id="${folderName}"]`);
|
||||
await BrowserActions.click(folderCard);
|
||||
const folderSelected = element(by.css(`.adf-datatable-row.adf-is-selected div[data-automation-id="${folderName}"].adf-datatable-cell--image`));
|
||||
const folderSelected = $(`.adf-datatable-row.adf-is-selected div[data-automation-id="${folderName}"].adf-datatable-cell--image`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(folderSelected);
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
}
|
||||
@@ -660,7 +659,7 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async selectFolder(folderName: string): Promise<void> {
|
||||
const folderSelected = element(by.css(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`));
|
||||
const folderSelected = $(`div[data-automation-id="${folderName}"] .adf-datatable-center-img-ie`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(folderSelected);
|
||||
await BrowserActions.click(folderSelected);
|
||||
}
|
||||
@@ -681,13 +680,13 @@ export class ContentServicesPage {
|
||||
}
|
||||
|
||||
async selectItemWithCheckbox(itemName: string): Promise<void> {
|
||||
const item = element(by.css(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`));
|
||||
const item = $(`adf-datatable-row[aria-label="${itemName}"] mat-checkbox .mat-checkbox-input`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(item);
|
||||
await BrowserActions.click(item);
|
||||
}
|
||||
|
||||
async unSelectItemWithCheckbox(itemName: string): Promise<void> {
|
||||
const item = element(by.css(`adf-datatable-row[aria-label="${itemName} selected"] mat-checkbox .mat-checkbox-input`));
|
||||
const item = $(`adf-datatable-row[aria-label="${itemName} selected"] mat-checkbox .mat-checkbox-input`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(item);
|
||||
await BrowserActions.click(item);
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { by, element } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
const source = {
|
||||
@@ -39,8 +39,8 @@ export class CustomSourcesPage {
|
||||
dataTable = new DataTableComponentPage();
|
||||
navigationBarPage = new NavigationBarPage();
|
||||
|
||||
toolbar = element(by.css('app-custom-sources .adf-toolbar-title'));
|
||||
selectModeDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="custom-sources-select"]')));
|
||||
toolbar = $('app-custom-sources .adf-toolbar-title');
|
||||
selectModeDropdown = new DropdownPage($('mat-select[data-automation-id="custom-sources-select"]'));
|
||||
|
||||
async waitForToolbarToBeVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.toolbar);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { $, $$, browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
|
||||
export class DataTablePage {
|
||||
|
||||
@@ -33,30 +33,30 @@ export class DataTablePage {
|
||||
};
|
||||
|
||||
dataTable: DataTableComponentPage;
|
||||
multiSelect = element(by.css(`div[data-automation-id='multiselect'] label > .mat-checkbox-inner-container`));
|
||||
multiSelect = $(`div[data-automation-id='multiselect'] label > .mat-checkbox-inner-container`);
|
||||
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||
allSelectedRows = element.all(by.css(`adf-datatable-row[class*='is-selected']`));
|
||||
selectedRowNumber = element(by.css(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`));
|
||||
selectAll = element(by.css(`div[class*='header'] label`));
|
||||
allSelectedRows = $$(`adf-datatable-row[class*='is-selected']`);
|
||||
selectedRowNumber = $(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`);
|
||||
selectAll = $(`div[class*='header'] label`);
|
||||
addRowElement = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
|
||||
replaceRowsElement = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
|
||||
replaceColumnsElement = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
|
||||
createdOnColumn = element(by.css(`div[data-automation-id='auto_id_createdOn']`));
|
||||
idColumnHeader = element(by.css(`div[data-automation-id='auto_id_id']`));
|
||||
pasteClipboardInput = element(by.css(`input[data-automation-id='paste clipboard input']`));
|
||||
createdOnColumn = $(`div[data-automation-id='auto_id_createdOn']`);
|
||||
idColumnHeader = $(`div[data-automation-id='auto_id_id']`);
|
||||
pasteClipboardInput = $(`input[data-automation-id='paste clipboard input']`);
|
||||
|
||||
selectModeDropdown = new DropdownPage(element(by.css(`mat-select[data-automation-id='datatable-selection-mode']`)));
|
||||
selectModeDropdown = new DropdownPage($(`mat-select[data-automation-id='datatable-selection-mode']`));
|
||||
|
||||
constructor(data?) {
|
||||
if (this.data[data]) {
|
||||
this.dataTable = new DataTableComponentPage(element(by.css(`div[data-automation-id='` + this.data[data] + `']`)));
|
||||
this.dataTable = new DataTableComponentPage($(`div[data-automation-id='` + this.data[data] + `']`));
|
||||
} else {
|
||||
this.dataTable = new DataTableComponentPage(element(by.css(`div[data-automation-id='` + this.data.defaultTable + `']`)));
|
||||
this.dataTable = new DataTableComponentPage($(`div[data-automation-id='` + this.data.defaultTable + `']`));
|
||||
}
|
||||
}
|
||||
|
||||
async insertFilter(filterText: string): Promise<void> {
|
||||
const inputFilter = element(by.css(`#adf-datatable-filter-input`));
|
||||
const inputFilter = $(`#adf-datatable-filter-input`);
|
||||
await BrowserActions.clearSendKeys(inputFilter, filterText);
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { $, $$ } from 'protractor';
|
||||
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||
|
||||
export class CreateLibraryDialogPage {
|
||||
@@ -30,11 +30,11 @@ export class CreateLibraryDialogPage {
|
||||
cancelButton = TestElement.byCss('button[data-automation-id="cancel-library-id"]');
|
||||
createButton = TestElement.byCss('button[data-automation-id="create-library-id"]');
|
||||
errorMessage = TestElement.byCss('.mat-dialog-content .mat-error');
|
||||
errorMessages = element.all(by.css('.mat-dialog-content .mat-error'));
|
||||
errorMessages = $$('.mat-dialog-content .mat-error');
|
||||
libraryNameHint = TestElement.byCss('adf-library-dialog .mat-hint');
|
||||
|
||||
async getSelectedRadio(): Promise<string> {
|
||||
const radio = element(by.css('.mat-radio-button[class*="checked"]'));
|
||||
const radio = $('.mat-radio-button[class*="checked"]');
|
||||
return BrowserActions.getText(radio);
|
||||
}
|
||||
|
||||
|
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { $$, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class FolderDialogPage {
|
||||
|
||||
folderDialog = element.all(by.css('adf-folder-dialog')).first();
|
||||
folderNameField = this.folderDialog.element(by.id('adf-folder-name-input'));
|
||||
folderDescriptionField = this.folderDialog.element(by.id('adf-folder-description-input'));
|
||||
createUpdateButton = this.folderDialog.element(by.id('adf-folder-create-button'));
|
||||
cancelButton = this.folderDialog.element(by.id('adf-folder-cancel-button'));
|
||||
folderTitle = this.folderDialog.element((by.css('h2.mat-dialog-title')));
|
||||
validationMessage = this.folderDialog.element(by.css('div.mat-form-field-subscript-wrapper mat-hint span'));
|
||||
folderDialog = $$('adf-folder-dialog').first();
|
||||
folderNameField = this.folderDialog.$('#adf-folder-name-input');
|
||||
folderDescriptionField = this.folderDialog.$('#adf-folder-description-input');
|
||||
createUpdateButton = this.folderDialog.$('#adf-folder-create-button');
|
||||
cancelButton = this.folderDialog.$('#adf-folder-cancel-button');
|
||||
folderTitle = this.folderDialog.$('h2.mat-dialog-title');
|
||||
validationMessage = this.folderDialog.$('div.mat-form-field-subscript-wrapper mat-hint span');
|
||||
|
||||
async getDialogTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.folderTitle);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { $$, $ } from 'protractor';
|
||||
import { BrowserVisibility, TogglePage, BrowserActions, DateTimePickerPage } from '@alfresco/adf-testing';
|
||||
import moment = require('moment');
|
||||
|
||||
@@ -23,18 +23,18 @@ export class ShareDialogPage {
|
||||
|
||||
togglePage = new TogglePage();
|
||||
dateTimePickerPage = new DateTimePickerPage();
|
||||
shareDialog = element(by.css('adf-share-dialog'));
|
||||
dialogTitle = element.all(by.css('[data-automation-id="adf-share-dialog-title"]')).first();
|
||||
shareToggle = element(by.css('[data-automation-id="adf-share-toggle"] label'));
|
||||
expireToggle = element(by.css(`[data-automation-id="adf-expire-toggle"] label`));
|
||||
shareToggleChecked = element(by.css('mat-dialog-container mat-slide-toggle.mat-checked'));
|
||||
shareLink = element(by.css('[data-automation-id="adf-share-link"]'));
|
||||
closeButton = element(by.css('button[data-automation-id="adf-share-dialog-close"]'));
|
||||
copySharedLinkButton = element(by.css('.adf-input-action'));
|
||||
expirationDateInput = element(by.css('input[formcontrolname="time"]'));
|
||||
confirmationDialog = element(by.css('adf-confirm-dialog'));
|
||||
confirmationCancelButton = element(by.id('adf-confirm-cancel'));
|
||||
confirmationRemoveButton = element(by.id('adf-confirm-accept'));
|
||||
shareDialog = $('adf-share-dialog');
|
||||
dialogTitle = $$('[data-automation-id="adf-share-dialog-title"]').first();
|
||||
shareToggle = $('[data-automation-id="adf-share-toggle"] label');
|
||||
expireToggle = $(`[data-automation-id="adf-expire-toggle"] label`);
|
||||
shareToggleChecked = $('mat-dialog-container mat-slide-toggle.mat-checked');
|
||||
shareLink = $('[data-automation-id="adf-share-link"]');
|
||||
closeButton = $('button[data-automation-id="adf-share-dialog-close"]');
|
||||
copySharedLinkButton = $('.adf-input-action');
|
||||
expirationDateInput = $('input[formcontrolname="time"]');
|
||||
confirmationDialog = $('adf-confirm-dialog');
|
||||
confirmationCancelButton = $('#adf-confirm-cancel');
|
||||
confirmationRemoveButton = $('#adf-confirm-accept');
|
||||
|
||||
async checkDialogIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.dialogTitle);
|
||||
@@ -106,7 +106,7 @@ export class ShareDialogPage {
|
||||
}
|
||||
|
||||
async dateTimePickerDialogIsClosed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsStale(element(by.css('mat-datetimepicker-content')));
|
||||
await BrowserVisibility.waitUntilElementIsStale($('mat-datetimepicker-content'));
|
||||
}
|
||||
|
||||
async getExpirationDate(): Promise<string> {
|
||||
|
@@ -15,28 +15,28 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser, ElementFinder, Locator } from 'protractor';
|
||||
import { element, by, browser, ElementFinder, $, $$ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class UploadDialogPage {
|
||||
|
||||
closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
|
||||
dialog = element(by.css('div[id="upload-dialog"]'));
|
||||
minimizedDialog = element(by.css('div[class*="upload-dialog--minimized"]'));
|
||||
uploadedStatusIcon: Locator = by.css('mat-icon[class*="status--done"]');
|
||||
cancelledStatusIcon: Locator = by.css('div[class*="status--cancelled"]');
|
||||
errorStatusIcon: Locator = by.css('div[class*="status--error"] mat-icon');
|
||||
errorTooltip = element(by.css('div.mat-tooltip'));
|
||||
closeButton = $('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]');
|
||||
dialog = $('div[id="upload-dialog"]');
|
||||
minimizedDialog = $('div[class*="upload-dialog--minimized"]');
|
||||
uploadedStatusIcon = 'mat-icon[class*="status--done"]';
|
||||
cancelledStatusIcon = 'div[class*="status--cancelled"]';
|
||||
errorStatusIcon = 'div[class*="status--error"] mat-icon';
|
||||
errorTooltip = $('div.mat-tooltip');
|
||||
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
|
||||
title = element(by.css('span[class*="upload-dialog__title"]'));
|
||||
minimizeButton = element(by.css('mat-icon[title="Minimize"]'));
|
||||
maximizeButton = element(by.css('mat-icon[title="Maximize"]'));
|
||||
canUploadConfirmationTitle = element(by.css('.upload-dialog__confirmation--title'));
|
||||
canUploadConfirmationDescription = element(by.css('.upload-dialog__confirmation--text'));
|
||||
title = $('span[class*="upload-dialog__title"]');
|
||||
minimizeButton = $('mat-icon[title="Minimize"]');
|
||||
maximizeButton = $('mat-icon[title="Maximize"]');
|
||||
canUploadConfirmationTitle = $('.upload-dialog__confirmation--title');
|
||||
canUploadConfirmationDescription = $('.upload-dialog__confirmation--text');
|
||||
confirmationDialogNoButton = element(by.partialButtonText('No'));
|
||||
confirmationDialogYesButton = element(by.partialButtonText('Yes'));
|
||||
cancelUploadsElement = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]')));
|
||||
cancelUploadInProgressButton = element(by.css('div[data-automation-id="cancel-upload-progress"]'));
|
||||
cancelUploadsElement = $('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]');
|
||||
cancelUploadInProgressButton = $('div[data-automation-id="cancel-upload-progress"]');
|
||||
|
||||
async clickOnCloseButton(): Promise<void> {
|
||||
await this.checkCloseButtonIsDisplayed();
|
||||
@@ -59,24 +59,20 @@ export class UploadDialogPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.dialog);
|
||||
}
|
||||
|
||||
getRowsByName(content: string): ElementFinder {
|
||||
return element.all(by.css(`div[class*='uploading-row'] span[title="${content}"]`)).first();
|
||||
}
|
||||
|
||||
async getRowByRowName(content: string): Promise<ElementFinder> {
|
||||
const rows = this.getRowsByName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(rows);
|
||||
return rows.element(this.rowByRowName);
|
||||
const row = await $$(`div[class*='uploading-row'] span[title="${content}"]`).last();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
return row.element(this.rowByRowName);
|
||||
}
|
||||
|
||||
async fileIsUploaded(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon), 60000);
|
||||
const row: ElementFinder = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.uploadedStatusIcon), 10000);
|
||||
}
|
||||
|
||||
async fileIsError(content: string) {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.errorStatusIcon));
|
||||
const row: ElementFinder = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.errorStatusIcon));
|
||||
}
|
||||
|
||||
async filesAreUploaded(content: string[]): Promise<void> {
|
||||
@@ -86,7 +82,7 @@ export class UploadDialogPage {
|
||||
}
|
||||
|
||||
async fileIsNotDisplayedInDialog(content: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`div[class*='uploading-row'] span[title="${content}"]`)));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible($(`div[class*='uploading-row'] span[title="${content}"]`));
|
||||
}
|
||||
|
||||
async cancelUploads(): Promise<void> {
|
||||
@@ -102,16 +98,16 @@ export class UploadDialogPage {
|
||||
}
|
||||
|
||||
async fileIsCancelled(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
const row: ElementFinder = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon), 10000);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.cancelledStatusIcon), 10000);
|
||||
}
|
||||
|
||||
async removeUploadedFile(content: string): Promise<void> {
|
||||
const row = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon));
|
||||
const row: ElementFinder = await this.getRowByRowName(content);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.uploadedStatusIcon));
|
||||
const elementRow = await this.getRowByRowName(content);
|
||||
await BrowserActions.click(elementRow.element(this.uploadedStatusIcon));
|
||||
await BrowserActions.click(elementRow.$(this.uploadedStatusIcon));
|
||||
}
|
||||
|
||||
async getTitleText(): Promise<string> {
|
||||
@@ -156,8 +152,8 @@ export class UploadDialogPage {
|
||||
}
|
||||
|
||||
async displayTooltip(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(this.errorStatusIcon));
|
||||
await browser.actions().mouseMove(element(this.errorStatusIcon)).perform();
|
||||
await BrowserVisibility.waitUntilElementIsVisible($(this.errorStatusIcon));
|
||||
await browser.actions().mouseMove($(this.errorStatusIcon)).perform();
|
||||
}
|
||||
|
||||
async getTooltip(): Promise<string> {
|
||||
|
@@ -15,20 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { $, browser } from 'protractor';
|
||||
import { BrowserActions, BrowserVisibility, TogglePage } from '@alfresco/adf-testing';
|
||||
|
||||
export class UploadTogglesPage {
|
||||
|
||||
togglePage = new TogglePage();
|
||||
multipleFileUploadToggle = element(by.id('adf-multiple-upload-switch'));
|
||||
uploadFolderToggle = element(by.css('#adf-folder-upload-switch'));
|
||||
extensionFilterToggle = element(by.id('adf-extension-filter-upload-switch'));
|
||||
maxSizeToggle = element(by.id('adf-max-size-filter-upload-switch'));
|
||||
versioningToggle = element(by.id('adf-version-upload-switch'));
|
||||
extensionAcceptedField = element(by.css('input[data-automation-id="accepted-files-type"]'));
|
||||
maxSizeField = element(by.css('input[data-automation-id="max-files-size"]'));
|
||||
disableUploadCheckbox = element(by.css('[id="adf-disable-upload"]'));
|
||||
multipleFileUploadToggle = $('#adf-multiple-upload-switch');
|
||||
uploadFolderToggle = $('#adf-folder-upload-switch');
|
||||
extensionFilterToggle = $('#adf-extension-filter-upload-switch');
|
||||
maxSizeToggle = $('#adf-max-size-filter-upload-switch');
|
||||
versioningToggle = $('#adf-version-upload-switch');
|
||||
extensionAcceptedField = $('input[data-automation-id="accepted-files-type"]');
|
||||
maxSizeField = $('input[data-automation-id="max-files-size"]');
|
||||
disableUploadCheckbox = $('[id="adf-disable-upload"]');
|
||||
|
||||
async enableMultipleFileUpload(): Promise<void> {
|
||||
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
|
||||
@@ -46,7 +46,7 @@ export class UploadTogglesPage {
|
||||
|
||||
async checkFolderUploadToggleIsEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const enabledFolderUpload = element(by.css('mat-slide-toggle[id="adf-folder-upload-switch"][class*="mat-checked"]'));
|
||||
const enabledFolderUpload = $('mat-slide-toggle[id="adf-folder-upload-switch"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledFolderUpload);
|
||||
return true;
|
||||
} catch {
|
||||
@@ -55,17 +55,17 @@ export class UploadTogglesPage {
|
||||
}
|
||||
|
||||
async checkMultipleFileUploadToggleIsEnabled(): Promise<void> {
|
||||
const enabledToggle = element(by.css('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]'));
|
||||
const enabledToggle = $('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
async checkMaxSizeToggleIsEnabled(): Promise<void> {
|
||||
const enabledToggle = element(by.css('mat-slide-toggle[id="adf-max-size-filter-upload-switch"][class*="mat-checked"]'));
|
||||
const enabledToggle = $('mat-slide-toggle[id="adf-max-size-filter-upload-switch"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
async checkVersioningToggleIsEnabled(): Promise<void> {
|
||||
const enabledToggle = element(by.css('mat-slide-toggle[id="adf-version-upload-switch"][class*="mat-checked"]'));
|
||||
const enabledToggle = $('mat-slide-toggle[id="adf-version-upload-switch"][class*="mat-checked"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ export class UploadTogglesPage {
|
||||
}
|
||||
async checkFolderUploadToggleIsNotEnabled(): Promise<boolean> {
|
||||
try {
|
||||
const inactiveToggleFolder = element(by.css('#adf-folder-upload-switch .mat-slide-toggle-label'));
|
||||
const inactiveToggleFolder = $('#adf-folder-upload-switch .mat-slide-toggle-label');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(inactiveToggleFolder);
|
||||
return true;
|
||||
} catch {
|
||||
|
@@ -15,18 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { $, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
export class IconsPage {
|
||||
|
||||
locateCustomIcon(name: string): ElementFinder {
|
||||
return element(by.css(`adf-icon[value='${name}'] svg`));
|
||||
}
|
||||
|
||||
locateLigatureIcon(name: string): ElementFinder {
|
||||
return element(by.css(`adf-icon[value='${name}'] .material-icons`));
|
||||
}
|
||||
locateCustomIcon = (name: string): ElementFinder => $(`adf-icon[value='${name}'] svg`);
|
||||
locateLigatureIcon = (name: string): ElementFinder => $(`adf-icon[value='${name}'] .material-icons`);
|
||||
|
||||
async isCustomIconDisplayed(name: string) {
|
||||
const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateCustomIcon(name));
|
||||
|
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, ElementFinder } from 'protractor';
|
||||
import { ElementFinder, $, $$ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class InfinitePaginationPage {
|
||||
|
||||
rootElement: ElementFinder;
|
||||
loadMoreButton;
|
||||
loading = element(by.css('[data-automation-id="adf-infinite-pagination-spinner"]'));
|
||||
loadMoreButton: ElementFinder;
|
||||
loading = $('[data-automation-id="adf-infinite-pagination-spinner"]');
|
||||
|
||||
constructor(rootElement = element.all(by.css('adf-infinite-pagination')).first()) {
|
||||
constructor(rootElement = $$('adf-infinite-pagination').first()) {
|
||||
this.rootElement = rootElement;
|
||||
this.loadMoreButton = this.rootElement.element(by.css('button[data-automation-id="adf-infinite-pagination-button"]'));
|
||||
this.loadMoreButton = this.rootElement.$('button[data-automation-id="adf-infinite-pagination-button"]');
|
||||
}
|
||||
|
||||
async clickLoadMoreButton(): Promise<void> {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { $, browser, by, element } from 'protractor';
|
||||
import { TogglePage, BrowserActions, BrowserVisibility, LoginPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class LoginShellPage {
|
||||
@@ -24,33 +24,33 @@ export class LoginShellPage {
|
||||
loginSSOPage = new LoginPage();
|
||||
|
||||
togglePage = new TogglePage();
|
||||
txtUsername = element(by.css('input[id="username"]'));
|
||||
txtPassword = element(by.css('input[id="password"]'));
|
||||
logoImg = element(by.css('img[id="adf-login-img-logo"]'));
|
||||
successRouteTxt = element(by.css('input[data-automation-id="adf-success-route"]'));
|
||||
logoTxt = element(by.css('input[data-automation-id="adf-url-logo"]'));
|
||||
usernameError = element(by.css('span[data-automation-id="username-error"]'));
|
||||
passwordError = element(by.css('span[data-automation-id="password-required"]'));
|
||||
loginError = element(by.css('.adf-login-error-message'));
|
||||
usernameInactive = element(by.css('input[id="username"][aria-invalid="false"]'));
|
||||
passwordInactive = element(by.css('input[id="password"][aria-invalid="false"]'));
|
||||
adfLogo = element(by.css('.adf-img-logo'));
|
||||
txtUsername = $('input[id="username"]');
|
||||
txtPassword = $('input[id="password"]');
|
||||
logoImg = $('img[id="adf-login-img-logo"]');
|
||||
successRouteTxt = $('input[data-automation-id="adf-success-route"]');
|
||||
logoTxt = $('input[data-automation-id="adf-url-logo"]');
|
||||
usernameError = $('span[data-automation-id="username-error"]');
|
||||
passwordError = $('span[data-automation-id="password-required"]');
|
||||
loginError = $('.adf-login-error-message');
|
||||
usernameInactive = $('input[id="username"][aria-invalid="false"]');
|
||||
passwordInactive = $('input[id="password"][aria-invalid="false"]');
|
||||
adfLogo = $('.adf-img-logo');
|
||||
|
||||
usernameHighlighted = element(by.css('input[id="username"][aria-invalid="true"]'));
|
||||
passwordHighlighted = element(by.css('input[id="password"][aria-invalid="true"]'));
|
||||
signInButton = element(by.id('login-button'));
|
||||
showPasswordElement = element(by.css('button[data-automation-id="show_password"]'));
|
||||
hidePasswordElement = element(by.css('button[data-automation-id="hide_password"]'));
|
||||
rememberMe = element(by.css('mat-checkbox[id="adf-login-remember"]'));
|
||||
needHelp = element(by.id('adf-login-action-left'));
|
||||
register = element(by.id('adf-login-action-right'));
|
||||
footerSwitch = element(by.id('switch4'));
|
||||
rememberMeSwitch = element(by.id('adf-toggle-show-rememberme'));
|
||||
successRouteSwitch = element(by.id('adf-toggle-show-successRoute'));
|
||||
logoSwitch = element(by.id('adf-toggle-logo'));
|
||||
header = element(by.id('adf-header'));
|
||||
usernameHighlighted = $('input[id="username"][aria-invalid="true"]');
|
||||
passwordHighlighted = $('input[id="password"][aria-invalid="true"]');
|
||||
signInButton = $('#login-button');
|
||||
showPasswordElement = $('button[data-automation-id="show_password"]');
|
||||
hidePasswordElement = $('button[data-automation-id="hide_password"]');
|
||||
rememberMe = $('mat-checkbox[id="adf-login-remember"]');
|
||||
needHelp = $('#adf-login-action-left');
|
||||
register = $('#adf-login-action-right');
|
||||
footerSwitch = $('#switch4');
|
||||
rememberMeSwitch = $('#adf-toggle-show-rememberme');
|
||||
successRouteSwitch = $('#adf-toggle-show-successRoute');
|
||||
logoSwitch = $('#adf-toggle-logo');
|
||||
header = $('#adf-header');
|
||||
settingsIcon = element(by.cssContainingText('a[data-automation-id="settings"] mat-icon', 'settings'));
|
||||
sidenavLayout = element(by.css(`[data-automation-id="sidenav-layout"]`));
|
||||
sidenavLayout = $(`[data-automation-id="sidenav-layout"]`);
|
||||
|
||||
async goToLoginPage(): Promise<void> {
|
||||
await BrowserActions.getUrl(this.loginURL);
|
||||
|
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||
|
||||
export class LogoutPage {
|
||||
|
||||
logoutSection: ElementFinder = element(by.css('div[data-automation-id="adf-logout-section"]'));
|
||||
logoutSection = $('div[data-automation-id="adf-logout-section"]');
|
||||
|
||||
async checkLogoutSectionIsDisplayed() {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
|
||||
|
@@ -15,45 +15,48 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element, Key, Locator, protractor } from 'protractor';
|
||||
import { $, by, element, Key, protractor, ElementFinder } from 'protractor';
|
||||
import { BrowserActions, BrowserVisibility, DropdownPage, TestElement, Logger } from '@alfresco/adf-testing';
|
||||
|
||||
export class MetadataViewPage {
|
||||
|
||||
title = element(by.css(`div[info-drawer-title]`));
|
||||
expandedAspect = element(by.css(`mat-expansion-panel-header[aria-expanded='true']`));
|
||||
aspectTitle: Locator = by.css(`mat-panel-title`);
|
||||
name = element(by.css(`[data-automation-id='card-textitem-value-properties.cm:name']`));
|
||||
creator = element(by.css(`[data-automation-id='card-textitem-value-createdByUser.displayName']`));
|
||||
createdDate = element(by.css(`span[data-automation-id='card-dateitem-createdAt']`));
|
||||
modifier = element(by.css(`[data-automation-id='card-textitem-value-modifiedByUser.displayName']`));
|
||||
modifiedDate = element(by.css(`span[data-automation-id='card-dateitem-modifiedAt']`));
|
||||
mimetypeName = element(by.css(`[data-automation-id='card-textitem-value-content.mimeTypeName']`));
|
||||
size = element(by.css(`[data-automation-id='card-textitem-value-content.sizeInBytes']`));
|
||||
description = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:description']`));
|
||||
author = element(by.css(`[data-automation-id='card-textitem-value-properties.cm:author']`));
|
||||
titleProperty = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`));
|
||||
editIcon = element(by.css(`button[data-automation-id='meta-data-card-toggle-edit']`));
|
||||
informationButton = element(by.css(`button[data-automation-id='meta-data-card-toggle-expand']`));
|
||||
informationSpan = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label']`));
|
||||
informationIcon = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label'] ~ mat-icon`));
|
||||
displayEmptySwitch = element(by.id(`adf-metadata-empty`));
|
||||
readonlySwitch = element(by.id(`adf-metadata-readonly`));
|
||||
multiSwitch = element(by.id(`adf-metadata-multi`));
|
||||
presetSwitch = element(by.id('adf-toggle-custom-preset'));
|
||||
defaultPropertiesSwitch = element(by.id('adf-metadata-default-properties'));
|
||||
title = $(`div[info-drawer-title]`);
|
||||
expandedAspect = $(`mat-expansion-panel-header[aria-expanded='true']`);
|
||||
aspectTitle = `mat-panel-title`;
|
||||
name = $(`[data-automation-id='card-textitem-value-properties.cm:name']`);
|
||||
creator = $(`[data-automation-id='card-textitem-value-createdByUser.displayName']`);
|
||||
createdDate = $(`span[data-automation-id='card-dateitem-createdAt']`);
|
||||
modifier = $(`[data-automation-id='card-textitem-value-modifiedByUser.displayName']`);
|
||||
modifiedDate = $(`span[data-automation-id='card-dateitem-modifiedAt']`);
|
||||
mimetypeName = $(`[data-automation-id='card-textitem-value-content.mimeTypeName']`);
|
||||
size = $(`[data-automation-id='card-textitem-value-content.sizeInBytes']`);
|
||||
description = $(`span[data-automation-id='card-textitem-value-properties.cm:description']`);
|
||||
author = $(`[data-automation-id='card-textitem-value-properties.cm:author']`);
|
||||
titleProperty = $(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`);
|
||||
editIcon = $(`button[data-automation-id='meta-data-card-toggle-edit']`);
|
||||
informationButton = $(`button[data-automation-id='meta-data-card-toggle-expand']`);
|
||||
informationSpan = $(`span[data-automation-id='meta-data-card-toggle-expand-label']`);
|
||||
informationIcon = $(`span[data-automation-id='meta-data-card-toggle-expand-label'] ~ mat-icon`);
|
||||
displayEmptySwitch = $(`#adf-metadata-empty`);
|
||||
readonlySwitch = $(`#adf-metadata-readonly`);
|
||||
multiSwitch = $(`#adf-metadata-multi`);
|
||||
presetSwitch = $('#adf-toggle-custom-preset');
|
||||
defaultPropertiesSwitch = $('#adf-metadata-default-properties');
|
||||
closeButton = element(by.cssContainingText('button.mat-button span', 'Close'));
|
||||
displayAspect = element(by.css(`input[data-placeholder='Display Aspect']`));
|
||||
displayAspect = $(`input[data-placeholder='Display Aspect']`);
|
||||
applyAspect = element(by.cssContainingText(`button span.mat-button-wrapper`, 'Apply Aspect'));
|
||||
saveMetadataButton = element(by.css(`[data-automation-id='save-metadata']`));
|
||||
resetMetadataButton = element(by.css(`[data-automation-id='reset-metadata']`));
|
||||
saveMetadataButton = $(`[data-automation-id='save-metadata']`);
|
||||
resetMetadataButton = $(`[data-automation-id='reset-metadata']`);
|
||||
|
||||
private getMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> => $(`mat-expansion-panel[data-automation-id="adf-metadata-group-${groupName}"]`);
|
||||
private getExpandedMetadataGroupLocator = async (groupName: string): Promise<ElementFinder> => $(`mat-expansion-panel[data-automation-id="adf-metadata-group-${groupName}"] > mat-expansion-panel-header`);
|
||||
|
||||
async getTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.title);
|
||||
}
|
||||
|
||||
async getExpandedAspectName(): Promise<string> {
|
||||
return BrowserActions.getText(this.expandedAspect.element(this.aspectTitle));
|
||||
return BrowserActions.getText(this.expandedAspect.$(this.aspectTitle));
|
||||
}
|
||||
|
||||
async getName(): Promise<string> {
|
||||
@@ -138,79 +141,79 @@ export class MetadataViewPage {
|
||||
}
|
||||
|
||||
async editPropertyIconIsDisplayed(propertyName: string) {
|
||||
const editPropertyIcon = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon'));
|
||||
const editPropertyIcon = $('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon');
|
||||
await BrowserVisibility.waitUntilElementIsPresent(editPropertyIcon);
|
||||
}
|
||||
|
||||
async clickResetButton(): Promise<void> {
|
||||
const clearPropertyIcon = element(by.css('button[data-automation-id="reset-metadata"]'));
|
||||
const clearPropertyIcon = $('button[data-automation-id="reset-metadata"]');
|
||||
await BrowserActions.click(clearPropertyIcon);
|
||||
}
|
||||
|
||||
async enterPropertyText(propertyName: string, text: string | number): Promise<void> {
|
||||
const textField = element(by.css('input[data-automation-id="card-textitem-value-' + propertyName + '"]'));
|
||||
const textField = $('input[data-automation-id="card-textitem-value-' + propertyName + '"]');
|
||||
await BrowserActions.clearSendKeys(textField, text.toString());
|
||||
await textField.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async enterPresetText(text: string): Promise<void> {
|
||||
const presetField = element(by.css('input[data-automation-id="adf-text-custom-preset"]'));
|
||||
const presetField = $('input[data-automation-id="adf-text-custom-preset"]');
|
||||
await BrowserActions.clearSendKeys(presetField, text.toString());
|
||||
await presetField.sendKeys(protractor.Key.ENTER);
|
||||
const applyButton = element(by.css('button[id="adf-metadata-aplly"]'));
|
||||
const applyButton = $('button[id="adf-metadata-aplly"]');
|
||||
await BrowserActions.click(applyButton);
|
||||
}
|
||||
|
||||
async enterDescriptionText(text: string): Promise<void> {
|
||||
const textField = element(by.css('textarea[data-automation-id="card-textitem-value-properties.cm:description"]'));
|
||||
const textField = $('textarea[data-automation-id="card-textitem-value-properties.cm:description"]');
|
||||
await BrowserActions.clearSendKeys(textField, text);
|
||||
await textField.sendKeys(Key.TAB);
|
||||
}
|
||||
|
||||
async getPropertyText(propertyName: string, type?: string): Promise<string> {
|
||||
const propertyType = type || 'textitem';
|
||||
const textField = element(by.css('[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]'));
|
||||
const textField = $('[data-automation-id="card-' + propertyType + '-value-' + propertyName + '"]');
|
||||
|
||||
return BrowserActions.getInputValue(textField);
|
||||
}
|
||||
|
||||
async getPropertyIconTooltip(propertyName: string): Promise<string> {
|
||||
const editPropertyIcon = element(by.css('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon'));
|
||||
const editPropertyIcon = $('[data-automation-id="header-' + propertyName + '"] .adf-textitem-edit-icon');
|
||||
return BrowserActions.getAttribute(editPropertyIcon, 'title');
|
||||
}
|
||||
|
||||
async clickMetadataGroup(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
const group = await this.getMetadataGroupLocator(groupName);
|
||||
await BrowserActions.click(group);
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsPresent(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
const group = await this.getMetadataGroupLocator(groupName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(group);
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsNotPresent(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]'));
|
||||
const group = await this.getMetadataGroupLocator(groupName);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(group);
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsExpand(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
const group = await this.getExpandedMetadataGroupLocator(groupName);
|
||||
await expect(await BrowserActions.getAttribute(group, 'class')).toContain('mat-expanded');
|
||||
}
|
||||
|
||||
async checkMetadataGroupIsNotExpand(groupName: string): Promise<void> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header'));
|
||||
const group = await this.getExpandedMetadataGroupLocator(groupName);
|
||||
await expect(await BrowserActions.getAttribute(group, 'class')).not.toContain('mat-expanded');
|
||||
}
|
||||
|
||||
async getMetadataGroupTitle(groupName: string): Promise<string> {
|
||||
const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title'));
|
||||
const group = $('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title');
|
||||
return BrowserActions.getText(group);
|
||||
}
|
||||
|
||||
async checkPropertyIsVisible(propertyName: string, type: string): Promise<void> {
|
||||
const property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]'));
|
||||
const property = $('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(property);
|
||||
}
|
||||
|
||||
|
@@ -16,32 +16,34 @@
|
||||
*/
|
||||
|
||||
import { AppListCloudPage, BrowserActions, BrowserVisibility, Logger } from '@alfresco/adf-testing';
|
||||
import { browser, by, element, ElementFinder } from 'protractor';
|
||||
import { $, browser, ElementFinder } from 'protractor';
|
||||
import { ProcessServicesPage } from '../../process-services/pages/process-services.page';
|
||||
|
||||
export class NavigationBarPage {
|
||||
|
||||
linkListContainer = element(by.css('.app-sidenav-linklist'));
|
||||
linkMenuChildrenContainer = element(by.css('.nestedMenu'));
|
||||
dataTableNestedButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Datatable"]'));
|
||||
dataTableCopyContentButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Copy Content"]'));
|
||||
dataTableDragAndDropButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Drag and Drop"]'));
|
||||
processServicesNestedButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="App"]'));
|
||||
processServicesCloudHomeButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Home"]'));
|
||||
themeButton = element(by.css('button[data-automation-id="theme menu"]'));
|
||||
themeMenuContent = element(by.css('div[class*="mat-menu-panel"]'));
|
||||
appTitle = element(by.css('.adf-app-title'));
|
||||
menuButton = element(by.css('button[data-automation-id="adf-menu-icon"]'));
|
||||
formButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Form"]'));
|
||||
peopleGroupCloudButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="People/Group Cloud"]'));
|
||||
serviceTaskListButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Service Task List"]'));
|
||||
logoutSection: ElementFinder = element(by.css('div[data-automation-id="adf-logout-section"]'));
|
||||
personalFiles: ElementFinder = element(by.css('div [title="Personal Files"]'));
|
||||
linkListContainer = $('.app-sidenav-linklist');
|
||||
linkMenuChildrenContainer = $('.nestedMenu');
|
||||
dataTableNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Datatable"]');
|
||||
dataTableCopyContentButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Copy Content"]');
|
||||
dataTableDragAndDropButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Drag and Drop"]');
|
||||
processServicesNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="App"]');
|
||||
processServicesCloudHomeButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Home"]');
|
||||
themeButton = $('button[data-automation-id="theme menu"]');
|
||||
themeMenuContent = $('div[class*="mat-menu-panel"]');
|
||||
appTitle = $('.adf-app-title');
|
||||
menuButton = $('button[data-automation-id="adf-menu-icon"]');
|
||||
formButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Form"]');
|
||||
peopleGroupCloudButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="People/Group Cloud"]');
|
||||
serviceTaskListButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Service Task List"]');
|
||||
logoutSection = $('div[data-automation-id="adf-logout-section"]');
|
||||
personalFiles = $('div [title="Personal Files"]');
|
||||
|
||||
getMenuItemLocator = (title: string) => $(`.app-sidenav-link[data-automation-id="${title}"]`);
|
||||
|
||||
async clickNavigationBarItem(title: string, untilElementIsVisible?: ElementFinder): Promise<void> {
|
||||
Logger.log(`clickNavigationBarItem ${title}`);
|
||||
|
||||
const menu = element(by.css(`.app-sidenav-link[data-automation-id="${title}"]`));
|
||||
const menu = $(`.app-sidenav-link[data-automation-id="${title}"]`);
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
|
||||
if (untilElementIsVisible) {
|
||||
@@ -69,7 +71,7 @@ export class NavigationBarPage {
|
||||
|
||||
async clickProcessCloudButton() {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItem('Process Cloud'), this.linkMenuChildrenContainer);
|
||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItemLocator('Process Cloud'), this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToProcessServicesCloudPage(): Promise<AppListCloudPage> {
|
||||
@@ -99,11 +101,7 @@ export class NavigationBarPage {
|
||||
|
||||
private async clickProcessServicesButton() {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItem('Process Services'), this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
private getMenuItem(title: string) {
|
||||
return element(by.css(`.app-sidenav-link[data-automation-id="${title}"]`));
|
||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItemLocator('Process Services'), this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToProcessServicesPage(): Promise<ProcessServicesPage> {
|
||||
@@ -205,7 +203,7 @@ export class NavigationBarPage {
|
||||
}
|
||||
|
||||
async clickOnSpecificThemeButton(themeName): Promise<void> {
|
||||
const themeElement = element(by.css(`button[data-automation-id="${themeName}"]`));
|
||||
const themeElement = $(`button[data-automation-id="${themeName}"]`);
|
||||
await BrowserActions.click(themeElement);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
@@ -223,12 +221,12 @@ export class NavigationBarPage {
|
||||
}
|
||||
|
||||
async checkToolbarColor(color: string): Promise<void> {
|
||||
const toolbarColor = element(by.css(`mat-toolbar[class*="mat-${color}"]`));
|
||||
const toolbarColor = $(`mat-toolbar[class*="mat-${color}"]`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(toolbarColor);
|
||||
}
|
||||
|
||||
async clickAppLogo(logoTitle: string): Promise<void> {
|
||||
const appLogo = element(by.css('a[title="' + logoTitle + '"]'));
|
||||
const appLogo = $('a[title="' + logoTitle + '"]');
|
||||
await BrowserActions.click(appLogo);
|
||||
}
|
||||
|
||||
@@ -237,7 +235,7 @@ export class NavigationBarPage {
|
||||
}
|
||||
|
||||
async checkLogoTooltip(logoTooltipTitle: string): Promise<void> {
|
||||
const logoTooltip = element(by.css('a[title="' + logoTooltipTitle + '"]'));
|
||||
const logoTooltip = $('a[title="' + logoTooltipTitle + '"]');
|
||||
await BrowserVisibility.waitUntilElementIsVisible(logoTooltip);
|
||||
}
|
||||
|
||||
|
@@ -15,24 +15,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
import { element, by, browser, $, $$ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, DropdownPage, SnackbarPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class NotificationDemoPage {
|
||||
|
||||
snackbarPage = new SnackbarPage();
|
||||
|
||||
messageField = element(by.css('input[data-automation-id="notification-message"]'));
|
||||
durationField = element(by.css('input[data-automation-id="notification-duration"]'));
|
||||
actionToggle = element(by.css('mat-slide-toggle[data-automation-id="notification-action-toggle"]'));
|
||||
notificationSnackBar = element.all(by.css('simple-snack-bar')).first();
|
||||
actionOutput = element(by.css('div[data-automation-id="notification-action-output"]'));
|
||||
notificationsPage = element(by.css('.app-sidenav-link[data-automation-id="Notifications"]'));
|
||||
notificationConfig = element(by.css('p[data-automation-id="notification-custom-object"]'));
|
||||
messageField = $('input[data-automation-id="notification-message"]');
|
||||
durationField = $('input[data-automation-id="notification-duration"]');
|
||||
actionToggle = $('mat-slide-toggle[data-automation-id="notification-action-toggle"]');
|
||||
notificationSnackBar = $$('simple-snack-bar').first();
|
||||
actionOutput = $('div[data-automation-id="notification-action-output"]');
|
||||
notificationsPage = $('.app-sidenav-link[data-automation-id="Notifications"]');
|
||||
notificationConfig = $('p[data-automation-id="notification-custom-object"]');
|
||||
|
||||
horizontalPositionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-horizontal-position"]')));
|
||||
verticalPositionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-vertical-position"]')));
|
||||
directionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-direction"]')));
|
||||
horizontalPositionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-horizontal-position"]'));
|
||||
verticalPositionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-vertical-position"]'));
|
||||
directionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-direction"]'));
|
||||
|
||||
async checkNotifyContains(message): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('simple-snack-bar', message)).first());
|
||||
@@ -79,7 +79,7 @@ export class NotificationDemoPage {
|
||||
}
|
||||
|
||||
async clickNotificationButton(): Promise<void> {
|
||||
const button = element(by.css('button[data-automation-id="notification-custom-config-button"]'));
|
||||
const button = $('button[data-automation-id="notification-custom-config-button"]');
|
||||
await BrowserActions.click(button);
|
||||
}
|
||||
|
||||
|
@@ -16,19 +16,19 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
|
||||
import { Locator, element, by, browser } from 'protractor';
|
||||
import { browser, $$, $ } from 'protractor';
|
||||
|
||||
export class TrashcanPage {
|
||||
|
||||
contentList = new DocumentListPage(element(by.css('adf-document-list')));
|
||||
rows: Locator = by.css('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
||||
tableBody = element.all(by.css('adf-document-list .adf-datatable-body')).first();
|
||||
pagination = element(by.css('adf-pagination'));
|
||||
emptyTrashcan = element(by.css('adf-empty-content'));
|
||||
restoreButton = element(by.css(`button[title='Restore']`));
|
||||
contentList = new DocumentListPage($('adf-document-list'));
|
||||
rows = $$('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
||||
tableBody = $$('adf-document-list .adf-datatable-body').first();
|
||||
pagination = $('adf-pagination');
|
||||
emptyTrashcan = $('adf-empty-content');
|
||||
restoreButton = $(`button[title='Restore']`);
|
||||
|
||||
async numberOfResultsDisplayed(): Promise<number> {
|
||||
return element.all(this.rows).count();
|
||||
return this.rows.count();
|
||||
}
|
||||
|
||||
async waitForTableBody(): Promise<void> {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import * as path from 'path';
|
||||
import { BrowserActions, TestElement, TogglePage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { $, browser } from 'protractor';
|
||||
|
||||
export class VersionManagePage {
|
||||
|
||||
@@ -31,9 +31,9 @@ export class VersionManagePage {
|
||||
majorRadio = TestElement.byId('adf-new-version-major');
|
||||
minorRadio = TestElement.byId('adf-new-version-minor');
|
||||
commentText = TestElement.byId('adf-new-version-text-area');
|
||||
readOnlySwitch = element(by.id('adf-version-manager-switch-readonly'));
|
||||
downloadSwitch = element(by.id('adf-version-manager-switch-download'));
|
||||
commentsSwitch = element(by.id('adf-version-manager-switch-comments'));
|
||||
readOnlySwitch = $('#adf-version-manager-switch-readonly');
|
||||
downloadSwitch = $('#adf-version-manager-switch-download');
|
||||
commentsSwitch = $('#adf-version-manager-switch-comments');
|
||||
confirmAccept = TestElement.byId('adf-confirm-accept');
|
||||
confirmCancel = TestElement.byId('adf-confirm-cancel');
|
||||
|
||||
|
@@ -106,18 +106,14 @@ describe('Pagination - returns to previous page when current is empty', () => {
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
||||
|
||||
let list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
|
||||
|
||||
await paginationPage.clickOnNextPage();
|
||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||
|
||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
|
||||
list = await contentServicesPage.getAllRowsNameColumn();
|
||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(5, 6))).toEqual(true);
|
||||
|
||||
await contentServicesPage.deleteContent(lastFile);
|
||||
await contentServicesPage.checkContentIsNotDisplayed(lastFile);
|
||||
|
||||
|
@@ -25,7 +25,7 @@ import {
|
||||
TaskFormCloudComponent,
|
||||
StartProcessCloudPage, ProcessCloudWidgetPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksCloudDemoPage } from '.././pages/tasks-cloud-demo.page';
|
||||
@@ -96,11 +96,11 @@ describe('Task cloud visibility', async () => {
|
||||
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
|
||||
await taskFormCloudComponent.formFields().setFieldValue(by.id, 'Number1', '5');
|
||||
await taskFormCloudComponent.formFields().setFieldValue('Number1', '5');
|
||||
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Number2');
|
||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
||||
|
||||
await taskFormCloudComponent.formFields().setFieldValue(by.id, 'Number1', '123');
|
||||
await taskFormCloudComponent.formFields().setFieldValue('Number1', '123');
|
||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
||||
});
|
||||
@@ -125,15 +125,15 @@ describe('Task cloud visibility', async () => {
|
||||
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
|
||||
await taskFormCloudComponent.formFields().setFieldValue(by.id, 'Number1', '5');
|
||||
await taskFormCloudComponent.formFields().setFieldValue('Number1', '5');
|
||||
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Number2');
|
||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
||||
|
||||
await taskFormCloudComponent.formFields().setFieldValue(by.id, 'Number1', '123');
|
||||
await taskFormCloudComponent.formFields().setFieldValue('Number1', '123');
|
||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
||||
|
||||
await taskFormCloudComponent.formFields().setFieldValue(by.id, 'Number1', '4');
|
||||
await taskFormCloudComponent.formFields().setFieldValue('Number1', '4');
|
||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
||||
await taskFormCloudComponent.clickCompleteButton();
|
||||
});
|
||||
|
@@ -15,30 +15,30 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { by, element, $, $$ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class PeopleGroupCloudComponentPage {
|
||||
|
||||
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"]'));
|
||||
peopleCloudSingleSelectionChecked = $('mat-radio-button[data-automation-id="app-people-single-mode"][class*="mat-radio-checked"]');
|
||||
peopleCloudMultipleSelectionChecked = $('mat-radio-button[data-automation-id="app-people-multiple-mode"][class*="mat-radio-checked"]');
|
||||
peopleCloudSingleSelection = $('mat-radio-button[data-automation-id="app-people-single-mode"]');
|
||||
peopleCloudMultipleSelection = $('mat-radio-button[data-automation-id="app-people-multiple-mode"]');
|
||||
peopleCloudFilterRole = $('mat-radio-button[data-automation-id="app-people-filter-role"]');
|
||||
groupCloudSingleSelection = $('mat-radio-button[data-automation-id="app-group-single-mode"]');
|
||||
groupCloudMultipleSelection = $('mat-radio-button[data-automation-id="app-group-multiple-mode"]');
|
||||
groupCloudFilterRole = $('mat-radio-button[data-automation-id="app-group-filter-role"]');
|
||||
peopleRoleInput = $('input[data-automation-id="app-people-roles-input"]');
|
||||
peopleAppInput = $('input[data-automation-id="app-people-app-input"]');
|
||||
peoplePreselect = $('input[data-automation-id="app-people-preselect-input"]');
|
||||
groupRoleInput = $('input[data-automation-id="app-group-roles-input"]');
|
||||
groupAppInput = $('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"]'));
|
||||
preselectValidation = $$('mat-checkbox.app-preselect-value').first();
|
||||
preselectValidationStatus = $$('mat-checkbox.app-preselect-value label input').first();
|
||||
peopleFilterByAppName = $('.app-people-control-options mat-radio-button[value="appName"]');
|
||||
groupFilterByAppName = $('.app-groups-control-options mat-radio-button[value="appName"]');
|
||||
|
||||
async checkPeopleCloudComponentTitleIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudComponentTitle);
|
||||
|
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, EditProcessFilterCloudComponentPage, ProcessFiltersCloudComponentPage, ProcessListCloudComponentPage } from '@alfresco/adf-testing';
|
||||
import { by, element } from 'protractor';
|
||||
import { by, element, $ } from 'protractor';
|
||||
|
||||
export class ProcessCloudDemoPage {
|
||||
|
||||
createButton = element(by.css('button[data-automation-id="create-button"'));
|
||||
newProcessButton = element(by.css('button[data-automation-id="btn-start-process"]'));
|
||||
createButton = $('button[data-automation-id="create-button"');
|
||||
newProcessButton = $('button[data-automation-id="btn-start-process"]');
|
||||
|
||||
processListCloud = new ProcessListCloudComponentPage();
|
||||
editProcessFilterCloud = new EditProcessFilterCloudComponentPage();
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import {
|
||||
BrowserVisibility,
|
||||
BrowserActions,
|
||||
@@ -24,15 +24,15 @@ import {
|
||||
|
||||
export class ServiceTaskListPage {
|
||||
dataTableComponentPage = new DataTableComponentPage();
|
||||
allServiceTaskButton = element(by.css('button[data-automation-id="my-service-tasks_filter"]'));
|
||||
completedServiceTaskButton = element(by.css('button[data-automation-id="completed-tasks_filter"]'));
|
||||
errorServiceTaskButton = element(by.css('button[data-automation-id="errored-service-tasks_filter"]'));
|
||||
searchHeader = element(by.css('adf-cloud-edit-service-task-filter mat-expansion-panel-header'));
|
||||
serviceTaskList = element(by.css('adf-cloud-service-task-list'));
|
||||
activityNameField = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-activityName"]'));
|
||||
activityStatus = element(by.css('[data-automation-id="datatable-row-0"] div[aria-label="Status"]'));
|
||||
activityName = element(by.css('[data-automation-id="datatable-row-0"] div[aria-label="Activity name"]'));
|
||||
resultList = element(by.css('div[role="rowgroup"].adf-datatable-body'));
|
||||
allServiceTaskButton = $('button[data-automation-id="my-service-tasks_filter"]');
|
||||
completedServiceTaskButton = $('button[data-automation-id="completed-tasks_filter"]');
|
||||
errorServiceTaskButton = $('button[data-automation-id="errored-service-tasks_filter"]');
|
||||
searchHeader = $('adf-cloud-edit-service-task-filter mat-expansion-panel-header');
|
||||
serviceTaskList = $('adf-cloud-service-task-list');
|
||||
activityNameField = $('input[data-automation-id="adf-cloud-edit-task-property-activityName"]');
|
||||
activityStatus = $('[data-automation-id="datatable-row-0"] div[aria-label="Status"]');
|
||||
activityName = $('[data-automation-id="datatable-row-0"] div[aria-label="Activity name"]');
|
||||
resultList = $('div[role="rowgroup"].adf-datatable-body');
|
||||
|
||||
async checkServiceTaskFiltersDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.allServiceTaskButton);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
import { element, by, browser, $ } from 'protractor';
|
||||
import {
|
||||
TogglePage,
|
||||
TaskFiltersCloudComponentPage,
|
||||
@@ -30,12 +30,12 @@ export class TasksCloudDemoPage {
|
||||
newTaskButton = TestElement.byCss('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"]'));
|
||||
displayTaskDetailsToggle = $('mat-slide-toggle[data-automation-id="taskDetailsRedirection"]');
|
||||
displayProcessDetailsToggle = $('mat-slide-toggle[data-automation-id="processDetailsRedirection"]');
|
||||
actionMenuToggle = $('mat-slide-toggle[data-automation-id="actionmenu"]');
|
||||
contextMenuToggle = $('mat-slide-toggle[data-automation-id="contextmenu"]');
|
||||
multiSelectionToggle = $('mat-slide-toggle[data-automation-id="multiSelection"]');
|
||||
testingModeToggle = $('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'));
|
||||
@@ -46,7 +46,7 @@ export class TasksCloudDemoPage {
|
||||
disableCheckbox = TestElement.byCss(`mat-checkbox[formcontrolname='disabled']`);
|
||||
visibleCheckbox = TestElement.byCss(`mat-checkbox[formcontrolname='visible']`);
|
||||
spinner = TestElement.byTag('mat-progress-spinner');
|
||||
modeDropdown = new DropdownPage(element(by.css('mat-form-field[data-automation-id="selectionMode"]')));
|
||||
modeDropdown = new DropdownPage($('mat-form-field[data-automation-id="selectionMode"]'));
|
||||
|
||||
togglePage = new TogglePage();
|
||||
|
||||
|
@@ -128,7 +128,6 @@ describe('Process Task - Attach content file', () => {
|
||||
|
||||
await processList.checkContentIsDisplayedById(processInstance.entry.id);
|
||||
await processList.selectRowById(processInstance.entry.id);
|
||||
|
||||
await taskList.checkTaskListIsLoaded();
|
||||
await taskList.selectRow(taskName);
|
||||
|
||||
|
@@ -44,7 +44,6 @@ describe('Task filters cloud', () => {
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
const editTaskFilter = tasksCloudDemoPage.editTaskFilterCloud;
|
||||
const taskList = new TaskListCloudComponentPage();
|
||||
|
||||
const apiService = createApiService();
|
||||
const identityService = new IdentityService(apiService);
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
|
@@ -23,7 +23,7 @@ import { createApiService,
|
||||
TaskUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AttachFormPage } from './../pages/attach-form.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
@@ -126,7 +126,7 @@ describe('Attach Form Component', () => {
|
||||
await attachFormPage.selectAttachFormOption(testNames.formName);
|
||||
await attachFormPage.clickAttachFormButton();
|
||||
|
||||
await formFields.setFieldValue(by.id, formTextField, testNames.formFieldValue);
|
||||
await formFields.setFieldValue(formTextField, testNames.formFieldValue);
|
||||
await formFields.completeForm();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
|
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor } from 'protractor';
|
||||
import { element, by, protractor, $ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class AnalyticsPage {
|
||||
|
||||
toolbarTitleInput = element(by.css('input[data-automation-id="reportName"]'));
|
||||
toolbarTitleContainer = element(by.css('adf-toolbar-title'));
|
||||
toolbarTitleInput = $('input[data-automation-id="reportName"]');
|
||||
toolbarTitleContainer = $('adf-toolbar-title');
|
||||
toolbarTitle = element(by.xpath('//mat-toolbar/adf-toolbar-title/div/h4'));
|
||||
reportMessage = element(by.css('div[class="ng-star-inserted"] span'));
|
||||
reportMessage = $('div[class="ng-star-inserted"] span');
|
||||
|
||||
async getReport(title: string): Promise<void> {
|
||||
const reportTitle = element(by.css(`mat-icon[data-automation-id="${title}_filter"]`));
|
||||
const reportTitle = $(`mat-icon[data-automation-id="${title}_filter"]`);
|
||||
await BrowserActions.click(reportTitle);
|
||||
}
|
||||
|
||||
|
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class AttachFormPage {
|
||||
|
||||
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'));
|
||||
attachFormDropdown = new DropdownPage(element(by.css('.adf-attach-form-row')));
|
||||
noFormMessage = $('.adf-empty-content__title');
|
||||
attachFormButton = $('#adf-attach-form-attach-button');
|
||||
completeButton = $('#adf-attach-form-complete-button');
|
||||
formDropdown = $('#form_id');
|
||||
cancelButton = $('#adf-attach-form-cancel-button');
|
||||
defaultTitle = $('.mat-card-title');
|
||||
attachFormDropdown = new DropdownPage($('.adf-attach-form-row'));
|
||||
|
||||
async checkNoFormMessageIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.noFormMessage);
|
||||
@@ -70,6 +70,6 @@ export class AttachFormPage {
|
||||
}
|
||||
|
||||
async checkAttachFormButtonIsDisabled(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css('button[id="adf-attach-form-attach-button"][disabled]')));
|
||||
await BrowserVisibility.waitUntilElementIsVisible($('button[id="adf-attach-form-attach-button"][disabled]'));
|
||||
}
|
||||
}
|
||||
|
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
import { protractor, browser, $, $$ } from 'protractor';
|
||||
import * as path from 'path';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class AttachmentListPage {
|
||||
|
||||
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']"));
|
||||
attachFileButton = $("input[type='file']");
|
||||
buttonMenu = $("button[data-automation-id='action_menu_0']");
|
||||
viewButton = $("button[data-automation-id*='MENU_ACTIONS.VIEW_CONTENT']");
|
||||
removeButton = $("button[data-automation-id*='MENU_ACTIONS.REMOVE_CONTENT']");
|
||||
downloadButton = $("button[data-automation-id*='MENU_ACTIONS.DOWNLOAD_CONTENT']");
|
||||
noContentContainer = $("div[class*='adf-no-content-container']");
|
||||
|
||||
async checkEmptyAttachmentList(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.noContentContainer);
|
||||
@@ -39,7 +39,7 @@ export class AttachmentListPage {
|
||||
}
|
||||
|
||||
async checkFileIsAttached(name: string): Promise<void> {
|
||||
const fileAttached = element.all(by.css('div[data-automation-id="' + name + '"]')).first();
|
||||
const fileAttached = $$('div[data-automation-id="' + name + '"]').first();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ export class AttachmentListPage {
|
||||
|
||||
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($$('div[data-automation-id="' + name + '"]').first());
|
||||
await BrowserActions.click(this.buttonMenu);
|
||||
await browser.sleep(500);
|
||||
await BrowserActions.click(this.viewButton);
|
||||
@@ -58,7 +58,7 @@ export class AttachmentListPage {
|
||||
|
||||
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($$('div[data-automation-id="' + name + '"]').first());
|
||||
await BrowserActions.click(this.buttonMenu);
|
||||
await browser.sleep(500);
|
||||
await BrowserActions.click(this.removeButton);
|
||||
@@ -67,7 +67,7 @@ export class AttachmentListPage {
|
||||
|
||||
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($$('div[data-automation-id="' + name + '"]').first());
|
||||
await BrowserActions.click(this.buttonMenu);
|
||||
await browser.sleep(500);
|
||||
await BrowserActions.click(this.downloadButton);
|
||||
@@ -75,14 +75,14 @@ export class AttachmentListPage {
|
||||
|
||||
async doubleClickFile(name: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.css(`div[data-automation-id="${name}"]`)).first());
|
||||
const fileAttached = element.all(by.css(`div[data-automation-id="${name}"]`)).first();
|
||||
await BrowserVisibility.waitUntilElementIsVisible($$(`div[data-automation-id="${name}"]`).first());
|
||||
const fileAttached = $$(`div[data-automation-id="${name}"]`).first();
|
||||
await BrowserActions.click(fileAttached);
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
}
|
||||
|
||||
async checkFileIsRemoved(name: string): Promise<void> {
|
||||
const fileAttached = element.all(by.css(`div[data-automation-id="${name}"]`)).first();
|
||||
const fileAttached = $$(`div[data-automation-id="${name}"]`).first();
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(fileAttached);
|
||||
}
|
||||
|
||||
|
@@ -16,15 +16,15 @@
|
||||
*/
|
||||
|
||||
import { TogglePage } from '@alfresco/adf-testing';
|
||||
import { element, by } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
|
||||
export class AppSettingsTogglesPage {
|
||||
|
||||
togglePage = new TogglePage();
|
||||
|
||||
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'));
|
||||
showDetailsHeaderToggle = $('#adf-show-header');
|
||||
showTaskFilterIconsToggle = $('#adf-show-task-filter-icon');
|
||||
showProcessFilterIconsToggle = $('#adf-show-process-filter-icon');
|
||||
|
||||
async enableShowHeader(): Promise<void> {
|
||||
await this.togglePage.enableToggle(this.showDetailsHeaderToggle);
|
||||
|
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class ChecklistDialog {
|
||||
|
||||
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'));
|
||||
nameField = $('input[data-automation-id="checklist-name"]');
|
||||
addChecklistButton = $('button[id="add-check"] span');
|
||||
closeButton = $('button[id="close-check-dialog"] span');
|
||||
dialogTitle = $('#add-checklist-title');
|
||||
|
||||
async addName(name: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.nameField, name);
|
||||
|
@@ -15,20 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, Key, ElementFinder } from 'protractor';
|
||||
import { element, by, Key, ElementFinder, $ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-testing';
|
||||
|
||||
export class StartTaskDialogPage {
|
||||
|
||||
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"]'));
|
||||
name = $('input[id="name_id"]');
|
||||
dueDate = $('input[id="date_id"]');
|
||||
description = $('textarea[id="description_id"]');
|
||||
assignee = $('div#people-widget-content input');
|
||||
startButton = $('button[id="button-start"]');
|
||||
startButtonEnabled = $('button[id="button-start"]:not(disabled)');
|
||||
cancelButton = $('button[id="button-cancel"]');
|
||||
|
||||
selectFormDropdown = new DropdownPage(element(by.css('mat-select[id="form_id"]')));
|
||||
selectFormDropdown = new DropdownPage($('mat-select[id="form_id"]'));
|
||||
selectAssigneeDropdown = new DropdownPage();
|
||||
|
||||
async addName(userName: string): Promise<void> {
|
||||
@@ -74,7 +74,7 @@ export class StartTaskDialogPage {
|
||||
}
|
||||
|
||||
async checkStartButtonIsDisabled(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css('button[id="button-start"]:disabled')));
|
||||
await BrowserVisibility.waitUntilElementIsVisible($('button[id="button-start"]:disabled'));
|
||||
}
|
||||
|
||||
async clickCancelButton(): Promise<void> {
|
||||
|
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { by, element } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
|
||||
export class FiltersPage {
|
||||
|
||||
activeFilter = element(by.css('.adf-active'));
|
||||
activeFilter = $('.adf-active');
|
||||
dataTable: DataTableComponentPage = new DataTableComponentPage();
|
||||
|
||||
async getActiveFilter(): Promise<string> {
|
||||
@@ -29,7 +29,7 @@ export class FiltersPage {
|
||||
|
||||
async goToFilter(filterName): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const filter = element(by.css(`button[data-automation-id="${filterName}_filter"]`));
|
||||
const filter = $(`button[data-automation-id="${filterName}_filter"]`);
|
||||
await BrowserActions.click(filter);
|
||||
await this.dataTable.waitTillContentLoaded();
|
||||
}
|
||||
@@ -43,7 +43,7 @@ export class FiltersPage {
|
||||
}
|
||||
|
||||
async checkFilterIsHighlighted(filterName: string): Promise<void> {
|
||||
const highlightedFilter = element(by.css(`.adf-active [data-automation-id='${filterName}_filter']`));
|
||||
const highlightedFilter = $(`.adf-active [data-automation-id='${filterName}_filter']`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(highlightedFilter);
|
||||
}
|
||||
}
|
||||
|
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, ConfigEditorPage } from '@alfresco/adf-testing';
|
||||
import { by, element } from 'protractor';
|
||||
import { $$, $ } from 'protractor';
|
||||
|
||||
export class FormDemoPage {
|
||||
|
||||
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);
|
||||
formCloudEditor = $$('.mat-tab-list .mat-tab-label').get(1);
|
||||
formCloudRender = $$('.mat-tab-list .mat-tab-label').get(0);
|
||||
|
||||
configEditorPage = new ConfigEditorPage();
|
||||
|
||||
@@ -34,8 +34,8 @@ export class FormDemoPage {
|
||||
}
|
||||
|
||||
async setConfigToEditor(text: string): Promise<void> {
|
||||
const configEditor = element(by.id('adf-form-config-editor'));
|
||||
const form = element(by.css('adf-form'));
|
||||
const configEditor = $('#adf-form-config-editor');
|
||||
const form = $('adf-form');
|
||||
await this.goToEditor();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(configEditor);
|
||||
await this.configEditorPage.enterBulkConfiguration(text);
|
||||
|
@@ -16,25 +16,23 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, StartProcessPage } from '@alfresco/adf-testing';
|
||||
import { Locator, by, element } from 'protractor';
|
||||
import { $, $$ } from 'protractor';
|
||||
|
||||
export class ProcessFiltersPage {
|
||||
|
||||
dataTable = new DataTableComponentPage();
|
||||
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.id('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('.adf-empty-content__title')).first();
|
||||
rows: Locator = by.css('adf-process-instance-list .adf-datatable-body adf-datatable-row[class*="adf-datatable-row"]');
|
||||
tableBody = element.all(by.css('adf-datatable .adf-datatable-body')).first();
|
||||
nameColumn: Locator = by.css('div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"] div[title="Name"] span');
|
||||
processIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]');
|
||||
startProcessEl = element(by.css('adf-start-process .adf-start-process'));
|
||||
createProcessButton = $('.app-processes-menu button[data-automation-id="create-button"] > span');
|
||||
newProcessButton = $('div > button[data-automation-id="btn-start-process"]');
|
||||
processesPage = $('#app-processes-menu');
|
||||
accordionMenu = $('.app-processes-menu mat-accordion');
|
||||
buttonWindow = $('div > button[data-automation-id="btn-start-process"] > div');
|
||||
noContentMessage = $$('.adf-empty-content__title').first();
|
||||
rows = $$('adf-process-instance-list .adf-datatable-body adf-datatable-row[class*="adf-datatable-row"]');
|
||||
tableBody = $$('adf-datatable .adf-datatable-body').first();
|
||||
processIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
|
||||
startProcessEl = $('adf-start-process .adf-start-process');
|
||||
|
||||
getButtonFilterLocatorByName = (name: string) => $(`button[data-automation-id='${name}_filter']`);
|
||||
|
||||
async startProcess(): Promise<StartProcessPage> {
|
||||
await this.clickCreateProcessButton();
|
||||
@@ -43,17 +41,19 @@ export class ProcessFiltersPage {
|
||||
}
|
||||
|
||||
async clickRunningFilterButton(): Promise<void> {
|
||||
await BrowserActions.click(this.runningFilter);
|
||||
await BrowserActions.click(await this.getButtonFilterLocatorByName('Running'));
|
||||
}
|
||||
|
||||
async clickCompletedFilterButton(): Promise<void> {
|
||||
await BrowserActions.click(this.completedFilter);
|
||||
await expect(await this.completedFilter.isEnabled()).toBe(true);
|
||||
const completedFilterButtonLocator = await this.getButtonFilterLocatorByName('Completed');
|
||||
await BrowserActions.click(completedFilterButtonLocator);
|
||||
await expect(await completedFilterButtonLocator.isEnabled()).toBe(true);
|
||||
}
|
||||
|
||||
async clickAllFilterButton(): Promise<void> {
|
||||
await BrowserActions.click(this.allFilter);
|
||||
await expect(await this.allFilter.isEnabled()).toBe(true);
|
||||
const allFilterButtonLocator = await this.getButtonFilterLocatorByName('All');
|
||||
await BrowserActions.click(allFilterButtonLocator);
|
||||
await expect(await allFilterButtonLocator.isEnabled()).toBe(true);
|
||||
}
|
||||
|
||||
async clickCreateProcessButton(): Promise<void> {
|
||||
@@ -78,18 +78,18 @@ export class ProcessFiltersPage {
|
||||
|
||||
async selectFromProcessList(title: string): Promise<void> {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
const processName = element.all(by.css(`div[data-automation-id="text_${title}"]`)).first();
|
||||
const processName = $$(`div[data-automation-id="text_${title}"]`).first();
|
||||
await BrowserActions.click(processName);
|
||||
}
|
||||
|
||||
async checkFilterIsHighlighted(filterName: string): Promise<void> {
|
||||
const processNameHighlighted = element(by.css(`adf-process-instance-filters .adf-active button[data-automation-id='${filterName}_filter']`));
|
||||
const processNameHighlighted = $(`adf-process-instance-filters .adf-active button[data-automation-id='${filterName}_filter']`);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(processNameHighlighted);
|
||||
}
|
||||
|
||||
async numberOfProcessRows(): Promise<number> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(this.rows).first());
|
||||
return element.all(this.rows).count();
|
||||
await BrowserVisibility.waitUntilElementIsVisible(await this.rows.first());
|
||||
return this.rows.count();
|
||||
}
|
||||
|
||||
async waitForTableBody(): Promise<void> {
|
||||
@@ -110,25 +110,25 @@ export class ProcessFiltersPage {
|
||||
}
|
||||
|
||||
async checkFilterIsDisplayed(name: string): Promise<void> {
|
||||
const filterName = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
const filterName = await this.getButtonFilterLocatorByName(name);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||
}
|
||||
|
||||
async checkFilterHasNoIcon(name: string): Promise<void> {
|
||||
const filterName = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
const filterName = await this.getButtonFilterLocatorByName(name);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(filterName.element(this.processIcon));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(filterName.$(this.processIcon));
|
||||
}
|
||||
|
||||
async getFilterIcon(name: string): Promise<string> {
|
||||
const filterName = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
const filterName = await this.getButtonFilterLocatorByName(name);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||
const icon = filterName.element(this.processIcon);
|
||||
const icon = filterName.$(this.processIcon);
|
||||
return BrowserActions.getText(icon);
|
||||
}
|
||||
|
||||
async checkFilterIsNotDisplayed(name: string): Promise<void> {
|
||||
const filterName = element(by.css(`button[data-automation-id='${name}_filter']`));
|
||||
const filterName = await this.getButtonFilterLocatorByName(name);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(filterName);
|
||||
}
|
||||
|
||||
|
@@ -16,18 +16,18 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { by, element, protractor } from 'protractor';
|
||||
import { $, by, element, protractor } from 'protractor';
|
||||
|
||||
export class ProcessListDemoPage {
|
||||
|
||||
appIdInput = element(by.css('input[data-automation-id="app-id"]'));
|
||||
appIdInput = $('input[data-automation-id="app-id"]');
|
||||
resetButton = element(by.cssContainingText('button span', 'Reset'));
|
||||
emptyProcessContent = element(by.css('.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"]'));
|
||||
emptyProcessContent = $('.adf-empty-content');
|
||||
processDefinitionInput = $('input[data-automation-id="process-definition-id"]');
|
||||
processInstanceInput = $('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"')));
|
||||
stateDropdown = new DropdownPage($('mat-select[data-automation-id="state"'));
|
||||
sortDropdown = new DropdownPage($('mat-select[data-automation-id="sort"'));
|
||||
|
||||
dataTable = new DataTableComponentPage();
|
||||
|
||||
|
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { element, by } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
|
||||
export class ProcessListPage {
|
||||
|
||||
processListTitle = element(by.css('.adf-empty-content__title'));
|
||||
processInstanceList = element(by.css('adf-process-instance-list'));
|
||||
processListTitle = $('.adf-empty-content__title');
|
||||
processInstanceList = $('adf-process-instance-list');
|
||||
|
||||
getDisplayedProcessListTitle(): Promise<string> {
|
||||
return BrowserActions.getText(this.processListTitle);
|
||||
|
@@ -17,23 +17,24 @@
|
||||
|
||||
import { ProcessServiceTabBarPage } from './process-service-tab-bar.page';
|
||||
|
||||
import { Locator, element, by, browser } from 'protractor';
|
||||
import { browser, $, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './tasks.page';
|
||||
|
||||
export class ProcessServicesPage {
|
||||
|
||||
apsAppsContainer = element(by.css('.adf-app-listgrid'));
|
||||
taskApp = element(by.css('mat-card[title="Task App"]'));
|
||||
iconTypeLocator: Locator = by.css('mat-icon[class*="card-logo-icon"]');
|
||||
descriptionLocator: Locator = by.css('mat-card-subtitle[class*="subtitle"]');
|
||||
apsAppsContainer = $('.adf-app-listgrid');
|
||||
iconTypeLocator = 'mat-icon[class*="card-logo-icon"]';
|
||||
descriptionLocator = 'mat-card-subtitle[class*="subtitle"]';
|
||||
|
||||
getApplicationNameLocator = (name: string): ElementFinder => $(`mat-card[title="${name}"]`);
|
||||
|
||||
async checkApsContainer(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.apsAppsContainer);
|
||||
}
|
||||
|
||||
async goToApp(applicationName: string): Promise<ProcessServiceTabBarPage> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
const app = this.getApplicationNameLocator(applicationName);
|
||||
await BrowserActions.click(app);
|
||||
const taskPage = new TasksPage();
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
@@ -41,7 +42,8 @@ export class ProcessServicesPage {
|
||||
}
|
||||
|
||||
async goToTaskApp(): Promise<ProcessServiceTabBarPage> {
|
||||
await BrowserActions.click(this.taskApp);
|
||||
const taskAppLocator = this.getApplicationNameLocator('Task App');
|
||||
await BrowserActions.click(taskAppLocator);
|
||||
return new ProcessServiceTabBarPage();
|
||||
}
|
||||
|
||||
@@ -53,32 +55,32 @@ export class ProcessServicesPage {
|
||||
}
|
||||
|
||||
async getAppIconType(applicationName: string): Promise<string> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
const app = this.getApplicationNameLocator(applicationName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
const iconType = app.element(this.iconTypeLocator);
|
||||
const iconType = await app.$(this.iconTypeLocator);
|
||||
return BrowserActions.getText(iconType);
|
||||
}
|
||||
|
||||
async getBackgroundColor(applicationName: string): Promise<string> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
const app = this.getApplicationNameLocator(applicationName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
return app.getCssValue('background-color');
|
||||
}
|
||||
|
||||
async getDescription(applicationName: string): Promise<string> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
const app = this.getApplicationNameLocator(applicationName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
const description = app.element(this.descriptionLocator);
|
||||
const description = await app.$(this.descriptionLocator);
|
||||
return BrowserActions.getText(description);
|
||||
}
|
||||
|
||||
async checkAppIsNotDisplayed(applicationName: string): Promise<void> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
const app = this.getApplicationNameLocator(applicationName);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(app);
|
||||
}
|
||||
|
||||
async checkAppIsDisplayed(applicationName: string): Promise<void> {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
const app = this.getApplicationNameLocator(applicationName);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
}
|
||||
}
|
||||
|
@@ -16,73 +16,73 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DropdownPage, TabsPage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element, 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 = element(by.css('adf-form'));
|
||||
formContent = $('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"]'));
|
||||
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"]'));
|
||||
formNameField = $('[data-automation-id="card-textitem-value-formName"]');
|
||||
formNameButton = $('[data-automation-id="card-textitem-toggle-formName"]');
|
||||
assigneeField = $('[data-automation-id="card-textitem-value-assignee"]');
|
||||
assigneeButton = $('[data-automation-id="card-textitem-toggle-assignee"]');
|
||||
statusField = $('[data-automation-id="card-textitem-value-status"]');
|
||||
categoryField = $('[data-automation-id="card-textitem-value-category"] ');
|
||||
parentNameField = $('span[data-automation-id*="parentName"] span');
|
||||
parentTaskIdField = $('[data-automation-id="card-textitem-value-parentTaskId"] ');
|
||||
durationField = $('[data-automation-id="card-textitem-value-duration"] ');
|
||||
endDateField = $$('span[data-automation-id*="endDate"] span').first();
|
||||
createdField = $('span[data-automation-id="card-dateitem-created"]');
|
||||
idField = $$('[data-automation-id="card-textitem-value-id"]').first();
|
||||
descriptionField = $('[data-automation-id="card-textitem-value-description"]');
|
||||
dueDateField = $$('span[data-automation-id*="dueDate"] span').first();
|
||||
activitiesTitle = $('div[class*="adf-info-drawer-layout-header-title"] div');
|
||||
commentField = $('#comment-input');
|
||||
addCommentButton = $('[data-automation-id="comments-input-add"]');
|
||||
involvePeopleButton = $('div[class*="add-people"]');
|
||||
addPeopleField = $('input[data-automation-id="adf-people-search-input"]');
|
||||
addInvolvedUserButton = $('button[id="add-people"]');
|
||||
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('.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('.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('.adf-form-title'));
|
||||
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"]'));
|
||||
saveFormButton = element(by.css('button[id="adf-form-save"]'));
|
||||
taskDetailsSection = $('div[data-automation-id="app-tasks-details"]');
|
||||
taskDetailsEmptySection = $('div[data-automation-id="adf-tasks-details--empty"]');
|
||||
completeTask = $('button[id="adf-no-form-complete-button"]');
|
||||
completeFormTask = $('button[id="adf-form-complete"]');
|
||||
taskDetailsTitle = $('.adf-activiti-task-details__header span');
|
||||
auditLogButton = $('button[adf-task-audit]');
|
||||
noPeopleInvolved = $('#no-people-label');
|
||||
cancelInvolvePeopleButton = $('#close-people-search');
|
||||
involvePeopleHeader = $('.adf-search-text-header');
|
||||
removeInvolvedPeople = $('button[data-automation-id="Remove"]');
|
||||
peopleTitle = $('#people-title');
|
||||
noFormMessage = $('span[id*="no-form-message"]');
|
||||
cancelAttachForm = $('#adf-no-form-cancel-button');
|
||||
attachFormButton = $('#adf-no-form-attach-form-button');
|
||||
disabledAttachFormButton = $('button[id="adf-no-form-attach-form-button"][disabled]');
|
||||
removeAttachForm = $('#adf-attach-form-remove-button');
|
||||
attachFormName = $('.adf-form-title');
|
||||
emptyTaskDetails = $('adf-task-details > div > div');
|
||||
priority = $('[data-automation-id*="card-textitem-value-priority"]');
|
||||
editableAssignee = $('[data-automation-id="card-textitem-value-assignee"][class*="clickable"]');
|
||||
claimElement = $('[data-automation-id="header-claim-button"]');
|
||||
releaseElement = $('[data-automation-id="header-unclaim-button"]');
|
||||
saveFormButton = $('button[id="adf-form-save"]');
|
||||
|
||||
attachFormDropdown = new DropdownPage(element(by.css('.adf-attach-form-row')));
|
||||
attachFormDropdown = new DropdownPage($('.adf-attach-form-row'));
|
||||
|
||||
async checkEditableAssigneeIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.editableAssignee);
|
||||
}
|
||||
|
||||
async checkEditableFormIsNotDisplayed(): Promise<void> {
|
||||
const editableForm = element(by.css('[data-automation-id="card-textitem-value-formName"][class*="clickable"]'));
|
||||
const editableForm = $('[data-automation-id="card-textitem-value-formName"][class*="clickable"]');
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(editableForm);
|
||||
}
|
||||
|
||||
async checkDueDatePickerButtonIsNotDisplayed(): Promise<void> {
|
||||
const dueDatePickerButton = element(by.css('mat-datetimepicker-toggle[data-automation-id="datepickertoggle-dueDate"]'));
|
||||
const dueDatePickerButton = $('mat-datetimepicker-toggle[data-automation-id="datepickertoggle-dueDate"]');
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(dueDatePickerButton);
|
||||
}
|
||||
|
||||
@@ -219,33 +219,33 @@ export class TaskDetailsPage {
|
||||
async updatePriority(priority?: string): Promise<void> {
|
||||
await BrowserActions.click(this.priority);
|
||||
await BrowserActions.clearWithBackSpace(this.priority);
|
||||
await BrowserActions.clearSendKeys(element(by.css('input[data-automation-id="card-textitem-value-priority"]')), priority, 500);
|
||||
await BrowserActions.clearSendKeys($('input[data-automation-id="card-textitem-value-priority"]'), priority, 500);
|
||||
await this.priority.sendKeys(Key.TAB);
|
||||
await browser.sleep(1000);
|
||||
}
|
||||
|
||||
async updateDueDate(): Promise<void> {
|
||||
await BrowserActions.click(this.dueDateField);
|
||||
await BrowserActions.click(element.all(by.css('.mat-datetimepicker-calendar-body-cell')).first());
|
||||
await BrowserActions.click($$('.mat-datetimepicker-calendar-body-cell').first());
|
||||
await browser.sleep(1000);
|
||||
}
|
||||
|
||||
async updateDescription(description?: string): Promise<void> {
|
||||
await BrowserActions.click(this.descriptionField);
|
||||
await BrowserActions.clearWithBackSpace(this.descriptionField);
|
||||
await BrowserActions.clearSendKeys(element(by.css('[data-automation-id="card-textitem-value-description"]')), description ? description : '');
|
||||
await BrowserActions.clearSendKeys($('[data-automation-id="card-textitem-value-description"]'), description ? description : '');
|
||||
await this.descriptionField.sendKeys(Key.TAB);
|
||||
await browser.sleep(1000);
|
||||
}
|
||||
|
||||
async updateAssignee(fullName: string): Promise<void> {
|
||||
await BrowserActions.click(this.assigneeButton);
|
||||
await BrowserActions.clearSendKeys(element(by.css('[id="userSearchText"]')), fullName);
|
||||
await BrowserActions.clearSendKeys($('[id="userSearchText"]'), fullName);
|
||||
await BrowserActions.click(element(by.cssContainingText('.adf-people-full-name', fullName)));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`adf-datatable-row[class*='is-selected']`)));
|
||||
await BrowserVisibility.waitUntilElementIsVisible($(`adf-datatable-row[class*='is-selected']`));
|
||||
|
||||
await browser.sleep(2000);
|
||||
await BrowserActions.click(element(by.css('button[id="add-people"]')));
|
||||
await BrowserActions.click($('button[id="add-people"]'));
|
||||
}
|
||||
|
||||
getTitle(): Promise<string> {
|
||||
@@ -304,19 +304,19 @@ export class TaskDetailsPage {
|
||||
}
|
||||
|
||||
getRowsUser(user: string) {
|
||||
return element(by.css(`div[data-automation-id="adf-people-full-name-${user.replace(' ', '-')}"]`));
|
||||
return $(`div[data-automation-id="adf-people-full-name-${user.replace(' ', '-')}"]`);
|
||||
}
|
||||
|
||||
async removeInvolvedUser(user): Promise<void> {
|
||||
const row = this.getRowsUser(user).element(by.xpath('ancestor::adf-datatable-row[contains(@class, "adf-datatable-row")]'));
|
||||
await BrowserActions.click(row.element(by.css('button[data-automation-id="action_menu_0"]')));
|
||||
await BrowserActions.click(row.$('button[data-automation-id="action_menu_0"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.removeInvolvedPeople);
|
||||
await BrowserActions.click(this.removeInvolvedPeople);
|
||||
|
||||
}
|
||||
|
||||
async getInvolvedUserEmail(user): Promise<string> {
|
||||
return BrowserActions.getText(element(by.css(`div[data-automation-id="adf-people-email-${user.replace(' ', '-')}"]`)));
|
||||
return BrowserActions.getText($(`div[data-automation-id="adf-people-email-${user.replace(' ', '-')}"]`));
|
||||
}
|
||||
|
||||
async clickAuditLogButton(): Promise<void> {
|
||||
|
@@ -16,16 +16,16 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions } from '@alfresco/adf-testing';
|
||||
import { element, by } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { TaskFiltersPage } from './task-filters.page';
|
||||
|
||||
export class TaskFiltersDemoPage {
|
||||
|
||||
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'));
|
||||
myTasks = $('button[data-automation-id="My Tasks_filter"]');
|
||||
queuedTask = $('button[data-automation-id="Queued Tasks_filter"]');
|
||||
completedTask = $('button[data-automation-id="Completed Tasks_filter"]');
|
||||
involvedTask = $('button[data-automation-id="Involved Tasks_filter"]');
|
||||
activeFilter = $('adf-task-filters .adf-active');
|
||||
|
||||
myTasksFilter(): TaskFiltersPage {
|
||||
return new TaskFiltersPage(this.myTasks);
|
||||
@@ -44,7 +44,7 @@ export class TaskFiltersDemoPage {
|
||||
}
|
||||
|
||||
customTaskFilter(filterName: string): TaskFiltersPage {
|
||||
return new TaskFiltersPage(element(by.css(`button[data-automation-id="${filterName}_filter"]`)));
|
||||
return new TaskFiltersPage($(`button[data-automation-id="${filterName}_filter"]`));
|
||||
}
|
||||
|
||||
async checkActiveFilterActive(): Promise<string> {
|
||||
|
@@ -15,13 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Locator, by, ElementFinder } from 'protractor';
|
||||
import { ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
export class TaskFiltersPage {
|
||||
|
||||
filter;
|
||||
taskIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]');
|
||||
filter: ElementFinder;
|
||||
taskIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
|
||||
|
||||
constructor(filter: ElementFinder) {
|
||||
this.filter = filter;
|
||||
@@ -33,13 +33,13 @@ export class TaskFiltersPage {
|
||||
|
||||
async getTaskFilterIcon(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
const icon = this.filter.element(this.taskIcon);
|
||||
const icon = this.filter.$(this.taskIcon);
|
||||
return BrowserActions.getText(icon);
|
||||
}
|
||||
|
||||
async checkTaskFilterHasNoIcon(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.taskIcon));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.taskIcon));
|
||||
}
|
||||
|
||||
async clickTaskFilter(): Promise<void> {
|
||||
|
@@ -16,26 +16,26 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DropdownPage, PaginationPage } from '@alfresco/adf-testing';
|
||||
import { by, element } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { TasksListPage } from './tasks-list.page';
|
||||
|
||||
export class TaskListDemoPage {
|
||||
|
||||
taskListPage = new TasksListPage();
|
||||
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('.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']"));
|
||||
appId = $("input[data-automation-id='appId input']");
|
||||
itemsPerPage = $("input[data-automation-id='items per page']");
|
||||
itemsPerPageForm = $("mat-form-field[data-automation-id='items per page']");
|
||||
processDefinitionId = $("input[data-automation-id='process definition id']");
|
||||
processInstanceId = $("input[data-automation-id='process instance id']");
|
||||
page = $("input[data-automation-id='page']");
|
||||
pageForm = $("mat-form-field[data-automation-id='page']");
|
||||
taskName = $("input[data-automation-id='task name']");
|
||||
resetButton = $('.app-reset-button button');
|
||||
dueBefore = $("input[data-automation-id='due before']");
|
||||
dueAfter = $("input[data-automation-id='due after']");
|
||||
taskId = $("input[data-automation-id='task id']");
|
||||
|
||||
stateDropDownArrow = element(by.css("mat-form-field[data-automation-id='state']"));
|
||||
stateDropDownArrow = $("mat-form-field[data-automation-id='state']");
|
||||
stateDropdown = new DropdownPage(this.stateDropDownArrow);
|
||||
|
||||
taskList(): TasksListPage {
|
||||
@@ -97,7 +97,7 @@ export class TaskListDemoPage {
|
||||
|
||||
async getItemsPerPageFieldErrorMessage(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageForm);
|
||||
const errorMessage = this.itemsPerPageForm.element(by.css('mat-error'));
|
||||
const errorMessage = this.itemsPerPageForm.$('mat-error');
|
||||
return BrowserActions.getText(errorMessage);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export class TaskListDemoPage {
|
||||
|
||||
async getPageFieldErrorMessage(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.pageForm);
|
||||
const errorMessage = this.pageForm.element(by.css('mat-error'));
|
||||
const errorMessage = this.pageForm.$('mat-error');
|
||||
return BrowserActions.getText(errorMessage);
|
||||
}
|
||||
|
||||
|
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { browser, $, $$ } from 'protractor';
|
||||
|
||||
export class TasksListPage {
|
||||
|
||||
taskList = element(by.css('adf-tasklist'));
|
||||
noTasksFound = element.all(by.css('.adf-empty-content__title')).first();
|
||||
taskList = $('adf-tasklist');
|
||||
noTasksFound = $$('.adf-empty-content__title').first();
|
||||
dataTable = new DataTableComponentPage(this.taskList);
|
||||
|
||||
getDataTable(): DataTableComponentPage {
|
||||
|
@@ -21,22 +21,20 @@ 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 { Locator, element, by } from 'protractor';
|
||||
import { element, by, $ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, FormFields } from '@alfresco/adf-testing';
|
||||
|
||||
export class TasksPage {
|
||||
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"]'));
|
||||
createButton = $('button[data-automation-id="create-button"');
|
||||
newTaskButton = $('button[data-automation-id="btn-start-task"]');
|
||||
addChecklistButton = $('button[class*="adf-add-to-checklist-button"]');
|
||||
rowByRowName = by.xpath('ancestor::mat-chip');
|
||||
checklistContainer: Locator = by.css('div[class*="checklist-menu"]');
|
||||
checklistContainer = $('div[class*="checklist-menu"]');
|
||||
taskTitle = '.adf-activiti-task-details__header span';
|
||||
rows: Locator = by.css('div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"] div[class*="adf-datatable-cell"]');
|
||||
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: Locator = by.css('div[data-automation-id="auto_id_name"]');
|
||||
completeButtonNoForm = $('#adf-no-form-complete-button');
|
||||
checklistDialog = $('#checklist-dialog');
|
||||
checklistNoMessage = $('#checklist-none-message');
|
||||
numberOfChecklists = $('[data-automation-id="checklist-label"] mat-chip');
|
||||
|
||||
async createNewTask(): Promise<StartTaskDialogPage> {
|
||||
await this.clickOnCreateButton();
|
||||
@@ -89,7 +87,7 @@ export class TasksPage {
|
||||
}
|
||||
|
||||
getRowsName(name: string) {
|
||||
return element(this.checklistContainer).element(by.cssContainingText('span', name));
|
||||
return this.checklistContainer.element(by.cssContainingText('span', name));
|
||||
}
|
||||
|
||||
getChecklistByName(name: string) {
|
||||
@@ -104,11 +102,11 @@ export class TasksPage {
|
||||
}
|
||||
|
||||
async checkChecklistIsNotDisplayed(name: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(this.checklistContainer).element(by.cssContainingText('span', name)));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.checklistContainer.element(by.cssContainingText('span', name)));
|
||||
}
|
||||
|
||||
async checkTaskTitle(taskName: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(this.taskTitle)));
|
||||
await BrowserVisibility.waitUntilElementIsVisible($(this.taskTitle));
|
||||
const title = element(by.cssContainingText(this.taskTitle, taskName));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(title);
|
||||
}
|
||||
@@ -140,13 +138,13 @@ export class TasksPage {
|
||||
async removeChecklists(name: string): Promise<void> {
|
||||
const elem = this.getRowsName(name);
|
||||
const row = elem.element(this.rowByRowName);
|
||||
await BrowserActions.click(row.element(by.css('mat-icon')));
|
||||
await BrowserActions.click(row.$('mat-icon'));
|
||||
}
|
||||
|
||||
async checkChecklistsRemoveButtonIsNotDisplayed(name: string): Promise<void> {
|
||||
const elem = this.getRowsName(name);
|
||||
const row = elem.element(this.rowByRowName);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(row.element(by.css('mat-icon')));
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(row.$('mat-icon'));
|
||||
}
|
||||
|
||||
async clickSortByNameAsc(): Promise<any> {
|
||||
|
@@ -51,7 +51,6 @@ describe('Comment component for Processes', () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
|
||||
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { createApiService, ApplicationsUtil, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
@@ -148,21 +148,21 @@ describe('Start Task - Custom App', () => {
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||
|
||||
await taskPage.formFields().setFieldValue(by.id, formTextField, formFieldValue);
|
||||
await taskPage.formFields().setFieldValue(formTextField, formFieldValue);
|
||||
|
||||
await taskPage.formFields().refreshForm();
|
||||
|
||||
await taskPage.formFields().checkFieldValue(by.id, formTextField, '');
|
||||
await taskPage.formFields().checkFieldValue(formTextField, '');
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||
|
||||
await taskPage.formFields().setFieldValue(by.id, formTextField, formFieldValue);
|
||||
await taskPage.formFields().setFieldValue(formTextField, formFieldValue);
|
||||
|
||||
await taskPage.formFields().checkFieldValue(by.id, formTextField, formFieldValue);
|
||||
await taskPage.formFields().checkFieldValue(formTextField, formFieldValue);
|
||||
|
||||
await taskPage.formFields().saveForm();
|
||||
|
||||
await taskPage.formFields().checkFieldValue(by.id, formTextField, formFieldValue);
|
||||
await taskPage.formFields().checkFieldValue(formTextField, formFieldValue);
|
||||
});
|
||||
|
||||
it('[C263951] Should be possible to assign a user', async () => {
|
||||
|
@@ -23,14 +23,14 @@ import { createApiService,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
import { browser } from 'protractor';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AttachmentListPage } from './../pages/attachment-list.page';
|
||||
import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import * as CONSTANTS from '../../util/constants';
|
||||
|
||||
describe('Start Task - Task App', () => {
|
||||
|
||||
@@ -133,17 +133,17 @@ describe('Start Task - Task App', () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||
|
||||
const formFields = await taskPage.formFields();
|
||||
await formFields.setFieldValue(by.id, formTextField, formFieldValue);
|
||||
await formFields.setFieldValue(formTextField, formFieldValue);
|
||||
|
||||
await formFields.refreshForm();
|
||||
await formFields.checkFieldValue(by.id, formTextField, '');
|
||||
await formFields.checkFieldValue(formTextField, '');
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||
|
||||
await formFields.setFieldValue(by.id, formTextField, formFieldValue);
|
||||
await formFields.checkFieldValue(by.id, formTextField, formFieldValue);
|
||||
await formFields.setFieldValue(formTextField, formFieldValue);
|
||||
await formFields.checkFieldValue(formTextField, formFieldValue);
|
||||
|
||||
await taskPage.formFields().saveForm();
|
||||
await formFields.checkFieldValue(by.id, formTextField, formFieldValue);
|
||||
await formFields.checkFieldValue(formTextField, formFieldValue);
|
||||
});
|
||||
|
||||
it('[C260425] Should be possible to assign a user', async () => {
|
||||
|
@@ -64,7 +64,7 @@ let specs = function () {
|
||||
} else {
|
||||
const FOLDER = process.env.FOLDER || '';
|
||||
setProvider(FOLDER);
|
||||
const specsToRun = FOLDER ? `./${FOLDER}/**/*.e2e.ts` : './**/*.ts';
|
||||
const specsToRun = FOLDER ? `./${FOLDER}/**/*.e2e.ts` : './**/*.e2e.ts';
|
||||
arraySpecs = [specsToRun];
|
||||
}
|
||||
|
||||
|
@@ -15,23 +15,25 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Locator, browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { browser, ElementFinder, protractor, $ } from 'protractor';
|
||||
import { BrowserVisibility, BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||
|
||||
export class SearchBarPage {
|
||||
|
||||
searchIcon = element(by.css(`button[class*='adf-search-button']`));
|
||||
searchBar = element(by.css(`adf-search-control input`));
|
||||
searchIcon = $(`button[class*='adf-search-button']`);
|
||||
searchBar = $(`adf-search-control input`);
|
||||
searchBarExpanded: TestElement = TestElement.byCss(`adf-search-control mat-form-field[class*="mat-focused"] input`);
|
||||
noResultMessage = element(by.css(`p[class*='adf-search-fixed-text']`));
|
||||
rowsAuthor: Locator = by.css(`.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`);
|
||||
searchBarPage = element(by.css(`mat-list[id='autocomplete-search-result-list']`));
|
||||
noResultMessage = $(`p[class*='adf-search-fixed-text']`);
|
||||
rowsAuthor = `.mat-list-text p[class*='adf-search-fixed-text']`;
|
||||
completeName = `h4[class*='adf-search-fixed-text']`;
|
||||
highlightName = `.adf-highlight`;
|
||||
searchBarPage = $(`mat-list[id='autocomplete-search-result-list']`);
|
||||
|
||||
getRowByRowName = (name: string): ElementFinder => $(`mat-list-item[data-automation-id='autocomplete_for_${name}']`);
|
||||
|
||||
async pressDownArrowAndEnter(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
||||
await this.searchBar.sendKeys(protractor.Key.ARROW_DOWN);
|
||||
await BrowserActions.clearSendKeys(this.searchBar, protractor.Key.ARROW_DOWN);
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
}
|
||||
|
||||
@@ -80,20 +82,16 @@ export class SearchBarPage {
|
||||
await BrowserActions.click(this.getRowByRowName(fileName));
|
||||
}
|
||||
|
||||
getRowByRowName(name: string): ElementFinder {
|
||||
return element(by.css(`mat-list-item[data-automation-id='autocomplete_for_${name}']`));
|
||||
}
|
||||
|
||||
async getSpecificRowsHighlightName(fileName: string): Promise<string> {
|
||||
return BrowserActions.getText(this.getRowByRowName(fileName).element(this.highlightName));
|
||||
return BrowserActions.getText(this.getRowByRowName(fileName).$(this.highlightName));
|
||||
}
|
||||
|
||||
async getSpecificRowsCompleteName(fileName: string): Promise<string> {
|
||||
return BrowserActions.getText(this.getRowByRowName(fileName).element(this.completeName));
|
||||
return BrowserActions.getText(this.getRowByRowName(fileName).$(this.completeName));
|
||||
}
|
||||
|
||||
async getSpecificRowsAuthor(fileName: string): Promise<string> {
|
||||
return BrowserActions.getText(this.getRowByRowName(fileName).element(this.rowsAuthor));
|
||||
return BrowserActions.getText(this.getRowByRowName(fileName).$(this.rowsAuthor));
|
||||
}
|
||||
|
||||
async clearText(): Promise<void> {
|
||||
|
@@ -16,28 +16,28 @@
|
||||
*/
|
||||
|
||||
import { BrowserVisibility, DateRangeFilterPage, NumberRangeFilterPage, SearchCategoriesPage, SearchCheckListPage, SearchRadioPage, SearchSliderPage, SearchTextPage } from '@alfresco/adf-testing';
|
||||
import { by, element } from 'protractor';
|
||||
import { $, by } from 'protractor';
|
||||
|
||||
export class SearchFiltersPage {
|
||||
|
||||
searchCategoriesPage: SearchCategoriesPage = new SearchCategoriesPage();
|
||||
|
||||
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 = 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"]'));
|
||||
searchFilters = $('adf-search-filter');
|
||||
fileTypeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.TYPE"]');
|
||||
creatorFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.CREATOR"]');
|
||||
fileSizeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.SIZE"]');
|
||||
nameFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Name"]');
|
||||
checkListFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Check List"]');
|
||||
createdDateRangeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Created Date (range)"]');
|
||||
typeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Type"]');
|
||||
sizeRangeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Content Size (range)"]');
|
||||
sizeSliderFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Content Size"]');
|
||||
facetQueriesDefaultGroup = $('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 = $('mat-expansion-panel[data-automation-id="expansion-panel-Type facet queries"]');
|
||||
facetQueriesSizeGroup = $('mat-expansion-panel[data-automation-id="expansion-panel-Size facet queries"]');
|
||||
facetIntervalsByCreated = $('mat-expansion-panel[data-automation-id="expansion-panel-The Created"]');
|
||||
facetIntervalsByModified = $('mat-expansion-panel[data-automation-id="expansion-panel-TheModified"]');
|
||||
|
||||
async checkSearchFiltersIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchFilters);
|
||||
@@ -72,7 +72,7 @@ export class SearchFiltersPage {
|
||||
}
|
||||
|
||||
async checkCustomFacetFieldLabelIsDisplayed(fieldLabel: string): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`mat-expansion-panel[data-automation-id="expansion-panel-${fieldLabel}"]`)));
|
||||
await BrowserVisibility.waitUntilElementIsVisible($(`mat-expansion-panel[data-automation-id="expansion-panel-${fieldLabel}"]`));
|
||||
}
|
||||
|
||||
sizeSliderFilterPage(): SearchSliderPage {
|
||||
|
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
|
||||
import { BrowserVisibility, DataTableComponentPage, SearchSortingPickerPage } from '@alfresco/adf-testing';
|
||||
import { by, element } from 'protractor';
|
||||
import { $ } from 'protractor';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
|
||||
export class SearchResultsPage {
|
||||
|
||||
noResultsMessage = element(by.css('.app-no-result-message'));
|
||||
noResultsMessage = $('.app-no-result-message');
|
||||
dataTable = new DataTableComponentPage();
|
||||
searchSortingPicker = new SearchSortingPickerPage();
|
||||
contentServices = new ContentServicesPage();
|
||||
|
@@ -90,7 +90,7 @@ describe('Search Component - Multi-Select Facet', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
const sitesApi = new SitesApi(apiService.getInstance());
|
||||
await Promise.all([
|
||||
uploadActions.deleteFileOrFolder(jpgFile.entry.id),
|
||||
uploadActions.deleteFileOrFolder(jpgFileSite.entry.id),
|
||||
@@ -214,7 +214,7 @@ describe('Search Component - Multi-Select Facet', () => {
|
||||
await usersActions.createUser(acsUser);
|
||||
|
||||
await apiService.login(acsUser.username, acsUser.password);
|
||||
|
||||
const sitesApi = new SitesApi(apiService.getInstance());
|
||||
site = await sitesApi.createSite({
|
||||
title: StringUtil.generateRandomString(8),
|
||||
visibility: 'PUBLIC'
|
||||
@@ -236,7 +236,7 @@ describe('Search Component - Multi-Select Facet', () => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await uploadActions.deleteFileOrFolder(txtFile.entry.id);
|
||||
|
||||
const sitesApi = new SitesApi(apiService.getInstance());
|
||||
await sitesApi.deleteSite(site.entry.id, { permanent: true });
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user