From 7586bcac24cc2a3db5f626db1c4cdfdac6cdeebd Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Fri, 12 Oct 2018 10:36:17 +0100 Subject: [PATCH] fix import navigation and processlist to ts --- .../share-file/share_file.e2e.ts | 2 +- .../share-file/unshare_file.e2e.ts | 2 +- .../adf/process_services/processListPage.js | 75 ------------------- .../adf/process_services/processListPage.ts | 71 ++++++++++++++++++ .../empty_process_list_component.e2e.ts | 4 +- 5 files changed, 75 insertions(+), 79 deletions(-) delete mode 100644 e2e/pages/adf/process_services/processListPage.js create mode 100644 e2e/pages/adf/process_services/processListPage.ts diff --git a/e2e/content-services/share-file/share_file.e2e.ts b/e2e/content-services/share-file/share_file.e2e.ts index e185bc4853..655a36f5c7 100644 --- a/e2e/content-services/share-file/share_file.e2e.ts +++ b/e2e/content-services/share-file/share_file.e2e.ts @@ -18,7 +18,7 @@ import { LoginPage } from '../../pages/adf/loginPage'; import { ContentServicesPage } from '../../pages/adf/contentServicesPage'; import ContentListPage = require('../../pages/adf/dialog/contentList'); -import NavigationBarPage = require('../../pages/adf/navigationBarPage'); +import { NavigationBarPage } from '../../pages/adf/navigationBarPage'; import { ViewerPage } from '../../pages/adf/viewerPage'; import { ShareDialog } from '../../pages/adf/dialog/shareDialog'; diff --git a/e2e/content-services/share-file/unshare_file.e2e.ts b/e2e/content-services/share-file/unshare_file.e2e.ts index 38999604e6..c3d8c1dacb 100644 --- a/e2e/content-services/share-file/unshare_file.e2e.ts +++ b/e2e/content-services/share-file/unshare_file.e2e.ts @@ -17,7 +17,7 @@ import CONSTANTS = require('../../util/constants'); import Util = require('../../util/util'); -import NavigationBarPage = require('../../pages/adf/navigationBarPage'); +import { NavigationBarPage } from '../../pages/adf/navigationBarPage'; import { LoginPage } from '../../pages/adf/loginPage'; import { ContentServicesPage } from '../../pages/adf/contentServicesPage'; import ContentListPage = require('../../pages/adf/dialog/contentList'); diff --git a/e2e/pages/adf/process_services/processListPage.js b/e2e/pages/adf/process_services/processListPage.js deleted file mode 100644 index ea7a860159..0000000000 --- a/e2e/pages/adf/process_services/processListPage.js +++ /dev/null @@ -1,75 +0,0 @@ -/*! - * @license - * Copyright 2016 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. - */ - -var Util = require('../../../util/util'); -var TestConfig = require('../../../test.config'); -var NavigationBarPage = require('../navigationBarPage'); - -var ProcessListPage = function () { - - var processListURL = TestConfig.adf.url + TestConfig.adf.port + "/activiti/apps/0/processes/"; - var processListIcon = element(by.css("mat-icon[class='adf-empty-content__icon mat-icon material-icons']")); - var processListTitle = element(by.css("p[class='adf-empty-content__title']")); - var processListSubtitle = element(by.css("p[class='adf-empty-content__subtitle']")); - var processDetailsMessage = element(by.css("adf-process-instance-details div[class='ng-star-inserted']")); - var openProcessDropdown = element(by.id('adf-select-process-dropdown')); - var selectProcessDropdown = element.all(by.css('span[class="mat-option-text"]')); - var startProcessButton = element(by.css('button[data-automation-id="btn-start"]')); - - this.goToProcessList = function () { - var navigationBarPage = new NavigationBarPage(); - navigationBarPage.clickProcessServicesButton(); - Util.waitUntilElementIsVisible(pageLoaded); - }; - - this.checkProcessListTitleIsDisplayed = function () { - Util.waitUntilElementIsVisible(processListTitle); - return processListTitle.getText(); - }; - - this.checkProcessDetailsMessagee = function () { - Util.waitUntilElementIsVisible(processListTitle); - return processDetailsMessage.getText(); - }; - - this.openProcessDropdown = function () { - Util.waitUntilElementIsVisible(openProcessDropdown); - return openProcessDropdown.click(); - }; - - this.selectProcessDropdown = function (index) { - Util.waitUntilElementIsVisible(selectProcessDropdown); - return selectProcessDropdown.get(index).click(); - }; - - this.startProcess = function () { - Util.waitUntilElementIsVisible(startProcessButton); - return startProcessButton.click(); - }; - - this.checkProcessListIcon = function () { - Util.waitUntilElementIsVisible(processListIcon); - return processListIcon.getText(); - }; - - this.checkProcessListSubtitle = function () { - Util.waitUntilElementIsVisible(processListSubtitle); - return processListSubtitle.getText(); - }; -}; - -module.exports = ProcessListPage; diff --git a/e2e/pages/adf/process_services/processListPage.ts b/e2e/pages/adf/process_services/processListPage.ts new file mode 100644 index 0000000000..d874dd8bad --- /dev/null +++ b/e2e/pages/adf/process_services/processListPage.ts @@ -0,0 +1,71 @@ +/*! + * @license + * Copyright 2016 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 Util = require('../../../util/util'); +import { NavigationBarPage } from '../navigationBarPage'; + +export class ProcessListPage { + + processListIcon = element(by.css('mat-icon[class="adf-empty-content__icon mat-icon material-icons"]')); + processListTitle = element(by.css('p[class="adf-empty-content__title"]')); + processListSubtitle = element(by.css('p[class="adf-empty-content__subtitle"]')); + processDetailsMessage = element(by.css('adf-process-instance-details div[class="ng-star-inserted"]')); + openProcessDropdownElement = element(by.id('adf-select-process-dropdown')); + selectProcessDropdownElement = element.all(by.css('span[class="mat-option-text"]')); + startProcessButton = element(by.css('button[data-automation-id="btn-start"]')); + + goToProcessList() { + let navigationBarPage = new NavigationBarPage(); + navigationBarPage.clickProcessServicesButton(); + Util.waitUntilElementIsVisible(pageLoaded); + } + + checkProcessListTitleIsDisplayed() { + Util.waitUntilElementIsVisible(this.processListTitle); + return this.processListTitle.getText(); + } + + checkProcessDetailsMessagee() { + Util.waitUntilElementIsVisible(this.processListTitle); + return this.processDetailsMessage.getText(); + } + + openProcessDropdown() { + Util.waitUntilElementIsVisible(this.openProcessDropdownElement); + return this.openProcessDropdownElement.click(); + } + + selectProcessDropdown(index) { + Util.waitUntilElementIsVisible(this.selectProcessDropdownElement); + return this.selectProcessDropdownElement.get(index).click(); + } + + startProcess() { + Util.waitUntilElementIsVisible(this.startProcessButton); + return this.startProcessButton.click(); + } + + checkProcessListIcon() { + Util.waitUntilElementIsVisible(this.processListIcon); + return this.processListIcon.getText(); + } + + checkProcessListSubtitle() { + Util.waitUntilElementIsVisible(this.processListSubtitle); + return this.processListSubtitle.getText(); + } +} diff --git a/e2e/process-services/empty_process_list_component.e2e.ts b/e2e/process-services/empty_process_list_component.e2e.ts index 0efdc06f97..0e5feebc68 100644 --- a/e2e/process-services/empty_process_list_component.e2e.ts +++ b/e2e/process-services/empty_process_list_component.e2e.ts @@ -18,11 +18,11 @@ import TestConfig = require('../test.config'); import resources = require('../util/resources'); import { LoginPage } from '../pages/adf/loginPage'; -import { NavigationBarPage } from '../../pages/adf/navigationBarPage'; +import { NavigationBarPage } from '../pages/adf/navigationBarPage'; import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage'; import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage'); import ProcessDetailsPage = require('../pages/adf/process_services/processDetailsPage'); -import ProcessListPage = require('../pages/adf/process_services/processListPage'); +import { ProcessListPage } from '../pages/adf/process_services/processListPage'; import AlfrescoApi = require('alfresco-js-api-node'); import { AppsActions } from '../actions/APS/apps.actions';