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,
|
||||
ContentNodeSelectorDialogPage,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
@@ -37,7 +36,7 @@ describe('Document List Component - Actions', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, LoginPage, StringUtil, UploadActions, UsersActions, ViewerPage } from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, StringUtil, UploadActions, UsersActions, ViewerPage } from '@alfresco/adf-testing';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import moment from 'moment-es6';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
@@ -30,7 +30,7 @@ describe('Document List Component', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
|
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
BrowserActions,
|
||||
ContentNodeSelectorDialogPage,
|
||||
LoginPage,
|
||||
@@ -41,7 +40,7 @@ describe('Document List Component', () => {
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
const notificationHistoryPage = new NotificationHistoryPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const nodesApi = new NodesApi(apiService.getInstance());
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
|
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
BreadcrumbPage,
|
||||
BreadcrumbDropdownPage,
|
||||
ContentNodeSelectorDialogPage,
|
||||
@@ -44,7 +43,7 @@ describe('Document List Component - Actions', () => {
|
||||
const breadCrumbPage = new BreadcrumbPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, LoginPage, StringUtil, UploadActions, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, StringUtil, UploadActions, UsersActions } from '@alfresco/adf-testing';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
@@ -25,7 +25,7 @@ describe('Document List Component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ArrayUtil,
|
||||
FileBrowserUtil,
|
||||
LocalStorageUtil,
|
||||
@@ -62,7 +61,7 @@ describe('Document List - Pagination', () => {
|
||||
const folderThreeModel = new FolderModel({ name: 'folderThree' });
|
||||
const numberOfSubFolders = 6;
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { browser } from 'protractor';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ApiService, BrowserActions, ErrorPage, LoginPage, StringUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, BrowserActions, ErrorPage, LoginPage, StringUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import { SitesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Document List Component', () => {
|
||||
@@ -27,7 +27,7 @@ describe('Document List Component', () => {
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const errorPage = new ErrorPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let privateSite;
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, DropActions, LoginPage, UploadActions, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, DropActions, LoginPage, UploadActions, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
@@ -28,7 +28,7 @@ describe('Document List Component - Properties', () => {
|
||||
const navigationBar = new NavigationBarPage();
|
||||
|
||||
let subFolder, parentFolder;
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
let acsUser = null;
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, PaginationPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, PaginationPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { FolderModel } from '../../models/ACS/folder.model';
|
||||
@@ -36,7 +36,7 @@ describe('Document List - Selection', () => {
|
||||
'location': browser.params.resources.Files.ADF_DOCUMENTS.DOCX.file_location
|
||||
});
|
||||
const displayColumnName = 'Display name';
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
beforeAll(async () => {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, LoginPage, StringUtil, UploadActions, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, StringUtil, UploadActions, UsersActions } from '@alfresco/adf-testing';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('Document List Component', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
let uploadedFolder, uploadedFolderExtra;
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
let acsUser = null;
|
||||
|
Reference in New Issue
Block a user