mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
[ADF-3430] E2E for using fields to filter Process List (#4040)
This commit is contained in:
119
e2e/pages/adf/demo-shell/process-services/processListDemoPage.ts
Normal file
119
e2e/pages/adf/demo-shell/process-services/processListDemoPage.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Util } from '../../../../util/util';
|
||||
import { DataTablePage } from '../../dataTablePage';
|
||||
import { element, by, protractor } from 'protractor';
|
||||
|
||||
export class ProcessListDemoPage {
|
||||
|
||||
appIdInput = element(by.css('input[data-automation-id="app-id"]'));
|
||||
resetButton = element(by.cssContainingText('button span', 'Reset'));
|
||||
emptyProcessContent = element(by.css('div[class="adf-empty-content"]'));
|
||||
processDefinitionInput = element(by.css('input[data-automation-id="process-definition-id"]'));
|
||||
processInstanceInput = element(by.css('input[data-automation-id="process-instance-id"]'));
|
||||
stateSelector = element(by.css('mat-select[data-automation-id="state"'));
|
||||
sortSelector = element(by.css('mat-select[data-automation-id="sort"'));
|
||||
|
||||
dataTable = new DataTablePage();
|
||||
|
||||
getDisplayedProcessesNames() {
|
||||
return this.dataTable.getAllRowsNameColumn();
|
||||
}
|
||||
|
||||
selectSorting(sort) {
|
||||
Util.waitUntilElementIsVisible(this.stateSelector);
|
||||
this.sortSelector.click();
|
||||
let sortLocator = element(by.cssContainingText('mat-option span', sort));
|
||||
Util.waitUntilElementIsVisible(sortLocator);
|
||||
sortLocator.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
selectStateFilter(state) {
|
||||
Util.waitUntilElementIsVisible(this.stateSelector);
|
||||
this.stateSelector.click();
|
||||
let stateLocator = element(by.cssContainingText('mat-option span', state));
|
||||
Util.waitUntilElementIsVisible(stateLocator);
|
||||
stateLocator.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
addAppId(appId) {
|
||||
Util.waitUntilElementIsVisible(this.appIdInput);
|
||||
this.appIdInput.click();
|
||||
this.appIdInput.sendKeys(protractor.Key.ENTER);
|
||||
this.appIdInput.clear();
|
||||
return this.appIdInput.sendKeys(appId);
|
||||
}
|
||||
|
||||
clickResetButton() {
|
||||
Util.waitUntilElementIsVisible(this.resetButton);
|
||||
return this.resetButton.click();
|
||||
}
|
||||
|
||||
checkErrorMessageIsDisplayed(error) {
|
||||
let errorMessage = element(by.cssContainingText('mat-error', error));
|
||||
Util.waitUntilElementIsVisible(errorMessage);
|
||||
}
|
||||
|
||||
checkNoProcessFoundIsDisplayed() {
|
||||
return Util.waitUntilElementIsVisible(this.emptyProcessContent);
|
||||
}
|
||||
|
||||
checkProcessIsNotDisplayed(processName) {
|
||||
return this.dataTable.checkRowIsNotDisplayedByName(processName);
|
||||
}
|
||||
|
||||
checkProcessIsDisplayed(processName) {
|
||||
return this.dataTable.checkRowIsDisplayedByName(processName);
|
||||
}
|
||||
|
||||
checkAppIdFieldIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.appIdInput);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkProcessInstanceIdFieldIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.processInstanceInput);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkStateFieldIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.stateSelector);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkSortFieldIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.sortSelector);
|
||||
return this;
|
||||
}
|
||||
|
||||
addProcessDefinitionId(procDefinitionId) {
|
||||
Util.waitUntilElementIsVisible(this.processDefinitionInput);
|
||||
this.processDefinitionInput.click();
|
||||
this.processDefinitionInput.clear();
|
||||
return this.processDefinitionInput.sendKeys(procDefinitionId);
|
||||
}
|
||||
|
||||
addProcessInstanceId(procInstanceId) {
|
||||
Util.waitUntilElementIsVisible(this.processInstanceInput);
|
||||
this.processInstanceInput.click();
|
||||
this.processInstanceInput.clear();
|
||||
return this.processInstanceInput.sendKeys(procInstanceId);
|
||||
}
|
||||
}
|
@@ -21,7 +21,7 @@ import { element, by, browser, protractor } from 'protractor';
|
||||
|
||||
export class UserInfoDialog {
|
||||
|
||||
dialog = element(by.css('mat-card[class*="adf-userinfo-card"]'));
|
||||
dialog = element.all(by.css('mat-card[class*="adf-userinfo-card"]')).first();
|
||||
userImage = element(by.css('div[id="user-initial-image"]'));
|
||||
userInfoEcmHeaderTitle = element(by.css('div[id="ecm-username"]'));
|
||||
userInfoEcmTitle = element(by.css('mat-card-content span[id="ecm-full-name"]'));
|
||||
@@ -54,6 +54,12 @@ export class UserInfoDialog {
|
||||
return this;
|
||||
}
|
||||
|
||||
checkProcessServicesTabIsSelected() {
|
||||
let tabsPage = new TabsPage;
|
||||
tabsPage.checkTabIsSelectedByTitle('Process Services');
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnProcessServicesTab() {
|
||||
let tabsPage = new TabsPage;
|
||||
tabsPage.clickTabByTitle('Process Services');
|
||||
|
@@ -43,6 +43,8 @@ export class NavigationBarPage {
|
||||
menuButton = element(by.css('button[data-automation-id="adf-menu-icon"]'));
|
||||
formButton = element(by.css('a[data-automation-id="Form"]'));
|
||||
treeViewButton = element(by.css('a[data-automation-id="Tree View"]'));
|
||||
processListButton = element(by.css('a[data-automation-id="Process List"]'));
|
||||
treeViewButton = element(by.css('a[data-automation-id="Tree View"]'));
|
||||
iconsButton = element(by.css('a[data-automation-id="Icons"]'));
|
||||
|
||||
navigateToDatatable() {
|
||||
@@ -50,6 +52,11 @@ export class NavigationBarPage {
|
||||
this.dataTableButton.click();
|
||||
}
|
||||
|
||||
navigateToDatatable() {
|
||||
Util.waitUntilElementIsVisible(this.dataTableButton);
|
||||
this.dataTableButton.click();
|
||||
}
|
||||
|
||||
clickContentServicesButton() {
|
||||
Util.waitUntilElementIsVisible(this.contentServicesButton);
|
||||
this.contentServicesButton.click();
|
||||
@@ -186,6 +193,10 @@ export class NavigationBarPage {
|
||||
browser.get(TestConfig.adf.url + `/files/${site.entry.guid}/display/list`);
|
||||
}
|
||||
|
||||
checkContentServicesButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.contentServicesButton);
|
||||
}
|
||||
|
||||
clickTreeViewButton() {
|
||||
Util.waitUntilElementIsVisible(this.treeViewButton);
|
||||
this.treeViewButton.click();
|
||||
@@ -195,4 +206,19 @@ export class NavigationBarPage {
|
||||
Util.waitUntilElementIsVisible(this.iconsButton);
|
||||
this.iconsButton.click();
|
||||
}
|
||||
|
||||
clickProcessListButton = function () {
|
||||
Util.waitUntilElementIsClickable(this.processListButton);
|
||||
return this.processListButton.click();
|
||||
};
|
||||
|
||||
clickTreeViewButton() {
|
||||
Util.waitUntilElementIsVisible(this.treeViewButton);
|
||||
this.treeViewButton.click();
|
||||
}
|
||||
|
||||
checkProcessListButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(this.processListButton);
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Util } from '../../../util/util';
|
||||
import { element, by, protractor } from 'protractor';
|
||||
|
||||
export class AnalyticsPage {
|
||||
|
||||
|
@@ -78,7 +78,6 @@ export class SettingsPage {
|
||||
this.goToSettingsPage();
|
||||
this.setProvider(this.bpm.option, this.bpm.text);
|
||||
Util.waitUntilElementIsVisible(this.bpmText);
|
||||
expect(this.ecmText.isPresent()).toBe(false);
|
||||
this.clickApply();
|
||||
return this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user