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

@@ -20,12 +20,16 @@ import { browser } from 'protractor';
import { ApiService, 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';
describe('Document List Component', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
let uploadedFolder, uploadedFolderExtra;
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const contentServicesPage = new ContentServicesPage();
const apiService = new ApiService();
const usersActions = new UsersActions(apiService);
@@ -82,7 +86,7 @@ describe('Document List Component', () => {
acsUser = await usersActions.createUser();
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
pdfUploadedNode = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
docxUploadedNode = await uploadActions.uploadFile(docxFileModel.location, docxFileModel.name, '-my-');
@@ -106,7 +110,11 @@ describe('Document List Component', () => {
});
beforeEach(async () => {
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
});
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C279926] Should only display the user\'s files and folders', async () => {
@@ -126,7 +134,7 @@ describe('Document List Component', () => {
});
it('[C279928] Should be able to display date with timeAgo', async () => {
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
timeAgoUploadedNode = await uploadActions.uploadFile(timeAgoFileModel.location, timeAgoFileModel.name, '-my-');
await contentServicesPage.goToDocumentList();
const dateValue = await contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created');
@@ -134,7 +142,7 @@ describe('Document List Component', () => {
});
it('[C279929] Should be able to display the date with date type', async () => {
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
mediumDateUploadedNode = await uploadActions.uploadFile(mediumFileModel.location, mediumFileModel.name, '-my-');
const createdDate = moment(mediumDateUploadedNode.createdAt).format('ll');
await contentServicesPage.goToDocumentList();
@@ -166,18 +174,20 @@ describe('Document List Component', () => {
await apiService.loginWithProfile('admin');
const user = await usersActions.createUser();
await apiService.login(user.email, user.password);
await apiService.login(user.username, user.password);
fileANode = await uploadActions.uploadFile(fakeFileA.location, fakeFileA.name, '-my-');
fileBNode = await uploadActions.uploadFile(fakeFileB.location, fakeFileB.name, '-my-');
fileCNode = await uploadActions.uploadFile(fakeFileC.location, fakeFileC.name, '-my-');
await loginPage.login(user.email, user.password);
await loginPage.login(user.username, user.password);
await contentServicesPage.goToDocumentList();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await apiService.loginWithProfile('admin');
if (fileANode) {
await uploadActions.deleteFileOrFolder(fileANode.entry.id);
@@ -215,86 +225,98 @@ describe('Document List Component', () => {
});
});
it('[C279959] Should display empty folder state for new folders', async () => {
const folderName = 'BANANA';
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.openFolder(folderName);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
await contentServicesPage.checkEmptyFolderImageUrlToContain('/assets/images/empty_doc_lib.svg');
});
describe('', () => {
it('[C272775] Should be able to upload a file in new folder', async () => {
const testFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_location
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
/* cspell:disable-next-line */
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.email, acsUser.password);
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.uploadFile(testFile.location);
await contentServicesPage.checkContentIsDisplayed(testFile.name);
});
it('[C261997] Should be able to clean Recent Files history', async () => {
await apiService.loginWithProfile('admin');
const cleanUser = await usersActions.createUser();
await loginPage.login(cleanUser.email, cleanUser.password);
await contentServicesPage.clickOnContentServices();
await contentServicesPage.checkRecentFileToBeShowed();
const icon = await contentServicesPage.getRecentFileIcon();
await expect(icon).toBe('history');
await contentServicesPage.expandRecentFiles();
await contentServicesPage.checkEmptyRecentFileIsDisplayed();
await contentServicesPage.closeRecentFiles();
});
it('[C279959] Should display empty folder state for new folders', async () => {
const folderName = 'BANANA';
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
it('[C279970] Should display Islocked field for folders', async () => {
const folderNameA = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
const folderNameB = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.email, acsUser.password);
uploadedFolder = await uploadActions.createFolder(folderNameA, '-my-');
uploadedFolderExtra = await uploadActions.createFolder(folderNameB, '-my-');
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(folderNameA);
await contentServicesPage.checkContentIsDisplayed(folderNameB);
await contentServicesPage.checkLockIsDisplayedForElement(folderNameA);
await contentServicesPage.checkLockIsDisplayedForElement(folderNameB);
});
it('[C269086] Should display Islocked field for files', async () => {
const testFileA = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.openFolder(folderName);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
await contentServicesPage.checkEmptyFolderImageUrlToContain('/assets/images/empty_doc_lib.svg');
});
const testFileB = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_path
it('[C272775] Should be able to upload a file in new folder', async () => {
const testFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_location
});
/* cspell:disable-next-line */
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name);
await contentServicesPage.openFolder(uploadedFolder.entry.name);
await contentServicesPage.uploadFile(testFile.location);
await contentServicesPage.checkContentIsDisplayed(testFile.name);
});
it('[C261997] Should be able to clean Recent Files history', async () => {
await apiService.loginWithProfile('admin');
const cleanUser = await usersActions.createUser();
await loginPage.login(cleanUser.username, cleanUser.password);
await contentServicesPage.clickOnContentServices();
await contentServicesPage.checkRecentFileToBeShowed();
const icon = await contentServicesPage.getRecentFileIcon();
await expect(icon).toBe('history');
await contentServicesPage.expandRecentFiles();
await contentServicesPage.checkEmptyRecentFileIsDisplayed();
await contentServicesPage.closeRecentFiles();
});
it('[C279970] Should display Islocked field for folders', async () => {
const folderNameA = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
const folderNameB = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
uploadedFolder = await uploadActions.createFolder(folderNameA, '-my-');
uploadedFolderExtra = await uploadActions.createFolder(folderNameB, '-my-');
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(folderNameA);
await contentServicesPage.checkContentIsDisplayed(folderNameB);
await contentServicesPage.checkLockIsDisplayedForElement(folderNameA);
await contentServicesPage.checkLockIsDisplayedForElement(folderNameB);
});
it('[C269086] Should display Islocked field for files', async () => {
const testFileA = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_path
});
const testFileB = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_path
});
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
testFileNode = await uploadActions.uploadFile(testFileA.location, testFileA.name, '-my-');
pdfBFileNode = await uploadActions.uploadFile(testFileB.location, testFileB.name, '-my-');
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(testFileA.name);
await contentServicesPage.checkContentIsDisplayed(testFileB.name);
await contentServicesPage.checkLockIsDisplayedForElement(testFileA.name);
await contentServicesPage.checkLockIsDisplayedForElement(testFileB.name);
});
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.email, acsUser.password);
testFileNode = await uploadActions.uploadFile(testFileA.location, testFileA.name, '-my-');
pdfBFileNode = await uploadActions.uploadFile(testFileB.location, testFileB.name, '-my-');
await loginPage.login(acsUser.email, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(testFileA.name);
await contentServicesPage.checkContentIsDisplayed(testFileB.name);
await contentServicesPage.checkLockIsDisplayedForElement(testFileA.name);
await contentServicesPage.checkLockIsDisplayedForElement(testFileB.name);
});
describe('Once uploaded 20 folders', () => {
@@ -304,7 +326,7 @@ describe('Document List Component', () => {
folderCreated = [];
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
let folderName = '';
let folder = null;
@@ -319,10 +341,12 @@ describe('Document List Component', () => {
for (let i = 0; i < folderCreated.length; i++) {
await uploadActions.deleteFileOrFolder(folderCreated[i].entry.id);
}
await navigationBarPage.clickLogoutButton();
});
it('[C277093] Should sort files with Items per page set to default', async () => {
await loginPage.login(acsUser.email, acsUser.password);
await navigationBarPage.clickLogoutButton();
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkListIsSortedByNameColumn('asc');
});
@@ -340,10 +364,10 @@ describe('Document List Component', () => {
beforeAll(async () => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
file = await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, '-my-');
await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});