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:
@@ -15,13 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, DataTableComponentPage, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, DataTableComponentPage, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { DataTablePage } from '../../core/pages/data-table.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
describe('Datatable component - selection', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const dataTablePage = new DataTablePage();
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
DropActions,
|
||||
LoginPage,
|
||||
NotificationHistoryPage,
|
||||
@@ -42,7 +41,7 @@ describe('Datatable component', () => {
|
||||
'location': browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
beforeAll(async () => {
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
@@ -36,7 +35,7 @@ describe('Enable infinite scrolling', () => {
|
||||
const infinitePaginationPage = new InfinitePaginationPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const acsUser = new UserModel();
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
BrowserActions,
|
||||
ErrorPage,
|
||||
LocalStorageUtil,
|
||||
@@ -47,7 +46,7 @@ describe('Login component', () => {
|
||||
required: 'Required'
|
||||
};
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
beforeAll(async () => {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { NotificationDemoPage } from '../core/pages/notification.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../core/pages/navigation-bar.page';
|
||||
@@ -25,7 +25,7 @@ describe('Notifications Component', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const notificationPage = new NotificationDemoPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let acsUser: UserModel;
|
||||
|
@@ -15,8 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
import { createApiService,
|
||||
ArrayUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
@@ -38,7 +37,7 @@ describe('Pagination - returns to previous page when current is empty', () => {
|
||||
const paginationPage = new PaginationPage();
|
||||
|
||||
const viewerPage = new ViewerPage();
|
||||
const apiService = new ApiService();
|
||||
const apiService = createApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const acsUser = new UserModel();
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, SettingsPage, UserInfoPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { createApiService, LoginPage, SettingsPage, UserInfoPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('User Info - SSO', () => {
|
||||
@@ -24,7 +24,7 @@ describe('User Info - SSO', () => {
|
||||
const loginSSOPage = new LoginPage();
|
||||
const userInfoPage = new UserInfoPage();
|
||||
|
||||
const apiService = new ApiService({ authType: 'OAUTH', provider: 'ECM' });
|
||||
const apiService = createApiService({ authType: 'OAUTH', provider: 'ECM' });
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let identityUser;
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user