Use hash strategy in demo shell as the other apps (#6402)

* hash startegy

* use hash in e2e

* trigger build

* fix

* fix

* remove children router overwrite crazynes

* Update login.module.ts

* revert not needed changes

* some fixes

* fix

* remove fdescribe

* fix

* fix

* Update share-file.e2e.ts

* Update lock-file.e2e.ts

* Update share-file.e2e.ts

* some fix

* some other fixes

* username as id

* fix after rebase

* username

* fix usernamee

* Fix the errorComponent

* Attempt to fix unit test - to check

* * Fixed circular dependency error while building adf-testing package

* * Fixed failing UT

* fix

* use username

* some fixes

* some fix

* fix

Co-authored-by: Maurizio Vitale <maurizio.vitale@alfresco.com>
Co-authored-by: Vito Albano <vitoalbano@vitoalbano-mbp-0120.local>
Co-authored-by: sivakumar414ram <siva.kumar@muraai.com>
This commit is contained in:
Eugenio Romano
2020-12-16 18:46:56 +00:00
committed by GitHub
parent 3734151338
commit 1c51b2a1a6
195 changed files with 1774 additions and 1460 deletions

View File

@@ -31,7 +31,7 @@ import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
describe('Comment Component', () => {
describe('Comment', () => {
const loginPage: LoginPage = new LoginPage();
const contentServicesPage: ContentServicesPage = new ContentServicesPage();
@@ -68,100 +68,100 @@ describe('Comment Component', () => {
acsUser = await usersActions.createUser();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
describe('component', () => {
beforeEach(async () => {
await apiService.login(acsUser.email, acsUser.password);
beforeEach(async () => {
await apiService.login(acsUser.username, acsUser.password);
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
nodeId = pngUploadedFile.entry.id;
nodeId = pngUploadedFile.entry.id;
userFullName = pngUploadedFile.entry.createdByUser.displayName;
userFullName = pngUploadedFile.entry.createdByUser.displayName;
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});
afterEach(async () => {
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(nodeId);
});
afterEach(async () => {
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(nodeId);
await navigationBarPage.clickLogoutButton();
});
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 });
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 viewerPage.viewFile(pngFileModel.name);
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await commentsPage.checkCommentsTabIsSelected();
await commentsPage.checkCommentInputIsDisplayed();
await commentsPage.checkCommentsTabIsSelected();
await commentsPage.checkCommentInputIsDisplayed();
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.test);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
await commentsPage.getTotalNumberOfComments('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.test);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
it('[C276948] Should be able to add a comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);
it('[C276948] Should be able to add a comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
await commentsPage.addComment(comments.first);
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.addComment(comments.first);
await commentsPage.checkUserIconIsDisplayed();
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.first);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
await commentsPage.getTotalNumberOfComments('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.first);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
it('[C280021] Should be able to add a multiline comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);
it('[C280021] Should be able to add a multiline comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
await commentsPage.addComment(comments.multiline);
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.addComment(comments.multiline);
await commentsPage.checkUserIconIsDisplayed();
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.multiline);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
await commentsPage.getTotalNumberOfComments('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.multiline);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
await commentsPage.addComment(comments.second);
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.addComment(comments.second);
await commentsPage.checkUserIconIsDisplayed();
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (2)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.second);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
await commentsPage.getTotalNumberOfComments('Comments (2)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.second);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
it('[C280022] Should not be able to add an HTML or other code input into the comment input filed', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
it('[C280022] Should not be able to add an HTML or other code input into the comment input filed', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
await commentsPage.addComment(comments.codeType);
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.addComment(comments.codeType);
await commentsPage.checkUserIconIsDisplayed();
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual('First name: Last name:');
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
await commentsPage.getTotalNumberOfComments('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual('First name: Last name:');
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
});
describe('Consumer Permissions', () => {
@@ -176,13 +176,13 @@ describe('Comment Component', () => {
});
await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.CONSUMER
});
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, site.entry.guid);
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.navigateToContentServices();
});
@@ -203,6 +203,7 @@ describe('Comment Component', () => {
await commentsPage.checkCommentsTabIsSelected();
await commentsPage.checkCommentInputIsNotDisplayed();
await viewerPage.clickCloseButton();
});
});
});