alfresco-ng2-components/e2e/process-services/empty-process-list-component.e2e.ts
gmandakini e85b57876e Added a new LocalStorageUtil and using the setConfigMethod to set the local storage variables (#4575)
* added a new LocalStorageUtil and using the setConfigMethod to set the localstorage variables, instead of using hte settings ui page.

* linting fix

* fixing import paths

* update new path LocalStorageUtil

* fix problems after rebase

* fix async loadin and clear

* local storage fix

* fix lint

* fix cs tests

* fix tag navigation and rename file appNavigation to processTabNavigation

* fix lint

* fix process test

* fix lint

Signed-off-by: Eugenio Romano <eugenio.romano@alfresco.com>

* fix start process cloud

* inc timeout
2019-04-22 00:42:59 +02:00

98 lines
4.2 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 resources = require('../util/resources');
import { LoginPage } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import { ProcessServicesPage } from '../pages/adf/process-services/processServicesPage';
import { ProcessFiltersPage } from '../pages/adf/process-services/processFiltersPage';
import { ProcessDetailsPage } from '../pages/adf/process-services/processDetailsPage';
import { ProcessListPage } from '../pages/adf/process-services/processListPage';
import { StartProcessPage } from '../pages/adf/process-services/startProcessPage';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../actions/APS/apps.actions';
import { UsersActions } from '../actions/users.actions';
describe('Empty Process List Test', () => {
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const processServicesPage = new ProcessServicesPage();
const processFiltersPage = new ProcessFiltersPage();
const processDetailsPage = new ProcessDetailsPage();
const processListPage = new ProcessListPage();
const startProcessPage = new StartProcessPage();
const appA = resources.Files.APP_WITH_PROCESSES;
const appB = resources.Files.SIMPLE_APP_WITH_USER_FORM;
let user;
beforeAll(async (done) => {
const apps = new AppsActions();
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: TestConfig.adf.url
});
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
user = await users.createTenantAndUser(this.alfrescoJsApi);
await this.alfrescoJsApi.login(user.email, user.password);
await apps.importPublishDeployApp(this.alfrescoJsApi, appA.file_location);
await apps.importPublishDeployApp(this.alfrescoJsApi, appB.file_location);
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
it('[C260494] Should add process to list when a process is created', () => {
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.goToApp(appA.title).clickProcessButton();
expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
expect(processDetailsPage.checkProcessDetailsMessage()).toEqual('No process details found');
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.selectFromProcessDropdown(appA.process_wse_name);
startProcessPage.clickStartProcessButton();
expect(processFiltersPage.numberOfProcessRows()).toEqual(1);
processDetailsPage.checkProcessDetailsCard();
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.goToApp(appB.title).clickProcessButton();
expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
expect(processDetailsPage.checkProcessDetailsMessage()).toEqual('No process details found');
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.selectFromProcessDropdown(appB.processName);
startProcessPage.clickStartProcessButton();
expect(processFiltersPage.numberOfProcessRows()).toEqual(1);
processDetailsPage.checkProcessDetailsCard();
});
});