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:
Popovics András
2021-06-19 23:03:17 +02:00
committed by GitHub
parent 2d61a2941c
commit 1ecc14f184
354 changed files with 1699 additions and 1843 deletions

View File

@@ -16,8 +16,7 @@
*/
import { browser } from 'protractor';
import {
ApiService,
import { createApiService,
LoginPage,
StringUtil,
UploadActions,
@@ -40,7 +39,7 @@ describe('Viewer', () => {
let site;
const acsUser = new UserModel();
const apiService = new ApiService();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);

View File

@@ -16,8 +16,7 @@
*/
import { browser } from 'protractor';
import {
ApiService, LocalStorageUtil,
import { createApiService, LocalStorageUtil,
LoginPage,
StringUtil,
UploadActions,
@@ -39,7 +38,7 @@ describe('Viewer', () => {
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const apiService = new ApiService({ authType: 'ECM', provider: 'ECM' });
const apiService = createApiService({ provider: 'ECM', authType: 'BASIC' });
const uploadActions = new UploadActions(apiService);
const usersActions = new UsersActions(apiService);

View File

@@ -16,8 +16,7 @@
*/
import { browser } from 'protractor';
import {
ApiService,
import { createApiService,
LoginPage,
StringUtil,
UploadActions,
@@ -43,7 +42,7 @@ describe('Viewer', () => {
'location': browser.params.resources.Files.ADF_DOCUMENTS.EXCEL_FOLDER.folder_path
});
const apiService = new ApiService();
const apiService = createApiService();
const uploadActions = new UploadActions(apiService);
const usersActions = new UsersActions(apiService);

View File

@@ -16,8 +16,7 @@
*/
import { browser } from 'protractor';
import {
ApiService,
import { createApiService,
LoginPage,
StringUtil,
UploadActions,
@@ -36,7 +35,7 @@ describe('Viewer', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const apiService = new ApiService();
const apiService = createApiService();
const uploadActions = new UploadActions(apiService);
const usersActions = new UsersActions(apiService);

View File

@@ -15,8 +15,7 @@
* limitations under the License.
*/
import {
ApiService,
import { createApiService,
LoginPage,
StringUtil,
UploadActions,
@@ -36,7 +35,7 @@ describe('Viewer', () => {
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);

View File

@@ -16,8 +16,7 @@
*/
import { browser } from 'protractor';
import {
ApiService,
import { createApiService,
LoginPage,
StringUtil,
UploadActions,
@@ -36,7 +35,7 @@ describe('Viewer', () => {
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);
let site;

View File

@@ -16,8 +16,7 @@
*/
import { browser } from 'protractor';
import {
ApiService,
import { createApiService,
LoginPage,
StringUtil,
UploadActions,
@@ -38,7 +37,7 @@ describe('Viewer', () => {
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const apiService = new ApiService();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
let site;

View File

@@ -16,8 +16,7 @@
*/
import { browser, by, element, protractor } from 'protractor';
import {
ApiService,
import { createApiService,
BrowserActions,
LoginPage,
UploadActions,
@@ -83,7 +82,7 @@ describe('Content Services Viewer', () => {
'firstPageText': browser.params.resources.Files.ADF_DOCUMENTS.PPT.first_page_text
});
const apiService = new ApiService();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);

View File

@@ -16,7 +16,7 @@
*/
import { browser } from 'protractor';
import { ApiService, FileBrowserUtil, LoginPage, UploadActions, UserModel, UsersActions, ViewerPage } from '@alfresco/adf-testing';
import { createApiService, FileBrowserUtil, LoginPage, UploadActions, UserModel, UsersActions, ViewerPage } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
@@ -29,7 +29,7 @@ describe('Viewer', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const apiService = new ApiService();
const apiService = createApiService();
const uploadActions = new UploadActions(apiService);
const usersActions = new UsersActions(apiService);

View File

@@ -16,8 +16,7 @@
*/
import { browser } from 'protractor';
import {
ApiService,
import { createApiService,
DataTableComponentPage,
LoginPage,
UploadActions,
@@ -47,7 +46,7 @@ describe('Viewer', () => {
'name': 'fileForOverlay.png',
'location': browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
});
const apiService = new ApiService();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);

View File

@@ -15,8 +15,7 @@
* limitations under the License.
*/
import {
ApiService,
import { createApiService,
BrowserActions,
LoginPage,
StringUtil,
@@ -41,7 +40,7 @@ describe('Viewer', () => {
const contentServicesPage = new ContentServicesPage();
const shareDialog = new ShareDialogPage();
const apiService = new ApiService();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
const sharedlinksApi = new SharedlinksApi(apiService);