Skip to content

Commit

Permalink
test if we can remove compatibility (#7064)
Browse files Browse the repository at this point in the history
remove compatibility
  • Loading branch information
eromano committed Jun 10, 2021
1 parent 4dc98eb commit 558056b
Show file tree
Hide file tree
Showing 125 changed files with 1,031 additions and 1,023 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -27,3 +27,4 @@ out-tsc
!/.protractor-smartrunner/
/reports/
e2e-result-*
licenses.txt
46 changes: 0 additions & 46 deletions e2e/actions/APS/apps-runtime.actions.ts

This file was deleted.

41 changes: 0 additions & 41 deletions e2e/actions/APS/form-model.actions.ts

This file was deleted.

42 changes: 0 additions & 42 deletions e2e/actions/APS/models.actions.ts

This file was deleted.

6 changes: 4 additions & 2 deletions e2e/content-services/components/comment-component.e2e.ts
Expand Up @@ -30,7 +30,7 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
import { SitesApi, SiteEntry } from '@alfresco/js-api';
import { SitesApi, SiteEntry, CommentsApi } from '@alfresco/js-api';

describe('Comment', () => {

Expand All @@ -39,7 +39,9 @@ describe('Comment', () => {
const viewerPage: ViewerPage = new ViewerPage();
const commentsPage: CommentsPage = new CommentsPage();
const navigationBarPage = new NavigationBarPage();

const apiService = new ApiService();
const commentsApi = new CommentsApi(apiService.getInstance());

let userFullName, nodeId;
let acsUser: UserModel;
Expand Down Expand Up @@ -93,7 +95,7 @@ describe('Comment', () => {
});

it('[C276947] Should be able to add a comment on ACS and view on ADF', async () => {
await apiService.getInstance().core.commentsApi.addComment(nodeId, { content: comments.test });
await commentsApi.createComment(nodeId, { content: comments.test });

await viewerPage.viewFile(pngFileModel.name);

Expand Down
36 changes: 21 additions & 15 deletions e2e/content-services/components/lock-file.e2e.ts
Expand Up @@ -29,7 +29,7 @@ import { ContentServicesPage } from '../../core/pages/content-services.page';
import { LockFilePage } from '../../content-services/pages/lock-file.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import { NodeEntry, SitesApi } from '@alfresco/js-api';
import { NodeEntry, NodesApi, SitesApi } from '@alfresco/js-api';
import CONSTANTS = require('../../util/constants');

describe('Lock File', () => {
Expand All @@ -45,6 +45,7 @@ describe('Lock File', () => {
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
const waitActions = new WaitActions(apiService);
const nodesApi = new NodesApi(apiService.getInstance());

const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
Expand All @@ -56,6 +57,11 @@ describe('Lock File', () => {
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_path
});

const pngFileToLockAdmin = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG_C.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG_C.file_path
});

let site, documentLibrary;

beforeAll(async () => {
Expand All @@ -73,7 +79,7 @@ describe('Lock File', () => {
visibility: 'PRIVATE'
});

const resultNode = await apiService.getInstance().core.nodesApi.getNodeChildren(site.entry.guid);
const resultNode = await nodesApi.listNodeChildren(site.entry.guid);

documentLibrary = resultNode.list.entries[0].entry.id;

Expand Down Expand Up @@ -111,7 +117,7 @@ describe('Lock File', () => {
afterEach(async () => {
await apiService.login(adminUser.username, adminUser.password);
try {
await apiService.getInstance().core.nodesApi.unlockNode(pngUploadedFile.entry.id);
await nodesApi.unlockNode(pngUploadedFile.entry.id);
await waitActions.nodeIsUnlock(pngUploadedFile.entry.id);
} catch (e) {
}
Expand All @@ -120,7 +126,7 @@ describe('Lock File', () => {
afterAll(async () => {
await apiService.loginWithProfile('admin');
try {
await apiService.getInstance().core.nodesApi.unlockNode(pngLockedUploadedFile.entry.id);
await nodesApi.unlockNode(pngLockedUploadedFile.entry.id);
} catch (e) {
}
try {
Expand Down Expand Up @@ -194,7 +200,7 @@ describe('Lock File', () => {
await apiService.login(adminUser.username, adminUser.password);

try {
await apiService.getInstance().core.nodesApi.unlockNode(pngUploadedFile.entry.id);
await nodesApi.unlockNode(pngUploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
} catch (error) {
}
Expand All @@ -209,7 +215,7 @@ describe('Lock File', () => {
await lockFilePage.saveButton.click();

try {
await apiService.getInstance().core.nodesApi.deleteNode(pngUploadedFile.entry.id);
await nodesApi.deleteNode(pngUploadedFile.entry.id);
} catch (error) {
await expect(error.status).toEqual(409);
}
Expand All @@ -223,7 +229,7 @@ describe('Lock File', () => {
await lockFilePage.saveButton.click();

try {
await apiService.getInstance().core.nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' });
await nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' });

} catch (error) {
await expect(error.status).toEqual(409);
Expand All @@ -238,7 +244,7 @@ describe('Lock File', () => {
await lockFilePage.saveButton.click();

try {
await apiService.getInstance().core.nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' });
await nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' });

} catch (error) {
await expect(error.status).toEqual(409);
Expand All @@ -253,7 +259,7 @@ describe('Lock File', () => {
await lockFilePage.saveButton.click();

try {
await apiService.getInstance().core.nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT');
await nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT');
} catch (error) {
await expect(error.status).toEqual(409);
}
Expand All @@ -266,7 +272,7 @@ describe('Lock File', () => {

beforeEach(async () => {
await apiService.login(adminUser.username, adminUser.password);
pngFileToBeLocked = await uploadActions.uploadFile(pngFileToLock.location, pngFileToLock.name, documentLibrary);
pngFileToBeLocked = await uploadActions.uploadFile(pngFileToLockAdmin.location, pngFileToLockAdmin.name, documentLibrary);
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
await loginPage.login(adminUser.username, adminUser.password);
await navigationBarPage.openContentServicesFolder(documentLibrary);
Expand Down Expand Up @@ -294,7 +300,7 @@ describe('Lock File', () => {
try {
await apiService.login(adminUser.username, adminUser.password);

const response = await apiService.getInstance().core.nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT');
const response = await nodesApi.updateNodeContent(pngUploadedFile.entry.id, 'NEW FILE CONTENT');
await expect(response.entry.modifiedAt.getTime()).toBeGreaterThan(response.entry.createdAt.getTime());
} catch (error) {
}
Expand All @@ -310,17 +316,17 @@ describe('Lock File', () => {

try {
await apiService.login(adminUser.username, adminUser.password);
await apiService.getInstance().core.nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' });
await nodesApi.moveNode(pngUploadedFile.entry.id, { targetParentId: '-my-' });

const movedFile = await apiService.getInstance().core.nodesApi.getNode(pngUploadedFile.entry.id);
const movedFile = await nodesApi.getNode(pngUploadedFile.entry.id);

await expect(movedFile.entry.parentId).not.toEqual(documentLibrary);
} catch (error) {
}
});

it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', async () => {
await contentServices.lockContent(pngFileToLock.name);
await contentServices.lockContent(pngFileToLockAdmin.name);

await lockFilePage.lockFileCheckboxText.waitVisible();
await lockFilePage.lockFileCheckbox.click();
Expand All @@ -340,7 +346,7 @@ describe('Lock File', () => {
await lockFilePage.saveButton.click();

try {
const response = await apiService.getInstance().core.nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' });
const response = await nodesApi.updateNode(pngUploadedFile.entry.id, { name: 'My new name' });
await expect(response.entry.name).toEqual('My new name');
} catch (error) {
}
Expand Down
8 changes: 5 additions & 3 deletions e2e/content-services/components/permissions-component.e2e.ts
Expand Up @@ -20,7 +20,7 @@ import { ContentServicesPage } from '../../core/pages/content-services.page';
import { FileModel } from '../../models/ACS/file.model';
import {
ApiService,
BrowserActions,
BrowserActions, Logger,
LoginPage,
NotificationHistoryPage,
PermissionActions,
Expand All @@ -37,6 +37,7 @@ import { MetadataViewPage } from '../../core/pages/metadata-view.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
import { NotificationDemoPage } from '../../core/pages/notification.page';
import { GroupsApi } from '@alfresco/js-api';

describe('Permissions Component', () => {

Expand All @@ -50,6 +51,7 @@ describe('Permissions Component', () => {
const notificationPage = new NotificationDemoPage();
const searchService = new SearchService(apiService);
const permissionActions = new PermissionActions(apiService);
const groupsApi = new GroupsApi(apiService.getInstance());

const contentList = contentServicesPage.getDocumentList();
const viewerPage = new ViewerPage();
Expand Down Expand Up @@ -94,7 +96,7 @@ describe('Permissions Component', () => {
await apiService.loginWithProfile('admin');
await usersActions.createUser(fileOwnerUser);
await usersActions.createUser(filePermissionUser);
await apiService.getInstance().core.groupsApi.createGroup(groupBody);
await groupsApi.createGroup(groupBody);

await apiService.login(fileOwnerUser.username, fileOwnerUser.password);
roleConsumerFolder = await uploadActions.createFolder(roleConsumerFolderModel.name, '-my-');
Expand All @@ -119,7 +121,7 @@ describe('Permissions Component', () => {
try {
await searchService.isUserSearchable(filePermissionUser);
} catch (e) {
console.error(`*****\n Failed to sync user \n*****`);
Logger.error(`*****\n Failed to sync user \n*****`);
}
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
} catch (e) {
Expand Down
12 changes: 8 additions & 4 deletions e2e/content-services/components/share-file.e2e.ts
Expand Up @@ -32,13 +32,11 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ShareDialogPage } from '../../core/pages/dialog/share-dialog.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import { SharedLinkEntry, SharedLinkPaging } from '@alfresco/js-api';
import { SharedLinkEntry, SharedLinkPaging, SharedlinksApi } from '@alfresco/js-api';
import { CustomSourcesPage } from '../../core/pages/custom-sources.page';

describe('Share file', () => {

const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const contentListPage = contentServicesPage.getDocumentList();
Expand All @@ -47,8 +45,14 @@ describe('Share file', () => {
const customSourcesPage = new CustomSourcesPage();
const viewerPage = new ViewerPage();
const notificationHistoryPage = new NotificationHistoryPage();

let acsUser: UserModel;

const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
const uploadActions = new UploadActions(apiService);
const sharedLinksApi = new SharedlinksApi(apiService.getInstance());

const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
Expand All @@ -67,7 +71,7 @@ describe('Share file', () => {

const apiCall = async () => {
await apiService.login(acsUser.username, acsUser.password);
return apiService.getInstance().core.sharedlinksApi.findSharedLinks();
return sharedLinksApi.listSharedLinks();
};

return ApiUtil.waitForApi(apiCall, predicate, 10, 2000);
Expand Down

0 comments on commit 558056b

Please sign in to comment.