From 6745f19d998a28a133e28f9bee68a1e7f92dcb29 Mon Sep 17 00:00:00 2001 From: jdosti Date: Sat, 8 Sep 2018 19:40:31 +0100 Subject: [PATCH] Providing a fix for task list failing tests (#3754) --- .../adf/process_services/taskFiltersPage.js | 4 +- .../task_filters_component.e2e.ts | 52 +++++++++++++------ 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/e2e/pages/adf/process_services/taskFiltersPage.js b/e2e/pages/adf/process_services/taskFiltersPage.js index 5de2bf59f4..06a64fdf46 100644 --- a/e2e/pages/adf/process_services/taskFiltersPage.js +++ b/e2e/pages/adf/process_services/taskFiltersPage.js @@ -24,10 +24,10 @@ var TaskFiltersPage = function () { var completedTask = element(by.css("span[data-automation-id='Completed Tasks_filter']")); var involvedTask = element(by.css("span[data-automation-id='Involved Tasks_filter']")); var tasksAccordionButton = element(by.css("div[data-automation-id='adf-panel-heading']")); - var tasksAccordionExpanded = element(by.xpath("mat-expansion-panel[contains(@class, 'mat-expanded')]")); + var tasksAccordionExpanded = element(by.css(`mat-expansion-panel[class*="mat-expanded"]`)); var startTaskButton = element(by.css("button[id='button-start']")); var newTaskButton = element(by.css("button[data-automation-id='btn-start-task']")); - var activeFilter = element(by.xpath("mat-list-item[contains(@class, 'active')]")); + var activeFilter = element(by.css(`mat-list-item[class*="active"]`)); var emptyTaskDetails = element(by.css("adf-task-details > div > div")); var emptyTaskList = element(by.css("p[class='adf-empty-content__title']")); diff --git a/e2e/process-services/task_filters_component.e2e.ts b/e2e/process-services/task_filters_component.e2e.ts index e0b342bf52..2b28165d65 100644 --- a/e2e/process-services/task_filters_component.e2e.ts +++ b/e2e/process-services/task_filters_component.e2e.ts @@ -17,6 +17,7 @@ import TestConfig = require('../test.config'); import resources = require('../util/resources'); + import LoginPage = require('../pages/adf/loginPage'); import NavigationBarPage = require('../pages/adf/navigationBarPage'); import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage'); @@ -40,38 +41,57 @@ describe('Task Filters Test', () => { let taskDetailsPage = new TaskDetailsPage(); let app = resources.Files.APP_WITH_DATE_FIELD_FORM; + let appId, tenantId; beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', hostBpm: TestConfig.adf.url }); - await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - - let user = await users.createTenantAndUser(this.alfrescoJsApi); - - await this.alfrescoJsApi.login(user.email, user.password); - - await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); - - await loginPage.loginToProcessServicesUsingUserModel(user); - done(); }); beforeEach(async (done) => { + + let apps = new AppsActions(); + let users = new UsersActions(); + + await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); + + let user = await users.createTenantAndUser(this.alfrescoJsApi); + + tenantId = user.tenantId; + + await this.alfrescoJsApi.login(user.email, user.password); + + let appModel = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + + appId = appModel.id; + + await loginPage.loginToProcessServicesUsingUserModel(user); + navigationBarPage.clickProcessServicesButton(); + processServicesPage.checkApsContainer(); processServicesPage.goToApp(app.title); done(); }); - it('[C260330] Should display task list when app is in task section', () => { + afterEach(async(done) => { + + await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId); + + await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); + + await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId); + + done(); + }); + + it('[C260330] Should display Task Filter List when app is in Task Tab', () => { tasksPage.clickOnCreateButton(); taskFiltersPage.clickNewTaskButton(); tasksPage.createNewTask().addName('Test').clickStartButton(); @@ -96,7 +116,7 @@ describe('Task Filters Test', () => { expect(taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined(); }); - it('[C260348] Should display task list when app is in task section', () => { + it('[C260348] Should display task in Complete Tasks List when task is completed', () => { expect(taskFiltersPage.checkMyTasksItem()).toBeDefined(); expect(taskFiltersPage.checkQueuedTaskItem()).toBeDefined(); expect(taskFiltersPage.checkInvolvedTaskItem()).toBeDefined(); @@ -136,7 +156,7 @@ describe('Task Filters Test', () => { expect(taskFiltersPage.checkEmptyTaskDetails()).toBe('No task details found'); }); - it('[C260349] Should display task list when app is in task section', () => { + it('[C260349] Should sort task by name when Name sorting is clicked', () => { tasksPage.clickOnCreateButton(); taskFiltersPage.clickNewTaskButton(); tasksPage.createNewTask().addName('Test1').clickStartButton(); @@ -175,4 +195,4 @@ describe('Task Filters Test', () => { tasksListPage.checkTaskIsDisplayedInTasksList('Test4'); }); -}); +}); \ No newline at end of file