Files
alfresco-ng2-components/e2e/process-services-cloud/task-filters-cloud.e2e.ts
Eugenio Romano 64be9e3624 [NO-ISSUE] Fix e2e test (#4621)
* fix sso, change timeout, parallel

* cange travis

* move name apps in resources file

* resources fix

* resources fix

* add sleep before search group

* add possibility to extend duration of snack-bar message from configuration

* fix unit test

* fix unit test

* remove timeout

* change timeout

* decrease message time

* add lint main branch travis

* reduce timeout

* add new check application presence

* change permission script
fix search selector

* fix travis conf

* check app environment and upload the app if abbsent

* fix cloud test

* remove duplicate

* restore ps test

* restore resources file

* fix e2e test

* process with variables missing

* test new conf travis

* fix lint

* fix spellcheck

* remove duplicate module

* fix ps module

* fix travis conf

* change check activiti env

* add concept of processes in resources
2019-04-18 13:31:42 +02:00

104 lines
4.7 KiB
TypeScript

/*!
* @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 TestConfig = require('../test.config');
import { LoginSSOPage, TasksService, ApiService, SettingsPage, AppListCloudPage, StringUtil } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasksCloudDemoPage';
import resources = require('../util/resources');
describe('Task filters cloud', () => {
describe('Task Filters', () => {
const settingsPage = new SettingsPage();
const loginSSOPage = new LoginSSOPage();
const navigationBarPage = new NavigationBarPage();
const appListCloudComponent = new AppListCloudPage();
const tasksCloudDemoPage = new TasksCloudDemoPage();
let tasksService: TasksService;
const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword;
const newTask = StringUtil.generateRandomString(5), completedTask = StringUtil.generateRandomString(5);
const simpleApp = resources.ACTIVITI7_APPS.SIMPLE_APP.name;
beforeAll(() => {
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, false);
loginSSOPage.clickOnSSOButton();
loginSSOPage.loginSSOIdentityService(user, password);
});
beforeEach((done) => {
navigationBarPage.navigateToProcessServicesCloudPage();
appListCloudComponent.checkApsContainer();
appListCloudComponent.goToApp(simpleApp);
done();
});
it('[C290011] Should display default filters when an app is deployed', () => {
tasksCloudDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
tasksCloudDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
});
it('[C290009] Should display default filters and created task', async () => {
const apiService = new ApiService('activiti', TestConfig.adf.hostBPM, TestConfig.adf.hostSso, 'BPM');
await apiService.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
tasksService = new TasksService(apiService);
const task = await tasksService.createStandaloneTask(newTask, simpleApp);
await tasksService.claimTask(task.entry.id, simpleApp);
tasksCloudDemoPage.completedTasksFilter().clickTaskFilter();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('Completed Tasks');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(newTask);
tasksCloudDemoPage.myTasksFilter().clickTaskFilter();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(newTask);
});
it('[C289955] Should display task in Complete Tasks List when task is completed', async () => {
const apiService = new ApiService('activiti', TestConfig.adf.hostBPM, TestConfig.adf.hostSso, 'BPM');
await apiService.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
tasksService = new TasksService(apiService);
const toBeCompletedTask = await tasksService.createStandaloneTask(completedTask, simpleApp);
await tasksService.claimTask(toBeCompletedTask.entry.id, simpleApp);
await tasksService.completeTask(toBeCompletedTask.entry.id, simpleApp);
tasksCloudDemoPage.myTasksFilter().clickTaskFilter();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTask);
tasksCloudDemoPage.completedTasksFilter().clickTaskFilter();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('Completed Tasks');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTask);
});
it('[C291792] Should select the first task filter from the list as default', () => {
expect(tasksCloudDemoPage.firstFilterIsActive()).toBe(true);
});
});
});