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.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { createApiService,
|
import { createApiService,
|
||||||
BreadcrumbPage,
|
BreadcrumbPage,
|
||||||
BreadcrumbDropdownPage,
|
BreadcrumbDropdownPage,
|
||||||
@@ -47,7 +47,7 @@ describe('Document List Component - Actions', () => {
|
|||||||
const usersActions = new UsersActions(apiService);
|
const usersActions = new UsersActions(apiService);
|
||||||
|
|
||||||
const uploadActions = new UploadActions(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', () => {
|
describe('Folder Actions - Copy and Move', () => {
|
||||||
const folderModel1 = new FolderModel({ name: StringUtil.generateRandomString() });
|
const folderModel1 = new FolderModel({ name: StringUtil.generateRandomString() });
|
||||||
|
@@ -22,7 +22,7 @@ import {
|
|||||||
DropdownPage,
|
DropdownPage,
|
||||||
TestElement
|
TestElement
|
||||||
} from '@alfresco/adf-testing';
|
} from '@alfresco/adf-testing';
|
||||||
import { browser, by } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
|
|
||||||
export class PermissionsPage {
|
export class PermissionsPage {
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ export class PermissionsPage {
|
|||||||
async clickRoleDropdownByUserOrGroupName(name: string): Promise<void> {
|
async clickRoleDropdownByUserOrGroupName(name: string): Promise<void> {
|
||||||
const row = this.dataTableComponentPage.getRow('Users and Groups', name);
|
const row = this.dataTableComponentPage.getRow('Users and Groups', name);
|
||||||
await row.click();
|
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();
|
await TestElement.byCss('.mat-select-panel').waitVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,12 +15,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class SocialPage {
|
export class SocialPage {
|
||||||
|
|
||||||
nodeIdField = element(by.css(`input[id="nodeId"]`));
|
nodeIdField = $(`input[id="nodeId"]`);
|
||||||
|
|
||||||
async getNodeIdFieldValue(): Promise<string> {
|
async getNodeIdFieldValue(): Promise<string> {
|
||||||
return BrowserActions.getInputValue(this.nodeIdField);
|
return BrowserActions.getInputValue(this.nodeIdField);
|
||||||
|
@@ -15,13 +15,13 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, protractor, browser } from 'protractor';
|
import { by, protractor, browser, $, $$ } from 'protractor';
|
||||||
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class TagPage {
|
export class TagPage {
|
||||||
|
|
||||||
addTagButton = TestElement.byCss('#add-tag');
|
addTagButton = TestElement.byCss('#add-tag');
|
||||||
insertNodeIdElement = element(by.css('input[id="nodeId"]'));
|
insertNodeIdElement = $('input[id="nodeId"]');
|
||||||
newTagInput = TestElement.byCss('input[id="new-tag-text"]');
|
newTagInput = TestElement.byCss('input[id="new-tag-text"]');
|
||||||
tagListRow = TestElement.byCss('adf-tag-node-actions-list mat-list-item');
|
tagListRow = TestElement.byCss('adf-tag-node-actions-list mat-list-item');
|
||||||
tagListByNodeIdRow = TestElement.byCss('adf-tag-node-list mat-chip');
|
tagListByNodeIdRow = TestElement.byCss('adf-tag-node-list mat-chip');
|
||||||
@@ -30,7 +30,7 @@ export class TagPage {
|
|||||||
showDeleteButton = TestElement.byCss('#adf-remove-button-tag');
|
showDeleteButton = TestElement.byCss('#adf-remove-button-tag');
|
||||||
showMoreButton = TestElement.byCss('button[data-automation-id="show-more-tags"]');
|
showMoreButton = TestElement.byCss('button[data-automation-id="show-more-tags"]');
|
||||||
showLessButton = TestElement.byCss('button[data-automation-id="show-fewer-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');
|
confirmTag = TestElement.byCss('#adf-tag-node-send');
|
||||||
|
|
||||||
getNodeId(): Promise<string> {
|
getNodeId(): Promise<string> {
|
||||||
|
@@ -15,15 +15,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, protractor } from 'protractor';
|
import { element, by, protractor, $, $$ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class TreeViewPage {
|
export class TreeViewPage {
|
||||||
|
|
||||||
treeViewTitle = element(by.cssContainingText('app-tree-view div', 'TREE VIEW TEST'));
|
treeViewTitle = element(by.cssContainingText('app-tree-view div', 'TREE VIEW TEST'));
|
||||||
nodeIdInput = element(by.css('input[data-placeholder="Node Id"]'));
|
nodeIdInput = $('input[data-placeholder="Node Id"]');
|
||||||
noNodeMessage = element(by.id('adf-tree-view-missing-node'));
|
noNodeMessage = $('#adf-tree-view-missing-node');
|
||||||
nodesOnPage = element.all(by.css('mat-tree-node'));
|
nodesOnPage = $$('mat-tree-node');
|
||||||
|
|
||||||
async checkTreeViewTitleIsDisplayed(): Promise<void> {
|
async checkTreeViewTitleIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.treeViewTitle);
|
await BrowserVisibility.waitUntilElementIsVisible(this.treeViewTitle);
|
||||||
@@ -34,17 +34,17 @@ export class TreeViewPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickNode(nodeName: string): Promise<void> {
|
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);
|
await BrowserActions.click(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkNodeIsDisplayedAsClosed(nodeName: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkNodeIsDisplayedAsOpen(nodeName: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ export class TreeViewPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkNodeIsNotDisplayed(nodeName: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsNotVisible(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { $, by, element } from 'protractor';
|
||||||
import {
|
import {
|
||||||
BrowserVisibility,
|
BrowserVisibility,
|
||||||
BrowserActions,
|
BrowserActions,
|
||||||
@@ -29,19 +29,19 @@ export class CardViewComponentPage {
|
|||||||
addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
||||||
nameCardTextItem = new CardTextItemPage('name');
|
nameCardTextItem = new CardTextItemPage('name');
|
||||||
booleanCardBooleanItem = new CardBooleanItemPage('boolean');
|
booleanCardBooleanItem = new CardBooleanItemPage('boolean');
|
||||||
intField = element(by.css(`input[data-automation-id='card-textitem-editinput-int']`));
|
intField = $(`input[data-automation-id='card-textitem-editinput-int']`);
|
||||||
floatField = element(by.css(`input[data-automation-id='card-textitem-editinput-float']`));
|
floatField = $(`input[data-automation-id='card-textitem-editinput-float']`);
|
||||||
valueInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
|
valueInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
|
||||||
nameInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
|
nameInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
|
||||||
consoleLog = element(by.className('app-console'));
|
consoleLog = element(by.className('app-console'));
|
||||||
deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
||||||
resetButton = element(by.css(`#adf-reset-card-log`));
|
resetButton = $(`#adf-reset-card-log`);
|
||||||
editableSwitch = element(by.id('app-toggle-editable'));
|
editableSwitch = $('#app-toggle-editable');
|
||||||
clearDateSwitch = element(by.id('app-toggle-clear-date'));
|
clearDateSwitch = $('#app-toggle-clear-date');
|
||||||
noneOptionSwitch = element(by.id('app-toggle-none-option'));
|
noneOptionSwitch = $('#app-toggle-none-option');
|
||||||
clickableField = element(by.css(`[data-automation-id="card-textitem-toggle-click"]`));
|
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> {
|
async clickOnAddButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.addButton);
|
await BrowserActions.click(this.addButton);
|
||||||
@@ -72,18 +72,18 @@ export class CardViewComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickOnIntField(): Promise<void> {
|
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 BrowserActions.click(toggleText);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.intField);
|
await BrowserVisibility.waitUntilElementIsVisible(this.intField);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickOnIntClearIcon(): Promise<void> {
|
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);
|
await BrowserActions.click(clearIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickOnIntSaveIcon(): Promise<void> {
|
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);
|
await BrowserActions.click(saveIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,28 +92,28 @@ export class CardViewComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getIntFieldText(): Promise<string> {
|
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);
|
return BrowserActions.getText(textField);
|
||||||
}
|
}
|
||||||
|
|
||||||
getErrorInt(): Promise<string> {
|
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);
|
return BrowserActions.getText(errorElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickOnFloatField(): Promise<void> {
|
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 BrowserActions.click(toggleText);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.floatField);
|
await BrowserVisibility.waitUntilElementIsVisible(this.floatField);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickOnFloatClearIcon(): Promise<void> {
|
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);
|
await BrowserActions.click(clearIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickOnFloatSaveIcon(): Promise<void> {
|
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);
|
await BrowserActions.click(saveIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,12 +122,12 @@ export class CardViewComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getFloatFieldText(): Promise<string> {
|
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);
|
return BrowserActions.getText(textField);
|
||||||
}
|
}
|
||||||
|
|
||||||
getErrorFloat(): Promise<string> {
|
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);
|
return BrowserActions.getText(errorElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ export class CardViewComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getOutputText(index: number): Promise<string> {
|
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> {
|
async deletePairsValues(): Promise<void> {
|
||||||
@@ -177,22 +177,22 @@ export class CardViewComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDateValue(): Promise<string> {
|
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();
|
return dateValue.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
async getDateTimeValue(): Promise<string> {
|
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();
|
return dateTimeValue.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
async clearDateField(): Promise<void> {
|
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);
|
await BrowserActions.click(clearDateButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clearDateTimeField(): Promise<void> {
|
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);
|
await BrowserActions.click(clearDateButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ export class CardViewComponentPage {
|
|||||||
const switchClass = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
const switchClass = await BrowserActions.getAttribute(this.editableSwitch, 'class');
|
||||||
if (switchClass.indexOf('mat-checked') === -1) {
|
if (switchClass.indexOf('mat-checked') === -1) {
|
||||||
await this.clearDateSwitch.click();
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(clearDateChecked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -209,13 +209,13 @@ export class CardViewComponentPage {
|
|||||||
const switchClass = await BrowserActions.getAttribute(this.noneOptionSwitch, 'class');
|
const switchClass = await BrowserActions.getAttribute(this.noneOptionSwitch, 'class');
|
||||||
if (switchClass.indexOf('mat-checked') === -1) {
|
if (switchClass.indexOf('mat-checked') === -1) {
|
||||||
await this.noneOptionSwitch.click();
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(noneOptionChecked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async isErrorNotDisplayed(): Promise<boolean> {
|
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 {
|
try {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(errorElement);
|
await BrowserVisibility.waitUntilElementIsNotVisible(errorElement);
|
||||||
return true;
|
return true;
|
||||||
@@ -231,10 +231,10 @@ export class CardViewComponentPage {
|
|||||||
async updateClickableField(text: string): Promise<void> {
|
async updateClickableField(text: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.clickableField);
|
await BrowserVisibility.waitUntilElementIsVisible(this.clickableField);
|
||||||
await BrowserActions.click(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 BrowserVisibility.waitUntilElementIsPresent(inputField);
|
||||||
await BrowserActions.clearSendKeys(inputField, text);
|
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 BrowserVisibility.waitUntilElementIsVisible(save);
|
||||||
await BrowserActions.click(save);
|
await BrowserActions.click(save);
|
||||||
}
|
}
|
||||||
|
@@ -16,18 +16,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, TabsPage } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, TabsPage } from '@alfresco/adf-testing';
|
||||||
import { by, element } from 'protractor';
|
import { $, $$ } from 'protractor';
|
||||||
|
|
||||||
export class CommentsPage {
|
export class CommentsPage {
|
||||||
|
|
||||||
tabsPage = new TabsPage();
|
tabsPage = new TabsPage();
|
||||||
numberOfComments = element(by.id('comment-header'));
|
numberOfComments = $('#comment-header');
|
||||||
commentUserIcon = element.all(by.id('comment-user-icon'));
|
commentUserIcon = $$('#comment-user-icon');
|
||||||
commentUserName = element.all(by.id('comment-user'));
|
commentUserName = $$('#comment-user');
|
||||||
commentMessage = element.all(by.id('comment-message'));
|
commentMessage = $$('#comment-message');
|
||||||
commentTime = element.all(by.id('comment-time'));
|
commentTime = $$('#comment-time');
|
||||||
commentInput = element(by.id('comment-input'));
|
commentInput = $('#comment-input');
|
||||||
addCommentButton = element(by.css("[data-automation-id='comments-input-add']"));
|
addCommentButton = $("[data-automation-id='comments-input-add']");
|
||||||
|
|
||||||
async getTotalNumberOfComments(text: string): Promise<void> {
|
async getTotalNumberOfComments(text: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementHasText(this.numberOfComments, text);
|
await BrowserVisibility.waitUntilElementHasText(this.numberOfComments, text);
|
||||||
|
@@ -25,7 +25,7 @@ import {
|
|||||||
DropdownPage,
|
DropdownPage,
|
||||||
Logger
|
Logger
|
||||||
} from '@alfresco/adf-testing';
|
} 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 { CreateLibraryDialogPage } from './dialog/create-library-dialog.page';
|
||||||
import { FolderDialogPage } from './dialog/folder-dialog.page';
|
import { FolderDialogPage } from './dialog/folder-dialog.page';
|
||||||
import { NavigationBarPage } from './navigation-bar.page';
|
import { NavigationBarPage } from './navigation-bar.page';
|
||||||
@@ -42,74 +42,73 @@ export class ContentServicesPage {
|
|||||||
created: 'Created'
|
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();
|
togglePage = new TogglePage();
|
||||||
createFolderDialog = new FolderDialogPage();
|
createFolderDialog = new FolderDialogPage();
|
||||||
createLibraryDialog = new CreateLibraryDialogPage();
|
createLibraryDialog = new CreateLibraryDialogPage();
|
||||||
|
|
||||||
multipleFileUploadToggle = element(by.id('adf-document-list-enable-drop-files'));
|
multipleFileUploadToggle = $('#adf-document-list-enable-drop-files');
|
||||||
uploadBorder = element(by.id('document-list-container'));
|
uploadBorder = $('#document-list-container');
|
||||||
contentServices = element(by.css('.app-sidenav-link[data-automation-id="Content Services"]'));
|
contentServices = $('.app-sidenav-link[data-automation-id="Content Services"]');
|
||||||
currentFolder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
|
currentFolder = $('div[class*="adf-breadcrumb-item adf-active"] div');
|
||||||
createFolderButton = element(by.css('button[data-automation-id="create-new-folder"]'));
|
createFolderButton = $('button[data-automation-id="create-new-folder"]');
|
||||||
editFolderButton = element(by.css('button[data-automation-id="edit-folder"]'));
|
editFolderButton = $('button[data-automation-id="edit-folder"]');
|
||||||
deleteNodesButton = element(by.css('button[data-automation-id="delete-toolbar-button"]'));
|
deleteNodesButton = $('button[data-automation-id="delete-toolbar-button"]');
|
||||||
createLibraryButton = element(by.css('button[data-automation-id="create-new-library"]'));
|
createLibraryButton = $('button[data-automation-id="create-new-library"]');
|
||||||
activeBreadcrumb = element(by.css('div[class*="active"]'));
|
activeBreadcrumb = $('div[class*="active"]');
|
||||||
tooltip: Locator = by.css('div[class*="--text adf-full-width"] span');
|
uploadFileButton = $('.adf-upload-button-file-container button');
|
||||||
uploadFileButton = element(by.css('.adf-upload-button-file-container button'));
|
uploadFileButtonInput = $('input[data-automation-id="upload-single-file"]');
|
||||||
uploadFileButtonInput = element(by.css('input[data-automation-id="upload-single-file"]'));
|
uploadMultipleFileButton = $('input[data-automation-id="upload-multiple-files"]');
|
||||||
uploadMultipleFileButton = element(by.css('input[data-automation-id="upload-multiple-files"]'));
|
uploadFolderButton = $('input[data-automation-id="uploadFolder"]');
|
||||||
uploadFolderButton = element(by.css('input[data-automation-id="uploadFolder"]'));
|
errorSnackBar = $('simple-snack-bar[class*="mat-simple-snackbar"]');
|
||||||
errorSnackBar = element(by.css('simple-snack-bar[class*="mat-simple-snackbar"]'));
|
emptyPagination = $('adf-pagination[class*="adf-pagination__empty"]');
|
||||||
emptyPagination = element(by.css('adf-pagination[class*="adf-pagination__empty"]'));
|
dragAndDrop = $$('adf-upload-drag-area div').first();
|
||||||
dragAndDrop = element.all(by.css('adf-upload-drag-area div')).first();
|
nameHeader = $$('div[data-automation-id="auto_id_name"] > span').first();
|
||||||
nameHeader = element.all(by.css('div[data-automation-id="auto_id_name"] > span')).first();
|
sizeHeader = $$('div[data-automation-id="auto_id_content.sizeInBytes"] > span').first();
|
||||||
sizeHeader = element.all(by.css('div[data-automation-id="auto_id_content.sizeInBytes"] > span')).first();
|
createdByHeader = $$('div[data-automation-id="auto_id_createdByUser.displayName"] > span').first();
|
||||||
createdByHeader = element.all(by.css('div[data-automation-id="auto_id_createdByUser.displayName"] > span')).first();
|
createdHeader = $$('div[data-automation-id="auto_id_createdAt"] > span').first();
|
||||||
createdHeader = element.all(by.css('div[data-automation-id="auto_id_createdAt"] > span')).first();
|
recentFiles = $('.app-container-recent');
|
||||||
recentFiles = element(by.css('.app-container-recent'));
|
recentFilesExpanded = $('.app-container-recent mat-expansion-panel-header.mat-expanded');
|
||||||
recentFilesExpanded = element(by.css('.app-container-recent mat-expansion-panel-header.mat-expanded'));
|
recentFilesClosed = $('.app-container-recent mat-expansion-panel-header');
|
||||||
recentFilesClosed = element(by.css('.app-container-recent mat-expansion-panel-header'));
|
recentFileIcon = $('.app-container-recent mat-expansion-panel-header mat-icon');
|
||||||
recentFileIcon = element(by.css('.app-container-recent mat-expansion-panel-header mat-icon'));
|
emptyFolder = $('.adf-empty-folder-this-space-is-empty');
|
||||||
emptyFolder = element(by.css('.adf-empty-folder-this-space-is-empty'));
|
emptyFolderImage = $('.adf-empty-folder-image');
|
||||||
emptyFolderImage = element(by.css('.adf-empty-folder-image'));
|
emptyRecent = $('.app-container-recent .app-empty-list__title');
|
||||||
emptyRecent = element(by.css('.app-container-recent .app-empty-list__title'));
|
gridViewButton = $('button[data-automation-id="document-list-grid-view"]');
|
||||||
gridViewButton = element(by.css('button[data-automation-id="document-list-grid-view"]'));
|
cardViewContainer = $('div.app-document-list-container div.adf-datatable-card');
|
||||||
cardViewContainer = element(by.css('div.app-document-list-container div.adf-datatable-card'));
|
|
||||||
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
||||||
nameColumnHeader = 'name';
|
nameColumnHeader = 'name';
|
||||||
createdByColumnHeader = 'createdByUser.displayName';
|
createdByColumnHeader = 'createdByUser.displayName';
|
||||||
createdColumnHeader = 'createdAt';
|
createdColumnHeader = 'createdAt';
|
||||||
deleteContentElement = element(by.css('button[data-automation-id*="DELETE"]'));
|
deleteContentElement = $('button[data-automation-id*="DELETE"]');
|
||||||
metadataAction = element(by.css('button[data-automation-id*="METADATA"]'));
|
metadataAction = $('button[data-automation-id*="METADATA"]');
|
||||||
versionManagerAction = element(by.css('button[data-automation-id*="VERSIONS"]'));
|
versionManagerAction = $('button[data-automation-id*="VERSIONS"]');
|
||||||
moveContentElement = element(by.css('button[data-automation-id*="MOVE"]'));
|
moveContentElement = $('button[data-automation-id*="MOVE"]');
|
||||||
copyContentElement = element(by.css('button[data-automation-id*="COPY"]'));
|
copyContentElement = $('button[data-automation-id*="COPY"]');
|
||||||
lockContentElement = element(by.css('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]'));
|
lockContentElement = $('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]');
|
||||||
downloadContent = element(by.css('button[data-automation-id*="DOWNLOAD"]'));
|
downloadContent = $('button[data-automation-id*="DOWNLOAD"]');
|
||||||
downloadButton = element(by.css('button[title="Download"]'));
|
downloadButton = $('button[title="Download"]');
|
||||||
favoriteButton = element(by.css('button[data-automation-id="favorite"]'));
|
favoriteButton = $('button[data-automation-id="favorite"]');
|
||||||
markedFavorite = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star'));
|
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'));
|
notMarkedFavorite = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star_border'));
|
||||||
multiSelectToggle = element(by.css('[data-automation-id="multiSelectToggle"]'));
|
multiSelectToggle = $('[data-automation-id="multiSelectToggle"]');
|
||||||
selectAllCheckbox = element.all(by.css('.adf-checkbox-sr-only')).first();
|
selectAllCheckbox = $$('.adf-checkbox-sr-only').first();
|
||||||
selectionModeDropdown = element(by.css('.mat-select[aria-label="Selection Mode"]'));
|
selectionModeDropdown = $('.mat-select[aria-label="Selection Mode"]');
|
||||||
selectedNodesList = element.all(by.css('.app-content-service-settings li'));
|
selectedNodesList = $$('.app-content-service-settings li');
|
||||||
siteListDropdown = new DropdownPage(element(by.css(`mat-select[data-automation-id='site-my-files-option']`)));
|
siteListDropdown = new DropdownPage($(`mat-select[data-automation-id='site-my-files-option']`));
|
||||||
sortingDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="grid-view-sorting"]')));
|
sortingDropdown = new DropdownPage($('mat-select[data-automation-id="grid-view-sorting"]'));
|
||||||
|
|
||||||
async pressContextMenuActionNamed(actionName): Promise<void> {
|
async pressContextMenuActionNamed(actionName): Promise<void> {
|
||||||
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
|
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkContextActionIsVisible(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);
|
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
async isContextActionEnabled(actionName): Promise<boolean> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(actionButton);
|
||||||
return actionButton.isEnabled();
|
return actionButton.isEnabled();
|
||||||
}
|
}
|
||||||
@@ -132,7 +131,7 @@ export class ContentServicesPage {
|
|||||||
|
|
||||||
async checkDeleteIsDisabled(content): Promise<void> {
|
async checkDeleteIsDisabled(content): Promise<void> {
|
||||||
await this.contentList.clickOnActionMenu(content);
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(disabledDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -489,12 +488,12 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async enableMediumTimeFormat(): Promise<void> {
|
async enableMediumTimeFormat(): Promise<void> {
|
||||||
const mediumTimeFormat = element(by.css('#enableMediumTimeFormat'));
|
const mediumTimeFormat = $('#enableMediumTimeFormat');
|
||||||
await BrowserActions.click(mediumTimeFormat);
|
await BrowserActions.click(mediumTimeFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
async enableThumbnails(): Promise<void> {
|
async enableThumbnails(): Promise<void> {
|
||||||
const thumbnailSlide = element(by.id('adf-thumbnails-upload-switch'));
|
const thumbnailSlide = $('#adf-thumbnails-upload-switch');
|
||||||
await BrowserActions.click(thumbnailSlide);
|
await BrowserActions.click(thumbnailSlide);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -503,7 +502,7 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDocumentListRowNumber(): Promise<number> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(documentList);
|
||||||
return $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
|
return $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count();
|
||||||
}
|
}
|
||||||
@@ -539,7 +538,7 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkLockIsDisplayedForElement(name): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(lockButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,7 +547,7 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getStyleValueForRowText(rowName, styleName): Promise<string> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||||
return row.getCssValue(styleName);
|
return row.getCssValue(styleName);
|
||||||
}
|
}
|
||||||
@@ -567,7 +566,7 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getRowIconImageUrl(fileName): Promise<string> {
|
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');
|
return BrowserActions.getAttribute(iconRow, 'src');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -590,30 +589,30 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDocumentCardIconForElement(elementName): Promise<string> {
|
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');
|
return BrowserActions.getAttribute(elementIcon, 'src');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkDocumentCardPropertyIsShowed(elementName, propertyName): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(elementProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAttributeValueForElement(elementName, propertyName): Promise<string> {
|
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);
|
return BrowserActions.getText(elementSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkMenuIsShowedForElementIndex(elementIndex): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(elementMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
async navigateToCardFolder(folderName): Promise<void> {
|
async navigateToCardFolder(folderName): Promise<void> {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
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);
|
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 BrowserVisibility.waitUntilElementIsVisible(folderSelected);
|
||||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
}
|
}
|
||||||
@@ -660,7 +659,7 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async selectFolder(folderName: string): Promise<void> {
|
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 BrowserVisibility.waitUntilElementIsVisible(folderSelected);
|
||||||
await BrowserActions.click(folderSelected);
|
await BrowserActions.click(folderSelected);
|
||||||
}
|
}
|
||||||
@@ -681,13 +680,13 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async selectItemWithCheckbox(itemName: string): Promise<void> {
|
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 BrowserVisibility.waitUntilElementIsVisible(item);
|
||||||
await BrowserActions.click(item);
|
await BrowserActions.click(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
async unSelectItemWithCheckbox(itemName: string): Promise<void> {
|
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 BrowserVisibility.waitUntilElementIsVisible(item);
|
||||||
await BrowserActions.click(item);
|
await BrowserActions.click(item);
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
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';
|
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||||
|
|
||||||
const source = {
|
const source = {
|
||||||
@@ -39,8 +39,8 @@ export class CustomSourcesPage {
|
|||||||
dataTable = new DataTableComponentPage();
|
dataTable = new DataTableComponentPage();
|
||||||
navigationBarPage = new NavigationBarPage();
|
navigationBarPage = new NavigationBarPage();
|
||||||
|
|
||||||
toolbar = element(by.css('app-custom-sources .adf-toolbar-title'));
|
toolbar = $('app-custom-sources .adf-toolbar-title');
|
||||||
selectModeDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="custom-sources-select"]')));
|
selectModeDropdown = new DropdownPage($('mat-select[data-automation-id="custom-sources-select"]'));
|
||||||
|
|
||||||
async waitForToolbarToBeVisible(): Promise<void> {
|
async waitForToolbarToBeVisible(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.toolbar);
|
await BrowserVisibility.waitUntilElementIsVisible(this.toolbar);
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
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 {
|
export class DataTablePage {
|
||||||
|
|
||||||
@@ -33,30 +33,30 @@ export class DataTablePage {
|
|||||||
};
|
};
|
||||||
|
|
||||||
dataTable: DataTableComponentPage;
|
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')]/..`));
|
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||||
allSelectedRows = element.all(by.css(`adf-datatable-row[class*='is-selected']`));
|
allSelectedRows = $$(`adf-datatable-row[class*='is-selected']`);
|
||||||
selectedRowNumber = element(by.css(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`));
|
selectedRowNumber = $(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`);
|
||||||
selectAll = element(by.css(`div[class*='header'] label`));
|
selectAll = $(`div[class*='header'] label`);
|
||||||
addRowElement = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
|
addRowElement = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
|
||||||
replaceRowsElement = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
|
replaceRowsElement = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
|
||||||
replaceColumnsElement = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
|
replaceColumnsElement = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
|
||||||
createdOnColumn = element(by.css(`div[data-automation-id='auto_id_createdOn']`));
|
createdOnColumn = $(`div[data-automation-id='auto_id_createdOn']`);
|
||||||
idColumnHeader = element(by.css(`div[data-automation-id='auto_id_id']`));
|
idColumnHeader = $(`div[data-automation-id='auto_id_id']`);
|
||||||
pasteClipboardInput = element(by.css(`input[data-automation-id='paste clipboard input']`));
|
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?) {
|
constructor(data?) {
|
||||||
if (this.data[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 {
|
} 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> {
|
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);
|
await BrowserActions.clearSendKeys(inputFilter, filterText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { $, $$ } from 'protractor';
|
||||||
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class CreateLibraryDialogPage {
|
export class CreateLibraryDialogPage {
|
||||||
@@ -30,11 +30,11 @@ export class CreateLibraryDialogPage {
|
|||||||
cancelButton = TestElement.byCss('button[data-automation-id="cancel-library-id"]');
|
cancelButton = TestElement.byCss('button[data-automation-id="cancel-library-id"]');
|
||||||
createButton = TestElement.byCss('button[data-automation-id="create-library-id"]');
|
createButton = TestElement.byCss('button[data-automation-id="create-library-id"]');
|
||||||
errorMessage = TestElement.byCss('.mat-dialog-content .mat-error');
|
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');
|
libraryNameHint = TestElement.byCss('adf-library-dialog .mat-hint');
|
||||||
|
|
||||||
async getSelectedRadio(): Promise<string> {
|
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);
|
return BrowserActions.getText(radio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,18 +15,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element, ElementFinder } from 'protractor';
|
import { $$, ElementFinder } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class FolderDialogPage {
|
export class FolderDialogPage {
|
||||||
|
|
||||||
folderDialog = element.all(by.css('adf-folder-dialog')).first();
|
folderDialog = $$('adf-folder-dialog').first();
|
||||||
folderNameField = this.folderDialog.element(by.id('adf-folder-name-input'));
|
folderNameField = this.folderDialog.$('#adf-folder-name-input');
|
||||||
folderDescriptionField = this.folderDialog.element(by.id('adf-folder-description-input'));
|
folderDescriptionField = this.folderDialog.$('#adf-folder-description-input');
|
||||||
createUpdateButton = this.folderDialog.element(by.id('adf-folder-create-button'));
|
createUpdateButton = this.folderDialog.$('#adf-folder-create-button');
|
||||||
cancelButton = this.folderDialog.element(by.id('adf-folder-cancel-button'));
|
cancelButton = this.folderDialog.$('#adf-folder-cancel-button');
|
||||||
folderTitle = this.folderDialog.element((by.css('h2.mat-dialog-title')));
|
folderTitle = this.folderDialog.$('h2.mat-dialog-title');
|
||||||
validationMessage = this.folderDialog.element(by.css('div.mat-form-field-subscript-wrapper mat-hint span'));
|
validationMessage = this.folderDialog.$('div.mat-form-field-subscript-wrapper mat-hint span');
|
||||||
|
|
||||||
async getDialogTitle(): Promise<string> {
|
async getDialogTitle(): Promise<string> {
|
||||||
return BrowserActions.getText(this.folderTitle);
|
return BrowserActions.getText(this.folderTitle);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { $$, $ } from 'protractor';
|
||||||
import { BrowserVisibility, TogglePage, BrowserActions, DateTimePickerPage } from '@alfresco/adf-testing';
|
import { BrowserVisibility, TogglePage, BrowserActions, DateTimePickerPage } from '@alfresco/adf-testing';
|
||||||
import moment = require('moment');
|
import moment = require('moment');
|
||||||
|
|
||||||
@@ -23,18 +23,18 @@ export class ShareDialogPage {
|
|||||||
|
|
||||||
togglePage = new TogglePage();
|
togglePage = new TogglePage();
|
||||||
dateTimePickerPage = new DateTimePickerPage();
|
dateTimePickerPage = new DateTimePickerPage();
|
||||||
shareDialog = element(by.css('adf-share-dialog'));
|
shareDialog = $('adf-share-dialog');
|
||||||
dialogTitle = element.all(by.css('[data-automation-id="adf-share-dialog-title"]')).first();
|
dialogTitle = $$('[data-automation-id="adf-share-dialog-title"]').first();
|
||||||
shareToggle = element(by.css('[data-automation-id="adf-share-toggle"] label'));
|
shareToggle = $('[data-automation-id="adf-share-toggle"] label');
|
||||||
expireToggle = element(by.css(`[data-automation-id="adf-expire-toggle"] label`));
|
expireToggle = $(`[data-automation-id="adf-expire-toggle"] label`);
|
||||||
shareToggleChecked = element(by.css('mat-dialog-container mat-slide-toggle.mat-checked'));
|
shareToggleChecked = $('mat-dialog-container mat-slide-toggle.mat-checked');
|
||||||
shareLink = element(by.css('[data-automation-id="adf-share-link"]'));
|
shareLink = $('[data-automation-id="adf-share-link"]');
|
||||||
closeButton = element(by.css('button[data-automation-id="adf-share-dialog-close"]'));
|
closeButton = $('button[data-automation-id="adf-share-dialog-close"]');
|
||||||
copySharedLinkButton = element(by.css('.adf-input-action'));
|
copySharedLinkButton = $('.adf-input-action');
|
||||||
expirationDateInput = element(by.css('input[formcontrolname="time"]'));
|
expirationDateInput = $('input[formcontrolname="time"]');
|
||||||
confirmationDialog = element(by.css('adf-confirm-dialog'));
|
confirmationDialog = $('adf-confirm-dialog');
|
||||||
confirmationCancelButton = element(by.id('adf-confirm-cancel'));
|
confirmationCancelButton = $('#adf-confirm-cancel');
|
||||||
confirmationRemoveButton = element(by.id('adf-confirm-accept'));
|
confirmationRemoveButton = $('#adf-confirm-accept');
|
||||||
|
|
||||||
async checkDialogIsDisplayed(): Promise<void> {
|
async checkDialogIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.dialogTitle);
|
await BrowserVisibility.waitUntilElementIsVisible(this.dialogTitle);
|
||||||
@@ -106,7 +106,7 @@ export class ShareDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async dateTimePickerDialogIsClosed(): Promise<void> {
|
async dateTimePickerDialogIsClosed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsStale(element(by.css('mat-datetimepicker-content')));
|
await BrowserVisibility.waitUntilElementIsStale($('mat-datetimepicker-content'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getExpirationDate(): Promise<string> {
|
async getExpirationDate(): Promise<string> {
|
||||||
|
@@ -15,28 +15,28 @@
|
|||||||
* limitations under the License.
|
* 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';
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class UploadDialogPage {
|
export class UploadDialogPage {
|
||||||
|
|
||||||
closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
|
closeButton = $('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]');
|
||||||
dialog = element(by.css('div[id="upload-dialog"]'));
|
dialog = $('div[id="upload-dialog"]');
|
||||||
minimizedDialog = element(by.css('div[class*="upload-dialog--minimized"]'));
|
minimizedDialog = $('div[class*="upload-dialog--minimized"]');
|
||||||
uploadedStatusIcon: Locator = by.css('mat-icon[class*="status--done"]');
|
uploadedStatusIcon = 'mat-icon[class*="status--done"]';
|
||||||
cancelledStatusIcon: Locator = by.css('div[class*="status--cancelled"]');
|
cancelledStatusIcon = 'div[class*="status--cancelled"]';
|
||||||
errorStatusIcon: Locator = by.css('div[class*="status--error"] mat-icon');
|
errorStatusIcon = 'div[class*="status--error"] mat-icon';
|
||||||
errorTooltip = element(by.css('div.mat-tooltip'));
|
errorTooltip = $('div.mat-tooltip');
|
||||||
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
|
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
|
||||||
title = element(by.css('span[class*="upload-dialog__title"]'));
|
title = $('span[class*="upload-dialog__title"]');
|
||||||
minimizeButton = element(by.css('mat-icon[title="Minimize"]'));
|
minimizeButton = $('mat-icon[title="Minimize"]');
|
||||||
maximizeButton = element(by.css('mat-icon[title="Maximize"]'));
|
maximizeButton = $('mat-icon[title="Maximize"]');
|
||||||
canUploadConfirmationTitle = element(by.css('.upload-dialog__confirmation--title'));
|
canUploadConfirmationTitle = $('.upload-dialog__confirmation--title');
|
||||||
canUploadConfirmationDescription = element(by.css('.upload-dialog__confirmation--text'));
|
canUploadConfirmationDescription = $('.upload-dialog__confirmation--text');
|
||||||
confirmationDialogNoButton = element(by.partialButtonText('No'));
|
confirmationDialogNoButton = element(by.partialButtonText('No'));
|
||||||
confirmationDialogYesButton = element(by.partialButtonText('Yes'));
|
confirmationDialogYesButton = element(by.partialButtonText('Yes'));
|
||||||
cancelUploadsElement = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]')));
|
cancelUploadsElement = $('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]');
|
||||||
cancelUploadInProgressButton = element(by.css('div[data-automation-id="cancel-upload-progress"]'));
|
cancelUploadInProgressButton = $('div[data-automation-id="cancel-upload-progress"]');
|
||||||
|
|
||||||
async clickOnCloseButton(): Promise<void> {
|
async clickOnCloseButton(): Promise<void> {
|
||||||
await this.checkCloseButtonIsDisplayed();
|
await this.checkCloseButtonIsDisplayed();
|
||||||
@@ -59,24 +59,20 @@ export class UploadDialogPage {
|
|||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.dialog);
|
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> {
|
async getRowByRowName(content: string): Promise<ElementFinder> {
|
||||||
const rows = this.getRowsByName(content);
|
const row = await $$(`div[class*='uploading-row'] span[title="${content}"]`).last();
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(rows);
|
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||||
return rows.element(this.rowByRowName);
|
return row.element(this.rowByRowName);
|
||||||
}
|
}
|
||||||
|
|
||||||
async fileIsUploaded(content: string): Promise<void> {
|
async fileIsUploaded(content: string): Promise<void> {
|
||||||
const row = await this.getRowByRowName(content);
|
const row: ElementFinder = await this.getRowByRowName(content);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon), 60000);
|
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.uploadedStatusIcon), 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async fileIsError(content: string) {
|
async fileIsError(content: string) {
|
||||||
const row = await this.getRowByRowName(content);
|
const row: ElementFinder = await this.getRowByRowName(content);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.errorStatusIcon));
|
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.errorStatusIcon));
|
||||||
}
|
}
|
||||||
|
|
||||||
async filesAreUploaded(content: string[]): Promise<void> {
|
async filesAreUploaded(content: string[]): Promise<void> {
|
||||||
@@ -86,7 +82,7 @@ export class UploadDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fileIsNotDisplayedInDialog(content: string): Promise<void> {
|
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> {
|
async cancelUploads(): Promise<void> {
|
||||||
@@ -102,16 +98,16 @@ export class UploadDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fileIsCancelled(content: string): Promise<void> {
|
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);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon), 10000);
|
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.cancelledStatusIcon), 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeUploadedFile(content: string): Promise<void> {
|
async removeUploadedFile(content: string): Promise<void> {
|
||||||
const row = await this.getRowByRowName(content);
|
const row: ElementFinder = await this.getRowByRowName(content);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.uploadedStatusIcon));
|
await BrowserVisibility.waitUntilElementIsVisible(row.$(this.uploadedStatusIcon));
|
||||||
const elementRow = await this.getRowByRowName(content);
|
const elementRow = await this.getRowByRowName(content);
|
||||||
await BrowserActions.click(elementRow.element(this.uploadedStatusIcon));
|
await BrowserActions.click(elementRow.$(this.uploadedStatusIcon));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getTitleText(): Promise<string> {
|
async getTitleText(): Promise<string> {
|
||||||
@@ -156,8 +152,8 @@ export class UploadDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async displayTooltip(): Promise<void> {
|
async displayTooltip(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(this.errorStatusIcon));
|
await BrowserVisibility.waitUntilElementIsVisible($(this.errorStatusIcon));
|
||||||
await browser.actions().mouseMove(element(this.errorStatusIcon)).perform();
|
await browser.actions().mouseMove($(this.errorStatusIcon)).perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
async getTooltip(): Promise<string> {
|
async getTooltip(): Promise<string> {
|
||||||
|
@@ -15,20 +15,20 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { browser, by, element } from 'protractor';
|
import { $, browser } from 'protractor';
|
||||||
import { BrowserActions, BrowserVisibility, TogglePage } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, TogglePage } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class UploadTogglesPage {
|
export class UploadTogglesPage {
|
||||||
|
|
||||||
togglePage = new TogglePage();
|
togglePage = new TogglePage();
|
||||||
multipleFileUploadToggle = element(by.id('adf-multiple-upload-switch'));
|
multipleFileUploadToggle = $('#adf-multiple-upload-switch');
|
||||||
uploadFolderToggle = element(by.css('#adf-folder-upload-switch'));
|
uploadFolderToggle = $('#adf-folder-upload-switch');
|
||||||
extensionFilterToggle = element(by.id('adf-extension-filter-upload-switch'));
|
extensionFilterToggle = $('#adf-extension-filter-upload-switch');
|
||||||
maxSizeToggle = element(by.id('adf-max-size-filter-upload-switch'));
|
maxSizeToggle = $('#adf-max-size-filter-upload-switch');
|
||||||
versioningToggle = element(by.id('adf-version-upload-switch'));
|
versioningToggle = $('#adf-version-upload-switch');
|
||||||
extensionAcceptedField = element(by.css('input[data-automation-id="accepted-files-type"]'));
|
extensionAcceptedField = $('input[data-automation-id="accepted-files-type"]');
|
||||||
maxSizeField = element(by.css('input[data-automation-id="max-files-size"]'));
|
maxSizeField = $('input[data-automation-id="max-files-size"]');
|
||||||
disableUploadCheckbox = element(by.css('[id="adf-disable-upload"]'));
|
disableUploadCheckbox = $('[id="adf-disable-upload"]');
|
||||||
|
|
||||||
async enableMultipleFileUpload(): Promise<void> {
|
async enableMultipleFileUpload(): Promise<void> {
|
||||||
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
|
await browser.executeScript('arguments[0].scrollIntoView()', this.multipleFileUploadToggle);
|
||||||
@@ -46,7 +46,7 @@ export class UploadTogglesPage {
|
|||||||
|
|
||||||
async checkFolderUploadToggleIsEnabled(): Promise<boolean> {
|
async checkFolderUploadToggleIsEnabled(): Promise<boolean> {
|
||||||
try {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(enabledFolderUpload);
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch {
|
||||||
@@ -55,17 +55,17 @@ export class UploadTogglesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkMultipleFileUploadToggleIsEnabled(): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkMaxSizeToggleIsEnabled(): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkVersioningToggleIsEnabled(): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ export class UploadTogglesPage {
|
|||||||
}
|
}
|
||||||
async checkFolderUploadToggleIsNotEnabled(): Promise<boolean> {
|
async checkFolderUploadToggleIsNotEnabled(): Promise<boolean> {
|
||||||
try {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(inactiveToggleFolder);
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch {
|
||||||
|
@@ -15,18 +15,13 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element, ElementFinder } from 'protractor';
|
import { $, ElementFinder } from 'protractor';
|
||||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class IconsPage {
|
export class IconsPage {
|
||||||
|
|
||||||
locateCustomIcon(name: string): ElementFinder {
|
locateCustomIcon = (name: string): ElementFinder => $(`adf-icon[value='${name}'] svg`);
|
||||||
return element(by.css(`adf-icon[value='${name}'] svg`));
|
locateLigatureIcon = (name: string): ElementFinder => $(`adf-icon[value='${name}'] .material-icons`);
|
||||||
}
|
|
||||||
|
|
||||||
locateLigatureIcon(name: string): ElementFinder {
|
|
||||||
return element(by.css(`adf-icon[value='${name}'] .material-icons`));
|
|
||||||
}
|
|
||||||
|
|
||||||
async isCustomIconDisplayed(name: string) {
|
async isCustomIconDisplayed(name: string) {
|
||||||
const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateCustomIcon(name));
|
const present = await BrowserVisibility.waitUntilElementIsVisible(this.locateCustomIcon(name));
|
||||||
|
@@ -15,18 +15,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, ElementFinder } from 'protractor';
|
import { ElementFinder, $, $$ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class InfinitePaginationPage {
|
export class InfinitePaginationPage {
|
||||||
|
|
||||||
rootElement: ElementFinder;
|
rootElement: ElementFinder;
|
||||||
loadMoreButton;
|
loadMoreButton: ElementFinder;
|
||||||
loading = element(by.css('[data-automation-id="adf-infinite-pagination-spinner"]'));
|
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.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> {
|
async clickLoadMoreButton(): Promise<void> {
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* 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';
|
import { TogglePage, BrowserActions, BrowserVisibility, LoginPage } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class LoginShellPage {
|
export class LoginShellPage {
|
||||||
@@ -24,33 +24,33 @@ export class LoginShellPage {
|
|||||||
loginSSOPage = new LoginPage();
|
loginSSOPage = new LoginPage();
|
||||||
|
|
||||||
togglePage = new TogglePage();
|
togglePage = new TogglePage();
|
||||||
txtUsername = element(by.css('input[id="username"]'));
|
txtUsername = $('input[id="username"]');
|
||||||
txtPassword = element(by.css('input[id="password"]'));
|
txtPassword = $('input[id="password"]');
|
||||||
logoImg = element(by.css('img[id="adf-login-img-logo"]'));
|
logoImg = $('img[id="adf-login-img-logo"]');
|
||||||
successRouteTxt = element(by.css('input[data-automation-id="adf-success-route"]'));
|
successRouteTxt = $('input[data-automation-id="adf-success-route"]');
|
||||||
logoTxt = element(by.css('input[data-automation-id="adf-url-logo"]'));
|
logoTxt = $('input[data-automation-id="adf-url-logo"]');
|
||||||
usernameError = element(by.css('span[data-automation-id="username-error"]'));
|
usernameError = $('span[data-automation-id="username-error"]');
|
||||||
passwordError = element(by.css('span[data-automation-id="password-required"]'));
|
passwordError = $('span[data-automation-id="password-required"]');
|
||||||
loginError = element(by.css('.adf-login-error-message'));
|
loginError = $('.adf-login-error-message');
|
||||||
usernameInactive = element(by.css('input[id="username"][aria-invalid="false"]'));
|
usernameInactive = $('input[id="username"][aria-invalid="false"]');
|
||||||
passwordInactive = element(by.css('input[id="password"][aria-invalid="false"]'));
|
passwordInactive = $('input[id="password"][aria-invalid="false"]');
|
||||||
adfLogo = element(by.css('.adf-img-logo'));
|
adfLogo = $('.adf-img-logo');
|
||||||
|
|
||||||
usernameHighlighted = element(by.css('input[id="username"][aria-invalid="true"]'));
|
usernameHighlighted = $('input[id="username"][aria-invalid="true"]');
|
||||||
passwordHighlighted = element(by.css('input[id="password"][aria-invalid="true"]'));
|
passwordHighlighted = $('input[id="password"][aria-invalid="true"]');
|
||||||
signInButton = element(by.id('login-button'));
|
signInButton = $('#login-button');
|
||||||
showPasswordElement = element(by.css('button[data-automation-id="show_password"]'));
|
showPasswordElement = $('button[data-automation-id="show_password"]');
|
||||||
hidePasswordElement = element(by.css('button[data-automation-id="hide_password"]'));
|
hidePasswordElement = $('button[data-automation-id="hide_password"]');
|
||||||
rememberMe = element(by.css('mat-checkbox[id="adf-login-remember"]'));
|
rememberMe = $('mat-checkbox[id="adf-login-remember"]');
|
||||||
needHelp = element(by.id('adf-login-action-left'));
|
needHelp = $('#adf-login-action-left');
|
||||||
register = element(by.id('adf-login-action-right'));
|
register = $('#adf-login-action-right');
|
||||||
footerSwitch = element(by.id('switch4'));
|
footerSwitch = $('#switch4');
|
||||||
rememberMeSwitch = element(by.id('adf-toggle-show-rememberme'));
|
rememberMeSwitch = $('#adf-toggle-show-rememberme');
|
||||||
successRouteSwitch = element(by.id('adf-toggle-show-successRoute'));
|
successRouteSwitch = $('#adf-toggle-show-successRoute');
|
||||||
logoSwitch = element(by.id('adf-toggle-logo'));
|
logoSwitch = $('#adf-toggle-logo');
|
||||||
header = element(by.id('adf-header'));
|
header = $('#adf-header');
|
||||||
settingsIcon = element(by.cssContainingText('a[data-automation-id="settings"] mat-icon', 'settings'));
|
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> {
|
async goToLoginPage(): Promise<void> {
|
||||||
await BrowserActions.getUrl(this.loginURL);
|
await BrowserActions.getUrl(this.loginURL);
|
||||||
|
@@ -15,12 +15,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element, ElementFinder } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { BrowserVisibility } from '@alfresco/adf-testing';
|
import { BrowserVisibility } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class LogoutPage {
|
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() {
|
async checkLogoutSectionIsDisplayed() {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
|
await BrowserVisibility.waitUntilElementIsVisible(this.logoutSection);
|
||||||
|
@@ -15,45 +15,48 @@
|
|||||||
* limitations under the License.
|
* 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';
|
import { BrowserActions, BrowserVisibility, DropdownPage, TestElement, Logger } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class MetadataViewPage {
|
export class MetadataViewPage {
|
||||||
|
|
||||||
title = element(by.css(`div[info-drawer-title]`));
|
title = $(`div[info-drawer-title]`);
|
||||||
expandedAspect = element(by.css(`mat-expansion-panel-header[aria-expanded='true']`));
|
expandedAspect = $(`mat-expansion-panel-header[aria-expanded='true']`);
|
||||||
aspectTitle: Locator = by.css(`mat-panel-title`);
|
aspectTitle = `mat-panel-title`;
|
||||||
name = element(by.css(`[data-automation-id='card-textitem-value-properties.cm:name']`));
|
name = $(`[data-automation-id='card-textitem-value-properties.cm:name']`);
|
||||||
creator = element(by.css(`[data-automation-id='card-textitem-value-createdByUser.displayName']`));
|
creator = $(`[data-automation-id='card-textitem-value-createdByUser.displayName']`);
|
||||||
createdDate = element(by.css(`span[data-automation-id='card-dateitem-createdAt']`));
|
createdDate = $(`span[data-automation-id='card-dateitem-createdAt']`);
|
||||||
modifier = element(by.css(`[data-automation-id='card-textitem-value-modifiedByUser.displayName']`));
|
modifier = $(`[data-automation-id='card-textitem-value-modifiedByUser.displayName']`);
|
||||||
modifiedDate = element(by.css(`span[data-automation-id='card-dateitem-modifiedAt']`));
|
modifiedDate = $(`span[data-automation-id='card-dateitem-modifiedAt']`);
|
||||||
mimetypeName = element(by.css(`[data-automation-id='card-textitem-value-content.mimeTypeName']`));
|
mimetypeName = $(`[data-automation-id='card-textitem-value-content.mimeTypeName']`);
|
||||||
size = element(by.css(`[data-automation-id='card-textitem-value-content.sizeInBytes']`));
|
size = $(`[data-automation-id='card-textitem-value-content.sizeInBytes']`);
|
||||||
description = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:description']`));
|
description = $(`span[data-automation-id='card-textitem-value-properties.cm:description']`);
|
||||||
author = element(by.css(`[data-automation-id='card-textitem-value-properties.cm:author']`));
|
author = $(`[data-automation-id='card-textitem-value-properties.cm:author']`);
|
||||||
titleProperty = element(by.css(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`));
|
titleProperty = $(`span[data-automation-id='card-textitem-value-properties.cm:title'] span`);
|
||||||
editIcon = element(by.css(`button[data-automation-id='meta-data-card-toggle-edit']`));
|
editIcon = $(`button[data-automation-id='meta-data-card-toggle-edit']`);
|
||||||
informationButton = element(by.css(`button[data-automation-id='meta-data-card-toggle-expand']`));
|
informationButton = $(`button[data-automation-id='meta-data-card-toggle-expand']`);
|
||||||
informationSpan = element(by.css(`span[data-automation-id='meta-data-card-toggle-expand-label']`));
|
informationSpan = $(`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`));
|
informationIcon = $(`span[data-automation-id='meta-data-card-toggle-expand-label'] ~ mat-icon`);
|
||||||
displayEmptySwitch = element(by.id(`adf-metadata-empty`));
|
displayEmptySwitch = $(`#adf-metadata-empty`);
|
||||||
readonlySwitch = element(by.id(`adf-metadata-readonly`));
|
readonlySwitch = $(`#adf-metadata-readonly`);
|
||||||
multiSwitch = element(by.id(`adf-metadata-multi`));
|
multiSwitch = $(`#adf-metadata-multi`);
|
||||||
presetSwitch = element(by.id('adf-toggle-custom-preset'));
|
presetSwitch = $('#adf-toggle-custom-preset');
|
||||||
defaultPropertiesSwitch = element(by.id('adf-metadata-default-properties'));
|
defaultPropertiesSwitch = $('#adf-metadata-default-properties');
|
||||||
closeButton = element(by.cssContainingText('button.mat-button span', 'Close'));
|
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'));
|
applyAspect = element(by.cssContainingText(`button span.mat-button-wrapper`, 'Apply Aspect'));
|
||||||
saveMetadataButton = element(by.css(`[data-automation-id='save-metadata']`));
|
saveMetadataButton = $(`[data-automation-id='save-metadata']`);
|
||||||
resetMetadataButton = element(by.css(`[data-automation-id='reset-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> {
|
async getTitle(): Promise<string> {
|
||||||
return BrowserActions.getText(this.title);
|
return BrowserActions.getText(this.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getExpandedAspectName(): Promise<string> {
|
async getExpandedAspectName(): Promise<string> {
|
||||||
return BrowserActions.getText(this.expandedAspect.element(this.aspectTitle));
|
return BrowserActions.getText(this.expandedAspect.$(this.aspectTitle));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getName(): Promise<string> {
|
async getName(): Promise<string> {
|
||||||
@@ -138,79 +141,79 @@ export class MetadataViewPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async editPropertyIconIsDisplayed(propertyName: string) {
|
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);
|
await BrowserVisibility.waitUntilElementIsPresent(editPropertyIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickResetButton(): Promise<void> {
|
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);
|
await BrowserActions.click(clearPropertyIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
async enterPropertyText(propertyName: string, text: string | number): Promise<void> {
|
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 BrowserActions.clearSendKeys(textField, text.toString());
|
||||||
await textField.sendKeys(protractor.Key.ENTER);
|
await textField.sendKeys(protractor.Key.ENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
async enterPresetText(text: string): Promise<void> {
|
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 BrowserActions.clearSendKeys(presetField, text.toString());
|
||||||
await presetField.sendKeys(protractor.Key.ENTER);
|
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);
|
await BrowserActions.click(applyButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
async enterDescriptionText(text: string): Promise<void> {
|
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 BrowserActions.clearSendKeys(textField, text);
|
||||||
await textField.sendKeys(Key.TAB);
|
await textField.sendKeys(Key.TAB);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPropertyText(propertyName: string, type?: string): Promise<string> {
|
async getPropertyText(propertyName: string, type?: string): Promise<string> {
|
||||||
const propertyType = type || 'textitem';
|
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);
|
return BrowserActions.getInputValue(textField);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPropertyIconTooltip(propertyName: string): Promise<string> {
|
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');
|
return BrowserActions.getAttribute(editPropertyIcon, 'title');
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickMetadataGroup(groupName: string): Promise<void> {
|
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);
|
await BrowserActions.click(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkMetadataGroupIsPresent(groupName: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkMetadataGroupIsNotPresent(groupName: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsNotVisible(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkMetadataGroupIsExpand(groupName: string): Promise<void> {
|
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');
|
await expect(await BrowserActions.getAttribute(group, 'class')).toContain('mat-expanded');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkMetadataGroupIsNotExpand(groupName: string): Promise<void> {
|
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');
|
await expect(await BrowserActions.getAttribute(group, 'class')).not.toContain('mat-expanded');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMetadataGroupTitle(groupName: string): Promise<string> {
|
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);
|
return BrowserActions.getText(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkPropertyIsVisible(propertyName: string, type: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,32 +16,34 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { AppListCloudPage, BrowserActions, BrowserVisibility, Logger } from '@alfresco/adf-testing';
|
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';
|
import { ProcessServicesPage } from '../../process-services/pages/process-services.page';
|
||||||
|
|
||||||
export class NavigationBarPage {
|
export class NavigationBarPage {
|
||||||
|
|
||||||
linkListContainer = element(by.css('.app-sidenav-linklist'));
|
linkListContainer = $('.app-sidenav-linklist');
|
||||||
linkMenuChildrenContainer = element(by.css('.nestedMenu'));
|
linkMenuChildrenContainer = $('.nestedMenu');
|
||||||
dataTableNestedButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Datatable"]'));
|
dataTableNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Datatable"]');
|
||||||
dataTableCopyContentButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Copy Content"]'));
|
dataTableCopyContentButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Copy Content"]');
|
||||||
dataTableDragAndDropButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Drag and Drop"]'));
|
dataTableDragAndDropButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Drag and Drop"]');
|
||||||
processServicesNestedButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="App"]'));
|
processServicesNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="App"]');
|
||||||
processServicesCloudHomeButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Home"]'));
|
processServicesCloudHomeButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Home"]');
|
||||||
themeButton = element(by.css('button[data-automation-id="theme menu"]'));
|
themeButton = $('button[data-automation-id="theme menu"]');
|
||||||
themeMenuContent = element(by.css('div[class*="mat-menu-panel"]'));
|
themeMenuContent = $('div[class*="mat-menu-panel"]');
|
||||||
appTitle = element(by.css('.adf-app-title'));
|
appTitle = $('.adf-app-title');
|
||||||
menuButton = element(by.css('button[data-automation-id="adf-menu-icon"]'));
|
menuButton = $('button[data-automation-id="adf-menu-icon"]');
|
||||||
formButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Form"]'));
|
formButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Form"]');
|
||||||
peopleGroupCloudButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="People/Group Cloud"]'));
|
peopleGroupCloudButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="People/Group Cloud"]');
|
||||||
serviceTaskListButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Service Task List"]'));
|
serviceTaskListButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Service Task List"]');
|
||||||
logoutSection: ElementFinder = element(by.css('div[data-automation-id="adf-logout-section"]'));
|
logoutSection = $('div[data-automation-id="adf-logout-section"]');
|
||||||
personalFiles: ElementFinder = element(by.css('div [title="Personal Files"]'));
|
personalFiles = $('div [title="Personal Files"]');
|
||||||
|
|
||||||
|
getMenuItemLocator = (title: string) => $(`.app-sidenav-link[data-automation-id="${title}"]`);
|
||||||
|
|
||||||
async clickNavigationBarItem(title: string, untilElementIsVisible?: ElementFinder): Promise<void> {
|
async clickNavigationBarItem(title: string, untilElementIsVisible?: ElementFinder): Promise<void> {
|
||||||
Logger.log(`clickNavigationBarItem ${title}`);
|
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();
|
await BrowserActions.closeMenuAndDialogs();
|
||||||
|
|
||||||
if (untilElementIsVisible) {
|
if (untilElementIsVisible) {
|
||||||
@@ -69,7 +71,7 @@ export class NavigationBarPage {
|
|||||||
|
|
||||||
async clickProcessCloudButton() {
|
async clickProcessCloudButton() {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
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> {
|
async navigateToProcessServicesCloudPage(): Promise<AppListCloudPage> {
|
||||||
@@ -99,11 +101,7 @@ export class NavigationBarPage {
|
|||||||
|
|
||||||
private async clickProcessServicesButton() {
|
private async clickProcessServicesButton() {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
await BrowserActions.closeMenuAndDialogs();
|
||||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItem('Process Services'), this.linkMenuChildrenContainer);
|
await BrowserActions.clickUntilIsNotVisible(this.getMenuItemLocator('Process Services'), this.linkMenuChildrenContainer);
|
||||||
}
|
|
||||||
|
|
||||||
private getMenuItem(title: string) {
|
|
||||||
return element(by.css(`.app-sidenav-link[data-automation-id="${title}"]`));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async navigateToProcessServicesPage(): Promise<ProcessServicesPage> {
|
async navigateToProcessServicesPage(): Promise<ProcessServicesPage> {
|
||||||
@@ -205,7 +203,7 @@ export class NavigationBarPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickOnSpecificThemeButton(themeName): Promise<void> {
|
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 BrowserActions.click(themeElement);
|
||||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||||
}
|
}
|
||||||
@@ -223,12 +221,12 @@ export class NavigationBarPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkToolbarColor(color: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(toolbarColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickAppLogo(logoTitle: string): Promise<void> {
|
async clickAppLogo(logoTitle: string): Promise<void> {
|
||||||
const appLogo = element(by.css('a[title="' + logoTitle + '"]'));
|
const appLogo = $('a[title="' + logoTitle + '"]');
|
||||||
await BrowserActions.click(appLogo);
|
await BrowserActions.click(appLogo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +235,7 @@ export class NavigationBarPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkLogoTooltip(logoTooltipTitle: string): Promise<void> {
|
async checkLogoTooltip(logoTooltipTitle: string): Promise<void> {
|
||||||
const logoTooltip = element(by.css('a[title="' + logoTooltipTitle + '"]'));
|
const logoTooltip = $('a[title="' + logoTooltipTitle + '"]');
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(logoTooltip);
|
await BrowserVisibility.waitUntilElementIsVisible(logoTooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,24 +15,24 @@
|
|||||||
* limitations under the License.
|
* 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';
|
import { BrowserVisibility, BrowserActions, DropdownPage, SnackbarPage } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class NotificationDemoPage {
|
export class NotificationDemoPage {
|
||||||
|
|
||||||
snackbarPage = new SnackbarPage();
|
snackbarPage = new SnackbarPage();
|
||||||
|
|
||||||
messageField = element(by.css('input[data-automation-id="notification-message"]'));
|
messageField = $('input[data-automation-id="notification-message"]');
|
||||||
durationField = element(by.css('input[data-automation-id="notification-duration"]'));
|
durationField = $('input[data-automation-id="notification-duration"]');
|
||||||
actionToggle = element(by.css('mat-slide-toggle[data-automation-id="notification-action-toggle"]'));
|
actionToggle = $('mat-slide-toggle[data-automation-id="notification-action-toggle"]');
|
||||||
notificationSnackBar = element.all(by.css('simple-snack-bar')).first();
|
notificationSnackBar = $$('simple-snack-bar').first();
|
||||||
actionOutput = element(by.css('div[data-automation-id="notification-action-output"]'));
|
actionOutput = $('div[data-automation-id="notification-action-output"]');
|
||||||
notificationsPage = element(by.css('.app-sidenav-link[data-automation-id="Notifications"]'));
|
notificationsPage = $('.app-sidenav-link[data-automation-id="Notifications"]');
|
||||||
notificationConfig = element(by.css('p[data-automation-id="notification-custom-object"]'));
|
notificationConfig = $('p[data-automation-id="notification-custom-object"]');
|
||||||
|
|
||||||
horizontalPositionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-horizontal-position"]')));
|
horizontalPositionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-horizontal-position"]'));
|
||||||
verticalPositionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-vertical-position"]')));
|
verticalPositionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-vertical-position"]'));
|
||||||
directionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-direction"]')));
|
directionDropdown = new DropdownPage($('mat-select[data-automation-id="notification-direction"]'));
|
||||||
|
|
||||||
async checkNotifyContains(message): Promise<void> {
|
async checkNotifyContains(message): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('simple-snack-bar', message)).first());
|
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('simple-snack-bar', message)).first());
|
||||||
@@ -79,7 +79,7 @@ export class NotificationDemoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickNotificationButton(): Promise<void> {
|
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);
|
await BrowserActions.click(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,19 +16,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, DocumentListPage } from '@alfresco/adf-testing';
|
||||||
import { Locator, element, by, browser } from 'protractor';
|
import { browser, $$, $ } from 'protractor';
|
||||||
|
|
||||||
export class TrashcanPage {
|
export class TrashcanPage {
|
||||||
|
|
||||||
contentList = new DocumentListPage(element(by.css('adf-document-list')));
|
contentList = new DocumentListPage($('adf-document-list'));
|
||||||
rows: Locator = by.css('adf-document-list div[class*="adf-datatable-body"] adf-datatable-row[class*="adf-datatable-row"]');
|
rows = $$('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();
|
tableBody = $$('adf-document-list .adf-datatable-body').first();
|
||||||
pagination = element(by.css('adf-pagination'));
|
pagination = $('adf-pagination');
|
||||||
emptyTrashcan = element(by.css('adf-empty-content'));
|
emptyTrashcan = $('adf-empty-content');
|
||||||
restoreButton = element(by.css(`button[title='Restore']`));
|
restoreButton = $(`button[title='Restore']`);
|
||||||
|
|
||||||
async numberOfResultsDisplayed(): Promise<number> {
|
async numberOfResultsDisplayed(): Promise<number> {
|
||||||
return element.all(this.rows).count();
|
return this.rows.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
async waitForTableBody(): Promise<void> {
|
async waitForTableBody(): Promise<void> {
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { BrowserActions, TestElement, TogglePage } from '@alfresco/adf-testing';
|
import { BrowserActions, TestElement, TogglePage } from '@alfresco/adf-testing';
|
||||||
import { browser, by, element } from 'protractor';
|
import { $, browser } from 'protractor';
|
||||||
|
|
||||||
export class VersionManagePage {
|
export class VersionManagePage {
|
||||||
|
|
||||||
@@ -31,9 +31,9 @@ export class VersionManagePage {
|
|||||||
majorRadio = TestElement.byId('adf-new-version-major');
|
majorRadio = TestElement.byId('adf-new-version-major');
|
||||||
minorRadio = TestElement.byId('adf-new-version-minor');
|
minorRadio = TestElement.byId('adf-new-version-minor');
|
||||||
commentText = TestElement.byId('adf-new-version-text-area');
|
commentText = TestElement.byId('adf-new-version-text-area');
|
||||||
readOnlySwitch = element(by.id('adf-version-manager-switch-readonly'));
|
readOnlySwitch = $('#adf-version-manager-switch-readonly');
|
||||||
downloadSwitch = element(by.id('adf-version-manager-switch-download'));
|
downloadSwitch = $('#adf-version-manager-switch-download');
|
||||||
commentsSwitch = element(by.id('adf-version-manager-switch-comments'));
|
commentsSwitch = $('#adf-version-manager-switch-comments');
|
||||||
confirmAccept = TestElement.byId('adf-confirm-accept');
|
confirmAccept = TestElement.byId('adf-confirm-accept');
|
||||||
confirmCancel = TestElement.byId('adf-confirm-cancel');
|
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 paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||||
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
|
||||||
|
|
||||||
let list = await contentServicesPage.getAllRowsNameColumn();
|
let list = await contentServicesPage.getAllRowsNameColumn();
|
||||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
|
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
|
||||||
|
|
||||||
await paginationPage.clickOnNextPage();
|
await paginationPage.clickOnNextPage();
|
||||||
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
|
||||||
|
|
||||||
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||||
|
|
||||||
list = await contentServicesPage.getAllRowsNameColumn();
|
list = await contentServicesPage.getAllRowsNameColumn();
|
||||||
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(5, 6))).toEqual(true);
|
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(5, 6))).toEqual(true);
|
||||||
|
|
||||||
await contentServicesPage.deleteContent(lastFile);
|
await contentServicesPage.deleteContent(lastFile);
|
||||||
await contentServicesPage.checkContentIsNotDisplayed(lastFile);
|
await contentServicesPage.checkContentIsNotDisplayed(lastFile);
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@ import {
|
|||||||
TaskFormCloudComponent,
|
TaskFormCloudComponent,
|
||||||
StartProcessCloudPage, ProcessCloudWidgetPage
|
StartProcessCloudPage, ProcessCloudWidgetPage
|
||||||
} from '@alfresco/adf-testing';
|
} from '@alfresco/adf-testing';
|
||||||
import { browser, by } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
|
|
||||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||||
import { TasksCloudDemoPage } from '.././pages/tasks-cloud-demo.page';
|
import { TasksCloudDemoPage } from '.././pages/tasks-cloud-demo.page';
|
||||||
@@ -96,11 +96,11 @@ describe('Task cloud visibility', async () => {
|
|||||||
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
||||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
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 taskFormCloudComponent.formFields().checkWidgetIsVisible('Number2');
|
||||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
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 expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||||
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
||||||
});
|
});
|
||||||
@@ -125,15 +125,15 @@ describe('Task cloud visibility', async () => {
|
|||||||
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
||||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
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 taskFormCloudComponent.formFields().checkWidgetIsVisible('Number2');
|
||||||
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
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 expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||||
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
|
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 expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
||||||
await taskFormCloudComponent.clickCompleteButton();
|
await taskFormCloudComponent.clickCompleteButton();
|
||||||
});
|
});
|
||||||
|
@@ -15,30 +15,30 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { by, element, $, $$ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class PeopleGroupCloudComponentPage {
|
export class PeopleGroupCloudComponentPage {
|
||||||
|
|
||||||
peopleCloudSingleSelectionChecked = element(by.css('mat-radio-button[data-automation-id="app-people-single-mode"][class*="mat-radio-checked"]'));
|
peopleCloudSingleSelectionChecked = $('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"]'));
|
peopleCloudMultipleSelectionChecked = $('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"]'));
|
peopleCloudSingleSelection = $('mat-radio-button[data-automation-id="app-people-single-mode"]');
|
||||||
peopleCloudMultipleSelection = element(by.css('mat-radio-button[data-automation-id="app-people-multiple-mode"]'));
|
peopleCloudMultipleSelection = $('mat-radio-button[data-automation-id="app-people-multiple-mode"]');
|
||||||
peopleCloudFilterRole = element(by.css('mat-radio-button[data-automation-id="app-people-filter-role"]'));
|
peopleCloudFilterRole = $('mat-radio-button[data-automation-id="app-people-filter-role"]');
|
||||||
groupCloudSingleSelection = element(by.css('mat-radio-button[data-automation-id="app-group-single-mode"]'));
|
groupCloudSingleSelection = $('mat-radio-button[data-automation-id="app-group-single-mode"]');
|
||||||
groupCloudMultipleSelection = element(by.css('mat-radio-button[data-automation-id="app-group-multiple-mode"]'));
|
groupCloudMultipleSelection = $('mat-radio-button[data-automation-id="app-group-multiple-mode"]');
|
||||||
groupCloudFilterRole = element(by.css('mat-radio-button[data-automation-id="app-group-filter-role"]'));
|
groupCloudFilterRole = $('mat-radio-button[data-automation-id="app-group-filter-role"]');
|
||||||
peopleRoleInput = element(by.css('input[data-automation-id="app-people-roles-input"]'));
|
peopleRoleInput = $('input[data-automation-id="app-people-roles-input"]');
|
||||||
peopleAppInput = element(by.css('input[data-automation-id="app-people-app-input"]'));
|
peopleAppInput = $('input[data-automation-id="app-people-app-input"]');
|
||||||
peoplePreselect = element(by.css('input[data-automation-id="app-people-preselect-input"]'));
|
peoplePreselect = $('input[data-automation-id="app-people-preselect-input"]');
|
||||||
groupRoleInput = element(by.css('input[data-automation-id="app-group-roles-input"]'));
|
groupRoleInput = $('input[data-automation-id="app-group-roles-input"]');
|
||||||
groupAppInput = element(by.css('input[data-automation-id="app-group-app-input"]'));
|
groupAppInput = $('input[data-automation-id="app-group-app-input"]');
|
||||||
peopleCloudComponentTitle = element(by.cssContainingText('mat-card-title', 'People Cloud Component'));
|
peopleCloudComponentTitle = element(by.cssContainingText('mat-card-title', 'People Cloud Component'));
|
||||||
groupCloudComponentTitle = element(by.cssContainingText('mat-card-title', 'Groups Cloud Component'));
|
groupCloudComponentTitle = element(by.cssContainingText('mat-card-title', 'Groups Cloud Component'));
|
||||||
preselectValidation = element.all(by.css('mat-checkbox.app-preselect-value')).first();
|
preselectValidation = $$('mat-checkbox.app-preselect-value').first();
|
||||||
preselectValidationStatus = element.all(by.css('mat-checkbox.app-preselect-value label input')).first();
|
preselectValidationStatus = $$('mat-checkbox.app-preselect-value label input').first();
|
||||||
peopleFilterByAppName = element(by.css('.app-people-control-options mat-radio-button[value="appName"]'));
|
peopleFilterByAppName = $('.app-people-control-options mat-radio-button[value="appName"]');
|
||||||
groupFilterByAppName = element(by.css('.app-groups-control-options mat-radio-button[value="appName"]'));
|
groupFilterByAppName = $('.app-groups-control-options mat-radio-button[value="appName"]');
|
||||||
|
|
||||||
async checkPeopleCloudComponentTitleIsDisplayed(): Promise<void> {
|
async checkPeopleCloudComponentTitleIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudComponentTitle);
|
await BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudComponentTitle);
|
||||||
|
@@ -16,12 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, EditProcessFilterCloudComponentPage, ProcessFiltersCloudComponentPage, ProcessListCloudComponentPage } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, EditProcessFilterCloudComponentPage, ProcessFiltersCloudComponentPage, ProcessListCloudComponentPage } from '@alfresco/adf-testing';
|
||||||
import { by, element } from 'protractor';
|
import { by, element, $ } from 'protractor';
|
||||||
|
|
||||||
export class ProcessCloudDemoPage {
|
export class ProcessCloudDemoPage {
|
||||||
|
|
||||||
createButton = element(by.css('button[data-automation-id="create-button"'));
|
createButton = $('button[data-automation-id="create-button"');
|
||||||
newProcessButton = element(by.css('button[data-automation-id="btn-start-process"]'));
|
newProcessButton = $('button[data-automation-id="btn-start-process"]');
|
||||||
|
|
||||||
processListCloud = new ProcessListCloudComponentPage();
|
processListCloud = new ProcessListCloudComponentPage();
|
||||||
editProcessFilterCloud = new EditProcessFilterCloudComponentPage();
|
editProcessFilterCloud = new EditProcessFilterCloudComponentPage();
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import {
|
import {
|
||||||
BrowserVisibility,
|
BrowserVisibility,
|
||||||
BrowserActions,
|
BrowserActions,
|
||||||
@@ -24,15 +24,15 @@ import {
|
|||||||
|
|
||||||
export class ServiceTaskListPage {
|
export class ServiceTaskListPage {
|
||||||
dataTableComponentPage = new DataTableComponentPage();
|
dataTableComponentPage = new DataTableComponentPage();
|
||||||
allServiceTaskButton = element(by.css('button[data-automation-id="my-service-tasks_filter"]'));
|
allServiceTaskButton = $('button[data-automation-id="my-service-tasks_filter"]');
|
||||||
completedServiceTaskButton = element(by.css('button[data-automation-id="completed-tasks_filter"]'));
|
completedServiceTaskButton = $('button[data-automation-id="completed-tasks_filter"]');
|
||||||
errorServiceTaskButton = element(by.css('button[data-automation-id="errored-service-tasks_filter"]'));
|
errorServiceTaskButton = $('button[data-automation-id="errored-service-tasks_filter"]');
|
||||||
searchHeader = element(by.css('adf-cloud-edit-service-task-filter mat-expansion-panel-header'));
|
searchHeader = $('adf-cloud-edit-service-task-filter mat-expansion-panel-header');
|
||||||
serviceTaskList = element(by.css('adf-cloud-service-task-list'));
|
serviceTaskList = $('adf-cloud-service-task-list');
|
||||||
activityNameField = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-activityName"]'));
|
activityNameField = $('input[data-automation-id="adf-cloud-edit-task-property-activityName"]');
|
||||||
activityStatus = element(by.css('[data-automation-id="datatable-row-0"] div[aria-label="Status"]'));
|
activityStatus = $('[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"]'));
|
activityName = $('[data-automation-id="datatable-row-0"] div[aria-label="Activity name"]');
|
||||||
resultList = element(by.css('div[role="rowgroup"].adf-datatable-body'));
|
resultList = $('div[role="rowgroup"].adf-datatable-body');
|
||||||
|
|
||||||
async checkServiceTaskFiltersDisplayed(): Promise<void> {
|
async checkServiceTaskFiltersDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.allServiceTaskButton);
|
await BrowserVisibility.waitUntilElementIsVisible(this.allServiceTaskButton);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, browser } from 'protractor';
|
import { element, by, browser, $ } from 'protractor';
|
||||||
import {
|
import {
|
||||||
TogglePage,
|
TogglePage,
|
||||||
TaskFiltersCloudComponentPage,
|
TaskFiltersCloudComponentPage,
|
||||||
@@ -30,12 +30,12 @@ export class TasksCloudDemoPage {
|
|||||||
newTaskButton = TestElement.byCss('button[data-automation-id="btn-start-task"]');
|
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();
|
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();
|
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"]'));
|
displayTaskDetailsToggle = $('mat-slide-toggle[data-automation-id="taskDetailsRedirection"]');
|
||||||
displayProcessDetailsToggle = element(by.css('mat-slide-toggle[data-automation-id="processDetailsRedirection"]'));
|
displayProcessDetailsToggle = $('mat-slide-toggle[data-automation-id="processDetailsRedirection"]');
|
||||||
actionMenuToggle = element(by.css('mat-slide-toggle[data-automation-id="actionmenu"]'));
|
actionMenuToggle = $('mat-slide-toggle[data-automation-id="actionmenu"]');
|
||||||
contextMenuToggle = element(by.css('mat-slide-toggle[data-automation-id="contextmenu"]'));
|
contextMenuToggle = $('mat-slide-toggle[data-automation-id="contextmenu"]');
|
||||||
multiSelectionToggle = element(by.css('mat-slide-toggle[data-automation-id="multiSelection"]'));
|
multiSelectionToggle = $('mat-slide-toggle[data-automation-id="multiSelection"]');
|
||||||
testingModeToggle = element(by.css('mat-slide-toggle[data-automation-id="testingMode"]'));
|
testingModeToggle = $('mat-slide-toggle[data-automation-id="testingMode"]');
|
||||||
selectedRows = element(by.xpath("//div[text()=' Selected Rows: ']"));
|
selectedRows = element(by.xpath("//div[text()=' Selected Rows: ']"));
|
||||||
noOfSelectedRows = element.all(by.xpath("//div[text()=' Selected Rows: ']//li"));
|
noOfSelectedRows = element.all(by.xpath("//div[text()=' Selected Rows: ']//li"));
|
||||||
addActionTitle = element(by.cssContainingText('.mat-card-title', 'Add Action'));
|
addActionTitle = element(by.cssContainingText('.mat-card-title', 'Add Action'));
|
||||||
@@ -46,7 +46,7 @@ export class TasksCloudDemoPage {
|
|||||||
disableCheckbox = TestElement.byCss(`mat-checkbox[formcontrolname='disabled']`);
|
disableCheckbox = TestElement.byCss(`mat-checkbox[formcontrolname='disabled']`);
|
||||||
visibleCheckbox = TestElement.byCss(`mat-checkbox[formcontrolname='visible']`);
|
visibleCheckbox = TestElement.byCss(`mat-checkbox[formcontrolname='visible']`);
|
||||||
spinner = TestElement.byTag('mat-progress-spinner');
|
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();
|
togglePage = new TogglePage();
|
||||||
|
|
||||||
|
@@ -128,7 +128,6 @@ describe('Process Task - Attach content file', () => {
|
|||||||
|
|
||||||
await processList.checkContentIsDisplayedById(processInstance.entry.id);
|
await processList.checkContentIsDisplayedById(processInstance.entry.id);
|
||||||
await processList.selectRowById(processInstance.entry.id);
|
await processList.selectRowById(processInstance.entry.id);
|
||||||
|
|
||||||
await taskList.checkTaskListIsLoaded();
|
await taskList.checkTaskListIsLoaded();
|
||||||
await taskList.selectRow(taskName);
|
await taskList.selectRow(taskName);
|
||||||
|
|
||||||
|
@@ -44,7 +44,6 @@ describe('Task filters cloud', () => {
|
|||||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||||
const editTaskFilter = tasksCloudDemoPage.editTaskFilterCloud;
|
const editTaskFilter = tasksCloudDemoPage.editTaskFilterCloud;
|
||||||
const taskList = new TaskListCloudComponentPage();
|
const taskList = new TaskListCloudComponentPage();
|
||||||
|
|
||||||
const apiService = createApiService();
|
const apiService = createApiService();
|
||||||
const identityService = new IdentityService(apiService);
|
const identityService = new IdentityService(apiService);
|
||||||
const groupIdentityService = new GroupIdentityService(apiService);
|
const groupIdentityService = new GroupIdentityService(apiService);
|
||||||
|
@@ -23,7 +23,7 @@ import { createApiService,
|
|||||||
TaskUtil,
|
TaskUtil,
|
||||||
UsersActions
|
UsersActions
|
||||||
} from '@alfresco/adf-testing';
|
} from '@alfresco/adf-testing';
|
||||||
import { browser, by } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||||
import { AttachFormPage } from './../pages/attach-form.page';
|
import { AttachFormPage } from './../pages/attach-form.page';
|
||||||
import { TasksPage } from './../pages/tasks.page';
|
import { TasksPage } from './../pages/tasks.page';
|
||||||
@@ -126,7 +126,7 @@ describe('Attach Form Component', () => {
|
|||||||
await attachFormPage.selectAttachFormOption(testNames.formName);
|
await attachFormPage.selectAttachFormOption(testNames.formName);
|
||||||
await attachFormPage.clickAttachFormButton();
|
await attachFormPage.clickAttachFormButton();
|
||||||
|
|
||||||
await formFields.setFieldValue(by.id, formTextField, testNames.formFieldValue);
|
await formFields.setFieldValue(formTextField, testNames.formFieldValue);
|
||||||
await formFields.completeForm();
|
await formFields.completeForm();
|
||||||
|
|
||||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||||
|
@@ -15,18 +15,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, protractor } from 'protractor';
|
import { element, by, protractor, $ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class AnalyticsPage {
|
export class AnalyticsPage {
|
||||||
|
|
||||||
toolbarTitleInput = element(by.css('input[data-automation-id="reportName"]'));
|
toolbarTitleInput = $('input[data-automation-id="reportName"]');
|
||||||
toolbarTitleContainer = element(by.css('adf-toolbar-title'));
|
toolbarTitleContainer = $('adf-toolbar-title');
|
||||||
toolbarTitle = element(by.xpath('//mat-toolbar/adf-toolbar-title/div/h4'));
|
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> {
|
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);
|
await BrowserActions.click(reportTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,18 +15,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-testing';
|
import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class AttachFormPage {
|
export class AttachFormPage {
|
||||||
|
|
||||||
noFormMessage = element(by.css('.adf-empty-content__title'));
|
noFormMessage = $('.adf-empty-content__title');
|
||||||
attachFormButton = element(by.id('adf-attach-form-attach-button'));
|
attachFormButton = $('#adf-attach-form-attach-button');
|
||||||
completeButton = element(by.id('adf-attach-form-complete-button'));
|
completeButton = $('#adf-attach-form-complete-button');
|
||||||
formDropdown = element(by.id('form_id'));
|
formDropdown = $('#form_id');
|
||||||
cancelButton = element(by.id('adf-attach-form-cancel-button'));
|
cancelButton = $('#adf-attach-form-cancel-button');
|
||||||
defaultTitle = element(by.css('.mat-card-title'));
|
defaultTitle = $('.mat-card-title');
|
||||||
attachFormDropdown = new DropdownPage(element(by.css('.adf-attach-form-row')));
|
attachFormDropdown = new DropdownPage($('.adf-attach-form-row'));
|
||||||
|
|
||||||
async checkNoFormMessageIsDisplayed(): Promise<void> {
|
async checkNoFormMessageIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.noFormMessage);
|
await BrowserVisibility.waitUntilElementIsVisible(this.noFormMessage);
|
||||||
@@ -70,6 +70,6 @@ export class AttachFormPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkAttachFormButtonIsDisabled(): Promise<void> {
|
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.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, protractor, browser } from 'protractor';
|
import { protractor, browser, $, $$ } from 'protractor';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class AttachmentListPage {
|
export class AttachmentListPage {
|
||||||
|
|
||||||
attachFileButton = element(by.css("input[type='file']"));
|
attachFileButton = $("input[type='file']");
|
||||||
buttonMenu = element(by.css("button[data-automation-id='action_menu_0']"));
|
buttonMenu = $("button[data-automation-id='action_menu_0']");
|
||||||
viewButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.VIEW_CONTENT']"));
|
viewButton = $("button[data-automation-id*='MENU_ACTIONS.VIEW_CONTENT']");
|
||||||
removeButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.REMOVE_CONTENT']"));
|
removeButton = $("button[data-automation-id*='MENU_ACTIONS.REMOVE_CONTENT']");
|
||||||
downloadButton = element(by.css("button[data-automation-id*='MENU_ACTIONS.DOWNLOAD_CONTENT']"));
|
downloadButton = $("button[data-automation-id*='MENU_ACTIONS.DOWNLOAD_CONTENT']");
|
||||||
noContentContainer = element(by.css("div[class*='adf-no-content-container']"));
|
noContentContainer = $("div[class*='adf-no-content-container']");
|
||||||
|
|
||||||
async checkEmptyAttachmentList(): Promise<void> {
|
async checkEmptyAttachmentList(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.noContentContainer);
|
await BrowserVisibility.waitUntilElementIsVisible(this.noContentContainer);
|
||||||
@@ -39,7 +39,7 @@ export class AttachmentListPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkFileIsAttached(name: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ export class AttachmentListPage {
|
|||||||
|
|
||||||
async viewFile(name: string): Promise<void> {
|
async viewFile(name: string): Promise<void> {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
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 BrowserActions.click(this.buttonMenu);
|
||||||
await browser.sleep(500);
|
await browser.sleep(500);
|
||||||
await BrowserActions.click(this.viewButton);
|
await BrowserActions.click(this.viewButton);
|
||||||
@@ -58,7 +58,7 @@ export class AttachmentListPage {
|
|||||||
|
|
||||||
async removeFile(name: string): Promise<void> {
|
async removeFile(name: string): Promise<void> {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
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 BrowserActions.click(this.buttonMenu);
|
||||||
await browser.sleep(500);
|
await browser.sleep(500);
|
||||||
await BrowserActions.click(this.removeButton);
|
await BrowserActions.click(this.removeButton);
|
||||||
@@ -67,7 +67,7 @@ export class AttachmentListPage {
|
|||||||
|
|
||||||
async downloadFile(name: string): Promise<void> {
|
async downloadFile(name: string): Promise<void> {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
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 BrowserActions.click(this.buttonMenu);
|
||||||
await browser.sleep(500);
|
await browser.sleep(500);
|
||||||
await BrowserActions.click(this.downloadButton);
|
await BrowserActions.click(this.downloadButton);
|
||||||
@@ -75,14 +75,14 @@ export class AttachmentListPage {
|
|||||||
|
|
||||||
async doubleClickFile(name: string): Promise<void> {
|
async doubleClickFile(name: string): Promise<void> {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
await BrowserActions.closeMenuAndDialogs();
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.css(`div[data-automation-id="${name}"]`)).first());
|
await BrowserVisibility.waitUntilElementIsVisible($$(`div[data-automation-id="${name}"]`).first());
|
||||||
const fileAttached = element.all(by.css(`div[data-automation-id="${name}"]`)).first();
|
const fileAttached = $$(`div[data-automation-id="${name}"]`).first();
|
||||||
await BrowserActions.click(fileAttached);
|
await BrowserActions.click(fileAttached);
|
||||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFileIsRemoved(name: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsNotVisible(fileAttached);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,15 +16,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { TogglePage } from '@alfresco/adf-testing';
|
import { TogglePage } from '@alfresco/adf-testing';
|
||||||
import { element, by } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
|
|
||||||
export class AppSettingsTogglesPage {
|
export class AppSettingsTogglesPage {
|
||||||
|
|
||||||
togglePage = new TogglePage();
|
togglePage = new TogglePage();
|
||||||
|
|
||||||
showDetailsHeaderToggle = element(by.id('adf-show-header'));
|
showDetailsHeaderToggle = $('#adf-show-header');
|
||||||
showTaskFilterIconsToggle = element(by.id('adf-show-task-filter-icon'));
|
showTaskFilterIconsToggle = $('#adf-show-task-filter-icon');
|
||||||
showProcessFilterIconsToggle = element(by.id('adf-show-process-filter-icon'));
|
showProcessFilterIconsToggle = $('#adf-show-process-filter-icon');
|
||||||
|
|
||||||
async enableShowHeader(): Promise<void> {
|
async enableShowHeader(): Promise<void> {
|
||||||
await this.togglePage.enableToggle(this.showDetailsHeaderToggle);
|
await this.togglePage.enableToggle(this.showDetailsHeaderToggle);
|
||||||
|
@@ -15,15 +15,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class ChecklistDialog {
|
export class ChecklistDialog {
|
||||||
|
|
||||||
nameField = element(by.css('input[data-automation-id="checklist-name"]'));
|
nameField = $('input[data-automation-id="checklist-name"]');
|
||||||
addChecklistButton = element(by.css('button[id="add-check"] span'));
|
addChecklistButton = $('button[id="add-check"] span');
|
||||||
closeButton = element(by.css('button[id="close-check-dialog"] span'));
|
closeButton = $('button[id="close-check-dialog"] span');
|
||||||
dialogTitle = element(by.id('add-checklist-title'));
|
dialogTitle = $('#add-checklist-title');
|
||||||
|
|
||||||
async addName(name: string): Promise<void> {
|
async addName(name: string): Promise<void> {
|
||||||
await BrowserActions.clearSendKeys(this.nameField, name);
|
await BrowserActions.clearSendKeys(this.nameField, name);
|
||||||
|
@@ -15,20 +15,20 @@
|
|||||||
* limitations under the License.
|
* 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';
|
import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class StartTaskDialogPage {
|
export class StartTaskDialogPage {
|
||||||
|
|
||||||
name = element(by.css('input[id="name_id"]'));
|
name = $('input[id="name_id"]');
|
||||||
dueDate = element(by.css('input[id="date_id"]'));
|
dueDate = $('input[id="date_id"]');
|
||||||
description = element(by.css('textarea[id="description_id"]'));
|
description = $('textarea[id="description_id"]');
|
||||||
assignee = element(by.css('div#people-widget-content input'));
|
assignee = $('div#people-widget-content input');
|
||||||
startButton = element(by.css('button[id="button-start"]'));
|
startButton = $('button[id="button-start"]');
|
||||||
startButtonEnabled = element(by.css('button[id="button-start"]:not(disabled)'));
|
startButtonEnabled = $('button[id="button-start"]:not(disabled)');
|
||||||
cancelButton = element(by.css('button[id="button-cancel"]'));
|
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();
|
selectAssigneeDropdown = new DropdownPage();
|
||||||
|
|
||||||
async addName(userName: string): Promise<void> {
|
async addName(userName: string): Promise<void> {
|
||||||
@@ -74,7 +74,7 @@ export class StartTaskDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkStartButtonIsDisabled(): Promise<void> {
|
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> {
|
async clickCancelButton(): Promise<void> {
|
||||||
|
@@ -16,11 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
||||||
import { by, element } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
|
|
||||||
export class FiltersPage {
|
export class FiltersPage {
|
||||||
|
|
||||||
activeFilter = element(by.css('.adf-active'));
|
activeFilter = $('.adf-active');
|
||||||
dataTable: DataTableComponentPage = new DataTableComponentPage();
|
dataTable: DataTableComponentPage = new DataTableComponentPage();
|
||||||
|
|
||||||
async getActiveFilter(): Promise<string> {
|
async getActiveFilter(): Promise<string> {
|
||||||
@@ -29,7 +29,7 @@ export class FiltersPage {
|
|||||||
|
|
||||||
async goToFilter(filterName): Promise<void> {
|
async goToFilter(filterName): Promise<void> {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
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 BrowserActions.click(filter);
|
||||||
await this.dataTable.waitTillContentLoaded();
|
await this.dataTable.waitTillContentLoaded();
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ export class FiltersPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkFilterIsHighlighted(filterName: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(highlightedFilter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,12 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, ConfigEditorPage } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, ConfigEditorPage } from '@alfresco/adf-testing';
|
||||||
import { by, element } from 'protractor';
|
import { $$, $ } from 'protractor';
|
||||||
|
|
||||||
export class FormDemoPage {
|
export class FormDemoPage {
|
||||||
|
|
||||||
formCloudEditor = element.all(by.css('.mat-tab-list .mat-tab-label')).get(1);
|
formCloudEditor = $$('.mat-tab-list .mat-tab-label').get(1);
|
||||||
formCloudRender = element.all(by.css('.mat-tab-list .mat-tab-label')).get(0);
|
formCloudRender = $$('.mat-tab-list .mat-tab-label').get(0);
|
||||||
|
|
||||||
configEditorPage = new ConfigEditorPage();
|
configEditorPage = new ConfigEditorPage();
|
||||||
|
|
||||||
@@ -34,8 +34,8 @@ export class FormDemoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setConfigToEditor(text: string): Promise<void> {
|
async setConfigToEditor(text: string): Promise<void> {
|
||||||
const configEditor = element(by.id('adf-form-config-editor'));
|
const configEditor = $('#adf-form-config-editor');
|
||||||
const form = element(by.css('adf-form'));
|
const form = $('adf-form');
|
||||||
await this.goToEditor();
|
await this.goToEditor();
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(configEditor);
|
await BrowserVisibility.waitUntilElementIsVisible(configEditor);
|
||||||
await this.configEditorPage.enterBulkConfiguration(text);
|
await this.configEditorPage.enterBulkConfiguration(text);
|
||||||
|
@@ -16,25 +16,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, StartProcessPage } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, DataTableComponentPage, StartProcessPage } from '@alfresco/adf-testing';
|
||||||
import { Locator, by, element } from 'protractor';
|
import { $, $$ } from 'protractor';
|
||||||
|
|
||||||
export class ProcessFiltersPage {
|
export class ProcessFiltersPage {
|
||||||
|
|
||||||
dataTable = new DataTableComponentPage();
|
dataTable = new DataTableComponentPage();
|
||||||
runningFilter = element(by.css('button[data-automation-id="Running_filter"]'));
|
createProcessButton = $('.app-processes-menu button[data-automation-id="create-button"] > span');
|
||||||
completedFilter = element(by.css('button[data-automation-id="Completed_filter"]'));
|
newProcessButton = $('div > button[data-automation-id="btn-start-process"]');
|
||||||
allFilter = element(by.css('button[data-automation-id="All_filter"]'));
|
processesPage = $('#app-processes-menu');
|
||||||
createProcessButton = element(by.css('.app-processes-menu button[data-automation-id="create-button"] > span'));
|
accordionMenu = $('.app-processes-menu mat-accordion');
|
||||||
newProcessButton = element(by.css('div > button[data-automation-id="btn-start-process"]'));
|
buttonWindow = $('div > button[data-automation-id="btn-start-process"] > div');
|
||||||
processesPage = element(by.id('app-processes-menu'));
|
noContentMessage = $$('.adf-empty-content__title').first();
|
||||||
accordionMenu = element(by.css('.app-processes-menu mat-accordion'));
|
rows = $$('adf-process-instance-list .adf-datatable-body adf-datatable-row[class*="adf-datatable-row"]');
|
||||||
buttonWindow = element(by.css('div > button[data-automation-id="btn-start-process"] > div'));
|
tableBody = $$('adf-datatable .adf-datatable-body').first();
|
||||||
noContentMessage = element.all(by.css('.adf-empty-content__title')).first();
|
processIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
|
||||||
rows: Locator = by.css('adf-process-instance-list .adf-datatable-body adf-datatable-row[class*="adf-datatable-row"]');
|
startProcessEl = $('adf-start-process .adf-start-process');
|
||||||
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');
|
getButtonFilterLocatorByName = (name: string) => $(`button[data-automation-id='${name}_filter']`);
|
||||||
processIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]');
|
|
||||||
startProcessEl = element(by.css('adf-start-process .adf-start-process'));
|
|
||||||
|
|
||||||
async startProcess(): Promise<StartProcessPage> {
|
async startProcess(): Promise<StartProcessPage> {
|
||||||
await this.clickCreateProcessButton();
|
await this.clickCreateProcessButton();
|
||||||
@@ -43,17 +41,19 @@ export class ProcessFiltersPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickRunningFilterButton(): Promise<void> {
|
async clickRunningFilterButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.runningFilter);
|
await BrowserActions.click(await this.getButtonFilterLocatorByName('Running'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickCompletedFilterButton(): Promise<void> {
|
async clickCompletedFilterButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.completedFilter);
|
const completedFilterButtonLocator = await this.getButtonFilterLocatorByName('Completed');
|
||||||
await expect(await this.completedFilter.isEnabled()).toBe(true);
|
await BrowserActions.click(completedFilterButtonLocator);
|
||||||
|
await expect(await completedFilterButtonLocator.isEnabled()).toBe(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickAllFilterButton(): Promise<void> {
|
async clickAllFilterButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.allFilter);
|
const allFilterButtonLocator = await this.getButtonFilterLocatorByName('All');
|
||||||
await expect(await this.allFilter.isEnabled()).toBe(true);
|
await BrowserActions.click(allFilterButtonLocator);
|
||||||
|
await expect(await allFilterButtonLocator.isEnabled()).toBe(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickCreateProcessButton(): Promise<void> {
|
async clickCreateProcessButton(): Promise<void> {
|
||||||
@@ -78,18 +78,18 @@ export class ProcessFiltersPage {
|
|||||||
|
|
||||||
async selectFromProcessList(title: string): Promise<void> {
|
async selectFromProcessList(title: string): Promise<void> {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
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);
|
await BrowserActions.click(processName);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFilterIsHighlighted(filterName: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(processNameHighlighted);
|
||||||
}
|
}
|
||||||
|
|
||||||
async numberOfProcessRows(): Promise<number> {
|
async numberOfProcessRows(): Promise<number> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element.all(this.rows).first());
|
await BrowserVisibility.waitUntilElementIsVisible(await this.rows.first());
|
||||||
return element.all(this.rows).count();
|
return this.rows.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
async waitForTableBody(): Promise<void> {
|
async waitForTableBody(): Promise<void> {
|
||||||
@@ -110,25 +110,25 @@ export class ProcessFiltersPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkFilterIsDisplayed(name: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFilterHasNoIcon(name: string): Promise<void> {
|
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.waitUntilElementIsVisible(filterName);
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(filterName.element(this.processIcon));
|
await BrowserVisibility.waitUntilElementIsNotVisible(filterName.$(this.processIcon));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFilterIcon(name: string): Promise<string> {
|
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);
|
await BrowserVisibility.waitUntilElementIsVisible(filterName);
|
||||||
const icon = filterName.element(this.processIcon);
|
const icon = filterName.$(this.processIcon);
|
||||||
return BrowserActions.getText(icon);
|
return BrowserActions.getText(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFilterIsNotDisplayed(name: string): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsNotVisible(filterName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,18 +16,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||||
import { by, element, protractor } from 'protractor';
|
import { $, by, element, protractor } from 'protractor';
|
||||||
|
|
||||||
export class ProcessListDemoPage {
|
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'));
|
resetButton = element(by.cssContainingText('button span', 'Reset'));
|
||||||
emptyProcessContent = element(by.css('.adf-empty-content'));
|
emptyProcessContent = $('.adf-empty-content');
|
||||||
processDefinitionInput = element(by.css('input[data-automation-id="process-definition-id"]'));
|
processDefinitionInput = $('input[data-automation-id="process-definition-id"]');
|
||||||
processInstanceInput = element(by.css('input[data-automation-id="process-instance-id"]'));
|
processInstanceInput = $('input[data-automation-id="process-instance-id"]');
|
||||||
|
|
||||||
stateDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="state"')));
|
stateDropdown = new DropdownPage($('mat-select[data-automation-id="state"'));
|
||||||
sortDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="sort"')));
|
sortDropdown = new DropdownPage($('mat-select[data-automation-id="sort"'));
|
||||||
|
|
||||||
dataTable = new DataTableComponentPage();
|
dataTable = new DataTableComponentPage();
|
||||||
|
|
||||||
|
@@ -16,12 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
import { element, by } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
|
|
||||||
export class ProcessListPage {
|
export class ProcessListPage {
|
||||||
|
|
||||||
processListTitle = element(by.css('.adf-empty-content__title'));
|
processListTitle = $('.adf-empty-content__title');
|
||||||
processInstanceList = element(by.css('adf-process-instance-list'));
|
processInstanceList = $('adf-process-instance-list');
|
||||||
|
|
||||||
getDisplayedProcessListTitle(): Promise<string> {
|
getDisplayedProcessListTitle(): Promise<string> {
|
||||||
return BrowserActions.getText(this.processListTitle);
|
return BrowserActions.getText(this.processListTitle);
|
||||||
|
@@ -17,23 +17,24 @@
|
|||||||
|
|
||||||
import { ProcessServiceTabBarPage } from './process-service-tab-bar.page';
|
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 { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
import { TasksPage } from './tasks.page';
|
import { TasksPage } from './tasks.page';
|
||||||
|
|
||||||
export class ProcessServicesPage {
|
export class ProcessServicesPage {
|
||||||
|
|
||||||
apsAppsContainer = element(by.css('.adf-app-listgrid'));
|
apsAppsContainer = $('.adf-app-listgrid');
|
||||||
taskApp = element(by.css('mat-card[title="Task App"]'));
|
iconTypeLocator = 'mat-icon[class*="card-logo-icon"]';
|
||||||
iconTypeLocator: Locator = by.css('mat-icon[class*="card-logo-icon"]');
|
descriptionLocator = 'mat-card-subtitle[class*="subtitle"]';
|
||||||
descriptionLocator: Locator = by.css('mat-card-subtitle[class*="subtitle"]');
|
|
||||||
|
getApplicationNameLocator = (name: string): ElementFinder => $(`mat-card[title="${name}"]`);
|
||||||
|
|
||||||
async checkApsContainer(): Promise<void> {
|
async checkApsContainer(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.apsAppsContainer);
|
await BrowserVisibility.waitUntilElementIsVisible(this.apsAppsContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
async goToApp(applicationName: string): Promise<ProcessServiceTabBarPage> {
|
async goToApp(applicationName: string): Promise<ProcessServiceTabBarPage> {
|
||||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
const app = this.getApplicationNameLocator(applicationName);
|
||||||
await BrowserActions.click(app);
|
await BrowserActions.click(app);
|
||||||
const taskPage = new TasksPage();
|
const taskPage = new TasksPage();
|
||||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||||
@@ -41,7 +42,8 @@ export class ProcessServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async goToTaskApp(): Promise<ProcessServiceTabBarPage> {
|
async goToTaskApp(): Promise<ProcessServiceTabBarPage> {
|
||||||
await BrowserActions.click(this.taskApp);
|
const taskAppLocator = this.getApplicationNameLocator('Task App');
|
||||||
|
await BrowserActions.click(taskAppLocator);
|
||||||
return new ProcessServiceTabBarPage();
|
return new ProcessServiceTabBarPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,32 +55,32 @@ export class ProcessServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAppIconType(applicationName: string): Promise<string> {
|
async getAppIconType(applicationName: string): Promise<string> {
|
||||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
const app = this.getApplicationNameLocator(applicationName);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||||
const iconType = app.element(this.iconTypeLocator);
|
const iconType = await app.$(this.iconTypeLocator);
|
||||||
return BrowserActions.getText(iconType);
|
return BrowserActions.getText(iconType);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getBackgroundColor(applicationName: string): Promise<string> {
|
async getBackgroundColor(applicationName: string): Promise<string> {
|
||||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
const app = this.getApplicationNameLocator(applicationName);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||||
return app.getCssValue('background-color');
|
return app.getCssValue('background-color');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getDescription(applicationName: string): Promise<string> {
|
async getDescription(applicationName: string): Promise<string> {
|
||||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
const app = this.getApplicationNameLocator(applicationName);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||||
const description = app.element(this.descriptionLocator);
|
const description = await app.$(this.descriptionLocator);
|
||||||
return BrowserActions.getText(description);
|
return BrowserActions.getText(description);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkAppIsNotDisplayed(applicationName: string): Promise<void> {
|
async checkAppIsNotDisplayed(applicationName: string): Promise<void> {
|
||||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
const app = this.getApplicationNameLocator(applicationName);
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(app);
|
await BrowserVisibility.waitUntilElementIsNotVisible(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkAppIsDisplayed(applicationName: string): Promise<void> {
|
async checkAppIsDisplayed(applicationName: string): Promise<void> {
|
||||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
const app = this.getApplicationNameLocator(applicationName);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(app);
|
await BrowserVisibility.waitUntilElementIsVisible(app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,73 +16,73 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, DropdownPage, TabsPage } from '@alfresco/adf-testing';
|
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';
|
import { AppSettingsTogglesPage } from './dialog/app-settings-toggles.page';
|
||||||
|
|
||||||
export class TaskDetailsPage {
|
export class TaskDetailsPage {
|
||||||
|
|
||||||
appSettingsTogglesClass = new AppSettingsTogglesPage();
|
appSettingsTogglesClass = new AppSettingsTogglesPage();
|
||||||
|
|
||||||
formContent = element(by.css('adf-form'));
|
formContent = $('adf-form');
|
||||||
|
|
||||||
formNameField = element(by.css('[data-automation-id="card-textitem-value-formName"]'));
|
formNameField = $('[data-automation-id="card-textitem-value-formName"]');
|
||||||
formNameButton = element(by.css('[data-automation-id="card-textitem-toggle-formName"]'));
|
formNameButton = $('[data-automation-id="card-textitem-toggle-formName"]');
|
||||||
assigneeField = element(by.css('[data-automation-id="card-textitem-value-assignee"]'));
|
assigneeField = $('[data-automation-id="card-textitem-value-assignee"]');
|
||||||
assigneeButton = element(by.css('[data-automation-id="card-textitem-toggle-assignee"]'));
|
assigneeButton = $('[data-automation-id="card-textitem-toggle-assignee"]');
|
||||||
statusField = element(by.css('[data-automation-id="card-textitem-value-status"]'));
|
statusField = $('[data-automation-id="card-textitem-value-status"]');
|
||||||
categoryField = element(by.css('[data-automation-id="card-textitem-value-category"] '));
|
categoryField = $('[data-automation-id="card-textitem-value-category"] ');
|
||||||
parentNameField = element(by.css('span[data-automation-id*="parentName"] span'));
|
parentNameField = $('span[data-automation-id*="parentName"] span');
|
||||||
parentTaskIdField = element(by.css('[data-automation-id="card-textitem-value-parentTaskId"] '));
|
parentTaskIdField = $('[data-automation-id="card-textitem-value-parentTaskId"] ');
|
||||||
durationField = element(by.css('[data-automation-id="card-textitem-value-duration"] '));
|
durationField = $('[data-automation-id="card-textitem-value-duration"] ');
|
||||||
endDateField = element.all(by.css('span[data-automation-id*="endDate"] span')).first();
|
endDateField = $$('span[data-automation-id*="endDate"] span').first();
|
||||||
createdField = element(by.css('span[data-automation-id="card-dateitem-created"]'));
|
createdField = $('span[data-automation-id="card-dateitem-created"]');
|
||||||
idField = element.all(by.css('[data-automation-id="card-textitem-value-id"]')).first();
|
idField = $$('[data-automation-id="card-textitem-value-id"]').first();
|
||||||
descriptionField = element(by.css('[data-automation-id="card-textitem-value-description"]'));
|
descriptionField = $('[data-automation-id="card-textitem-value-description"]');
|
||||||
dueDateField = element.all(by.css('span[data-automation-id*="dueDate"] span')).first();
|
dueDateField = $$('span[data-automation-id*="dueDate"] span').first();
|
||||||
activitiesTitle = element(by.css('div[class*="adf-info-drawer-layout-header-title"] div'));
|
activitiesTitle = $('div[class*="adf-info-drawer-layout-header-title"] div');
|
||||||
commentField = element(by.id('comment-input'));
|
commentField = $('#comment-input');
|
||||||
addCommentButton = element(by.css('[data-automation-id="comments-input-add"]'));
|
addCommentButton = $('[data-automation-id="comments-input-add"]');
|
||||||
involvePeopleButton = element(by.css('div[class*="add-people"]'));
|
involvePeopleButton = $('div[class*="add-people"]');
|
||||||
addPeopleField = element(by.css('input[data-automation-id="adf-people-search-input"]'));
|
addPeopleField = $('input[data-automation-id="adf-people-search-input"]');
|
||||||
addInvolvedUserButton = element(by.css('button[id="add-people"]'));
|
addInvolvedUserButton = $('button[id="add-people"]');
|
||||||
taskDetailsInfoDrawer = element(by.tagName('adf-info-drawer'));
|
taskDetailsInfoDrawer = element(by.tagName('adf-info-drawer'));
|
||||||
taskDetailsSection = element(by.css('div[data-automation-id="app-tasks-details"]'));
|
taskDetailsSection = $('div[data-automation-id="app-tasks-details"]');
|
||||||
taskDetailsEmptySection = element(by.css('div[data-automation-id="adf-tasks-details--empty"]'));
|
taskDetailsEmptySection = $('div[data-automation-id="adf-tasks-details--empty"]');
|
||||||
completeTask = element(by.css('button[id="adf-no-form-complete-button"]'));
|
completeTask = $('button[id="adf-no-form-complete-button"]');
|
||||||
completeFormTask = element(by.css('button[id="adf-form-complete"]'));
|
completeFormTask = $('button[id="adf-form-complete"]');
|
||||||
taskDetailsTitle = element(by.css('.adf-activiti-task-details__header span'));
|
taskDetailsTitle = $('.adf-activiti-task-details__header span');
|
||||||
auditLogButton = element(by.css('button[adf-task-audit]'));
|
auditLogButton = $('button[adf-task-audit]');
|
||||||
noPeopleInvolved = element(by.id('no-people-label'));
|
noPeopleInvolved = $('#no-people-label');
|
||||||
cancelInvolvePeopleButton = element(by.id('close-people-search'));
|
cancelInvolvePeopleButton = $('#close-people-search');
|
||||||
involvePeopleHeader = element(by.css('.adf-search-text-header'));
|
involvePeopleHeader = $('.adf-search-text-header');
|
||||||
removeInvolvedPeople = element(by.css('button[data-automation-id="Remove"]'));
|
removeInvolvedPeople = $('button[data-automation-id="Remove"]');
|
||||||
peopleTitle = element(by.id('people-title'));
|
peopleTitle = $('#people-title');
|
||||||
noFormMessage = element(by.css('span[id*="no-form-message"]'));
|
noFormMessage = $('span[id*="no-form-message"]');
|
||||||
cancelAttachForm = element(by.id('adf-no-form-cancel-button'));
|
cancelAttachForm = $('#adf-no-form-cancel-button');
|
||||||
attachFormButton = element(by.id('adf-no-form-attach-form-button'));
|
attachFormButton = $('#adf-no-form-attach-form-button');
|
||||||
disabledAttachFormButton = element(by.css('button[id="adf-no-form-attach-form-button"][disabled]'));
|
disabledAttachFormButton = $('button[id="adf-no-form-attach-form-button"][disabled]');
|
||||||
removeAttachForm = element(by.id('adf-attach-form-remove-button'));
|
removeAttachForm = $('#adf-attach-form-remove-button');
|
||||||
attachFormName = element(by.css('.adf-form-title'));
|
attachFormName = $('.adf-form-title');
|
||||||
emptyTaskDetails = element(by.css('adf-task-details > div > div'));
|
emptyTaskDetails = $('adf-task-details > div > div');
|
||||||
priority = element(by.css('[data-automation-id*="card-textitem-value-priority"]'));
|
priority = $('[data-automation-id*="card-textitem-value-priority"]');
|
||||||
editableAssignee = element(by.css('[data-automation-id="card-textitem-value-assignee"][class*="clickable"]'));
|
editableAssignee = $('[data-automation-id="card-textitem-value-assignee"][class*="clickable"]');
|
||||||
claimElement = element(by.css('[data-automation-id="header-claim-button"]'));
|
claimElement = $('[data-automation-id="header-claim-button"]');
|
||||||
releaseElement = element(by.css('[data-automation-id="header-unclaim-button"]'));
|
releaseElement = $('[data-automation-id="header-unclaim-button"]');
|
||||||
saveFormButton = element(by.css('button[id="adf-form-save"]'));
|
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> {
|
async checkEditableAssigneeIsNotDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.editableAssignee);
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.editableAssignee);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkEditableFormIsNotDisplayed(): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsNotVisible(editableForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkDueDatePickerButtonIsNotDisplayed(): Promise<void> {
|
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);
|
await BrowserVisibility.waitUntilElementIsNotVisible(dueDatePickerButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,33 +219,33 @@ export class TaskDetailsPage {
|
|||||||
async updatePriority(priority?: string): Promise<void> {
|
async updatePriority(priority?: string): Promise<void> {
|
||||||
await BrowserActions.click(this.priority);
|
await BrowserActions.click(this.priority);
|
||||||
await BrowserActions.clearWithBackSpace(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 this.priority.sendKeys(Key.TAB);
|
||||||
await browser.sleep(1000);
|
await browser.sleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateDueDate(): Promise<void> {
|
async updateDueDate(): Promise<void> {
|
||||||
await BrowserActions.click(this.dueDateField);
|
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);
|
await browser.sleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateDescription(description?: string): Promise<void> {
|
async updateDescription(description?: string): Promise<void> {
|
||||||
await BrowserActions.click(this.descriptionField);
|
await BrowserActions.click(this.descriptionField);
|
||||||
await BrowserActions.clearWithBackSpace(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 this.descriptionField.sendKeys(Key.TAB);
|
||||||
await browser.sleep(1000);
|
await browser.sleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateAssignee(fullName: string): Promise<void> {
|
async updateAssignee(fullName: string): Promise<void> {
|
||||||
await BrowserActions.click(this.assigneeButton);
|
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 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 browser.sleep(2000);
|
||||||
await BrowserActions.click(element(by.css('button[id="add-people"]')));
|
await BrowserActions.click($('button[id="add-people"]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
getTitle(): Promise<string> {
|
getTitle(): Promise<string> {
|
||||||
@@ -304,19 +304,19 @@ export class TaskDetailsPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRowsUser(user: string) {
|
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> {
|
async removeInvolvedUser(user): Promise<void> {
|
||||||
const row = this.getRowsUser(user).element(by.xpath('ancestor::adf-datatable-row[contains(@class, "adf-datatable-row")]'));
|
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 BrowserVisibility.waitUntilElementIsVisible(this.removeInvolvedPeople);
|
||||||
await BrowserActions.click(this.removeInvolvedPeople);
|
await BrowserActions.click(this.removeInvolvedPeople);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getInvolvedUserEmail(user): Promise<string> {
|
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> {
|
async clickAuditLogButton(): Promise<void> {
|
||||||
|
@@ -16,16 +16,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserActions } from '@alfresco/adf-testing';
|
||||||
import { element, by } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { TaskFiltersPage } from './task-filters.page';
|
import { TaskFiltersPage } from './task-filters.page';
|
||||||
|
|
||||||
export class TaskFiltersDemoPage {
|
export class TaskFiltersDemoPage {
|
||||||
|
|
||||||
myTasks = element(by.css('button[data-automation-id="My Tasks_filter"]'));
|
myTasks = $('button[data-automation-id="My Tasks_filter"]');
|
||||||
queuedTask = element(by.css('button[data-automation-id="Queued Tasks_filter"]'));
|
queuedTask = $('button[data-automation-id="Queued Tasks_filter"]');
|
||||||
completedTask = element(by.css('button[data-automation-id="Completed Tasks_filter"]'));
|
completedTask = $('button[data-automation-id="Completed Tasks_filter"]');
|
||||||
involvedTask = element(by.css('button[data-automation-id="Involved Tasks_filter"]'));
|
involvedTask = $('button[data-automation-id="Involved Tasks_filter"]');
|
||||||
activeFilter = element(by.css('adf-task-filters .adf-active'));
|
activeFilter = $('adf-task-filters .adf-active');
|
||||||
|
|
||||||
myTasksFilter(): TaskFiltersPage {
|
myTasksFilter(): TaskFiltersPage {
|
||||||
return new TaskFiltersPage(this.myTasks);
|
return new TaskFiltersPage(this.myTasks);
|
||||||
@@ -44,7 +44,7 @@ export class TaskFiltersDemoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
customTaskFilter(filterName: string): TaskFiltersPage {
|
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> {
|
async checkActiveFilterActive(): Promise<string> {
|
||||||
|
@@ -15,13 +15,13 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Locator, by, ElementFinder } from 'protractor';
|
import { ElementFinder } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class TaskFiltersPage {
|
export class TaskFiltersPage {
|
||||||
|
|
||||||
filter;
|
filter: ElementFinder;
|
||||||
taskIcon: Locator = by.css('adf-icon[data-automation-id="adf-filter-icon"]');
|
taskIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
|
||||||
|
|
||||||
constructor(filter: ElementFinder) {
|
constructor(filter: ElementFinder) {
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
@@ -33,13 +33,13 @@ export class TaskFiltersPage {
|
|||||||
|
|
||||||
async getTaskFilterIcon(): Promise<string> {
|
async getTaskFilterIcon(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||||
const icon = this.filter.element(this.taskIcon);
|
const icon = this.filter.$(this.taskIcon);
|
||||||
return BrowserActions.getText(icon);
|
return BrowserActions.getText(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkTaskFilterHasNoIcon(): Promise<void> {
|
async checkTaskFilterHasNoIcon(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.taskIcon));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.taskIcon));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickTaskFilter(): Promise<void> {
|
async clickTaskFilter(): Promise<void> {
|
||||||
|
@@ -16,26 +16,26 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, DropdownPage, PaginationPage } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, DropdownPage, PaginationPage } from '@alfresco/adf-testing';
|
||||||
import { by, element } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { TasksListPage } from './tasks-list.page';
|
import { TasksListPage } from './tasks-list.page';
|
||||||
|
|
||||||
export class TaskListDemoPage {
|
export class TaskListDemoPage {
|
||||||
|
|
||||||
taskListPage = new TasksListPage();
|
taskListPage = new TasksListPage();
|
||||||
appId = element(by.css("input[data-automation-id='appId input']"));
|
appId = $("input[data-automation-id='appId input']");
|
||||||
itemsPerPage = element(by.css("input[data-automation-id='items per page']"));
|
itemsPerPage = $("input[data-automation-id='items per page']");
|
||||||
itemsPerPageForm = element(by.css("mat-form-field[data-automation-id='items per page']"));
|
itemsPerPageForm = $("mat-form-field[data-automation-id='items per page']");
|
||||||
processDefinitionId = element(by.css("input[data-automation-id='process definition id']"));
|
processDefinitionId = $("input[data-automation-id='process definition id']");
|
||||||
processInstanceId = element(by.css("input[data-automation-id='process instance id']"));
|
processInstanceId = $("input[data-automation-id='process instance id']");
|
||||||
page = element(by.css("input[data-automation-id='page']"));
|
page = $("input[data-automation-id='page']");
|
||||||
pageForm = element(by.css("mat-form-field[data-automation-id='page']"));
|
pageForm = $("mat-form-field[data-automation-id='page']");
|
||||||
taskName = element(by.css("input[data-automation-id='task name']"));
|
taskName = $("input[data-automation-id='task name']");
|
||||||
resetButton = element(by.css('.app-reset-button button'));
|
resetButton = $('.app-reset-button button');
|
||||||
dueBefore = element(by.css("input[data-automation-id='due before']"));
|
dueBefore = $("input[data-automation-id='due before']");
|
||||||
dueAfter = element(by.css("input[data-automation-id='due after']"));
|
dueAfter = $("input[data-automation-id='due after']");
|
||||||
taskId = element(by.css("input[data-automation-id='task id']"));
|
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);
|
stateDropdown = new DropdownPage(this.stateDropDownArrow);
|
||||||
|
|
||||||
taskList(): TasksListPage {
|
taskList(): TasksListPage {
|
||||||
@@ -97,7 +97,7 @@ export class TaskListDemoPage {
|
|||||||
|
|
||||||
async getItemsPerPageFieldErrorMessage(): Promise<string> {
|
async getItemsPerPageFieldErrorMessage(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageForm);
|
await BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageForm);
|
||||||
const errorMessage = this.itemsPerPageForm.element(by.css('mat-error'));
|
const errorMessage = this.itemsPerPageForm.$('mat-error');
|
||||||
return BrowserActions.getText(errorMessage);
|
return BrowserActions.getText(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ export class TaskListDemoPage {
|
|||||||
|
|
||||||
async getPageFieldErrorMessage(): Promise<string> {
|
async getPageFieldErrorMessage(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.pageForm);
|
await BrowserVisibility.waitUntilElementIsVisible(this.pageForm);
|
||||||
const errorMessage = this.pageForm.element(by.css('mat-error'));
|
const errorMessage = this.pageForm.$('mat-error');
|
||||||
return BrowserActions.getText(errorMessage);
|
return BrowserActions.getText(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,12 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
||||||
import { browser, by, element } from 'protractor';
|
import { browser, $, $$ } from 'protractor';
|
||||||
|
|
||||||
export class TasksListPage {
|
export class TasksListPage {
|
||||||
|
|
||||||
taskList = element(by.css('adf-tasklist'));
|
taskList = $('adf-tasklist');
|
||||||
noTasksFound = element.all(by.css('.adf-empty-content__title')).first();
|
noTasksFound = $$('.adf-empty-content__title').first();
|
||||||
dataTable = new DataTableComponentPage(this.taskList);
|
dataTable = new DataTableComponentPage(this.taskList);
|
||||||
|
|
||||||
getDataTable(): DataTableComponentPage {
|
getDataTable(): DataTableComponentPage {
|
||||||
|
@@ -21,22 +21,20 @@ import { TaskDetailsPage } from './task-details.page';
|
|||||||
import { FiltersPage } from './filters.page';
|
import { FiltersPage } from './filters.page';
|
||||||
import { ChecklistDialog } from './dialog/create-checklist-dialog.page';
|
import { ChecklistDialog } from './dialog/create-checklist-dialog.page';
|
||||||
import { TasksListPage } from './tasks-list.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';
|
import { BrowserVisibility, BrowserActions, FormFields } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class TasksPage {
|
export class TasksPage {
|
||||||
createButton = element(by.css('button[data-automation-id="create-button"'));
|
createButton = $('button[data-automation-id="create-button"');
|
||||||
newTaskButton = element(by.css('button[data-automation-id="btn-start-task"]'));
|
newTaskButton = $('button[data-automation-id="btn-start-task"]');
|
||||||
addChecklistButton = element(by.css('button[class*="adf-add-to-checklist-button"]'));
|
addChecklistButton = $('button[class*="adf-add-to-checklist-button"]');
|
||||||
rowByRowName = by.xpath('ancestor::mat-chip');
|
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';
|
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 = $('#adf-no-form-complete-button');
|
||||||
completeButtonNoForm = element(by.id('adf-no-form-complete-button'));
|
checklistDialog = $('#checklist-dialog');
|
||||||
checklistDialog = element(by.id('checklist-dialog'));
|
checklistNoMessage = $('#checklist-none-message');
|
||||||
checklistNoMessage = element(by.id('checklist-none-message'));
|
numberOfChecklists = $('[data-automation-id="checklist-label"] mat-chip');
|
||||||
numberOfChecklists = element(by.css('[data-automation-id="checklist-label"] mat-chip'));
|
|
||||||
sortByName: Locator = by.css('div[data-automation-id="auto_id_name"]');
|
|
||||||
|
|
||||||
async createNewTask(): Promise<StartTaskDialogPage> {
|
async createNewTask(): Promise<StartTaskDialogPage> {
|
||||||
await this.clickOnCreateButton();
|
await this.clickOnCreateButton();
|
||||||
@@ -89,7 +87,7 @@ export class TasksPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRowsName(name: string) {
|
getRowsName(name: string) {
|
||||||
return element(this.checklistContainer).element(by.cssContainingText('span', name));
|
return this.checklistContainer.element(by.cssContainingText('span', name));
|
||||||
}
|
}
|
||||||
|
|
||||||
getChecklistByName(name: string) {
|
getChecklistByName(name: string) {
|
||||||
@@ -104,11 +102,11 @@ export class TasksPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkChecklistIsNotDisplayed(name: string): Promise<void> {
|
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> {
|
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));
|
const title = element(by.cssContainingText(this.taskTitle, taskName));
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(title);
|
await BrowserVisibility.waitUntilElementIsVisible(title);
|
||||||
}
|
}
|
||||||
@@ -140,13 +138,13 @@ export class TasksPage {
|
|||||||
async removeChecklists(name: string): Promise<void> {
|
async removeChecklists(name: string): Promise<void> {
|
||||||
const elem = this.getRowsName(name);
|
const elem = this.getRowsName(name);
|
||||||
const row = elem.element(this.rowByRowName);
|
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> {
|
async checkChecklistsRemoveButtonIsNotDisplayed(name: string): Promise<void> {
|
||||||
const elem = this.getRowsName(name);
|
const elem = this.getRowsName(name);
|
||||||
const row = elem.element(this.rowByRowName);
|
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> {
|
async clickSortByNameAsc(): Promise<any> {
|
||||||
|
@@ -51,7 +51,6 @@ describe('Comment component for Processes', () => {
|
|||||||
await apiService.loginWithProfile('admin');
|
await apiService.loginWithProfile('admin');
|
||||||
|
|
||||||
user = await usersActions.createUser();
|
user = await usersActions.createUser();
|
||||||
|
|
||||||
await apiService.login(user.username, user.password);
|
await apiService.login(user.username, user.password);
|
||||||
|
|
||||||
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { createApiService, ApplicationsUtil, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
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 { FileModel } from '../../models/ACS/file.model';
|
||||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
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.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().refreshForm();
|
||||||
|
|
||||||
await taskPage.formFields().checkFieldValue(by.id, formTextField, '');
|
await taskPage.formFields().checkFieldValue(formTextField, '');
|
||||||
|
|
||||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
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().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 () => {
|
it('[C263951] Should be possible to assign a user', async () => {
|
||||||
|
@@ -23,14 +23,14 @@ import { createApiService,
|
|||||||
UserModel,
|
UserModel,
|
||||||
UsersActions
|
UsersActions
|
||||||
} from '@alfresco/adf-testing';
|
} from '@alfresco/adf-testing';
|
||||||
import { browser, by } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
import { FileModel } from '../../models/ACS/file.model';
|
import { FileModel } from '../../models/ACS/file.model';
|
||||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||||
import { AttachmentListPage } from './../pages/attachment-list.page';
|
import { AttachmentListPage } from './../pages/attachment-list.page';
|
||||||
import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page';
|
import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page';
|
||||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||||
import { TasksPage } from './../pages/tasks.page';
|
import { TasksPage } from './../pages/tasks.page';
|
||||||
import CONSTANTS = require('../../util/constants');
|
import * as CONSTANTS from '../../util/constants';
|
||||||
|
|
||||||
describe('Start Task - Task App', () => {
|
describe('Start Task - Task App', () => {
|
||||||
|
|
||||||
@@ -133,17 +133,17 @@ describe('Start Task - Task App', () => {
|
|||||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||||
|
|
||||||
const formFields = await taskPage.formFields();
|
const formFields = await taskPage.formFields();
|
||||||
await formFields.setFieldValue(by.id, formTextField, formFieldValue);
|
await formFields.setFieldValue(formTextField, formFieldValue);
|
||||||
|
|
||||||
await formFields.refreshForm();
|
await formFields.refreshForm();
|
||||||
await formFields.checkFieldValue(by.id, formTextField, '');
|
await formFields.checkFieldValue(formTextField, '');
|
||||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
|
||||||
|
|
||||||
await formFields.setFieldValue(by.id, formTextField, formFieldValue);
|
await formFields.setFieldValue(formTextField, formFieldValue);
|
||||||
await formFields.checkFieldValue(by.id, formTextField, formFieldValue);
|
await formFields.checkFieldValue(formTextField, formFieldValue);
|
||||||
|
|
||||||
await taskPage.formFields().saveForm();
|
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 () => {
|
it('[C260425] Should be possible to assign a user', async () => {
|
||||||
|
@@ -64,7 +64,7 @@ let specs = function () {
|
|||||||
} else {
|
} else {
|
||||||
const FOLDER = process.env.FOLDER || '';
|
const FOLDER = process.env.FOLDER || '';
|
||||||
setProvider(FOLDER);
|
setProvider(FOLDER);
|
||||||
const specsToRun = FOLDER ? `./${FOLDER}/**/*.e2e.ts` : './**/*.ts';
|
const specsToRun = FOLDER ? `./${FOLDER}/**/*.e2e.ts` : './**/*.e2e.ts';
|
||||||
arraySpecs = [specsToRun];
|
arraySpecs = [specsToRun];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,23 +15,25 @@
|
|||||||
* limitations under the License.
|
* 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';
|
import { BrowserVisibility, BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class SearchBarPage {
|
export class SearchBarPage {
|
||||||
|
|
||||||
searchIcon = element(by.css(`button[class*='adf-search-button']`));
|
searchIcon = $(`button[class*='adf-search-button']`);
|
||||||
searchBar = element(by.css(`adf-search-control input`));
|
searchBar = $(`adf-search-control input`);
|
||||||
searchBarExpanded: TestElement = TestElement.byCss(`adf-search-control mat-form-field[class*="mat-focused"] 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']`));
|
noResultMessage = $(`p[class*='adf-search-fixed-text']`);
|
||||||
rowsAuthor: Locator = by.css(`.mat-list-text p[class*='adf-search-fixed-text']`);
|
rowsAuthor = `.mat-list-text p[class*='adf-search-fixed-text']`;
|
||||||
completeName: Locator = by.css(`h4[class*='adf-search-fixed-text']`);
|
completeName = `h4[class*='adf-search-fixed-text']`;
|
||||||
highlightName: Locator = by.css(`.adf-highlight`);
|
highlightName = `.adf-highlight`;
|
||||||
searchBarPage = element(by.css(`mat-list[id='autocomplete-search-result-list']`));
|
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> {
|
async pressDownArrowAndEnter(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
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();
|
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,20 +82,16 @@ export class SearchBarPage {
|
|||||||
await BrowserActions.click(this.getRowByRowName(fileName));
|
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> {
|
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> {
|
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> {
|
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> {
|
async clearText(): Promise<void> {
|
||||||
|
@@ -16,28 +16,28 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserVisibility, DateRangeFilterPage, NumberRangeFilterPage, SearchCategoriesPage, SearchCheckListPage, SearchRadioPage, SearchSliderPage, SearchTextPage } from '@alfresco/adf-testing';
|
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 {
|
export class SearchFiltersPage {
|
||||||
|
|
||||||
searchCategoriesPage: SearchCategoriesPage = new SearchCategoriesPage();
|
searchCategoriesPage: SearchCategoriesPage = new SearchCategoriesPage();
|
||||||
|
|
||||||
searchFilters = element(by.css('adf-search-filter'));
|
searchFilters = $('adf-search-filter');
|
||||||
fileTypeFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-SEARCH.FACET_FIELDS.TYPE"]'));
|
fileTypeFilter = $('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"]'));
|
creatorFilter = $('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"]'));
|
fileSizeFilter = $('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"]'));
|
nameFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Name"]');
|
||||||
checkListFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Check List"]'));
|
checkListFilter = $('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)"]'));
|
createdDateRangeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Created Date (range)"]');
|
||||||
typeFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Type"]'));
|
typeFilter = $('mat-expansion-panel[data-automation-id="expansion-panel-Type"]');
|
||||||
sizeRangeFilter = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-Content Size (range)"]'));
|
sizeRangeFilter = $('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"]'));
|
sizeSliderFilter = $('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"],' +
|
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"]'));
|
'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"]'));
|
facetQueriesTypeGroup = $('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"]'));
|
facetQueriesSizeGroup = $('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"]'));
|
facetIntervalsByCreated = $('mat-expansion-panel[data-automation-id="expansion-panel-The Created"]');
|
||||||
facetIntervalsByModified = element(by.css('mat-expansion-panel[data-automation-id="expansion-panel-TheModified"]'));
|
facetIntervalsByModified = $('mat-expansion-panel[data-automation-id="expansion-panel-TheModified"]');
|
||||||
|
|
||||||
async checkSearchFiltersIsDisplayed(): Promise<void> {
|
async checkSearchFiltersIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchFilters);
|
await BrowserVisibility.waitUntilElementIsVisible(this.searchFilters);
|
||||||
@@ -72,7 +72,7 @@ export class SearchFiltersPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkCustomFacetFieldLabelIsDisplayed(fieldLabel: string): Promise<void> {
|
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 {
|
sizeSliderFilterPage(): SearchSliderPage {
|
||||||
|
@@ -16,12 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserVisibility, DataTableComponentPage, SearchSortingPickerPage } from '@alfresco/adf-testing';
|
import { BrowserVisibility, DataTableComponentPage, SearchSortingPickerPage } from '@alfresco/adf-testing';
|
||||||
import { by, element } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||||
|
|
||||||
export class SearchResultsPage {
|
export class SearchResultsPage {
|
||||||
|
|
||||||
noResultsMessage = element(by.css('.app-no-result-message'));
|
noResultsMessage = $('.app-no-result-message');
|
||||||
dataTable = new DataTableComponentPage();
|
dataTable = new DataTableComponentPage();
|
||||||
searchSortingPicker = new SearchSortingPickerPage();
|
searchSortingPicker = new SearchSortingPickerPage();
|
||||||
contentServices = new ContentServicesPage();
|
contentServices = new ContentServicesPage();
|
||||||
|
@@ -90,7 +90,7 @@ describe('Search Component - Multi-Select Facet', () => {
|
|||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await apiService.loginWithProfile('admin');
|
await apiService.loginWithProfile('admin');
|
||||||
|
const sitesApi = new SitesApi(apiService.getInstance());
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
uploadActions.deleteFileOrFolder(jpgFile.entry.id),
|
uploadActions.deleteFileOrFolder(jpgFile.entry.id),
|
||||||
uploadActions.deleteFileOrFolder(jpgFileSite.entry.id),
|
uploadActions.deleteFileOrFolder(jpgFileSite.entry.id),
|
||||||
@@ -214,7 +214,7 @@ describe('Search Component - Multi-Select Facet', () => {
|
|||||||
await usersActions.createUser(acsUser);
|
await usersActions.createUser(acsUser);
|
||||||
|
|
||||||
await apiService.login(acsUser.username, acsUser.password);
|
await apiService.login(acsUser.username, acsUser.password);
|
||||||
|
const sitesApi = new SitesApi(apiService.getInstance());
|
||||||
site = await sitesApi.createSite({
|
site = await sitesApi.createSite({
|
||||||
title: StringUtil.generateRandomString(8),
|
title: StringUtil.generateRandomString(8),
|
||||||
visibility: 'PUBLIC'
|
visibility: 'PUBLIC'
|
||||||
@@ -236,7 +236,7 @@ describe('Search Component - Multi-Select Facet', () => {
|
|||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await apiService.loginWithProfile('admin');
|
await apiService.loginWithProfile('admin');
|
||||||
await uploadActions.deleteFileOrFolder(txtFile.entry.id);
|
await uploadActions.deleteFileOrFolder(txtFile.entry.id);
|
||||||
|
const sitesApi = new SitesApi(apiService.getInstance());
|
||||||
await sitesApi.deleteSite(site.entry.id, { permanent: true });
|
await sitesApi.deleteSite(site.entry.id, { permanent: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { $, by, element, $$ } from 'protractor';
|
||||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||||
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
|
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
|
||||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||||
@@ -29,13 +29,17 @@ const column = {
|
|||||||
export class AddPermissionsDialogPage {
|
export class AddPermissionsDialogPage {
|
||||||
|
|
||||||
dataTableComponentPage: DataTableComponentPage = new DataTableComponentPage();
|
dataTableComponentPage: DataTableComponentPage = new DataTableComponentPage();
|
||||||
userRoleDataTableComponentPage: DataTableComponentPage = new DataTableComponentPage(element(by.css('[data-automation-id="adf-user-role-selection-table"]')));
|
userRoleDataTableComponentPage: DataTableComponentPage = new DataTableComponentPage($('[data-automation-id="adf-user-role-selection-table"]'));
|
||||||
|
|
||||||
addPermissionDialog = element(by.css('adf-add-permission-dialog'));
|
addPermissionDialog = $('adf-add-permission-dialog');
|
||||||
searchUserInput = element(by.id('searchInput'));
|
searchUserInput = $('#searchInput');
|
||||||
searchResults = element(by.css('#adf-add-permission-authority-results #adf-search-results-content'));
|
searchResults = $('#adf-add-permission-authority-results #adf-search-results-content');
|
||||||
addButton = element(by.css('[data-automation-id="add-permission-dialog-confirm-button"]'));
|
addButton = $('[data-automation-id="add-permission-dialog-confirm-button"]');
|
||||||
closeButton = element(by.id('add-permission-dialog-close-button'));
|
closeButton = $('#add-permission-dialog-close-button');
|
||||||
|
|
||||||
|
getRoleDropdownOptions() {
|
||||||
|
return $$('.mat-option-text');
|
||||||
|
}
|
||||||
|
|
||||||
async clickCloseButton(): Promise<void> {
|
async clickCloseButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.closeButton);
|
await BrowserActions.click(this.closeButton);
|
||||||
@@ -69,7 +73,7 @@ export class AddPermissionsDialogPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkPermissionsDatatableIsDisplayed(): Promise<void> {
|
async checkPermissionsDatatableIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css('[class*="adf-datatable-permission"]')));
|
await BrowserVisibility.waitUntilElementIsVisible($('[class*="adf-datatable-permission"]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getRoleCellValue(rowName: string): Promise<string> {
|
async getRoleCellValue(rowName: string): Promise<string> {
|
||||||
@@ -79,11 +83,7 @@ export class AddPermissionsDialogPage {
|
|||||||
|
|
||||||
async clickRoleDropdownByUserOrGroupName(name: string): Promise<void> {
|
async clickRoleDropdownByUserOrGroupName(name: string): Promise<void> {
|
||||||
const row = this.dataTableComponentPage.getRow('Users and Groups', name);
|
const row = this.dataTableComponentPage.getRow('Users and Groups', name);
|
||||||
await BrowserActions.click(row.element(by.id('adf-select-role-permission')));
|
await BrowserActions.click(row.$('adf-select-role-permission'));
|
||||||
}
|
|
||||||
|
|
||||||
getRoleDropdownOptions() {
|
|
||||||
return element.all(by.css('.mat-option-text'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectOption(name: string): Promise<void> {
|
async selectOption(name: string): Promise<void> {
|
||||||
@@ -105,7 +105,7 @@ export class AddPermissionsDialogPage {
|
|||||||
|
|
||||||
async selectRole(name: string, role: string) {
|
async selectRole(name: string, role: string) {
|
||||||
const row = this.userRoleDataTableComponentPage.getRow('Users and Groups', name);
|
const row = this.userRoleDataTableComponentPage.getRow('Users and Groups', name);
|
||||||
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();
|
await TestElement.byCss('.mat-select-panel').waitVisible();
|
||||||
await this.selectOption(role);
|
await this.selectOption(role);
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { $, $$, by } from 'protractor';
|
||||||
import { DocumentListPage } from '../pages/document-list.page';
|
import { DocumentListPage } from '../pages/document-list.page';
|
||||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||||
@@ -27,22 +27,22 @@ import { UploadButtonPage } from '../pages/upload-button.page';
|
|||||||
import { FileModel } from '../../core/models/file.model';
|
import { FileModel } from '../../core/models/file.model';
|
||||||
|
|
||||||
export class ContentNodeSelectorDialogPage {
|
export class ContentNodeSelectorDialogPage {
|
||||||
dialog = element(by.css(`adf-content-node-selector`));
|
dialog = $(`adf-content-node-selector`);
|
||||||
header = this.dialog.element(by.css(`header[data-automation-id='content-node-selector-title']`));
|
header = this.dialog.$(`header[data-automation-id='content-node-selector-title']`);
|
||||||
searchInputElement = this.dialog.element(by.css(`input[data-automation-id='content-node-selector-search-input']`));
|
searchInputElement = this.dialog.$(`input[data-automation-id='content-node-selector-search-input']`);
|
||||||
searchLabel = this.dialog.element(by.css('.adf-content-node-selector-content-input .mat-form-field-label'));
|
searchLabel = this.dialog.$('.adf-content-node-selector-content-input .mat-form-field-label');
|
||||||
selectedRow = this.dialog.element(by.css(`adf-datatable-row[class*="adf-is-selected"]`));
|
selectedRow = this.dialog.$(`adf-datatable-row[class*="adf-is-selected"]`);
|
||||||
cancelButton = element(by.css(`button[data-automation-id='content-node-selector-actions-cancel']`));
|
cancelButton = $(`button[data-automation-id='content-node-selector-actions-cancel']`);
|
||||||
moveCopyButton = element(by.css(`button[data-automation-id='content-node-selector-actions-choose']`));
|
moveCopyButton = $(`button[data-automation-id='content-node-selector-actions-choose']`);
|
||||||
|
|
||||||
contentList = new DocumentListPage(this.dialog);
|
contentList = new DocumentListPage(this.dialog);
|
||||||
dataTable = this.contentList.dataTablePage();
|
dataTable = this.contentList.dataTablePage();
|
||||||
siteListDropdown = new DropdownPage(this.dialog.element(by.css(`mat-select[data-automation-id='site-my-files-option']`)));
|
siteListDropdown = new DropdownPage(this.dialog.$(`mat-select[data-automation-id='site-my-files-option']`));
|
||||||
breadcrumbDropdown = new BreadcrumbDropdownPage();
|
breadcrumbDropdown = new BreadcrumbDropdownPage();
|
||||||
tabPage: TabPage = new TabPage();
|
tabPage: TabPage = new TabPage();
|
||||||
uploadButtonComponent = new UploadButtonPage();
|
uploadButtonComponent = new UploadButtonPage();
|
||||||
|
|
||||||
uploadFromLocalTab = element.all(by.css('*[role="tab"]')).get(1);
|
uploadFromLocalTab = $$('*[role="tab"]').get(1);
|
||||||
uploadFromLocalTabName = 'Upload from your device';
|
uploadFromLocalTabName = 'Upload from your device';
|
||||||
repositoryTabName = 'Repository';
|
repositoryTabName = 'Repository';
|
||||||
|
|
||||||
|
@@ -15,11 +15,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||||
|
|
||||||
export class DownloadDialogPage {
|
export class DownloadDialogPage {
|
||||||
cancelButton = element(by.id(`cancel-button`));
|
cancelButton = $(`#cancel-button`);
|
||||||
|
|
||||||
async clickCancelButton(): Promise<void> {
|
async clickCancelButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.cancelButton);
|
await BrowserActions.click(this.cancelButton);
|
||||||
|
@@ -15,18 +15,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { $, $$ } from 'protractor';
|
||||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||||
import { DropdownPage } from '../../../core/pages/material/dropdown.page';
|
import { DropdownPage } from '../../../core/pages/material/dropdown.page';
|
||||||
|
|
||||||
export class BreadcrumbDropdownPage {
|
export class BreadcrumbDropdownPage {
|
||||||
|
|
||||||
breadCrumb = element(by.css(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`));
|
breadCrumb = $(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`);
|
||||||
parentFolder = this.breadCrumb.element(by.css(`button[data-automation-id='dropdown-breadcrumb-trigger']`));
|
parentFolder = this.breadCrumb.$(`button[data-automation-id='dropdown-breadcrumb-trigger']`);
|
||||||
currentFolder = this.breadCrumb.element(by.css(`div span[data-automation-id="current-folder"]`));
|
currentFolder = this.breadCrumb.$(`div span[data-automation-id="current-folder"]`);
|
||||||
|
|
||||||
breadCrumbDropdown = new DropdownPage(element.all(by.css(`div[class*='mat-select-panel']`)).first());
|
breadCrumbDropdown = new DropdownPage($$(`div[class*='mat-select-panel']`).first());
|
||||||
|
|
||||||
async choosePath(pathName: string): Promise<void> {
|
async choosePath(pathName: string): Promise<void> {
|
||||||
await this.breadCrumbDropdown.selectOption(pathName);
|
await this.breadCrumbDropdown.selectOption(pathName);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Locator, by, element, ElementFinder, browser } from 'protractor';
|
import { by, ElementFinder, browser, $$ } from 'protractor';
|
||||||
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
|
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
|
||||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||||
@@ -24,14 +24,14 @@ import { Logger } from '../../core/utils/logger';
|
|||||||
export class DocumentListPage {
|
export class DocumentListPage {
|
||||||
|
|
||||||
rootElement: ElementFinder;
|
rootElement: ElementFinder;
|
||||||
optionButton: Locator = by.css('button[data-automation-id*="action_menu_"]');
|
optionButton = 'button[data-automation-id*="action_menu_"]';
|
||||||
tableBody: ElementFinder;
|
tableBody: ElementFinder;
|
||||||
dataTable: DataTableComponentPage;
|
dataTable: DataTableComponentPage;
|
||||||
|
|
||||||
constructor(rootElement = element.all(by.css('adf-document-list')).first()) {
|
constructor(rootElement = $$('adf-document-list').first()) {
|
||||||
this.rootElement = rootElement;
|
this.rootElement = rootElement;
|
||||||
this.dataTable = new DataTableComponentPage(this.rootElement);
|
this.dataTable = new DataTableComponentPage(this.rootElement);
|
||||||
this.tableBody = rootElement.all(by.css('.adf-datatable-body')).first();
|
this.tableBody = rootElement.$$('.adf-datatable-body').first();
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkLockedIcon(content: string): Promise<void> {
|
async checkLockedIcon(content: string): Promise<void> {
|
||||||
@@ -70,7 +70,7 @@ export class DocumentListPage {
|
|||||||
Logger.log(`Click action menu ${content}`);
|
Logger.log(`Click action menu ${content}`);
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
await BrowserActions.closeMenuAndDialogs();
|
||||||
const row = this.dataTable.getRow('Display name', content);
|
const row = this.dataTable.getRow('Display name', content);
|
||||||
await BrowserActions.click(row.element(this.optionButton));
|
await BrowserActions.click(row.$(this.optionButton));
|
||||||
await BrowserActions.waitUntilActionMenuIsVisible();
|
await BrowserActions.waitUntilActionMenuIsVisible();
|
||||||
await browser.sleep(500);
|
await browser.sleep(500);
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ export class DocumentListPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getLibraryRole(name: string): Promise<string> {
|
async getLibraryRole(name: string): Promise<string> {
|
||||||
return this.dataTable.getRow('Display name', name).element(by.css('adf-library-role-column')).getText();
|
return this.dataTable.getRow('Display name', name).$('adf-library-role-column').getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -15,15 +15,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { browser, by, element } from 'protractor';
|
import { $, browser } from 'protractor';
|
||||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||||
|
|
||||||
export class LikePage {
|
export class LikePage {
|
||||||
|
|
||||||
likeCounter = element(by.css(`div[id="adf-like-counter"]`));
|
likeCounter = $(`div[id="adf-like-counter"]`);
|
||||||
likeButton = element(by.css(`.adf-like-grey`));
|
likeButton = $(`.adf-like-grey`);
|
||||||
unlikeButton = element(by.css(`.adf-like-select`));
|
unlikeButton = $(`.adf-like-select`);
|
||||||
|
|
||||||
async checkLikeCounter(counter: number): Promise<void> {
|
async checkLikeCounter(counter: number): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementHasText(this.likeCounter, counter);
|
await BrowserVisibility.waitUntilElementHasText(this.likeCounter, counter);
|
||||||
|
@@ -15,49 +15,52 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||||
|
|
||||||
export class RatePage {
|
export class RatePage {
|
||||||
|
|
||||||
|
private ratingsCounter = $(`div[id="adf-rating-counter"]`);
|
||||||
|
private coloredStar = async (rateValue: number) => $(`span[id="adf-rate-${rateValue}"] mat-icon`);
|
||||||
|
private greyStar = async (rateValue: number) => $(`mat-icon[id="adf-grey-star-${rateValue}"]`);
|
||||||
|
|
||||||
async rateComponent(rateValue: number) {
|
async rateComponent(rateValue: number) {
|
||||||
const unratedStar = element(by.css(`span[id="adf-rate-${rateValue}"]`));
|
const unratedStar = await this.coloredStar(rateValue);
|
||||||
await BrowserActions.click(unratedStar);
|
await BrowserActions.click(unratedStar);
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeRating(rateValue: number): Promise<void> {
|
async removeRating(rateValue: number): Promise<void> {
|
||||||
const ratedStar = element(by.css(`mat-icon[id="adf-colored-star-${rateValue}"]`));
|
const ratedStar = await this.coloredStar(rateValue);
|
||||||
await BrowserActions.click(ratedStar);
|
await BrowserActions.click(ratedStar);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkRatingCounter(rating: number): Promise<void> {
|
async checkRatingCounter(rating: number): Promise<void> {
|
||||||
const ratingsCounter = element(by.css(`div[id="adf-rating-counter"]`));
|
await BrowserVisibility.waitUntilElementHasText(this.ratingsCounter, rating);
|
||||||
await BrowserVisibility.waitUntilElementHasText(ratingsCounter, rating);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async isStarRated(rateValue: number): Promise<void> {
|
async isStarRated(rateValue: number): Promise<void> {
|
||||||
const ratedStar = element(by.css(`mat-icon[id="adf-colored-star-${rateValue}"]`));
|
const ratedStar = await this.coloredStar(rateValue);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(ratedStar);
|
await BrowserVisibility.waitUntilElementIsVisible(ratedStar);
|
||||||
}
|
}
|
||||||
|
|
||||||
async isNotStarRated(rateValue: number): Promise<void> {
|
async isNotStarRated(rateValue: number): Promise<void> {
|
||||||
const unratedStar = element(by.css(`mat-icon[id="adf-grey-star-${rateValue}"]`));
|
const unratedStar = await this.greyStar(rateValue);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(unratedStar);
|
await BrowserVisibility.waitUntilElementIsVisible(unratedStar);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getRatedStarColor(rateValue: number): Promise<string> {
|
async getRatedStarColor(rateValue: number): Promise<string> {
|
||||||
const ratedStar = element(by.css(`mat-icon[id="adf-colored-star-${rateValue}"]`));
|
const ratedStar = await this.coloredStar(rateValue);
|
||||||
return BrowserActions.getColor(ratedStar);
|
return BrowserActions.getColor(ratedStar);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUnratedStarColor(rateValue: number): Promise<string> {
|
async getUnratedStarColor(rateValue: number): Promise<string> {
|
||||||
const unratedStar = element(by.css(`mat-icon[id="adf-grey-star-${rateValue}"]`));
|
const unratedStar = await this.greyStar(rateValue);
|
||||||
return BrowserActions.getColor(unratedStar);
|
return BrowserActions.getColor(unratedStar);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAverageStarColor(rateValue: number): Promise<string> {
|
async getAverageStarColor(rateValue: number): Promise<string> {
|
||||||
const coloredStar = element(by.css(`mat-icon[id="adf-colored-star-${rateValue}"]`));
|
const coloredStar = await this.coloredStar(rateValue);
|
||||||
return BrowserActions.getColor(coloredStar);
|
return BrowserActions.getColor(coloredStar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,21 +15,21 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, protractor, ElementFinder, Locator, element } from 'protractor';
|
import { protractor, ElementFinder, $ } from 'protractor';
|
||||||
import { DatePickerCalendarPage } from '../../../core/pages/material/date-picker-calendar.page';
|
import { DatePickerCalendarPage } from '../../../core/pages/material/date-picker-calendar.page';
|
||||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||||
|
|
||||||
export class DateRangeFilterPage {
|
export class DateRangeFilterPage {
|
||||||
|
|
||||||
fromField: Locator = by.css('input[data-automation-id="date-range-from-input"]');
|
fromField = 'input[data-automation-id="date-range-from-input"]';
|
||||||
fromDateToggle: Locator = by.css('mat-datepicker-toggle[data-automation-id="date-range-from-date-toggle"]');
|
fromDateToggle = 'mat-datepicker-toggle[data-automation-id="date-range-from-date-toggle"]';
|
||||||
toField: Locator = by.css('input[data-automation-id="date-range-to-input"]');
|
toField = 'input[data-automation-id="date-range-to-input"]';
|
||||||
toDateToggle: Locator = by.css('mat-datepicker-toggle[data-automation-id="date-range-to-date-toggle"]');
|
toDateToggle = 'mat-datepicker-toggle[data-automation-id="date-range-to-date-toggle"]';
|
||||||
applyButton: Locator = by.css('button[data-automation-id="date-range-apply-btn"]');
|
applyButton = 'button[data-automation-id="date-range-apply-btn"]';
|
||||||
clearButton: Locator = by.css('button[data-automation-id="date-range-clear-btn"]');
|
clearButton = 'button[data-automation-id="date-range-clear-btn"]';
|
||||||
fromErrorMessage: Locator = by.css('mat-error[data-automation-id="date-range-from-error"]');
|
fromErrorMessage = 'mat-error[data-automation-id="date-range-from-error"]';
|
||||||
toErrorMessage: Locator = by.css('mat-error[data-automation-id="date-range-to-error"]');
|
toErrorMessage = 'mat-error[data-automation-id="date-range-to-error"]';
|
||||||
filter: ElementFinder;
|
filter: ElementFinder;
|
||||||
|
|
||||||
constructor(filter: ElementFinder) {
|
constructor(filter: ElementFinder) {
|
||||||
@@ -37,13 +37,13 @@ export class DateRangeFilterPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFromDate(): Promise<string> {
|
async getFromDate(): Promise<string> {
|
||||||
return BrowserActions.getInputValue(this.filter.element(this.fromField));
|
return BrowserActions.getInputValue(this.filter.$(this.fromField));
|
||||||
}
|
}
|
||||||
|
|
||||||
async putFromDate(date): Promise<void> {
|
async putFromDate(date): Promise<void> {
|
||||||
await this.checkFromFieldIsDisplayed();
|
await this.checkFromFieldIsDisplayed();
|
||||||
await BrowserActions.clearSendKeys(this.filter.element(this.fromField), date);
|
await BrowserActions.clearSendKeys(this.filter.$(this.fromField), date);
|
||||||
await this.filter.element(this.fromField).sendKeys(protractor.Key.ENTER);
|
await this.filter.$(this.fromField).sendKeys(protractor.Key.ENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFromCalendarSelectedDate(): Promise<string> {
|
async getFromCalendarSelectedDate(): Promise<string> {
|
||||||
@@ -54,7 +54,7 @@ export class DateRangeFilterPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openFromDatePicker(): Promise<DatePickerCalendarPage> {
|
async openFromDatePicker(): Promise<DatePickerCalendarPage> {
|
||||||
await BrowserActions.click(this.filter.element(this.fromDateToggle));
|
await BrowserActions.click(this.filter.$(this.fromDateToggle));
|
||||||
|
|
||||||
const datePicker = new DatePickerCalendarPage();
|
const datePicker = new DatePickerCalendarPage();
|
||||||
await datePicker.checkDatePickerIsDisplayed();
|
await datePicker.checkDatePickerIsDisplayed();
|
||||||
@@ -62,82 +62,82 @@ export class DateRangeFilterPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openToDatePicker(): Promise<DatePickerCalendarPage> {
|
async openToDatePicker(): Promise<DatePickerCalendarPage> {
|
||||||
await BrowserActions.click(this.filter.element(this.toDateToggle));
|
await BrowserActions.click(this.filter.$(this.toDateToggle));
|
||||||
const datePicker = new DatePickerCalendarPage();
|
const datePicker = new DatePickerCalendarPage();
|
||||||
await datePicker.checkDatePickerIsDisplayed();
|
await datePicker.checkDatePickerIsDisplayed();
|
||||||
return datePicker;
|
return datePicker;
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickFromField(): Promise<void> {
|
async clickFromField(): Promise<void> {
|
||||||
await BrowserActions.click(this.filter.element(this.fromField));
|
await BrowserActions.click(this.filter.$(this.fromField));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFromErrorMessageIsDisplayed(msg: string): Promise<void> {
|
async checkFromErrorMessageIsDisplayed(msg: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromErrorMessage));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.fromErrorMessage));
|
||||||
const text = await BrowserActions.getText(this.filter.element(this.fromErrorMessage));
|
const text = await BrowserActions.getText(this.filter.$(this.fromErrorMessage));
|
||||||
await expect(text).toEqual(msg);
|
await expect(text).toEqual(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFromErrorMessageIsNotDisplayed(): Promise<void> {
|
async checkFromErrorMessageIsNotDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.fromErrorMessage));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.fromErrorMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFromFieldIsDisplayed(): Promise<void> {
|
async checkFromFieldIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromField));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.fromField));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFromDateToggleIsDisplayed(): Promise<void> {
|
async checkFromDateToggleIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromDateToggle));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.fromDateToggle));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getToDate(): Promise<string> {
|
async getToDate(): Promise<string> {
|
||||||
return BrowserActions.getInputValue(this.filter.element(this.toField));
|
return BrowserActions.getInputValue(this.filter.$(this.toField));
|
||||||
}
|
}
|
||||||
|
|
||||||
async putToDate(date): Promise<void> {
|
async putToDate(date): Promise<void> {
|
||||||
await this.checkToFieldIsDisplayed();
|
await this.checkToFieldIsDisplayed();
|
||||||
await BrowserActions.clearSendKeys(element(this.toField), date);
|
await BrowserActions.clearSendKeys($(this.toField), date);
|
||||||
await this.filter.element(this.toField).sendKeys(protractor.Key.ENTER);
|
await this.filter.$(this.toField).sendKeys(protractor.Key.ENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickToField(): Promise<void> {
|
async clickToField(): Promise<void> {
|
||||||
await BrowserActions.click(this.filter.element(this.toField));
|
await BrowserActions.click(this.filter.$(this.toField));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkToErrorMessageIsDisplayed(msg): Promise<void> {
|
async checkToErrorMessageIsDisplayed(msg): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toErrorMessage));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.toErrorMessage));
|
||||||
const text = await BrowserActions.getText(this.filter.element(this.toErrorMessage));
|
const text = await BrowserActions.getText(this.filter.$(this.toErrorMessage));
|
||||||
await expect(text).toEqual(msg);
|
await expect(text).toEqual(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkToFieldIsDisplayed(): Promise<void> {
|
async checkToFieldIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toField));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.toField));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkToDateToggleIsDisplayed(): Promise<void> {
|
async checkToDateToggleIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toDateToggle));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.toDateToggle));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickApplyButton(): Promise<void> {
|
async clickApplyButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.filter.element(this.applyButton));
|
await BrowserActions.click(this.filter.$(this.applyButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkApplyButtonIsDisplayed(): Promise<void> {
|
async checkApplyButtonIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.applyButton));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.applyButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkApplyButtonIsEnabled(): Promise<void> {
|
async checkApplyButtonIsEnabled(): Promise<void> {
|
||||||
const isEnabled = await this.filter.element(this.applyButton).isEnabled();
|
const isEnabled = await this.filter.$(this.applyButton).isEnabled();
|
||||||
await expect(isEnabled).toBe(true);
|
await expect(isEnabled).toBe(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkApplyButtonIsDisabled(): Promise<void> {
|
async checkApplyButtonIsDisabled(): Promise<void> {
|
||||||
const isEnabled = await this.filter.element(this.applyButton).isEnabled();
|
const isEnabled = await this.filter.$(this.applyButton).isEnabled();
|
||||||
await expect(isEnabled).toBe(false);
|
await expect(isEnabled).toBe(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkClearButtonIsDisplayed(): Promise<void> {
|
async checkClearButtonIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.clearButton));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.clearButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -14,20 +14,20 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { by, ElementFinder, Locator, protractor } from 'protractor';
|
import { ElementFinder, protractor } from 'protractor';
|
||||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||||
|
|
||||||
export class NumberRangeFilterPage {
|
export class NumberRangeFilterPage {
|
||||||
|
|
||||||
fromInput: Locator = by.css('input[data-automation-id="number-range-from-input"]');
|
fromInput = 'input[data-automation-id="number-range-from-input"]';
|
||||||
toInput: Locator = by.css('input[data-automation-id="number-range-to-input"]');
|
toInput = 'input[data-automation-id="number-range-to-input"]';
|
||||||
applyButton: Locator = by.css('button[data-automation-id="number-range-btn-apply"]');
|
applyButton = 'button[data-automation-id="number-range-btn-apply"]';
|
||||||
clearButton: Locator = by.css('button[data-automation-id="number-range-btn-clear"]');
|
clearButton = 'button[data-automation-id="number-range-btn-clear"]';
|
||||||
fromErrorInvalid: Locator = by.css('mat-error[data-automation-id="number-range-from-error-invalid"]');
|
fromErrorInvalid = 'mat-error[data-automation-id="number-range-from-error-invalid"]';
|
||||||
fromErrorRequired: Locator = by.css('mat-error[data-automation-id="number-range-from-error-required"]');
|
fromErrorRequired = 'mat-error[data-automation-id="number-range-from-error-required"]';
|
||||||
toErrorInvalid: Locator = by.css('mat-error[data-automation-id="number-range-to-error-invalid"]');
|
toErrorInvalid = 'mat-error[data-automation-id="number-range-to-error-invalid"]';
|
||||||
toErrorRequired: Locator = by.css('mat-error[data-automation-id="number-range-to-error-required"]');
|
toErrorRequired = 'mat-error[data-automation-id="number-range-to-error-required"]';
|
||||||
filter: ElementFinder;
|
filter: ElementFinder;
|
||||||
|
|
||||||
constructor(filter: ElementFinder) {
|
constructor(filter: ElementFinder) {
|
||||||
@@ -35,99 +35,99 @@ export class NumberRangeFilterPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clearFromField(): Promise<void> {
|
async clearFromField(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsClickable(this.filter.element(this.fromInput));
|
await BrowserVisibility.waitUntilElementIsClickable(this.filter.$(this.fromInput));
|
||||||
await BrowserActions.clearWithBackSpace(this.filter.element(this.fromInput));
|
await BrowserActions.clearWithBackSpace(this.filter.$(this.fromInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFromNumber(): Promise<string> {
|
async getFromNumber(): Promise<string> {
|
||||||
return BrowserActions.getInputValue(this.filter.element(this.fromInput));
|
return BrowserActions.getInputValue(this.filter.$(this.fromInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
async putFromNumber(value): Promise<void> {
|
async putFromNumber(value): Promise<void> {
|
||||||
await this.checkFromFieldIsDisplayed();
|
await this.checkFromFieldIsDisplayed();
|
||||||
await BrowserActions.clearSendKeys(this.filter.element(this.fromInput), value);
|
await BrowserActions.clearSendKeys(this.filter.$(this.fromInput), value);
|
||||||
await this.filter.element(this.fromInput).sendKeys(protractor.Key.ENTER);
|
await this.filter.$(this.fromInput).sendKeys(protractor.Key.ENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFromErrorRequired(): Promise<string> {
|
async getFromErrorRequired(): Promise<string> {
|
||||||
return BrowserActions.getText(this.filter.element(this.fromErrorRequired));
|
return BrowserActions.getText(this.filter.$(this.fromErrorRequired));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFromErrorRequiredIsDisplayed(): Promise<void> {
|
async checkFromErrorRequiredIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromErrorRequired));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.fromErrorRequired));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFromErrorInvalid(): Promise<string> {
|
async getFromErrorInvalid(): Promise<string> {
|
||||||
return BrowserActions.getText(this.filter.element(this.fromErrorInvalid));
|
return BrowserActions.getText(this.filter.$(this.fromErrorInvalid));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFromErrorInvalidIsDisplayed(): Promise<void> {
|
async checkFromErrorInvalidIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromErrorInvalid));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.fromErrorInvalid));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFromFieldIsDisplayed(): Promise<void> {
|
async checkFromFieldIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.fromInput));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.fromInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clearToField(): Promise<void> {
|
async clearToField(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsClickable(this.filter.element(this.toInput));
|
await BrowserVisibility.waitUntilElementIsClickable(this.filter.$(this.toInput));
|
||||||
await BrowserActions.clearWithBackSpace(this.filter.element(this.toInput));
|
await BrowserActions.clearWithBackSpace(this.filter.$(this.toInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getToNumber(): Promise<string> {
|
async getToNumber(): Promise<string> {
|
||||||
return BrowserActions.getInputValue(this.filter.element(this.toInput));
|
return BrowserActions.getInputValue(this.filter.$(this.toInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
async putToNumber(value): Promise<void> {
|
async putToNumber(value): Promise<void> {
|
||||||
await this.checkToFieldIsDisplayed();
|
await this.checkToFieldIsDisplayed();
|
||||||
await BrowserActions.clearSendKeys(this.filter.element(this.toInput), value);
|
await BrowserActions.clearSendKeys(this.filter.$(this.toInput), value);
|
||||||
await this.filter.element(this.toInput).sendKeys(protractor.Key.ENTER);
|
await this.filter.$(this.toInput).sendKeys(protractor.Key.ENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getToErrorRequired(): Promise<string> {
|
async getToErrorRequired(): Promise<string> {
|
||||||
return BrowserActions.getText(this.filter.element(this.toErrorRequired));
|
return BrowserActions.getText(this.filter.$(this.toErrorRequired));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkToErrorRequiredIsDisplayed(): Promise<void> {
|
async checkToErrorRequiredIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toErrorRequired));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.toErrorRequired));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getToErrorInvalid(): Promise<string> {
|
async getToErrorInvalid(): Promise<string> {
|
||||||
return BrowserActions.getText(this.filter.element(this.toErrorInvalid));
|
return BrowserActions.getText(this.filter.$(this.toErrorInvalid));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkToErrorInvalidIsDisplayed(): Promise<void> {
|
async checkToErrorInvalidIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toErrorInvalid));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.toErrorInvalid));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkToFieldIsDisplayed(): Promise<void> {
|
async checkToFieldIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.toInput));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.toInput));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickApplyButton(): Promise<void> {
|
async clickApplyButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.filter.element(this.applyButton));
|
await BrowserActions.click(this.filter.$(this.applyButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkApplyButtonIsDisplayed(): Promise<void> {
|
async checkApplyButtonIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.applyButton));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.applyButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkApplyButtonIsEnabled(): Promise<boolean> {
|
async checkApplyButtonIsEnabled(): Promise<boolean> {
|
||||||
return this.filter.element(this.applyButton).isEnabled();
|
return this.filter.$(this.applyButton).isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickClearButton(): Promise<void> {
|
async clickClearButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.filter.element(this.clearButton));
|
await BrowserActions.click(this.filter.$(this.clearButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkClearButtonIsDisplayed(): Promise<void> {
|
async checkClearButtonIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.clearButton));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.clearButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkNoErrorMessageIsDisplayed(): Promise<void> {
|
async checkNoErrorMessageIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.fromErrorInvalid));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.fromErrorInvalid));
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.fromErrorRequired));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.fromErrorRequired));
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.toErrorInvalid));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.toErrorInvalid));
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.toErrorRequired));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.toErrorRequired));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, ElementFinder } from 'protractor';
|
import { ElementFinder } from 'protractor';
|
||||||
import { SearchTextPage } from './search-text.page';
|
import { SearchTextPage } from './search-text.page';
|
||||||
import { SearchCheckListPage } from './search-check-list.page';
|
import { SearchCheckListPage } from './search-check-list.page';
|
||||||
import { SearchRadioPage } from './search-radio.page';
|
import { SearchRadioPage } from './search-radio.page';
|
||||||
@@ -56,11 +56,11 @@ export class SearchCategoriesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickFilter(filter: ElementFinder): Promise<void> {
|
async clickFilter(filter: ElementFinder): Promise<void> {
|
||||||
await BrowserActions.click(filter.element(by.css('mat-expansion-panel-header')));
|
await BrowserActions.click(filter.$('mat-expansion-panel-header'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickFilterHeader(filter: ElementFinder): Promise<void> {
|
async clickFilterHeader(filter: ElementFinder): Promise<void> {
|
||||||
const fileSizeFilterHeader = filter.element(by.css('mat-expansion-panel-header'));
|
const fileSizeFilterHeader = filter.$('mat-expansion-panel-header');
|
||||||
await BrowserActions.click(fileSizeFilterHeader);
|
await BrowserActions.click(fileSizeFilterHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,17 +15,17 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Locator, element, by, ElementFinder, browser } from 'protractor';
|
import { element, by, ElementFinder, browser } from 'protractor';
|
||||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||||
|
|
||||||
export class SearchCheckListPage {
|
export class SearchCheckListPage {
|
||||||
|
|
||||||
filter: ElementFinder;
|
filter: ElementFinder;
|
||||||
inputBy: Locator = by.css('div[class*="mat-expansion-panel-content"] input');
|
inputBy = 'div[class*="mat-expansion-panel-content"] input';
|
||||||
showMoreBy: Locator = by.css('button[title="Show more"]');
|
showMoreBy = 'button[title="Show more"]';
|
||||||
showLessBy: Locator = by.css('button[title="Show less"]');
|
showLessBy = 'button[title="Show less"]';
|
||||||
clearAllButton: Locator = by.css('button');
|
clearAllButton = 'button';
|
||||||
|
|
||||||
constructor(filter: ElementFinder) {
|
constructor(filter: ElementFinder) {
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
@@ -33,20 +33,20 @@ export class SearchCheckListPage {
|
|||||||
|
|
||||||
async clickCheckListOption(option: string): Promise<void> {
|
async clickCheckListOption(option: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||||
const result = this.filter.all(by.css(`mat-checkbox[data-automation-id*='${option}'] .mat-checkbox-inner-container`)).first();
|
const result = this.filter.$$(`mat-checkbox[data-automation-id*='${option}'] .mat-checkbox-inner-container`).first();
|
||||||
await BrowserActions.click(result);
|
await BrowserActions.click(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkChipIsDisplayed(option: string): Promise<void> {
|
async checkChipIsDisplayed(option: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('mat-chip', option)).element(by.css('mat-icon')));
|
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('mat-chip', option)).$('mat-icon'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkChipIsNotDisplayed(option: string): Promise<void> {
|
async checkChipIsNotDisplayed(option: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('mat-chip', option)).element(by.css('mat-icon')));
|
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('mat-chip', option)).$('mat-icon'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeFilterOption(option: string): Promise<void> {
|
async removeFilterOption(option: string): Promise<void> {
|
||||||
const cancelChipButton = element(by.cssContainingText('mat-chip', option)).element(by.css('mat-icon'));
|
const cancelChipButton = element(by.cssContainingText('mat-chip', option)).$('mat-icon');
|
||||||
await BrowserActions.click(cancelChipButton);
|
await BrowserActions.click(cancelChipButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,50 +59,50 @@ export class SearchCheckListPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkSearchFilterInputIsDisplayed(): Promise<void> {
|
async checkSearchFilterInputIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.all(this.inputBy).first());
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$$(this.inputBy).first());
|
||||||
}
|
}
|
||||||
|
|
||||||
async searchInFilter(option: string): Promise<void> {
|
async searchInFilter(option: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
|
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
|
||||||
const inputElement = this.filter.all(this.inputBy).first();
|
const inputElement = this.filter.$$(this.inputBy).first();
|
||||||
await BrowserVisibility.waitUntilElementIsClickable(inputElement);
|
await BrowserVisibility.waitUntilElementIsClickable(inputElement);
|
||||||
await BrowserActions.clearSendKeys(inputElement, option);
|
await BrowserActions.clearSendKeys(inputElement, option);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkShowLessButtonIsNotDisplayed(): Promise<void> {
|
async checkShowLessButtonIsNotDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.showLessBy));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.showLessBy));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkShowLessButtonIsDisplayed(): Promise<void> {
|
async checkShowLessButtonIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.showLessBy));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.showLessBy));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkShowMoreButtonIsDisplayed(): Promise<void> {
|
async checkShowMoreButtonIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.showMoreBy));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.showMoreBy));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkShowMoreButtonIsNotDisplayed(): Promise<void> {
|
async checkShowMoreButtonIsNotDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.showMoreBy));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.showMoreBy));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickShowMoreButtonUntilIsNotDisplayed(): Promise<void> {
|
async clickShowMoreButtonUntilIsNotDisplayed(): Promise<void> {
|
||||||
const visible = await browser.isElementPresent(this.filter.element(this.showMoreBy));
|
const visible = await browser.isElementPresent(this.filter.$(this.showMoreBy));
|
||||||
if (visible) {
|
if (visible) {
|
||||||
await BrowserActions.click(this.filter.element(this.showMoreBy));
|
await BrowserActions.click(this.filter.$(this.showMoreBy));
|
||||||
await this.clickShowMoreButtonUntilIsNotDisplayed();
|
await this.clickShowMoreButtonUntilIsNotDisplayed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickShowLessButtonUntilIsNotDisplayed(): Promise<void> {
|
async clickShowLessButtonUntilIsNotDisplayed(): Promise<void> {
|
||||||
const visible = await browser.isElementPresent(this.filter.element(this.showLessBy));
|
const visible = await browser.isElementPresent(this.filter.$(this.showLessBy));
|
||||||
if (visible) {
|
if (visible) {
|
||||||
await BrowserActions.click(this.filter.element(this.showLessBy));
|
await BrowserActions.click(this.filter.$(this.showLessBy));
|
||||||
await this.clickShowLessButtonUntilIsNotDisplayed();
|
await this.clickShowLessButtonUntilIsNotDisplayed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async getBucketNumberOfFilterType(option: string): Promise<any> {
|
async getBucketNumberOfFilterType(option: string): Promise<any> {
|
||||||
const fileTypeFilter = this.filter.all(by.css('mat-checkbox[data-automation-id*=".' + option + '"] span')).first();
|
const fileTypeFilter = this.filter.$$('mat-checkbox[data-automation-id*=".' + option + '"] span').first();
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(fileTypeFilter);
|
await BrowserVisibility.waitUntilElementIsVisible(fileTypeFilter);
|
||||||
const valueOfBucket = await BrowserActions.getText(fileTypeFilter);
|
const valueOfBucket = await BrowserActions.getText(fileTypeFilter);
|
||||||
const numberOfBucket = valueOfBucket.split('(')[1];
|
const numberOfBucket = valueOfBucket.split('(')[1];
|
||||||
@@ -112,47 +112,47 @@ export class SearchCheckListPage {
|
|||||||
|
|
||||||
async checkCheckListOptionIsDisplayed(option: string): Promise<void> {
|
async checkCheckListOptionIsDisplayed(option: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||||
const result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}']`));
|
const result = this.filter.$(`mat-checkbox[data-automation-id*='-${option}']`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(result);
|
await BrowserVisibility.waitUntilElementIsVisible(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkCheckListOptionIsNotSelected(option: string): Promise<void> {
|
async checkCheckListOptionIsNotSelected(option: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||||
const result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`));
|
const result = this.filter.$(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`);
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(result);
|
await BrowserVisibility.waitUntilElementIsNotVisible(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkCheckListOptionIsSelected(option: string): Promise<void> {
|
async checkCheckListOptionIsSelected(option: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||||
const result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`));
|
const result = this.filter.$(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(result);
|
await BrowserVisibility.waitUntilElementIsVisible(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkClearAllButtonIsDisplayed() {
|
async checkClearAllButtonIsDisplayed() {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||||
const result = this.filter.element(this.clearAllButton);
|
const result = this.filter.$(this.clearAllButton);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(result);
|
await BrowserVisibility.waitUntilElementIsVisible(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickClearAllButton(): Promise<void> {
|
async clickClearAllButton(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||||
const result = this.filter.element(this.clearAllButton);
|
const result = this.filter.$(this.clearAllButton);
|
||||||
await BrowserActions.click(result);
|
await BrowserActions.click(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCheckListOptionsNumberOnPage(): Promise<number> {
|
async getCheckListOptionsNumberOnPage(): Promise<number> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||||
const checkListOptions = this.filter.all(by.css('.checklist mat-checkbox'));
|
const checkListOptions = this.filter.$$('.checklist mat-checkbox');
|
||||||
return checkListOptions.count();
|
return checkListOptions.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickShowMoreButton(): Promise<void> {
|
async clickShowMoreButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.filter.element(this.showMoreBy));
|
await BrowserActions.click(this.filter.$(this.showMoreBy));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickShowLessButton(): Promise<void> {
|
async clickShowLessButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.filter.element(this.showLessBy));
|
await BrowserActions.click(this.filter.$(this.showLessBy));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -15,27 +15,27 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, browser, ElementFinder } from 'protractor';
|
import { browser, ElementFinder, $, $$ } from 'protractor';
|
||||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||||
|
|
||||||
export class SearchRadioPage {
|
export class SearchRadioPage {
|
||||||
|
|
||||||
filter: ElementFinder;
|
filter: ElementFinder;
|
||||||
showMoreButton = element(by.css('adf-search-radio button[title="Show more"]'));
|
showMoreButton = $('adf-search-radio button[title="Show more"]');
|
||||||
showLessButton = element(by.css('adf-search-radio button[title="Show less"]'));
|
showLessButton = $('adf-search-radio button[title="Show less"]');
|
||||||
|
|
||||||
constructor(filter: ElementFinder) {
|
constructor(filter: ElementFinder) {
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFilterRadioButtonIsDisplayed(filterName: string): Promise<void> {
|
async checkFilterRadioButtonIsDisplayed(filterName: string): Promise<void> {
|
||||||
const filterType = element(by.css('mat-radio-button[data-automation-id="search-radio-' + filterName + '"]'));
|
const filterType = $(`mat-radio-button[data-automation-id="search-radio-${filterName}"]`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(filterType);
|
await BrowserVisibility.waitUntilElementIsVisible(filterType);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFilterRadioButtonIsChecked(filterName: string): Promise<void> {
|
async checkFilterRadioButtonIsChecked(filterName: string): Promise<void> {
|
||||||
const selectedFilterType = element(by.css('mat-radio-button[data-automation-id="search-radio-' + filterName + '"][class*="checked"]'));
|
const selectedFilterType = $(`mat-radio-button[data-automation-id="search-radio-${filterName}"][class*="checked"]`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(selectedFilterType);
|
await BrowserVisibility.waitUntilElementIsVisible(selectedFilterType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ export class SearchRadioPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getRadioButtonsNumberOnPage(): Promise<number> {
|
async getRadioButtonsNumberOnPage(): Promise<number> {
|
||||||
const radioButtons = element.all(by.css('mat-radio-button'));
|
const radioButtons = $$('mat-radio-button');
|
||||||
return radioButtons.count();
|
return radioButtons.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,64 +15,64 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Locator, browser, by, ElementFinder } from 'protractor';
|
import { browser, ElementFinder } from 'protractor';
|
||||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||||
|
|
||||||
export class SearchSliderPage {
|
export class SearchSliderPage {
|
||||||
|
|
||||||
filter: ElementFinder;
|
filter: ElementFinder;
|
||||||
slider: Locator = by.css('mat-slider[data-automation-id="slider-range"]');
|
slider = 'mat-slider[data-automation-id="slider-range"]';
|
||||||
clearButton: Locator = by.css('button[data-automation-id="slider-btn-clear"]');
|
clearButton = 'button[data-automation-id="slider-btn-clear"]';
|
||||||
sliderWithThumbLabel: Locator = by.css('mat-slider[data-automation-id="slider-range"][class*="mat-slider-thumb-label-showing"]');
|
sliderWithThumbLabel = 'mat-slider[data-automation-id="slider-range"][class*="mat-slider-thumb-label-showing"]';
|
||||||
|
|
||||||
constructor(filter: ElementFinder) {
|
constructor(filter: ElementFinder) {
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMaxValue() {
|
async getMaxValue() {
|
||||||
return BrowserActions.getAttribute(this.filter.element(this.slider), 'aria-valuemax');
|
return BrowserActions.getAttribute(this.filter.$(this.slider), 'aria-valuemax');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getMinValue() {
|
async getMinValue() {
|
||||||
return BrowserActions.getAttribute(this.filter.element(this.slider), 'aria-valuemin');
|
return BrowserActions.getAttribute(this.filter.$(this.slider), 'aria-valuemin');
|
||||||
}
|
}
|
||||||
|
|
||||||
async getValue() {
|
async getValue() {
|
||||||
return BrowserActions.getAttribute(this.filter.element(this.slider), 'aria-valuenow');
|
return BrowserActions.getAttribute(this.filter.$(this.slider), 'aria-valuenow');
|
||||||
}
|
}
|
||||||
|
|
||||||
async setValue(value: number): Promise<void> {
|
async setValue(value: number): Promise<void> {
|
||||||
const elem = this.filter.element(this.slider).element(by.css('.mat-slider-wrapper'));
|
const elem = this.filter.$(this.slider).$('.mat-slider-wrapper');
|
||||||
await browser.actions().mouseMove(elem, { x: 0, y: 0 }).perform();
|
await browser.actions().mouseMove(elem, { x: 0, y: 0 }).perform();
|
||||||
await browser.actions().mouseDown().mouseMove({x: value * 10, y: 0}).mouseUp().perform();
|
await browser.actions().mouseDown().mouseMove({x: value * 10, y: 0}).mouseUp().perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkSliderIsDisplayed(): Promise<void> {
|
async checkSliderIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.slider));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.slider));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkSliderIsNotDisplayed(): Promise<void> {
|
async checkSliderIsNotDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.slider));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.slider));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkSliderWithThumbLabelIsNotDisplayed(): Promise<void> {
|
async checkSliderWithThumbLabelIsNotDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.sliderWithThumbLabel));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.sliderWithThumbLabel));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickClearButton(): Promise<void> {
|
async clickClearButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.filter.element(this.clearButton));
|
await BrowserActions.click(this.filter.$(this.clearButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkClearButtonIsEnabled() {
|
async checkClearButtonIsEnabled() {
|
||||||
return this.filter.element(this.clearButton).isEnabled();
|
return this.filter.$(this.clearButton).isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkClearButtonIsDisplayed(): Promise<void> {
|
async checkClearButtonIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter.element(this.clearButton));
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$(this.clearButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkClearButtonIsNotDisplayed(): Promise<void> {
|
async checkClearButtonIsNotDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.clearButton));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.clearButton));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,15 +15,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { browser, by, element } from 'protractor';
|
import { $, browser, by, element } from 'protractor';
|
||||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||||
import { DropdownPage } from '../../../core/pages/material/dropdown.page';
|
import { DropdownPage } from '../../../core/pages/material/dropdown.page';
|
||||||
|
|
||||||
export class SearchSortingPickerPage {
|
export class SearchSortingPickerPage {
|
||||||
|
|
||||||
sortingDropdown = new DropdownPage(element(by.css('.adf-sorting-picker .mat-select-arrow')));
|
sortingDropdown = new DropdownPage($('.adf-sorting-picker .mat-select-arrow'));
|
||||||
orderArrow = element(by.css('adf-sorting-picker button mat-icon'));
|
orderArrow = $('adf-sorting-picker button mat-icon');
|
||||||
|
|
||||||
async sortBy(sortOrder: string, sortType: string | RegExp): Promise<void> {
|
async sortBy(sortOrder: string, sortType: string | RegExp): Promise<void> {
|
||||||
await this.sortingDropdown.clickDropdown();
|
await this.sortingDropdown.clickDropdown();
|
||||||
|
@@ -15,14 +15,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { protractor, by, ElementFinder, Locator } from 'protractor';
|
import { protractor, ElementFinder } from 'protractor';
|
||||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||||
|
|
||||||
export class SearchTextPage {
|
export class SearchTextPage {
|
||||||
|
|
||||||
filter: ElementFinder;
|
filter: ElementFinder;
|
||||||
inputBy: Locator = by.css('input');
|
inputBy = 'input';
|
||||||
|
|
||||||
constructor(filter: ElementFinder) {
|
constructor(filter: ElementFinder) {
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
@@ -30,7 +30,7 @@ export class SearchTextPage {
|
|||||||
|
|
||||||
async searchByName(name: string): Promise<void> {
|
async searchByName(name: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||||
await BrowserActions.clearSendKeys(this.filter.element(this.inputBy), name);
|
await BrowserActions.clearSendKeys(this.filter.$(this.inputBy), name);
|
||||||
await this.filter.element(this.inputBy).sendKeys(protractor.Key.ENTER);
|
await this.filter.$(this.inputBy).sendKeys(protractor.Key.ENTER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,13 +15,13 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||||
import { FileModel } from '../../core/models/file.model';
|
import { FileModel } from '../../core/models/file.model';
|
||||||
|
|
||||||
export class UploadButtonPage {
|
export class UploadButtonPage {
|
||||||
|
|
||||||
uploadButton = element(by.css('adf-upload-button input'));
|
uploadButton = $('adf-upload-button input');
|
||||||
|
|
||||||
async attachFiles(files: FileModel[]): Promise<void> {
|
async attachFiles(files: FileModel[]): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(this.uploadButton);
|
await BrowserVisibility.waitUntilElementIsPresent(this.uploadButton);
|
||||||
@@ -31,11 +31,13 @@ export class UploadButtonPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async isButtonNotDisplayed(): Promise<boolean> {
|
async isButtonNotDisplayed(): Promise<boolean> {
|
||||||
|
let result = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.uploadButton);
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.uploadButton);
|
||||||
return true;
|
result = true;
|
||||||
} catch (e) {
|
} catch (e) { /* do nothing */ }
|
||||||
return false;
|
|
||||||
}
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,15 +15,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { by, element } from 'protractor';
|
import { $, by, element } from 'protractor';
|
||||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||||
|
|
||||||
export class EditJsonDialog {
|
export class EditJsonDialog {
|
||||||
|
|
||||||
dialog = element(by.css(`.adf-edit-json-dialog`));
|
dialog = $(`.adf-edit-json-dialog`);
|
||||||
closeButton = element(by.cssContainingText(`button span`, 'Close'));
|
closeButton = element(by.cssContainingText(`button span`, 'Close'));
|
||||||
dialogContent = this.dialog.element(by.css(`mat-dialog-content textarea`));
|
dialogContent = this.dialog.$(`mat-dialog-content textarea`);
|
||||||
|
|
||||||
async checkDialogIsDisplayed(): Promise<void> {
|
async checkDialogIsDisplayed(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.dialog);
|
await BrowserVisibility.waitUntilElementIsVisible(this.dialog);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||||
import { DataTableComponentPage } from './data-table-component.page';
|
import { DataTableComponentPage } from './data-table-component.page';
|
||||||
|
|
||||||
@@ -47,21 +47,21 @@ export class AboutPage {
|
|||||||
version: 'version'
|
version: 'version'
|
||||||
};
|
};
|
||||||
|
|
||||||
appTitle = element(by.css('[data-automation-id="adf-github-app-title"]'));
|
appTitle = $('[data-automation-id="adf-github-app-title"]');
|
||||||
sourceCodeTitle = element(by.css('[data-automation-id="adf-github-source-code-title"]'));
|
sourceCodeTitle = $('[data-automation-id="adf-github-source-code-title"]');
|
||||||
githubUrl = element(by.css('[data-automation-id="adf-github-url"]'));
|
githubUrl = $('[data-automation-id="adf-github-url"]');
|
||||||
githubVersion = element(by.css('[data-automation-id="adf-github-version"]'));
|
githubVersion = $('[data-automation-id="adf-github-version"]');
|
||||||
bpmHost = element(by.css('[data-automation-id="adf-process-service-host"]'));
|
bpmHost = $('[data-automation-id="adf-process-service-host"]');
|
||||||
ecmHost = element(by.css('[data-automation-id="adf-content-service-host"]'));
|
ecmHost = $('[data-automation-id="adf-content-service-host"]');
|
||||||
productVersionTitle = element(by.css('[data-automation-id="adf-about-product-version-title"]'));
|
productVersionTitle = $('[data-automation-id="adf-about-product-version-title"]');
|
||||||
bpmEdition = element(by.css('[data-automation-id="adf-about-bpm-edition"]'));
|
bpmEdition = $('[data-automation-id="adf-about-bpm-edition"]');
|
||||||
ecmEdition = element(by.css('[data-automation-id="adf-about-ecm-edition"]'));
|
ecmEdition = $('[data-automation-id="adf-about-ecm-edition"]');
|
||||||
bpmVersion = element(by.css('[data-automation-id="adf-about-bpm-version"]'));
|
bpmVersion = $('[data-automation-id="adf-about-bpm-version"]');
|
||||||
ecmVersion = element(by.css('[data-automation-id="adf-about-ecm-version"]'));
|
ecmVersion = $('[data-automation-id="adf-about-ecm-version"]');
|
||||||
ecmStatusTitle = element(by.css('[data-automation-id="adf-about-ecm-status-title"]'));
|
ecmStatusTitle = $('[data-automation-id="adf-about-ecm-status-title"]');
|
||||||
ecmLicenseTitle = element(by.css('[data-automation-id="adf-about-ecm-license-title"]'));
|
ecmLicenseTitle = $('[data-automation-id="adf-about-ecm-license-title"]');
|
||||||
ecmModulesTitle = element(by.css('[data-automation-id="adf-about-ecm-modules-title"]'));
|
ecmModulesTitle = $('[data-automation-id="adf-about-ecm-modules-title"]');
|
||||||
aboutModulesTitle = element(by.css('[data-automation-id="adf-about-modules-title"]'));
|
aboutModulesTitle = $('[data-automation-id="adf-about-modules-title"]');
|
||||||
|
|
||||||
dataTable = new DataTableComponentPage();
|
dataTable = new DataTableComponentPage();
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ export class AboutPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkColumnIsDisplayed(column: string): Promise<void> {
|
async checkColumnIsDisplayed(column: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`div[data-automation-id="auto_id_${column}"]`)));
|
await BrowserVisibility.waitUntilElementIsVisible($(`div[data-automation-id="auto_id_${column}"]`));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -15,16 +15,16 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { BrowserActions } from '../utils/browser-actions';
|
import { BrowserActions } from '../utils/browser-actions';
|
||||||
|
|
||||||
export class BreadcrumbPage {
|
export class BreadcrumbPage {
|
||||||
|
|
||||||
breadcrumb = element(by.css(`adf-breadcrumb nav[data-automation-id='breadcrumb']`));
|
breadcrumb = $(`adf-breadcrumb nav[data-automation-id='breadcrumb']`);
|
||||||
currentItem = element(by.css('.adf-breadcrumb-item-current'));
|
currentItem = $('.adf-breadcrumb-item-current');
|
||||||
|
|
||||||
async chooseBreadCrumb(breadCrumbItem: string): Promise<void> {
|
async chooseBreadCrumb(breadCrumbItem: string): Promise<void> {
|
||||||
const path = this.breadcrumb.element(by.css(`a[data-automation-id='breadcrumb_${breadCrumbItem}']`));
|
const path = this.breadcrumb.$(`a[data-automation-id='breadcrumb_${breadCrumbItem}']`);
|
||||||
await BrowserActions.click(path);
|
await BrowserActions.click(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,25 +15,25 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, ElementFinder, Locator } from 'protractor';
|
import { element, by, ElementFinder } from 'protractor';
|
||||||
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
|
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
|
||||||
|
|
||||||
export class CardBooleanItemPage {
|
export class CardBooleanItemPage {
|
||||||
|
|
||||||
rootElement: ElementFinder;
|
rootElement: ElementFinder;
|
||||||
labelLocator: Locator = by.css('div[data-automation-id*="card-boolean-label"]');
|
labelLocator = 'div[data-automation-id*="card-boolean-label"]';
|
||||||
checkbox: Locator = by.css('mat-checkbox[data-automation-id*="card-boolean"]');
|
checkbox = 'mat-checkbox[data-automation-id*="card-boolean"]';
|
||||||
|
|
||||||
constructor(label: string = 'required') {
|
constructor(label: string = 'required') {
|
||||||
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-boolitem`));
|
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-boolitem`));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkboxClick(): Promise<void> {
|
async checkboxClick(): Promise<void> {
|
||||||
await BrowserActions.click(this.rootElement.element(this.checkbox));
|
await BrowserActions.click(this.rootElement.$(this.checkbox));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkLabelIsPresent(): Promise<void> {
|
async checkLabelIsPresent(): Promise<void> {
|
||||||
const labelElement = this.rootElement.element(this.labelLocator);
|
const labelElement = this.rootElement.$(this.labelLocator);
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(labelElement);
|
await BrowserVisibility.waitUntilElementIsPresent(labelElement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Locator, element, by, ElementFinder } from 'protractor';
|
import { element, by, ElementFinder, $$ } from 'protractor';
|
||||||
import { DateTimePickerPage } from '../material/date-time-picker.page';
|
import { DateTimePickerPage } from '../material/date-time-picker.page';
|
||||||
import { DatePickerPage } from '../material/date-picker.page';
|
import { DatePickerPage } from '../material/date-picker.page';
|
||||||
import { BrowserVisibility } from '../../utils/browser-visibility';
|
import { BrowserVisibility } from '../../utils/browser-visibility';
|
||||||
@@ -26,10 +26,10 @@ export class CardDateItemPage {
|
|||||||
dateTimePickerPage: DateTimePickerPage;
|
dateTimePickerPage: DateTimePickerPage;
|
||||||
datePickerPage = new DatePickerPage();
|
datePickerPage = new DatePickerPage();
|
||||||
|
|
||||||
labelLocator: Locator = by.css('div[data-automation-id*="card-dateitem-label"]');
|
labelLocator = 'div[data-automation-id*="card-dateitem-label"]';
|
||||||
valueLocator: Locator = by.css('span[data-automation-id*="card-date"]');
|
valueLocator = 'span[data-automation-id*="card-date"]';
|
||||||
dateTimePicker = element.all(by.css('.mat-datetimepicker-toggle')).first();
|
dateTimePicker = $$('.mat-datetimepicker-toggle').first();
|
||||||
saveButton: Locator = by.css('button[data-automation-id*="card-dateitem-update"]');
|
saveButton = 'button[data-automation-id*="card-dateitem-update"]';
|
||||||
|
|
||||||
constructor(label: string = 'minDate') {
|
constructor(label: string = 'minDate') {
|
||||||
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-dateitem`));
|
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-dateitem`));
|
||||||
@@ -45,11 +45,11 @@ export class CardDateItemPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDateValue(): Promise<string> {
|
async getDateValue(): Promise<string> {
|
||||||
return this.rootElement.element(this.valueLocator).getText();
|
return this.rootElement.$(this.valueLocator).getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkLabelIsVisible(): Promise<void> {
|
async checkLabelIsVisible(): Promise<void> {
|
||||||
const labelElement = this.rootElement.element(this.labelLocator);
|
const labelElement = this.rootElement.$(this.labelLocator);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(labelElement);
|
await BrowserVisibility.waitUntilElementIsVisible(labelElement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,24 +15,24 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, ElementFinder, Locator } from 'protractor';
|
import { element, by, ElementFinder } from 'protractor';
|
||||||
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
|
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
|
||||||
import { DropdownPage } from '../material/dropdown.page';
|
import { DropdownPage } from '../material/dropdown.page';
|
||||||
|
|
||||||
export class CardSelectItemPage {
|
export class CardSelectItemPage {
|
||||||
|
|
||||||
rootElement: ElementFinder;
|
rootElement: ElementFinder;
|
||||||
labelLocator: Locator = by.css('div[data-automation-id*="card-select-label"]');
|
labelLocator = 'div[data-automation-id*="card-select-label"]';
|
||||||
readOnlyField: Locator = by.css('[data-automation-class="read-only-value"]');
|
readOnlyField = '[data-automation-class="read-only-value"]';
|
||||||
dropdown: DropdownPage;
|
dropdown: DropdownPage;
|
||||||
|
|
||||||
constructor(label: string = 'fileSource') {
|
constructor(label: string = 'fileSource') {
|
||||||
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-selectitem`));
|
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "label-${label}")]/ancestor::adf-card-view-selectitem`));
|
||||||
this.dropdown = new DropdownPage(this.rootElement.element(by.css('mat-select')));
|
this.dropdown = new DropdownPage(this.rootElement.$('mat-select'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkLabelIsPresent(): Promise<void> {
|
async checkLabelIsPresent(): Promise<void> {
|
||||||
const labelElement = this.rootElement.element(this.labelLocator);
|
const labelElement = this.rootElement.$(this.labelLocator);
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(labelElement);
|
await BrowserVisibility.waitUntilElementIsPresent(labelElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,8 +41,8 @@ export class CardSelectItemPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getReadonlyValue(): Promise<string> {
|
async getReadonlyValue(): Promise<string> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(this.readOnlyField));
|
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$(this.readOnlyField));
|
||||||
return BrowserActions.getText(this.rootElement.element(this.readOnlyField));
|
return BrowserActions.getText(this.rootElement.$(this.readOnlyField));
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectDropdownOption(option: string): Promise<void> {
|
async selectDropdownOption(option: string): Promise<void> {
|
||||||
@@ -50,6 +50,6 @@ export class CardSelectItemPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkElementIsReadonly(): Promise<void> {
|
async checkElementIsReadonly(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(this.readOnlyField));
|
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$(this.readOnlyField));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,63 +15,63 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Locator, element, by, ElementFinder, Key } from 'protractor';
|
import { element, by, ElementFinder, Key } from 'protractor';
|
||||||
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
|
import { BrowserActions, BrowserVisibility } from '../../utils/public-api';
|
||||||
export class CardTextItemPage {
|
export class CardTextItemPage {
|
||||||
|
|
||||||
rootElement: ElementFinder;
|
rootElement: ElementFinder;
|
||||||
textField: Locator = by.css('[data-automation-id*="card-textitem-value"]');
|
textField = '[data-automation-id*="card-textitem-value"]';
|
||||||
saveButton: Locator = by.css('button[data-automation-id*="card-textitem-update"]');
|
saveButton = 'button[data-automation-id*="card-textitem-update"]';
|
||||||
clearButton: Locator = by.css('button[data-automation-id*="card-textitem-reset"]');
|
clearButton = 'button[data-automation-id*="card-textitem-reset"]';
|
||||||
field: Locator = by.css('[data-automation-id*="card-textitem-value"]');
|
field = '[data-automation-id*="card-textitem-value"]';
|
||||||
labelLocator: Locator = by.css('div[data-automation-id*="card-textitem-label"]');
|
labelLocator = 'div[data-automation-id*="card-textitem-label"]';
|
||||||
errorMessage: Locator = by.css('.adf-textitem-editable-error');
|
errorMessage = '.adf-textitem-editable-error';
|
||||||
clickableElement: Locator = by.css('.adf-textitem-clickable');
|
clickableElement = '.adf-textitem-clickable';
|
||||||
readOnlyField: Locator = by.css('.adf-property-read-only');
|
readOnlyField = '.adf-property-read-only';
|
||||||
|
|
||||||
constructor(label: string = 'assignee') {
|
constructor(label: string = 'assignee') {
|
||||||
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "card-textitem-label-${label}")]//ancestor::adf-card-view-textitem`));
|
this.rootElement = element(by.xpath(`//div[contains(@data-automation-id, "card-textitem-label-${label}")]//ancestor::adf-card-view-textitem`));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFieldValue(): Promise<string> {
|
async getFieldValue(): Promise<string> {
|
||||||
const fieldElement = this.rootElement.element(this.field);
|
const fieldElement = this.rootElement.$(this.field);
|
||||||
return BrowserActions.getInputValue(fieldElement);
|
return BrowserActions.getInputValue(fieldElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkLabelIsPresent(): Promise<void> {
|
async checkLabelIsPresent(): Promise<void> {
|
||||||
const labelElement = this.rootElement.element(this.labelLocator);
|
const labelElement = this.rootElement.$(this.labelLocator);
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(labelElement);
|
await BrowserVisibility.waitUntilElementIsPresent(labelElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkLabelIsVisible(): Promise<void> {
|
async checkLabelIsVisible(): Promise<void> {
|
||||||
const labelElement = this.rootElement.element(this.labelLocator);
|
const labelElement = this.rootElement.$(this.labelLocator);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(labelElement);
|
await BrowserVisibility.waitUntilElementIsVisible(labelElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async enterTextField(text: string): Promise<void> {
|
async enterTextField(text: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(this.textField));
|
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$(this.textField));
|
||||||
await BrowserActions.clearSendKeys(this.rootElement.element(this.textField), text, 500);
|
await BrowserActions.clearSendKeys(this.rootElement.$(this.textField), text, 500);
|
||||||
await this.rootElement.element(this.textField).sendKeys(Key.TAB);
|
await this.rootElement.$(this.textField).sendKeys(Key.TAB);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickOnSaveButton(): Promise<void> {
|
async clickOnSaveButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.rootElement.element(this.saveButton));
|
await BrowserActions.click(this.rootElement.$(this.saveButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickOnClearButton(): Promise<void> {
|
async clickOnClearButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.rootElement.element(this.clearButton));
|
await BrowserActions.click(this.rootElement.$(this.clearButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getErrorMessage(): Promise<string> {
|
async getErrorMessage(): Promise<string> {
|
||||||
const errorField = this.rootElement.element(this.errorMessage);
|
const errorField = this.rootElement.$(this.errorMessage);
|
||||||
return BrowserActions.getText(errorField);
|
return BrowserActions.getText(errorField);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkElementIsReadonly(): Promise<void> {
|
async checkElementIsReadonly(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(this.readOnlyField));
|
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$(this.readOnlyField));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickField(): Promise<void> {
|
async clickField(): Promise<void> {
|
||||||
await BrowserActions.click(this.rootElement.element(by.css(`button[data-automation-id*='clickable-icon']`)));
|
await BrowserActions.click(this.rootElement.$(`button[data-automation-id*='clickable-icon']`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,26 +15,26 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, browser } from 'protractor';
|
import { browser, $ } from 'protractor';
|
||||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||||
import { BrowserActions } from '../utils/browser-actions';
|
import { BrowserActions } from '../utils/browser-actions';
|
||||||
|
|
||||||
export class ConfigEditorPage {
|
export class ConfigEditorPage {
|
||||||
|
|
||||||
textField = element(by.css('#adf-form-config-editor div.overflow-guard > textarea'));
|
textField = $('#adf-form-config-editor div.overflow-guard > textarea');
|
||||||
|
|
||||||
async enterConfiguration(text: string): Promise<void> {
|
async enterConfiguration(text: string): Promise<void> {
|
||||||
await BrowserActions.clearSendKeys(this.textField, text);
|
await BrowserActions.clearSendKeys(this.textField, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickSaveButton(): Promise<void> {
|
async clickSaveButton(): Promise<void> {
|
||||||
const saveButton = element(by.id('app-form-config-save'));
|
const saveButton = $('#app-form-config-save');
|
||||||
await BrowserActions.click(saveButton);
|
await BrowserActions.click(saveButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickClearButton(): Promise<void> {
|
async clickClearButton(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.textField);
|
await BrowserVisibility.waitUntilElementIsVisible(this.textField);
|
||||||
const clearButton = element(by.id('app-form-config-clear'));
|
const clearButton = $('#app-form-config-clear');
|
||||||
await BrowserActions.click(clearButton);
|
await BrowserActions.click(clearButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,12 +15,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { $ } from 'protractor';
|
||||||
import { BrowserActions } from '../utils/browser-actions';
|
import { BrowserActions } from '../utils/browser-actions';
|
||||||
import { element, by } from 'protractor';
|
|
||||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||||
|
|
||||||
export class ContextMenuPage {
|
export class ContextMenuPage {
|
||||||
contextMenu = element(by.id('adf-context-menu-content'));
|
contextMenu = $('#adf-context-menu-content');
|
||||||
|
|
||||||
async isContextMenuDisplayed(): Promise<boolean> {
|
async isContextMenuDisplayed(): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
@@ -32,6 +32,6 @@ export class ContextMenuPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickContextMenuActionNamed(actionName: string): Promise<void> {
|
async clickContextMenuActionNamed(actionName: string): Promise<void> {
|
||||||
await BrowserActions.click(element(by.css(`button[data-automation-id="context-${actionName}"]`)));
|
await BrowserActions.click($(`button[data-automation-id="context-${actionName}"]`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Locator, browser, by, element, protractor, ElementFinder, ElementArrayFinder } from 'protractor';
|
import { browser, by, element, protractor, ElementFinder, ElementArrayFinder, $, $$ } from 'protractor';
|
||||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||||
import { BrowserActions } from '../utils/browser-actions';
|
import { BrowserActions } from '../utils/browser-actions';
|
||||||
import { Logger } from '../utils/logger';
|
import { Logger } from '../utils/logger';
|
||||||
@@ -26,7 +26,6 @@ export class DataTableComponentPage {
|
|||||||
list: ElementArrayFinder;
|
list: ElementArrayFinder;
|
||||||
contents: ElementArrayFinder;
|
contents: ElementArrayFinder;
|
||||||
tableBody: ElementFinder;
|
tableBody: ElementFinder;
|
||||||
rows: Locator = by.css(`adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`);
|
|
||||||
allColumns: ElementArrayFinder;
|
allColumns: ElementArrayFinder;
|
||||||
selectedRowNumber: ElementFinder;
|
selectedRowNumber: ElementFinder;
|
||||||
allSelectedRows: ElementArrayFinder;
|
allSelectedRows: ElementArrayFinder;
|
||||||
@@ -36,21 +35,27 @@ export class DataTableComponentPage {
|
|||||||
emptyListTitle: ElementFinder;
|
emptyListTitle: ElementFinder;
|
||||||
emptyListSubtitle: ElementFinder;
|
emptyListSubtitle: ElementFinder;
|
||||||
|
|
||||||
|
rows = `adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`;
|
||||||
|
|
||||||
MAX_LOADING_TIME = 120000;
|
MAX_LOADING_TIME = 120000;
|
||||||
|
|
||||||
constructor(rootElement = element.all(by.css('adf-datatable')).first()) {
|
constructor(rootElement = $$('adf-datatable').first()) {
|
||||||
this.rootElement = rootElement;
|
this.rootElement = rootElement;
|
||||||
this.list = this.rootElement.all(by.css(`div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`));
|
this.list = this.rootElement.$$(`div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`);
|
||||||
this.contents = this.rootElement.all(by.css('.adf-datatable-body span'));
|
this.contents = this.rootElement.$$('.adf-datatable-body span');
|
||||||
this.tableBody = this.rootElement.all(by.css(`.adf-datatable-body`)).first();
|
this.tableBody = this.rootElement.$$(`.adf-datatable-body`).first();
|
||||||
this.allColumns = this.rootElement.all(by.css('div[data-automation-id*="auto_id_entry."]'));
|
this.allColumns = this.rootElement.$$('div[data-automation-id*="auto_id_entry."]');
|
||||||
this.selectedRowNumber = this.rootElement.element(by.css(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`));
|
this.selectedRowNumber = this.rootElement.$(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`);
|
||||||
this.allSelectedRows = this.rootElement.all(by.css(`adf-datatable-row[class*='is-selected']`));
|
this.allSelectedRows = this.rootElement.$$(`adf-datatable-row[class*='is-selected']`);
|
||||||
this.selectAll = this.rootElement.element(by.css(`div[class*='adf-datatable-header'] mat-checkbox`));
|
this.selectAll = this.rootElement.$(`div[class*='adf-datatable-header'] mat-checkbox`);
|
||||||
this.copyColumnTooltip = this.rootElement.element(by.css(`adf-copy-content-tooltip span`));
|
this.copyColumnTooltip = this.rootElement.$(`adf-copy-content-tooltip span`);
|
||||||
this.emptyList = this.rootElement.element(by.css(`adf-empty-content`));
|
this.emptyList = this.rootElement.$(`adf-empty-content`);
|
||||||
this.emptyListTitle = this.rootElement.element(by.css(`.adf-empty-content__title`));
|
this.emptyListTitle = this.rootElement.$(`.adf-empty-content__title`);
|
||||||
this.emptyListSubtitle = this.rootElement.element(by.css(`.adf-empty-content__subtitle`));
|
this.emptyListSubtitle = this.rootElement.$(`.adf-empty-content__subtitle`);
|
||||||
|
}
|
||||||
|
|
||||||
|
geCellElementDetail(detail: string): ElementArrayFinder {
|
||||||
|
return $$(`adf-datatable div[title="${detail}"] span`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkAllRowsButtonIsDisplayed(): Promise<void> {
|
async checkAllRowsButtonIsDisplayed(): Promise<void> {
|
||||||
@@ -59,12 +64,12 @@ export class DataTableComponentPage {
|
|||||||
|
|
||||||
async checkAllRows(): Promise<void> {
|
async checkAllRows(): Promise<void> {
|
||||||
await BrowserActions.click(this.selectAll);
|
await BrowserActions.click(this.selectAll);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.selectAll.element(by.css('input[aria-checked="true"]')));
|
await BrowserVisibility.waitUntilElementIsVisible(this.selectAll.$('input[aria-checked="true"]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async uncheckAllRows(): Promise<void> {
|
async uncheckAllRows(): Promise<void> {
|
||||||
await BrowserActions.click(this.selectAll);
|
await BrowserActions.click(this.selectAll);
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectAll.element(by.css('input[aria-checked="true"]')));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectAll.$('input[aria-checked="true"]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickCheckbox(columnName: string, columnValue: string): Promise<void> {
|
async clickCheckbox(columnName: string, columnValue: string): Promise<void> {
|
||||||
@@ -73,16 +78,16 @@ export class DataTableComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkRowIsNotChecked(columnName: string, columnValue: string): Promise<void> {
|
async checkRowIsNotChecked(columnName: string, columnValue: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.getRowCheckbox(columnName, columnValue).element(by.css('input[aria-checked="true"]')));
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.getRowCheckbox(columnName, columnValue).$('input[aria-checked="true"]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkRowIsChecked(columnName: string, columnValue: string): Promise<void> {
|
async checkRowIsChecked(columnName: string, columnValue: string): Promise<void> {
|
||||||
const rowCheckbox = this.getRowCheckbox(columnName, columnValue);
|
const rowCheckbox = this.getRowCheckbox(columnName, columnValue);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(rowCheckbox.element(by.css('input[aria-checked="true"]')));
|
await BrowserVisibility.waitUntilElementIsVisible(rowCheckbox.$('input[aria-checked="true"]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
getRowCheckbox(columnName: string, columnValue: string): ElementFinder {
|
getRowCheckbox(columnName: string, columnValue: string): ElementFinder {
|
||||||
return this.getRow(columnName, columnValue).element(by.css('mat-checkbox'));
|
return this.getRow(columnName, columnValue).$('mat-checkbox');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkNoRowIsSelected(): Promise<void> {
|
async checkNoRowIsSelected(): Promise<void> {
|
||||||
@@ -140,7 +145,7 @@ export class DataTableComponentPage {
|
|||||||
async getColumnValueForRow(identifyingColumn: string, identifyingValue: string, columnName: string): Promise<string> {
|
async getColumnValueForRow(identifyingColumn: string, identifyingValue: string, columnName: string): Promise<string> {
|
||||||
const row = this.getRow(identifyingColumn, identifyingValue);
|
const row = this.getRow(identifyingColumn, identifyingValue);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||||
const rowColumn = row.element(by.css(`div[title="${columnName}"] span`));
|
const rowColumn = row.$(`div[title="${columnName}"] span`);
|
||||||
return BrowserActions.getText(rowColumn);
|
return BrowserActions.getText(rowColumn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,7 +158,7 @@ export class DataTableComponentPage {
|
|||||||
* @return 'true' if the list is sorted as await expected and 'false' if it isn't
|
* @return 'true' if the list is sorted as await expected and 'false' if it isn't
|
||||||
*/
|
*/
|
||||||
async checkListIsSorted(sortOrder: string, columnTitle: string, listType: string = 'STRING'): Promise<any> {
|
async checkListIsSorted(sortOrder: string, columnTitle: string, listType: string = 'STRING'): Promise<any> {
|
||||||
const column = element.all(by.css(`div.adf-datatable-cell[title='${columnTitle}'] span`));
|
const column = $$(`div.adf-datatable-cell[title='${columnTitle}'] span`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(column.first());
|
await BrowserVisibility.waitUntilElementIsVisible(column.first());
|
||||||
const initialList = [];
|
const initialList = [];
|
||||||
|
|
||||||
@@ -212,7 +217,7 @@ export class DataTableComponentPage {
|
|||||||
|
|
||||||
async rightClickOnRow(columnName: string, columnValue: string): Promise<void> {
|
async rightClickOnRow(columnName: string, columnValue: string): Promise<void> {
|
||||||
await this.rightClickOnItem(columnName, columnValue);
|
await this.rightClickOnItem(columnName, columnValue);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
await BrowserVisibility.waitUntilElementIsVisible($('#adf-context-menu-content'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getTooltip(columnName: string, columnValue: string): Promise<string> {
|
async getTooltip(columnName: string, columnValue: string): Promise<string> {
|
||||||
@@ -222,7 +227,7 @@ export class DataTableComponentPage {
|
|||||||
async rightClickOnRowByIndex(index: number): Promise<void> {
|
async rightClickOnRowByIndex(index: number): Promise<void> {
|
||||||
const row = this.getRowByIndex(index);
|
const row = this.getRowByIndex(index);
|
||||||
await BrowserActions.rightClick(row);
|
await BrowserActions.rightClick(row);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
await BrowserVisibility.waitUntilElementIsVisible($('#adf-context-menu-content'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async rightClickOnItem(columnName: string, columnValue: string): Promise<void> {
|
async rightClickOnItem(columnName: string, columnValue: string): Promise<void> {
|
||||||
@@ -237,35 +242,37 @@ export class DataTableComponentPage {
|
|||||||
async numberOfRows(): Promise<number> {
|
async numberOfRows(): Promise<number> {
|
||||||
try {
|
try {
|
||||||
await this.waitForFirstRow();
|
await this.waitForFirstRow();
|
||||||
return this.rootElement.all(this.rows).count();
|
return this.rootElement.$$(this.rows).count();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async waitForFirstRow(): Promise<void> {
|
async waitForFirstRow(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.all(this.rows).first());
|
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$$(this.rows).first());
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAllRowsColumnValues(column: string): Promise<string[]> {
|
async getAllRowsColumnValues(column: string): Promise<string[]> {
|
||||||
let columnValues: string[] = [];
|
let columnValues: string[] = [];
|
||||||
const columnLocator: Locator = by.css("adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row'] div[title='" + column + "'] span");
|
const columnLocator = $$(`adf-datatable div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row'] div[title="${column}"] span`);
|
||||||
|
|
||||||
|
await BrowserVisibility.waitUntilElementIsPresent(await columnLocator.first(), 1000);
|
||||||
try {
|
try {
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(element.all(columnLocator).first(), 1000);
|
await BrowserVisibility.waitUntilElementIsPresent(columnLocator.first(), 1000);
|
||||||
columnValues = <string[]> await element.all(columnLocator)
|
columnValues = await columnLocator
|
||||||
.filter(async (el) => el.isPresent())
|
.filter(async (el) => el.isPresent())
|
||||||
.map(async (el) => el.getText());
|
.map(async (el) => el.getText());
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Logger.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
return columnValues;
|
return columnValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getRowsWithSameColumnValues(columnName: string, columnValue: string) {
|
async getRowsWithSameColumnValues(columnName: string, columnValue: string) {
|
||||||
const columnLocator: Locator = by.css(`div[title='${columnName}'] div[data-automation-id="text_${columnValue}"] span`);
|
const columnLocator = `div[title='${columnName}'] div[data-automation-id="text_${columnValue}"] span`;
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.all(columnLocator).first());
|
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$$(columnLocator).first());
|
||||||
return this.rootElement.all(columnLocator).getText();
|
return this.rootElement.$$(columnLocator).getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
async doubleClickRow(columnName: string, columnValue: string): Promise<void> {
|
async doubleClickRow(columnName: string, columnValue: string): Promise<void> {
|
||||||
@@ -279,36 +286,32 @@ export class DataTableComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFirstElementDetail(detail: string): Promise<string> {
|
async getFirstElementDetail(detail: string): Promise<string> {
|
||||||
const firstNode = element.all(by.css(`adf-datatable div[title="${detail}"] span`)).first();
|
const firstNode = $$(`adf-datatable div[title="${detail}"] span`).first();
|
||||||
return BrowserActions.getText(firstNode);
|
return BrowserActions.getText(firstNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
geCellElementDetail(detail: string): ElementArrayFinder {
|
|
||||||
return element.all(by.css(`adf-datatable div[title="${detail}"] span`));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sort the list by name column.
|
* Sort the list by name column.
|
||||||
*
|
*
|
||||||
* @param sortOrder : 'ASC' to sort the list ascendant and 'DESC' for descendant
|
* @param sortOrder : 'ASC' to sort the list ascendant and 'DESC' for descendant
|
||||||
*/
|
*/
|
||||||
async sortByColumn(sortOrder: string, titleColumn: string): Promise<void> {
|
async sortByColumn(sortOrder: string, titleColumn: string): Promise<void> {
|
||||||
const locator: Locator = by.css(`div[data-automation-id="auto_id_${titleColumn}"]`);
|
const locator = $(`div[data-automation-id="auto_id_${titleColumn}"]`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(locator));
|
await BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||||
const result = await BrowserActions.getAttribute(element(locator), 'class');
|
const result = await BrowserActions.getAttribute(locator, 'class');
|
||||||
|
|
||||||
if (sortOrder.toLocaleLowerCase() === 'asc') {
|
if (sortOrder.toLocaleLowerCase() === 'asc') {
|
||||||
if (!result.includes('sorted-asc')) {
|
if (!result.includes('sorted-asc')) {
|
||||||
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
||||||
await BrowserActions.click(element(locator));
|
await BrowserActions.click(locator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (result.includes('sorted-asc')) {
|
if (result.includes('sorted-asc')) {
|
||||||
await BrowserActions.click(element(locator));
|
await BrowserActions.click(locator);
|
||||||
} else if (result.includes('sortable')) {
|
} else if (result.includes('sortable')) {
|
||||||
await BrowserActions.click(element(locator));
|
await BrowserActions.click(locator);
|
||||||
await BrowserActions.click(element(locator));
|
await BrowserActions.click(locator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -359,7 +362,7 @@ export class DataTableComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCellElementByValue(columnName: string, columnValue: string, columnPrefix = 'text_'): ElementFinder {
|
getCellElementByValue(columnName: string, columnValue: string, columnPrefix = 'text_'): ElementFinder {
|
||||||
return this.rootElement.all(by.css(`div[title="${columnName}"] div[data-automation-id="${columnPrefix}${columnValue}"] span`)).first();
|
return this.rootElement.$$(`div[title="${columnName}"] div[data-automation-id="${columnPrefix}${columnValue}"] span`).first();
|
||||||
}
|
}
|
||||||
|
|
||||||
async tableIsLoaded(): Promise<void> {
|
async tableIsLoaded(): Promise<void> {
|
||||||
@@ -456,7 +459,7 @@ export class DataTableComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkColumnIsDisplayed(column: string): Promise<void> {
|
async checkColumnIsDisplayed(column: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`div[data-automation-id="auto_id_entry.${column}"]`)));
|
await BrowserVisibility.waitUntilElementIsVisible($(`div[data-automation-id="auto_id_entry.${column}"]`));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getNumberOfColumns(): Promise<number> {
|
async getNumberOfColumns(): Promise<number> {
|
||||||
@@ -468,11 +471,11 @@ export class DataTableComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCellByRowNumberAndColumnName(rowNumber: number, columnName: string): ElementFinder {
|
getCellByRowNumberAndColumnName(rowNumber: number, columnName: string): ElementFinder {
|
||||||
return this.list.get(rowNumber).all(by.css(`div[title="${columnName}"] span`)).first();
|
return this.list.get(rowNumber).$$(`div[title="${columnName}"] span`).first();
|
||||||
}
|
}
|
||||||
|
|
||||||
getCellByRowContentAndColumn(rowColumn: string, rowContent: string, columnName: string): ElementFinder {
|
getCellByRowContentAndColumn(rowColumn: string, rowContent: string, columnName: string): ElementFinder {
|
||||||
return this.getRow(rowColumn, rowContent).element(by.css(`div[title='${columnName}']`));
|
return this.getRow(rowColumn, rowContent).$(`div[title='${columnName}']`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectRowByContent(content: string): Promise<void> {
|
async selectRowByContent(content: string): Promise<void> {
|
||||||
@@ -500,33 +503,33 @@ export class DataTableComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickRowByContent(name: string): Promise<void> {
|
async clickRowByContent(name: string): Promise<void> {
|
||||||
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${name}']`)).first();
|
const resultElement = this.rootElement.$$(`div[data-automation-id='${name}']`).first();
|
||||||
await BrowserActions.click(resultElement);
|
await BrowserActions.click(resultElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickRowByContentCheckbox(name: string): Promise<void> {
|
async clickRowByContentCheckbox(name: string): Promise<void> {
|
||||||
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${name}']`)).first().element(by.xpath(`ancestor::adf-datatable-row/div/mat-checkbox`));
|
const resultElement = this.rootElement.$$(`div[data-automation-id='${name}']`).first().element(by.xpath(`ancestor::adf-datatable-row/div/mat-checkbox`));
|
||||||
await browser.actions().mouseMove(resultElement);
|
await browser.actions().mouseMove(resultElement);
|
||||||
await BrowserActions.click(resultElement);
|
await BrowserActions.click(resultElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkRowContentIsDisplayed(content: string): Promise<void> {
|
async checkRowContentIsDisplayed(content: string): Promise<void> {
|
||||||
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}']`)).first();
|
const resultElement = this.rootElement.$$(`div[data-automation-id='${content}']`).first();
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(resultElement);
|
await BrowserVisibility.waitUntilElementIsVisible(resultElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkRowContentIsNotDisplayed(content: string): Promise<void> {
|
async checkRowContentIsNotDisplayed(content: string): Promise<void> {
|
||||||
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}']`)).first();
|
const resultElement = this.rootElement.$$(`div[data-automation-id='${content}']`).first();
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(resultElement);
|
await BrowserVisibility.waitUntilElementIsNotVisible(resultElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkRowContentIsDisabled(content: string): Promise<void> {
|
async checkRowContentIsDisabled(content: string): Promise<void> {
|
||||||
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}'] div.adf-cell-value img[aria-label='Disabled']`)).first();
|
const resultElement = this.rootElement.$$(`div[data-automation-id='${content}'] div.adf-cell-value img[aria-label='Disabled']`).first();
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(resultElement);
|
await BrowserVisibility.waitUntilElementIsVisible(resultElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async doubleClickRowByContent(name: string): Promise<void> {
|
async doubleClickRowByContent(name: string): Promise<void> {
|
||||||
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${name}']`)).first();
|
const resultElement = this.rootElement.$$(`div[data-automation-id='${name}']`).first();
|
||||||
await BrowserActions.click(resultElement);
|
await BrowserActions.click(resultElement);
|
||||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
}
|
}
|
||||||
@@ -566,7 +569,7 @@ export class DataTableComponentPage {
|
|||||||
async getEmptyListText(): Promise<string> {
|
async getEmptyListText(): Promise<string> {
|
||||||
const isEmpty = await this.isEmpty();
|
const isEmpty = await this.isEmpty();
|
||||||
if (isEmpty) {
|
if (isEmpty) {
|
||||||
return this.rootElement.by.css('adf-custom-empty-content-template').getText();
|
return this.rootElement.$('adf-custom-empty-content-template').getText();
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
@@ -16,16 +16,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Column } from './column';
|
import { Column } from './column';
|
||||||
import { by, element, ElementFinder, Locator, protractor, browser } from 'protractor';
|
import { by, element, ElementFinder, protractor, browser, $$ } from 'protractor';
|
||||||
import { BrowserActions } from '../../utils/browser-actions';
|
import { BrowserActions } from '../../utils/browser-actions';
|
||||||
import { BrowserVisibility } from '../../utils/browser-visibility';
|
import { BrowserVisibility } from '../../utils/browser-visibility';
|
||||||
|
|
||||||
export class DataTableItem {
|
export class DataTableItem {
|
||||||
columns = new Array<Column>();
|
columns = new Array<Column>();
|
||||||
rootElement: ElementFinder;
|
rootElement: ElementFinder;
|
||||||
rows: Locator = by.css(`div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`);
|
rows = `div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`;
|
||||||
|
|
||||||
constructor(rootElement = element.all(by.css('adf-datatable')).first()) {
|
constructor(rootElement = $$('adf-datatable').first()) {
|
||||||
this.rootElement = rootElement;
|
this.rootElement = rootElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ export class DataTableItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async waitForFirstRow(): Promise<void> {
|
async waitForFirstRow(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.all(this.rows).first());
|
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.$$(this.rows).first());
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickAndEnterOnRow(columnName: string, columnValue: string): Promise<void> {
|
async clickAndEnterOnRow(columnName: string, columnValue: string): Promise<void> {
|
||||||
@@ -70,7 +70,7 @@ export class DataTableItem {
|
|||||||
async getColumnValueForRow(identifyingColumnName: string, identifyingColumnValue: string, columnName: string): Promise<string> {
|
async getColumnValueForRow(identifyingColumnName: string, identifyingColumnValue: string, columnName: string): Promise<string> {
|
||||||
const row = await this.getRow(identifyingColumnName, identifyingColumnValue);
|
const row = await this.getRow(identifyingColumnName, identifyingColumnValue);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(row);
|
await BrowserVisibility.waitUntilElementIsVisible(row);
|
||||||
const rowColumn = row.element(by.css(`div[title="${columnName}"] span`));
|
const rowColumn = row.$(`div[title="${columnName}"] span`);
|
||||||
return BrowserActions.getText(rowColumn);
|
return BrowserActions.getText(rowColumn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,14 +16,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||||
import { element, by } from 'protractor';
|
import { $ } from 'protractor';
|
||||||
import { BrowserActions } from '../utils/browser-actions';
|
import { BrowserActions } from '../utils/browser-actions';
|
||||||
|
|
||||||
export class ErrorPage {
|
export class ErrorPage {
|
||||||
|
|
||||||
errorPageCode = element(by.css('adf-error-content .adf-error-content-code'));
|
errorPageCode = $('adf-error-content .adf-error-content-code');
|
||||||
errorPageTitle = element(by.css('adf-error-content .adf-error-content-title'));
|
errorPageTitle = $('adf-error-content .adf-error-content-title');
|
||||||
errorPageDescription = element(by.css('adf-error-content .adf-error-content-description'));
|
errorPageDescription = $('adf-error-content .adf-error-content-description');
|
||||||
|
|
||||||
async checkErrorCode(): Promise<void> {
|
async checkErrorCode(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.errorPageCode);
|
await BrowserVisibility.waitUntilElementIsVisible(this.errorPageCode);
|
||||||
|
@@ -15,37 +15,43 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { browser, Locator, by, element, ElementFinder } from 'protractor';
|
import { browser, Locator, by, element, ElementFinder, $, $$ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '../../utils/public-api';
|
import { BrowserVisibility, BrowserActions } from '../../utils/public-api';
|
||||||
import { DropdownPage } from '../material/dropdown.page';
|
import { DropdownPage } from '../material/dropdown.page';
|
||||||
|
|
||||||
export class FormFields {
|
export class FormFields {
|
||||||
|
|
||||||
formContent = element(by.css('adf-form-renderer'));
|
selectFormDropdown = new DropdownPage($$('.adf-attach-form .mat-select-arrow').first());
|
||||||
refreshButton = element(by.css('div[class*="form-reload-button"] mat-icon'));
|
formContent = $('adf-form-renderer');
|
||||||
|
refreshButton = $('div[class*="form-reload-button"] mat-icon');
|
||||||
saveButton = element(by.cssContainingText('mat-card-actions[class*="adf-for"] span', 'SAVE'));
|
saveButton = element(by.cssContainingText('mat-card-actions[class*="adf-for"] span', 'SAVE'));
|
||||||
valueLocator: Locator = by.css('input');
|
valueLocator: Locator = by.css('input');
|
||||||
labelLocator: Locator = by.css('label');
|
labelLocator: Locator = by.css('label');
|
||||||
noFormMessage = element(by.css('.adf-empty-content__title'));
|
noFormMessage = $('.adf-empty-content__title');
|
||||||
noFormMessageStandaloneTask = element(by.css('adf-task-standalone #adf-no-form-message'));
|
noFormMessageStandaloneTask = $('adf-task-standalone #adf-no-form-message');
|
||||||
noFormTemplate = element(by.css('adf-empty-content'));
|
noFormTemplate = $('adf-empty-content');
|
||||||
completedTaskNoFormMessage = element(by.css('div[id*="completed-form-message"] p'));
|
completedTaskNoFormMessage = $('div[id*="completed-form-message"] p');
|
||||||
completedStandaloneTaskNoFormMessage = element(by.css('adf-task-standalone #adf-completed-form-message'));
|
completedStandaloneTaskNoFormMessage = $('adf-task-standalone #adf-completed-form-message');
|
||||||
attachFormButton = element(by.id('adf-attach-form-attach-button'));
|
attachFormButton = $('#adf-attach-form-attach-button');
|
||||||
completeButton = element(by.id('adf-form-complete'));
|
completeButton = $('#adf-form-complete');
|
||||||
completeNoFormButton = element(by.id('adf-no-form-complete-button'));
|
completeNoFormButton = $('#adf-no-form-complete-button');
|
||||||
cancelButton = element(by.id('adf-no-form-cancel-button'));
|
cancelButton = $('#adf-no-form-cancel-button');
|
||||||
errorMessage: Locator = by.css('.adf-error-text-container .adf-error-text');
|
errorMessage: Locator = by.css('.adf-error-text-container .adf-error-text');
|
||||||
|
|
||||||
selectFormDropdown = new DropdownPage(element.all(by.css('.adf-attach-form .mat-select-arrow')).first());
|
getWidget = (fieldId: string): ElementFinder => $(`adf-form-field div[id='field-${fieldId}-container']`);
|
||||||
|
|
||||||
async setFieldValue(locator, field, value: string): Promise<void> {
|
async setFieldValue(field: string, value: string): Promise<void> {
|
||||||
const fieldElement = element(locator(field));
|
const fieldElement = $(`#${field}`);
|
||||||
await BrowserActions.clearSendKeys(fieldElement, value);
|
await BrowserActions.clearSendKeys(fieldElement, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async checkFieldValue(field: string, value: string): Promise<void> {
|
||||||
|
const fieldElement = $(`#${field}`);
|
||||||
|
await BrowserVisibility.waitUntilElementHasValue(fieldElement, value);
|
||||||
|
}
|
||||||
|
|
||||||
async checkWidgetIsVisible(fieldId: string): Promise<void> {
|
async checkWidgetIsVisible(fieldId: string): Promise<void> {
|
||||||
const fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first();
|
const fieldElement = $$(`adf-form-field div[id='field-${fieldId}-container']`).first();
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(fieldElement);
|
await BrowserVisibility.waitUntilElementIsVisible(fieldElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,19 +62,15 @@ export class FormFields {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkWidgetIsClickable(fieldId: string): Promise<void> {
|
async checkWidgetIsClickable(fieldId: string): Promise<void> {
|
||||||
const fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first();
|
const fieldElement = $$(`adf-form-field div[id='field-${fieldId}-container']`).first();
|
||||||
await BrowserVisibility.waitUntilElementIsClickable(fieldElement);
|
await BrowserVisibility.waitUntilElementIsClickable(fieldElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkWidgetIsHidden(fieldId: string): Promise<void> {
|
async checkWidgetIsHidden(fieldId: string): Promise<void> {
|
||||||
const hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`));
|
const hiddenElement = $(`adf-form-field div[id='field-${fieldId}-container']`);
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(hiddenElement, 6000);
|
await BrowserVisibility.waitUntilElementIsNotVisible(hiddenElement, 6000);
|
||||||
}
|
}
|
||||||
|
|
||||||
getWidget(fieldId: string): ElementFinder {
|
|
||||||
return element(by.css(`adf-form-field div[id='field-${fieldId}-container']`));
|
|
||||||
}
|
|
||||||
|
|
||||||
async getFieldValue(fieldId: string, valueLocatorParam?: any): Promise<string> {
|
async getFieldValue(fieldId: string, valueLocatorParam?: any): Promise<string> {
|
||||||
const valueWidget = await (await this.getWidget(fieldId)).element(valueLocatorParam || this.valueLocator);
|
const valueWidget = await (await this.getWidget(fieldId)).element(valueLocatorParam || this.valueLocator);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(valueWidget);
|
await BrowserVisibility.waitUntilElementIsVisible(valueWidget);
|
||||||
@@ -92,15 +94,11 @@ export class FormFields {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getFieldPlaceHolder(fieldId: string, locator = 'input'): Promise<string> {
|
async getFieldPlaceHolder(fieldId: string, locator = 'input'): Promise<string> {
|
||||||
const placeHolderLocator = element(by.css(`${locator}#${fieldId}`));
|
const placeHolderLocator = $(`${locator}#${fieldId}`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator);
|
await BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator);
|
||||||
return BrowserActions.getAttribute(placeHolderLocator, 'data-placeholder');
|
return BrowserActions.getAttribute(placeHolderLocator, 'data-placeholder');
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFieldValue(locator, field, val): Promise<void> {
|
|
||||||
await BrowserVisibility.waitUntilElementHasValue(element(locator(field)), val);
|
|
||||||
}
|
|
||||||
|
|
||||||
async refreshForm(): Promise<void> {
|
async refreshForm(): Promise<void> {
|
||||||
await BrowserActions.click(this.refreshButton);
|
await BrowserActions.click(this.refreshButton);
|
||||||
await browser.sleep(500);
|
await browser.sleep(500);
|
||||||
@@ -177,13 +175,13 @@ export class FormFields {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkWidgetIsReadOnlyMode(fieldId: string): Promise<ElementFinder> {
|
async checkWidgetIsReadOnlyMode(fieldId: string): Promise<ElementFinder> {
|
||||||
const widget = element(by.css(`adf-form-field #field-${fieldId}-container .adf-readonly`));
|
const widget = $(`adf-form-field #field-${fieldId}-container .adf-readonly`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(widget);
|
await BrowserVisibility.waitUntilElementIsVisible(widget);
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
async isFormFieldEnabled(formFieldId: string): Promise<boolean> {
|
async isFormFieldEnabled(formFieldId: string): Promise<boolean> {
|
||||||
return element(by.id(`${formFieldId}`)).isEnabled();
|
return $(`#${formFieldId}`).isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
async completeForm(): Promise<void> {
|
async completeForm(): Promise<void> {
|
||||||
@@ -199,7 +197,7 @@ export class FormFields {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setValueInInputById(fieldId: string, value: string): Promise<void> {
|
async setValueInInputById(fieldId: string, value: string): Promise<void> {
|
||||||
const input = element(by.id(fieldId));
|
const input = $(`#${fieldId}`);
|
||||||
await BrowserActions.clearSendKeys(input, value);
|
await BrowserActions.clearSendKeys(input, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,13 +15,13 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { element, by, $ } from 'protractor';
|
||||||
import { BrowserVisibility } from '../../utils/browser-visibility';
|
import { BrowserVisibility } from '../../utils/browser-visibility';
|
||||||
import { BrowserActions } from '../../utils/public-api';
|
import { BrowserActions } from '../../utils/public-api';
|
||||||
|
|
||||||
export class FormPage {
|
export class FormPage {
|
||||||
|
|
||||||
errorLog = element(by.css('div[class*="console"]'));
|
errorLog = $('div[class*="console"]');
|
||||||
saveButton = element(by.cssContainingText('mat-card-actions[class*="adf-for"] span', 'SAVE'));
|
saveButton = element(by.cssContainingText('mat-card-actions[class*="adf-for"] span', 'SAVE'));
|
||||||
|
|
||||||
async checkErrorMessageForWidgetIsDisplayed(errorMessage: string): Promise<void> {
|
async checkErrorMessageForWidgetIsDisplayed(errorMessage: string): Promise<void> {
|
||||||
@@ -47,7 +47,7 @@ export class FormPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async isSaveButtonDisabled(): Promise<boolean> {
|
async isSaveButtonDisabled(): Promise<boolean> {
|
||||||
const saveButtonDisabled = element(by.css('.adf-form-mat-card-actions [disabled]'));
|
const saveButtonDisabled = $('.adf-form-mat-card-actions [disabled]');
|
||||||
try {
|
try {
|
||||||
await saveButtonDisabled.isDisplayed();
|
await saveButtonDisabled.isDisplayed();
|
||||||
return true;
|
return true;
|
||||||
@@ -57,7 +57,7 @@ export class FormPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async isValidationIconBlue(): Promise<boolean> {
|
async isValidationIconBlue(): Promise<boolean> {
|
||||||
const validationIcon = element(by.css('#adf-valid-form-icon'));
|
const validationIcon = $('#adf-valid-form-icon');
|
||||||
try {
|
try {
|
||||||
await validationIcon.isDisplayed();
|
await validationIcon.isDisplayed();
|
||||||
return true;
|
return true;
|
||||||
@@ -67,7 +67,7 @@ export class FormPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async isValidationIconRed(): Promise<boolean> {
|
async isValidationIconRed(): Promise<boolean> {
|
||||||
const validationIcon = element(by.css('#adf-invalid-form-icon'));
|
const validationIcon = $('#adf-invalid-form-icon');
|
||||||
try {
|
try {
|
||||||
await validationIcon.isDisplayed();
|
await validationIcon.isDisplayed();
|
||||||
return true;
|
return true;
|
||||||
|
@@ -15,23 +15,23 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, Locator } from 'protractor';
|
import { $$, $ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
|
|
||||||
export class AmountWidgetPage {
|
export class AmountWidgetPage {
|
||||||
|
|
||||||
currency: Locator = by.css('.adf-amount-widget__prefix-spacing');
|
currency = '.adf-amount-widget__prefix-spacing';
|
||||||
formFields: FormFields = new FormFields();
|
formFields: FormFields = new FormFields();
|
||||||
|
|
||||||
async getAmountFieldLabel(fieldId: string): Promise<string> {
|
async getAmountFieldLabel(fieldId: string): Promise<string> {
|
||||||
const label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first();
|
const label = $$(`adf-form-field div[id="field-${fieldId}-container"] label`).first();
|
||||||
return BrowserActions.getText(label);
|
return BrowserActions.getText(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAmountFieldCurrency(fieldId: string): Promise<string> {
|
async getAmountFieldCurrency(fieldId: string): Promise<string> {
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
return BrowserActions.getText(widget.element(this.currency));
|
return BrowserActions.getText(widget.$(this.currency));
|
||||||
}
|
}
|
||||||
|
|
||||||
async setFieldValue(fieldId: string, value: any): Promise<void> {
|
async setFieldValue(fieldId: string, value: any): Promise<void> {
|
||||||
@@ -39,12 +39,12 @@ export class AmountWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async removeFromAmountWidget(fieldId: string) {
|
async removeFromAmountWidget(fieldId: string) {
|
||||||
const amountWidgetInput = element(by.id(fieldId));
|
const amountWidgetInput = $(`#${fieldId}`);
|
||||||
await BrowserActions.clearWithBackSpace(amountWidgetInput);
|
await BrowserActions.clearWithBackSpace(amountWidgetInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clearFieldValue(fieldId: string): Promise<void> {
|
async clearFieldValue(fieldId: string): Promise<void> {
|
||||||
const numberField = element(by.id(fieldId));
|
const numberField = $(`#${fieldId}`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(numberField);
|
await BrowserVisibility.waitUntilElementIsVisible(numberField);
|
||||||
await numberField.clear();
|
await numberField.clear();
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ export class AmountWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getErrorMessage(fieldId: string): Promise<string> {
|
async getErrorMessage(fieldId: string): Promise<string> {
|
||||||
const errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`));
|
const errorMessage = $(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`);
|
||||||
return BrowserActions.getText(errorMessage);
|
return BrowserActions.getText(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,33 +17,33 @@
|
|||||||
|
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||||
import { Locator, element, by, browser } from 'protractor';
|
import { by, browser, $ } from 'protractor';
|
||||||
import { TestElement } from '../../../test-element';
|
import { TestElement } from '../../../test-element';
|
||||||
|
|
||||||
export class AttachFileWidgetPage {
|
export class AttachFileWidgetPage {
|
||||||
|
|
||||||
formFields = new FormFields();
|
formFields = new FormFields();
|
||||||
alfrescoTypeUploadLocator: Locator = by.css('button[id="attachfile"]');
|
alfrescoTypeUploadLocator = 'button[id="attachfile"]';
|
||||||
localStorageButton = element(by.css('input[id="attachfile"]'));
|
localStorageButton = $('input[id="attachfile"]');
|
||||||
filesListLocator: Locator = by.css('div[id="adf-attach-widget-readonly-list"]');
|
filesListLocator = 'div[id="adf-attach-widget-readonly-list"]';
|
||||||
attachFileWidget = element(by.css('#attachfile'));
|
attachFileWidget = $('#attachfile');
|
||||||
attachedFileMenu = element(by.css('mat-list-item button'));
|
attachedFileMenu = $('mat-list-item button');
|
||||||
attachedFileOptions = element(by.css('.mat-menu-panel .mat-menu-content'));
|
attachedFileOptions = $('.mat-menu-panel .mat-menu-content');
|
||||||
viewFileOptionButton = element(by.css(`.mat-menu-panel .mat-menu-content button[id$="show-file"]`));
|
viewFileOptionButton = $(`.mat-menu-panel .mat-menu-content button[id$="show-file"]`);
|
||||||
downloadFileOptionButton = element(by.css(`.mat-menu-panel .mat-menu-content button[id$="download-file"]`));
|
downloadFileOptionButton = $(`.mat-menu-panel .mat-menu-content button[id$="download-file"]`);
|
||||||
removeFileOptionButton = TestElement.byCss(`.mat-menu-panel .mat-menu-content button[id$="remove"]`);
|
removeFileOptionButton = TestElement.byCss(`.mat-menu-panel .mat-menu-content button[id$="remove"]`);
|
||||||
|
|
||||||
async attachFile(fieldId, fileLocation): Promise<void> {
|
async attachFile(fieldId: string, fileLocation: string): Promise<void> {
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
const uploadButton = await widget.element(this.alfrescoTypeUploadLocator);
|
const uploadButton = await widget.$(this.alfrescoTypeUploadLocator);
|
||||||
await BrowserActions.click(uploadButton);
|
await BrowserActions.click(uploadButton);
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(this.localStorageButton);
|
await BrowserVisibility.waitUntilElementIsPresent(this.localStorageButton);
|
||||||
await this.localStorageButton.sendKeys(fileLocation);
|
await this.localStorageButton.sendKeys(fileLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkNoFileIsAttached(fieldId): Promise<void> {
|
async checkNoFileIsAttached(fieldId: string): Promise<void> {
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
const fileItem = widget.element(this.filesListLocator).element(by.css('mat-list-item'));
|
const fileItem = widget.$(this.filesListLocator).$('mat-list-item');
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(fileItem);
|
await BrowserVisibility.waitUntilElementIsNotVisible(fileItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,8 +54,7 @@ export class AttachFileWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkFileIsAttached(fieldId: string, name: string): Promise<void> {
|
async checkFileIsAttached(fieldId: string, name: string): Promise<void> {
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const fileAttached = await this.getFileAttachedNotAttachedLocator(fieldId, name);
|
||||||
const fileAttached = widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,14 +64,13 @@ export class AttachFileWidgetPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFileIsNotAttached(fieldId, name): Promise<void> {
|
async checkFileIsNotAttached(fieldId: string, name: string): Promise<void> {
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const fileNotAttached = await this.getFileAttachedNotAttachedLocator(fieldId, name);
|
||||||
const fileNotAttached = widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(fileNotAttached);
|
await BrowserVisibility.waitUntilElementIsNotVisible(fileNotAttached);
|
||||||
}
|
}
|
||||||
|
|
||||||
async viewFile(name: string): Promise<void> {
|
async viewFile(name: string): Promise<void> {
|
||||||
const fileView = element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
const fileView = $(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
||||||
await BrowserActions.click(fileView);
|
await BrowserActions.click(fileView);
|
||||||
await browser.actions().doubleClick(fileView).perform();
|
await browser.actions().doubleClick(fileView).perform();
|
||||||
}
|
}
|
||||||
@@ -84,10 +82,10 @@ export class AttachFileWidgetPage {
|
|||||||
async toggleAttachedFileMenu(fieldId: string, fileName: string): Promise<void> {
|
async toggleAttachedFileMenu(fieldId: string, fileName: string): Promise<void> {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
await BrowserActions.closeMenuAndDialogs();
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
const fileAttached = await widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', fileName));
|
const fileAttached = await this.getFileAttachedNotAttachedLocator(fieldId, fileName);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
await BrowserVisibility.waitUntilElementIsVisible(fileAttached);
|
||||||
const id = await BrowserActions.getAttribute(fileAttached, 'id');
|
const id = await BrowserActions.getAttribute(fileAttached, 'id');
|
||||||
const optionMenu = widget.element(by.css(`button[id='${id}-option-menu']`));
|
const optionMenu = widget.$(`button[id='${id}-option-menu']`);
|
||||||
await BrowserActions.click(optionMenu);
|
await BrowserActions.click(optionMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,39 +127,44 @@ export class AttachFileWidgetPage {
|
|||||||
return this.removeFileOptionButton.isEnabled();
|
return this.removeFileOptionButton.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkUploadIsNotVisible(fieldId): Promise<void> {
|
async checkUploadIsNotVisible(fieldId: string): Promise<void> {
|
||||||
const alfrescoTypeUploadLocator = by.css(`button[id="${fieldId}"]`);
|
const alfrescoTypeUploadLocator = `button[id="${fieldId}"]`;
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
const uploadButton = await widget.element(alfrescoTypeUploadLocator);
|
const uploadButton = await widget.$(alfrescoTypeUploadLocator);
|
||||||
await BrowserVisibility.waitUntilElementIsNotPresent(uploadButton);
|
await BrowserVisibility.waitUntilElementIsNotPresent(uploadButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkUploadIsVisible(fieldId): Promise<void> {
|
async checkUploadIsVisible(fieldId: string): Promise<void> {
|
||||||
const alfrescoTypeUploadLocator = by.css(`button[id="${fieldId}"]`);
|
const alfrescoTypeUploadLocator = `button[id="${fieldId}"]`;
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
const uploadButton = await widget.element(alfrescoTypeUploadLocator);
|
const uploadButton = await widget.$(alfrescoTypeUploadLocator);
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(uploadButton);
|
await BrowserVisibility.waitUntilElementIsPresent(uploadButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkLocalTypeUploadIsPresent(fieldId): Promise<void> {
|
async checkLocalTypeUploadIsPresent(fieldId: string): Promise<void> {
|
||||||
const localTypeUpload = element(by.css(`input[id="${fieldId}"]`));
|
const localTypeUpload = $(`input[id="${fieldId}"]`);
|
||||||
await BrowserVisibility.waitUntilElementIsPresent(localTypeUpload);
|
await BrowserVisibility.waitUntilElementIsPresent(localTypeUpload);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkLocalTypeUploadIsNotPresent(fieldId): Promise<void> {
|
async checkLocalTypeUploadIsNotPresent(fieldId: string): Promise<void> {
|
||||||
const localTypeUpload = element(by.css(`input[id="${fieldId}"]`));
|
const localTypeUpload = $(`input[id="${fieldId}"]`);
|
||||||
await BrowserVisibility.waitUntilElementIsNotPresent(localTypeUpload);
|
await BrowserVisibility.waitUntilElementIsNotPresent(localTypeUpload);
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectUploadSource(name: string): Promise<void> {
|
async selectUploadSource(name: string): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.attachedFileOptions);
|
await BrowserVisibility.waitUntilElementIsVisible(this.attachedFileOptions);
|
||||||
await BrowserActions.click(element(by.css(`button[id="attach-${name}"]`)));
|
await BrowserActions.click($(`button[id="attach-${name}"]`));
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickUploadButton(fieldId): Promise<void> {
|
async clickUploadButton(fieldId: string): Promise<void> {
|
||||||
await BrowserActions.closeMenuAndDialogs();
|
await BrowserActions.closeMenuAndDialogs();
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
const uploadButton = await widget.element(this.alfrescoTypeUploadLocator);
|
const uploadButton = await widget.$(this.alfrescoTypeUploadLocator);
|
||||||
await BrowserActions.click(uploadButton);
|
await BrowserActions.click(uploadButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async getFileAttachedNotAttachedLocator(fieldId: string, name: string) {
|
||||||
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
|
return widget.$(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,42 +15,45 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Locator, by, element } from 'protractor';
|
import { by, $ } from 'protractor';
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
import { BrowserActions, BrowserVisibility } from '../../../utils/public-api';
|
import { BrowserActions, BrowserVisibility } from '../../../utils/public-api';
|
||||||
|
|
||||||
export class AttachFolderWidgetPage {
|
export class AttachFolderWidgetPage {
|
||||||
|
|
||||||
formFields: FormFields = new FormFields();
|
formFields: FormFields = new FormFields();
|
||||||
foldersListLocator: Locator = by.css('.adf-attach-folder-result');
|
foldersListLocator = '.adf-attach-folder-result';
|
||||||
|
|
||||||
async clickWidget(fieldId: string): Promise<void> {
|
async clickWidget(fieldId: string): Promise<void> {
|
||||||
const widget = await this.formFields.getWidget(fieldId).element(by.css(`button[id="folder-${fieldId}-button"]`));
|
const widget = await this.formFields.getWidget(fieldId).$(`button[id="folder-${fieldId}-button"]`);
|
||||||
await BrowserActions.click(widget);
|
await BrowserActions.click(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFolderIsAttached(fieldId, name): Promise<void> {
|
async checkFolderIsAttached(fieldId: string, name: string): Promise<void> {
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const folderAttached = await this.getFolderAttachedLocator(fieldId, name);
|
||||||
const folderAttached = widget.element(this.foldersListLocator).element(by.cssContainingText('span', name));
|
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(folderAttached);
|
await BrowserVisibility.waitUntilElementIsVisible(folderAttached);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkFolderIsNotAttached(fieldId, name): Promise<void> {
|
async checkFolderIsNotAttached(fieldId: string, name: string): Promise<void> {
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const folderAttached = await this.getFolderAttachedLocator(fieldId, name);
|
||||||
const folderAttached = widget.element(this.foldersListLocator).element(by.cssContainingText('span', name));
|
|
||||||
await BrowserVisibility.waitUntilElementIsNotPresent(folderAttached);
|
await BrowserVisibility.waitUntilElementIsNotPresent(folderAttached);
|
||||||
}
|
}
|
||||||
|
|
||||||
async attachFileWidgetDisplayed(id: string): Promise<void> {
|
async attachFileWidgetDisplayed(id: string): Promise<void> {
|
||||||
const locator = element(by.css(id ? id : '#attachfolder'));
|
const locator = $(id ? id : '#attachfolder');
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(locator);
|
await BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeFolder(fieldId: string, name: string): Promise<void> {
|
async removeFolder(fieldId: string, name: string): Promise<void> {
|
||||||
await this.checkFolderIsAttached(fieldId, name);
|
await this.checkFolderIsAttached(fieldId, name);
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
const folderToBeRemoved = widget.element(this.foldersListLocator).element(by.css(`[id="folder-${fieldId}-remove"]`));
|
const folderToBeRemoved = widget.$(this.foldersListLocator).$(`[id="folder-${fieldId}-remove"]`);
|
||||||
await BrowserActions.click(folderToBeRemoved);
|
await BrowserActions.click(folderToBeRemoved);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async getFolderAttachedLocator(fieldId: string, name: string) {
|
||||||
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
|
return widget.$(this.foldersListLocator).element(by.cssContainingText('span', name));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -17,20 +17,20 @@
|
|||||||
|
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
import { BrowserActions } from '../../../utils/public-api';
|
import { BrowserActions } from '../../../utils/public-api';
|
||||||
import { Locator, by, element } from 'protractor';
|
import { $$, $ } from 'protractor';
|
||||||
|
|
||||||
export class CheckboxWidgetPage {
|
export class CheckboxWidgetPage {
|
||||||
|
|
||||||
formFields = new FormFields();
|
formFields = new FormFields();
|
||||||
checkboxLabel = element(by.css('span[class*="mat-checkbox-label"]'));
|
checkboxLabel = $('span[class*="mat-checkbox-label"]');
|
||||||
checkboxLocator: Locator = by.css('mat-checkbox');
|
checkboxLocator = ('mat-checkbox');
|
||||||
|
|
||||||
getCheckboxLabel(): Promise<string> {
|
getCheckboxLabel(): Promise<string> {
|
||||||
return BrowserActions.getText(this.checkboxLabel);
|
return BrowserActions.getText(this.checkboxLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickCheckboxInput(fieldId: string): Promise<void> {
|
async clickCheckboxInput(fieldId: string): Promise<void> {
|
||||||
const checkboxInput = element.all(by.css(`mat-checkbox[id="${fieldId}"] div`)).first();
|
const checkboxInput = $$(`mat-checkbox[id="${fieldId}"] div`).first();
|
||||||
await BrowserActions.click(checkboxInput);
|
await BrowserActions.click(checkboxInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ export class CheckboxWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async isCheckboxChecked(fieldId: string): Promise<boolean> {
|
async isCheckboxChecked(fieldId: string): Promise<boolean> {
|
||||||
const checkboxWidget = await (await this.formFields.getWidget(fieldId)).element(this.checkboxLocator);
|
const checkboxWidget = await (await this.formFields.getWidget(fieldId)).$(this.checkboxLocator);
|
||||||
const attributeValue = await BrowserActions.getAttribute(checkboxWidget, 'class');
|
const attributeValue = await BrowserActions.getAttribute(checkboxWidget, 'class');
|
||||||
return attributeValue.includes('mat-checkbox-checked');
|
return attributeValue.includes('mat-checkbox-checked');
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,7 @@ export class ContainerWidgetPage {
|
|||||||
|
|
||||||
fileLocator: Locator = by.css("div [class*='upload-widget__content-text']");
|
fileLocator: Locator = by.css("div [class*='upload-widget__content-text']");
|
||||||
|
|
||||||
getFieldText(fieldId): Promise<string> {
|
getFieldText(fieldId: string): Promise<string> {
|
||||||
return this.formFields.getFieldText(fieldId, this.fileLocator);
|
return this.formFields.getFieldText(fieldId, this.fileLocator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,20 +16,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
import { element, by } from 'protractor';
|
import { element, by, $ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||||
|
|
||||||
export class DateTimeWidgetPage {
|
export class DateTimeWidgetPage {
|
||||||
|
|
||||||
formFields = new FormFields();
|
formFields = new FormFields();
|
||||||
outsideLayer = element(by.css('div[class*="cdk-overlay-container"]'));
|
outsideLayer = $('div[class*="cdk-overlay-container"]');
|
||||||
|
|
||||||
async checkWidgetIsVisible(fieldId: string): Promise<void> {
|
async checkWidgetIsVisible(fieldId: string): Promise<void> {
|
||||||
await this.formFields.checkWidgetIsVisible(fieldId);
|
await this.formFields.checkWidgetIsVisible(fieldId);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getDateTimeLabel(fieldId: string): Promise<string> {
|
async getDateTimeLabel(fieldId: string): Promise<string> {
|
||||||
const label = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`));
|
const label = $(`adf-form-field div[id="field-${fieldId}-container"] label`);
|
||||||
return BrowserActions.getText(label);
|
return BrowserActions.getText(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ export class DateTimeWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getErrorMessage(fieldId: string): Promise<string> {
|
async getErrorMessage(fieldId: string): Promise<string> {
|
||||||
const errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`));
|
const errorMessage = $(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`);
|
||||||
return BrowserActions.getText(errorMessage);
|
return BrowserActions.getText(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ export class DateTimeWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openDatepicker(fieldId: string): Promise<void> {
|
async openDatepicker(fieldId: string): Promise<void> {
|
||||||
await BrowserActions.click(element(by.id(fieldId)));
|
await BrowserActions.click($(`#${fieldId}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectTime(time: string): Promise<void> {
|
async selectTime(time: string): Promise<void> {
|
||||||
@@ -78,13 +78,13 @@ export class DateTimeWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async removeFromDatetimeWidget(fieldId: string): Promise<void> {
|
async removeFromDatetimeWidget(fieldId: string): Promise<void> {
|
||||||
|
const amountWidgetInput = $(`#${fieldId}`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(await this.formFields.getWidget(fieldId));
|
await BrowserVisibility.waitUntilElementIsVisible(await this.formFields.getWidget(fieldId));
|
||||||
const amountWidgetInput = element(by.id(fieldId));
|
|
||||||
await BrowserActions.clearWithBackSpace(amountWidgetInput);
|
await BrowserActions.clearWithBackSpace(amountWidgetInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clearDateTimeInput(fieldId: string): Promise<void> {
|
async clearDateTimeInput(fieldId: string): Promise<void> {
|
||||||
const dateInput = element(by.id(fieldId));
|
const dateInput = $(`#${fieldId}`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(dateInput);
|
await BrowserVisibility.waitUntilElementIsVisible(dateInput);
|
||||||
await dateInput.clear();
|
await dateInput.clear();
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
import { element, by } from 'protractor';
|
import { $$, $ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||||
|
|
||||||
export class DateWidgetPage {
|
export class DateWidgetPage {
|
||||||
@@ -32,7 +32,7 @@ export class DateWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getDateLabel(fieldId: string): Promise<string> {
|
async getDateLabel(fieldId: string): Promise<string> {
|
||||||
const label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first();
|
const label = $$(`adf-form-field div[id="field-${fieldId}-container"] label`).first();
|
||||||
return BrowserActions.getText(label);
|
return BrowserActions.getText(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ export class DateWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clearDateInput(fieldId: string): Promise<void> {
|
async clearDateInput(fieldId: string): Promise<void> {
|
||||||
const dateInput = element(by.id(fieldId));
|
const dateInput = $(`#${fieldId}`);
|
||||||
await BrowserActions.clearWithBackSpace(dateInput);
|
await BrowserActions.clearWithBackSpace(dateInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,18 +56,18 @@ export class DateWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkErrorMessageIsNotDisplayed(fieldId: string): Promise<void> {
|
async checkErrorMessageIsNotDisplayed(fieldId: string): Promise<void> {
|
||||||
const errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`));
|
const errorMessage = $(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`);
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(errorMessage);
|
await BrowserVisibility.waitUntilElementIsNotVisible(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getErrorMessage(fieldId: string): Promise<string> {
|
async getErrorMessage(fieldId: string): Promise<string> {
|
||||||
const errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`));
|
const errorMessage = $(`adf-form-field div[id="field-${fieldId}-container"] .adf-error-text`);
|
||||||
return BrowserActions.getText(errorMessage);
|
return BrowserActions.getText(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeFromDatetimeWidget(fieldId: string): Promise<void> {
|
async removeFromDatetimeWidget(fieldId: string): Promise<void> {
|
||||||
const widget = await this.formFields.getWidget(fieldId);
|
const widget = await this.formFields.getWidget(fieldId);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(widget);
|
await BrowserVisibility.waitUntilElementIsVisible(widget);
|
||||||
await BrowserActions.clearSendKeys(element(by.id(fieldId)), '');
|
await BrowserActions.clearSendKeys($(`#${fieldId}`), '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
import { by, element, Locator } from 'protractor';
|
import { by, Locator, $ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||||
import { EditJsonDialog } from '../../../dialog/public-api';
|
import { EditJsonDialog } from '../../../dialog/public-api';
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ export class DisplayValueWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async checkDisplayValueWidgetIsHidden(fieldId: string): Promise<boolean> {
|
async checkDisplayValueWidgetIsHidden(fieldId: string): Promise<boolean> {
|
||||||
const hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container'][hidden]`));
|
const hiddenElement = $(`adf-form-field div[id='field-${fieldId}-container'][hidden]`);
|
||||||
try {
|
try {
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(hiddenElement);
|
await BrowserVisibility.waitUntilElementIsNotVisible(hiddenElement);
|
||||||
return true;
|
return true;
|
||||||
@@ -55,7 +55,7 @@ export class DisplayValueWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickOnDisplayJsonValueWidget(fieldId: string) {
|
async clickOnDisplayJsonValueWidget(fieldId: string) {
|
||||||
const jsonButton = element(by.css(`adf-form-field div[id='field-${fieldId}-container'] button`));
|
const jsonButton = $(`adf-form-field div[id='field-${fieldId}-container'] button`);
|
||||||
await BrowserActions.click(jsonButton);
|
await BrowserActions.click(jsonButton);
|
||||||
await this.editJsonDialog.checkDialogIsDisplayed();
|
await this.editJsonDialog.checkDialogIsDisplayed();
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
import { by, element } from 'protractor';
|
import { by, element, $ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||||
|
|
||||||
export class DropdownWidgetPage {
|
export class DropdownWidgetPage {
|
||||||
@@ -35,12 +35,12 @@ export class DropdownWidgetPage {
|
|||||||
|
|
||||||
async openDropdown(locator: string = '#dropdown'): Promise<void> {
|
async openDropdown(locator: string = '#dropdown'): Promise<void> {
|
||||||
await this.checkDropdownIsDisplayed(locator);
|
await this.checkDropdownIsDisplayed(locator);
|
||||||
const dropdown = locator ? element(by.css(`${locator}`)) : element(by.css(`#dropdown`));
|
const dropdown = locator ? $(`${locator}`) : $(`#dropdown`);
|
||||||
await BrowserActions.click(dropdown);
|
await BrowserActions.click(dropdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkDropdownIsDisplayed(locator: string = '#dropdown'): Promise<void> {
|
async checkDropdownIsDisplayed(locator: string = '#dropdown'): Promise<void> {
|
||||||
const dropdown = element(by.css(`${locator}`));
|
const dropdown = $(`${locator}`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(dropdown);
|
await BrowserVisibility.waitUntilElementIsVisible(dropdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
import { Locator, by, element, protractor } from 'protractor';
|
import { Locator, by, element, protractor, $, $$ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||||
|
|
||||||
export class DynamicTableWidgetPage {
|
export class DynamicTableWidgetPage {
|
||||||
@@ -27,14 +27,16 @@ export class DynamicTableWidgetPage {
|
|||||||
columnNameLocator: Locator = by.css('table[id*="dynamic-table"] th');
|
columnNameLocator: Locator = by.css('table[id*="dynamic-table"] th');
|
||||||
cancelButton = element(by.cssContainingText('button span', 'Cancel'));
|
cancelButton = element(by.cssContainingText('button span', 'Cancel'));
|
||||||
editButton = element(by.cssContainingText('button span', 'edit'));
|
editButton = element(by.cssContainingText('button span', 'edit'));
|
||||||
columnDateTime = element(by.id('columnDateTime'));
|
columnDateTime = $('#columnDateTime');
|
||||||
columnDate = element(by.id('columnDate'));
|
columnDate = $('#columnDate');
|
||||||
calendarHeader = element(by.css('.mat-datetimepicker-calendar-header-date-time'));
|
calendarHeader = $('.mat-datetimepicker-calendar-header-date-time');
|
||||||
calendarContent = element(by.css('.mat-datetimepicker-calendar-content'));
|
calendarContent = $('.mat-datetimepicker-calendar-content');
|
||||||
saveButton = element(by.cssContainingText('button span', 'Save'));
|
saveButton = element(by.cssContainingText('button span', 'Save'));
|
||||||
errorMessage = element(by.css('.adf-error-text'));
|
errorMessage = $('.adf-error-text');
|
||||||
dateWidget = element.all(by.css('mat-datepicker-toggle button')).first();
|
dateWidget = $$('mat-datepicker-toggle button').first();
|
||||||
tableRow = element.all(by.css('tbody tr'));
|
tableRow = $$('tbody tr');
|
||||||
|
|
||||||
|
private getTableRowByIndex = (idx: string) => $(`#dynamictable-row-${idx}`);
|
||||||
|
|
||||||
getFieldLabel(fieldId: string): Promise<string> {
|
getFieldLabel(fieldId: string): Promise<string> {
|
||||||
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
|
return this.formFields.getFieldLabel(fieldId, this.labelLocator);
|
||||||
@@ -45,12 +47,12 @@ export class DynamicTableWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async clickAddRow(id?: string): Promise<void> {
|
async clickAddRow(id?: string): Promise<void> {
|
||||||
const rowButton = element(by.id(`${id ? id : 'label'}-add-row`));
|
const rowButton = $(`#${id ? id : 'label'}-add-row`);
|
||||||
await BrowserActions.click(rowButton);
|
await BrowserActions.click(rowButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickTableRow(rowNumber): Promise<void> {
|
async clickTableRow(rowNumber): Promise<void> {
|
||||||
const tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber));
|
const tableRowByIndex = this.getTableRowByIndex(rowNumber);
|
||||||
await BrowserActions.click(tableRowByIndex);
|
await BrowserActions.click(tableRowByIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,18 +65,18 @@ export class DynamicTableWidgetPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setDatatableInput(text, id = 'id'): Promise<void> {
|
async setDatatableInput(text, id = 'id'): Promise<void> {
|
||||||
const dataTableInput = element(by.id(id));
|
const dataTableInput = $(`#${id}`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(dataTableInput);
|
await BrowserVisibility.waitUntilElementIsVisible(dataTableInput);
|
||||||
await BrowserActions.clearSendKeys(dataTableInput, text);
|
await BrowserActions.clearSendKeys(dataTableInput, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getTableRowText(rowNumber): Promise<string> {
|
async getTableRowText(rowNumber): Promise<string> {
|
||||||
const tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber));
|
const tableRowByIndex = this.getTableRowByIndex(rowNumber);
|
||||||
return BrowserActions.getText(tableRowByIndex);
|
return BrowserActions.getText(tableRowByIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkTableRowIsNotVisible(rowNumber): Promise<void> {
|
async checkTableRowIsNotVisible(rowNumber): Promise<void> {
|
||||||
const tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber));
|
const tableRowByIndex = this.getTableRowByIndex(rowNumber);
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(tableRowByIndex);
|
await BrowserVisibility.waitUntilElementIsNotVisible(tableRowByIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,13 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { FormFields } from '../form-fields';
|
import { FormFields } from '../form-fields';
|
||||||
import { Locator, by, element } from 'protractor';
|
import { Locator, by, element, $ } from 'protractor';
|
||||||
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
import { BrowserVisibility, BrowserActions } from '../../../utils/public-api';
|
||||||
|
|
||||||
export class GroupWidgetPage {
|
export class GroupWidgetPage {
|
||||||
|
|
||||||
groupField = element(by.css('input[data-automation-id="adf-group-search-input"]'));
|
groupField = $('input[data-automation-id="adf-group-search-input"]');
|
||||||
firstResult = element(by.id('adf-group-widget-user-0'));
|
firstResult = $('#adf-group-widget-user-0');
|
||||||
formFields = new FormFields();
|
formFields = new FormFields();
|
||||||
groupDropDownList: Locator = by.css('.mat-autocomplete-panel');
|
groupDropDownList: Locator = by.css('.mat-autocomplete-panel');
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user