From dc797feacb3b5b942703aff55843d4e94c64f7f0 Mon Sep 17 00:00:00 2001 From: marouanbentaleb <38426175+marouanbentaleb@users.noreply.github.com> Date: Wed, 8 Aug 2018 12:59:48 +0100 Subject: [PATCH] [ADF-3284] ProcessFilter - the method ngOnChange doesn't check the property filterParam (e2e) (#3660) * E2E for process filters urls * Putting the test in an existing spec --- .../process_filters_component.e2e.ts | 32 ++++++++++++++++++- e2e/util/util.js | 8 ----- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/e2e/process-services/process_filters_component.e2e.ts b/e2e/process-services/process_filters_component.e2e.ts index 2267368f22..2ce219762a 100644 --- a/e2e/process-services/process_filters_component.e2e.ts +++ b/e2e/process-services/process_filters_component.e2e.ts @@ -29,6 +29,7 @@ import AlfrescoApi = require('alfresco-js-api-node'); import { AppsActions } from '../actions/APS/apps.actions'; import { UsersActions } from '../actions/users.actions'; +import { browser } from 'protractor'; describe('Process Filters Test', () => { @@ -39,6 +40,7 @@ describe('Process Filters Test', () => { let processFiltersPage = new ProcessFiltersPage(); let appNavigationBarPage = new AppNavigationBarPage(); let processDetailsPage = new ProcessDetailsPage(); + let appModel; let app = resources.Files.APP_WITH_DATE_FIELD_FORM; @@ -67,7 +69,7 @@ describe('Process Filters Test', () => { await this.alfrescoJsApi.login(user.email, user.password); - await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + appModel = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); await loginPage.loginToProcessServicesUsingUserModel(user); @@ -124,4 +126,32 @@ describe('Process Filters Test', () => { processFiltersPage.selectFromProcessList(processTitle.completed); processDetailsPage.checkProcessDetailsCard(); }); + + it('[C280407] Should be able to access the filters with URL', async () => { + + let defaultFiltersNumber = 3; + let deployedApp, processFilterUrl; + + let taskAppFilters = await browser.controlFlow().execute(async() => { + + let appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + + deployedApp = appDefinitions.data.find((currentApp) => { + + return currentApp.modelId === appModel.id; + }); + + processFilterUrl = TestConfig.adf.url + '/activiti/apps/' + deployedApp.id + '/processes/'; + + return this.alfrescoJsApi.activiti.userFiltersApi.getUserProcessInstanceFilters({appId: deployedApp.id}); + }); + + expect(taskAppFilters.size).toBe(defaultFiltersNumber); + + taskAppFilters.data.forEach((filter) => { + browser.get(processFilterUrl + filter.id); + processServicesPage.checkProcessListIsDisplayed(); + processFiltersPage.checkFilterIsHighlighted(filter.name); + }); + }); }); diff --git a/e2e/util/util.js b/e2e/util/util.js index 1fb61ab8a7..b5972d57f9 100644 --- a/e2e/util/util.js +++ b/e2e/util/util.js @@ -16,17 +16,12 @@ */ var exports = module.exports = {}; -var http = require('http'); -var https = require('https'); - var fs = require('fs'); -var FormData = require('form-data'); var path = require('path'); var until = protractor.ExpectedConditions; var TestConfig = require('../test.config'); var moment = require('moment'); -var CONSTANTS = require('./constants'); var DEFAULT_TIMEOUT = parseInt(TestConfig.main.timeout); /** @@ -35,9 +30,6 @@ var DEFAULT_TIMEOUT = parseInt(TestConfig.main.timeout); * @class util.Util */ -// Dynamically load http or https library based on protocol chosen -var apiRequest = TestConfig.main.protocol !== 'http' ? https : http; - /** * creates an absolute path string if multiple file uploads are required */