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:
@@ -17,8 +17,7 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
@@ -41,7 +40,7 @@ describe('Comment component for Processes', () => {
|
||||
const taskPage = new TasksPage();
|
||||
const commentsPage = new CommentsPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
ArrayUtil,
|
||||
DateUtil,
|
||||
@@ -41,7 +40,7 @@ describe('Start Task - Custom App', () => {
|
||||
const taskListSinglePage = new TaskListDemoPage();
|
||||
const paginationPage = new PaginationPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const appsRuntime = new ApplicationsUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
BrowserVisibility,
|
||||
@@ -45,7 +44,7 @@ describe('Info Drawer', () => {
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const processFiltersPage = new ProcessFiltersPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
@@ -36,7 +35,7 @@ describe('Items per page set to 15 and adding of tasks', () => {
|
||||
const taskPage = new TasksPage();
|
||||
const paginationPage = new PaginationPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
@@ -36,7 +35,7 @@ describe('Task List Pagination - Sorting', () => {
|
||||
const taskPage = new TasksPage();
|
||||
const paginationPage = new PaginationPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
@@ -35,7 +35,7 @@ describe('Start Task - Task App', () => {
|
||||
let processUserModel;
|
||||
const noFormMessage = 'No forms attached';
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationUtil = new ApplicationsUtil(apiService);
|
||||
const tasksApi = new TasksApi(apiService.getInstance());
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
@@ -34,7 +34,7 @@ describe('Start Task - Custom App', () => {
|
||||
const attachmentListPage = new AttachmentListPage();
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
@@ -42,7 +41,7 @@ describe('Start Task - Task App', () => {
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const applicationsUtil = new ApplicationsUtil(apiService);
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
@@ -49,7 +48,7 @@ describe('Task Assignee', () => {
|
||||
const processDetailsPage = new ProcessDetailsPage();
|
||||
const taskPage = new TasksPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const adminGroupsApi = new AdminGroupsApi(apiService.getInstance());
|
||||
|
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
FileBrowserUtil,
|
||||
LoginPage, ModelsActions, TaskUtil,
|
||||
@@ -44,7 +43,7 @@ describe('Attachment list action menu for tasks', () => {
|
||||
const attachmentListPage = new AttachmentListPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
@@ -19,8 +19,7 @@ import {
|
||||
LoginPage,
|
||||
BrowserActions,
|
||||
FileBrowserUtil,
|
||||
ApplicationsUtil,
|
||||
ApiService,
|
||||
ApplicationsUtil, createApiService,
|
||||
UsersActions,
|
||||
TaskUtil
|
||||
} from '@alfresco/adf-testing';
|
||||
@@ -37,7 +36,7 @@ describe('Task Audit', () => {
|
||||
const taskPage = new TasksPage();
|
||||
const processServices = new ProcessServicesPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage, ModelsActions,
|
||||
ProcessUtil,
|
||||
@@ -47,7 +46,7 @@ describe('Task Details - Form', () => {
|
||||
const filtersPage = new FiltersPage();
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const formActions = new FormUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
@@ -29,7 +29,7 @@ describe('Task Details - No form', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const taskPage = new TasksPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let processUserModel;
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
LoginPage, ModelsActions,
|
||||
@@ -42,7 +41,7 @@ describe('Task Details component', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage, ModelsActions,
|
||||
UserFiltersUtil,
|
||||
@@ -48,7 +47,7 @@ describe('Task', () => {
|
||||
const taskDetailsPage = new TaskDetailsPage();
|
||||
const taskFiltersDemoPage = new TaskFiltersDemoPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
@@ -186,7 +185,7 @@ describe('Task', () => {
|
||||
const appSettingsToggles = new AppSettingsTogglesPage();
|
||||
const taskFiltersDemoPage = new TaskFiltersDemoPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const userFiltersApi = new UserFiltersUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UserFiltersUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, ApplicationsUtil, LoginPage, UserFiltersUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
@@ -37,7 +37,7 @@ describe('Task Filters Sorting', () => {
|
||||
const taskDetailsPage = new TaskDetailsPage();
|
||||
const taskFiltersDemoPage = new TaskFiltersDemoPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const userFiltersUtil = new UserFiltersUtil(apiService);
|
||||
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
@@ -36,7 +35,7 @@ describe('Task List Pagination', () => {
|
||||
const taskPage = new TasksPage();
|
||||
const paginationPage = new PaginationPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let processUserModel: UserModel;
|
||||
|
Reference in New Issue
Block a user