mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-3472] e2e service task (#6460)
* [AAE-3472-adf] added e2e service task test fixed spell-check & re-included C311290 * added super admin as user * spellcheck disabled for superad * improved steps * simplified & used API method * disabled check spell for a line
This commit is contained in:
committed by
GitHub
parent
8d4408f2d6
commit
87f60a5b72
@@ -34,6 +34,7 @@ export class NavigationBarPage {
|
||||
menuButton = element(by.css('button[data-automation-id="adf-menu-icon"]'));
|
||||
formButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Form"]'));
|
||||
peopleGroupCloudButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="People/Group Cloud"]'));
|
||||
serviceTaskListButton = this.linkMenuChildrenContainer.element(by.css('.app-sidenav-link[data-automation-id="Service Task List"]'));
|
||||
logoutSection: ElementFinder = element(by.css('div[data-automation-id="adf-logout-section"]'));
|
||||
personalFiles: ElementFinder = element(by.css('div [title="Personal Files"]'));
|
||||
|
||||
@@ -90,6 +91,12 @@ export class NavigationBarPage {
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
async navigateToServiceTaskListCloudPage(): Promise<void> {
|
||||
await this.clickProcessCloudButton();
|
||||
await BrowserActions.click(this.serviceTaskListButton);
|
||||
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
|
||||
}
|
||||
|
||||
private async clickProcessServicesButton() {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await BrowserActions.clickUntilIsNotVisible(this.getMenuItem('Process Services'), this.linkMenuChildrenContainer);
|
||||
|
74
e2e/process-services-cloud/pages/service-task-list.page.ts
Normal file
74
e2e/process-services-cloud/pages/service-task-list.page.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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 { element, by } from 'protractor';
|
||||
import {
|
||||
BrowserVisibility,
|
||||
BrowserActions,
|
||||
DataTableComponentPage
|
||||
} from '@alfresco/adf-testing';
|
||||
|
||||
export class ServiceTaskListPage {
|
||||
dataTableComponentPage = new DataTableComponentPage();
|
||||
allServiceTaskButton = element(by.css('button[data-automation-id="my-service-tasks_filter"]'));
|
||||
completedServiceTaskButton = element(by.css('button[data-automation-id="completed-tasks_filter"]'));
|
||||
errorServiceTaskButton = element(by.css('button[data-automation-id="errored-service-tasks_filter"]'));
|
||||
searchHeader = element(by.css('adf-cloud-edit-service-task-filter mat-expansion-panel-header'));
|
||||
serviceTaskList = element(by.css('adf-cloud-service-task-list'));
|
||||
activityNameField = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-activityName"]'));
|
||||
activityStatus = element(by.css('[data-automation-id="datatable-row-0"] div[aria-label="Status"]'));
|
||||
activityName = element(by.css('[data-automation-id="datatable-row-0"] div[aria-label="Activity name"]'));
|
||||
resultList = element(by.css('div[role="rowgroup"].adf-datatable-body'));
|
||||
|
||||
async checkServiceTaskFiltersDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.allServiceTaskButton);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.completedServiceTaskButton);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.errorServiceTaskButton);
|
||||
}
|
||||
|
||||
async checkSearchServiceTaskFiltersDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.searchHeader);
|
||||
}
|
||||
|
||||
async checkServiceTaskListDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.serviceTaskList);
|
||||
}
|
||||
|
||||
async clickCompletedServiceTask(): Promise<void> {
|
||||
await BrowserActions.click(this.completedServiceTaskButton);
|
||||
}
|
||||
|
||||
async clickSearchHeaderServiceTask(): Promise<void> {
|
||||
await BrowserActions.click(this.searchHeader);
|
||||
}
|
||||
|
||||
async searchByActivityName(text: string): Promise<void> {
|
||||
await BrowserActions.clearSendKeys(this.activityNameField, text);
|
||||
}
|
||||
|
||||
async getActivityNameText(): Promise<string> {
|
||||
return BrowserActions.getText(this.activityName);
|
||||
}
|
||||
|
||||
async getStatusText(): Promise<string> {
|
||||
return BrowserActions.getText(this.activityStatus);
|
||||
}
|
||||
|
||||
async checkServiceTaskListResultsIsLoaded(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.resultList);
|
||||
}
|
||||
}
|
@@ -0,0 +1,88 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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 { browser
|
||||
} from 'protractor';
|
||||
import {
|
||||
LoginPage,
|
||||
ApiService,
|
||||
IdentityService,
|
||||
GroupIdentityService,
|
||||
ProcessDefinitionsService,
|
||||
ProcessInstancesService
|
||||
} from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
|
||||
import { ServiceTaskListPage } from './pages/service-task-list.page';
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
describe('Service task list cloud', () => {
|
||||
|
||||
describe('Service Task Filters', () => {
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const serviceTaskListPage = new ServiceTaskListPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const identityService = new IdentityService(apiService);
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
const processDefinitionService = new ProcessDefinitionsService(apiService);
|
||||
const processInstancesService = new ProcessInstancesService(apiService);
|
||||
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
/* cspell:disable-next-line */
|
||||
const activityNameSimpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.multiinstanceservicetask;
|
||||
|
||||
let testUser, groupInfo;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
||||
testUser = await identityService.createIdentityUserWithRole([identityService.ROLES.ACTIVITI_USER]);
|
||||
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
|
||||
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
|
||||
|
||||
await apiService.login(testUser.email, testUser.password);
|
||||
const processDefinition = await processDefinitionService
|
||||
/* cspell:disable-next-line */
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.multiinstanceservicetask, simpleApp);
|
||||
await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
||||
|
||||
/* cspell:disable-next-line */
|
||||
await loginSSOPage.login(browser.params.testConfig.users.superadmin.username, browser.params.testConfig.users.superadmin.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
});
|
||||
|
||||
it('[C587515] Should be able to select a filter service task and see only the service task related to the selected app', async () => {
|
||||
await navigationBarPage.navigateToServiceTaskListCloudPage();
|
||||
await serviceTaskListPage.checkServiceTaskFiltersDisplayed();
|
||||
await serviceTaskListPage.checkSearchServiceTaskFiltersDisplayed();
|
||||
await serviceTaskListPage.checkServiceTaskListDisplayed();
|
||||
|
||||
await serviceTaskListPage.clickCompletedServiceTask();
|
||||
await serviceTaskListPage.clickSearchHeaderServiceTask();
|
||||
await serviceTaskListPage.searchByActivityName(activityNameSimpleApp);
|
||||
await serviceTaskListPage.checkServiceTaskListResultsIsLoaded();
|
||||
|
||||
await expect(await serviceTaskListPage.getStatusText()).toBe(CONSTANTS.SERVICE_TASK_STATUS.COMPLETED);
|
||||
});
|
||||
});
|
||||
});
|
@@ -7,6 +7,5 @@
|
||||
"C279932": "login problem APS not basic",
|
||||
"C279931": "login problem APS not basic",
|
||||
"C279930": "login problem APS not basic",
|
||||
"C299187": "ADF-5285 Failing aspect test due multiple replica",
|
||||
"C311290": "ADF-5293"
|
||||
"C299187": "ADF-5285 Failing aspect test due multiple replica"
|
||||
}
|
||||
|
@@ -27,6 +27,9 @@ const HR_USER_PASSWORD = process.env.HR_USER_PASSWORD || "defaulthruserpassword"
|
||||
const USERNAME_ADF = process.env.USERNAME_ADF || "defaultuser";
|
||||
const PASSWORD_ADF = process.env.PASSWORD_ADF || "defaultuserpassword";
|
||||
|
||||
const USERNAME_SUPER_ADMIN_ADF = process.env.USERNAME_SUPER_ADMIN_ADF || "defaultuser";
|
||||
const PASSWORD_SUPER_ADMIN_ADF = process.env.PASSWORD_SUPER_ADMIN_ADF || "defaultuserpassword";
|
||||
|
||||
const REDIRECT_URI = process.env.REDIRECT_URI || "/";
|
||||
const REDIRECT_URI_LOGOUT = process.env.REDIRECT_URI_LOGOUT || "#/logout";
|
||||
|
||||
@@ -86,6 +89,11 @@ module.exports = {
|
||||
password: PASSWORD_ADF
|
||||
},
|
||||
|
||||
superadmin: {
|
||||
username: USERNAME_SUPER_ADMIN_ADF,
|
||||
password: PASSWORD_SUPER_ADMIN_ADF
|
||||
},
|
||||
|
||||
identityAdmin: {
|
||||
username: IDENTITY_ADMIN_EMAIL,
|
||||
password: IDENTITY_ADMIN_PASSWORD
|
||||
|
@@ -145,3 +145,11 @@ exports.CS_USER_ROLES = {
|
||||
CONTRIBUTOR: 'SiteContributor',
|
||||
MANAGER: 'SiteManager'
|
||||
};
|
||||
|
||||
exports.SERVICE_TASK_STATUS = {
|
||||
ALL:'ALL',
|
||||
STARTED:'STARTED',
|
||||
COMPLETED: 'COMPLETED',
|
||||
CANCELLED: 'CANCELLED',
|
||||
ERROR:'ERROR'
|
||||
};
|
||||
|
Reference in New Issue
Block a user