mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Refactor e2e's ApiService (#7101)
* Refactor e2e's ApiService * Fix bits here and there * [ci:force] Remove unused imports * [ci:force] Extract shared part from adf-testing * [ci:force] Extract StringUtils as well * Make protractor's Logger not have duplicated code * [ci:force]
This commit is contained in:
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
@@ -38,7 +37,7 @@ describe('Comment component for Processes', () => {
|
||||
const commentsPage = new CommentsPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
@@ -17,8 +17,7 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
@@ -39,7 +38,7 @@ describe('Sorting for process filters', () => {
|
||||
const processFiltersPage = new ProcessFiltersPage();
|
||||
const filtersPage = new FiltersPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { AppSettingsTogglesPage } from './../pages/dialog/app-settings-toggles.page';
|
||||
@@ -30,7 +30,7 @@ describe('New Process Filters', () => {
|
||||
const appSettingsToggles = new AppSettingsTogglesPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
@@ -35,7 +35,7 @@ describe('Empty Process List Test', () => {
|
||||
const processDetailsPage = new ProcessDetailsPage();
|
||||
const processListPage = new ProcessListPage();
|
||||
const startProcessPage = new StartProcessPage();
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
|
||||
let user;
|
||||
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
@@ -37,7 +36,7 @@ describe('Process List - Pagination when adding processes', () => {
|
||||
const processFiltersPage = new ProcessFiltersPage();
|
||||
const processDetailsPage = new ProcessDetailsPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
FileBrowserUtil,
|
||||
LoginPage,
|
||||
@@ -43,7 +42,7 @@ describe('Attachment list action menu for processes', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
LoginPage,
|
||||
@@ -48,7 +47,7 @@ describe('Process Filters Test', () => {
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const processDetailsPage = new ProcessDetailsPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
|
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
@@ -43,7 +42,7 @@ describe('Process Instance Details', () => {
|
||||
const processListPage = new ProcessListPage();
|
||||
const processDetailsPage = new ProcessDetailsPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
LoginPage, ModelsActions,
|
||||
@@ -35,7 +34,7 @@ describe('Process List Test', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const processListDemoPage = new ProcessListDemoPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const applicationsUtil = new ApplicationsUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
@@ -38,7 +37,7 @@ describe('Process List - Pagination', () => {
|
||||
const processFiltersPage = new ProcessFiltersPage();
|
||||
const processDetailsPage = new ProcessDetailsPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
|
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil, BrowserActions,
|
||||
FileBrowserUtil,
|
||||
LocalStorageUtil,
|
||||
@@ -62,8 +61,8 @@ describe('Start Process Component', () => {
|
||||
const selectAppsDialog = new SelectAppsDialog();
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiServiceUserTwo = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const apiServiceUserTwo = createApiService();
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const processApi = new ProcessInstancesApi(apiService.getInstance());
|
||||
@@ -482,7 +481,7 @@ describe('Start Process Component', () => {
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
const apiServiceAll = new ApiService({
|
||||
const apiServiceAll = createApiService({
|
||||
provider: 'ALL',
|
||||
hostEcm: browser.params.testConfig.appConfig.ecmHost,
|
||||
hostBpm: browser.params.testConfig.appConfig.bpmHost
|
||||
@@ -494,7 +493,7 @@ describe('Start Process Component', () => {
|
||||
|
||||
processUserModel = await usersActionsAll.createUser();
|
||||
|
||||
const alfrescoJsBPMAdminUser = new ApiService({ hostBpm: browser.params.testConfig.appConfig.bpmHost });
|
||||
const alfrescoJsBPMAdminUser = createApiService({ hostBpm: browser.params.testConfig.appConfig.bpmHost });
|
||||
|
||||
await alfrescoJsBPMAdminUser.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
|
Reference in New Issue
Block a user