Fix e2e test (#4981)

* fix core viewer

* increase rendition retry

* sso refresh before test

* general fix test

* try use last proxy

* avoid use proxy

* remove proxy

* fix setting tests

* fix share and sso test

* fix lint exclude

* fix sso

* fix some process services cloud e2e

* fix sso download

* exclude sso test

* fix cloud

* add logout content service test

* add logout core

* add logout search

* redefine global before all

* separate protracotr method

* try

* try multiple attempt before all

* add prefix group and users

* add prefix group and users

* add prefix group and users

* rexecute sso test

* fix process service visibility e2e

* split SSO login test

* fix SSO download

* fix SSO download

* fix some cloud issues

* fix some cloud issues

* fix some cloud issues

* share file fix cs

* fix cloud test
This commit is contained in:
Eugenio Romano
2019-08-08 17:52:45 +02:00
committed by GitHub
parent b7b251fe72
commit f04c135377
181 changed files with 1136 additions and 668 deletions

View File

@@ -40,7 +40,7 @@ describe('Restore content directive', function () {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf.url
hostEcm: browser.params.testConfig.adf_acs.host
});
const pdfFileModel = new FileModel({
@@ -61,7 +61,8 @@ describe('Restore content directive', function () {
const folderName = StringUtil.generateRandomString(5);
const uploadActions = new UploadActions(this.alfrescoJsApi);
let folderWithContent, folderWithFolder, subFolder, subFile, testFile, restoreFile, publicSite, siteFolder, siteFile;
let folderWithContent, folderWithFolder, subFolder, subFile, testFile, restoreFile, publicSite, siteFolder,
siteFile;
beforeAll(async (done) => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -81,12 +82,13 @@ describe('Restore content directive', function () {
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(folderWithContent.entry.id);
await uploadActions.deleteFileOrFolder(folderWithFolder.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id);
done();
});
beforeEach(async (done) => {
@@ -241,92 +243,92 @@ describe('Restore content directive', function () {
describe('Restore deleted library', () => {
beforeAll(async (done) => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const publicSiteName = `00${StringUtil.generateRandomString(5)}`;
const publicSiteBody = {visibility: 'PUBLIC', title: publicSiteName};
publicSite = await this.alfrescoJsApi.core.sitesApi.createSite(publicSiteBody);
siteFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), publicSite.entry.guid);
siteFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, siteFolder.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id);
done();
beforeAll(async (done) => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const publicSiteName = `00${StringUtil.generateRandomString(5)}`;
const publicSiteBody = { visibility: 'PUBLIC', title: publicSiteName };
publicSite = await this.alfrescoJsApi.core.sitesApi.createSite(publicSiteBody);
siteFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), publicSite.entry.guid);
siteFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, siteFolder.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id);
done();
});
it('[C260241] Should restore the deleted library along with contents inside', async () => {
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(publicSite.entry.id);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(publicSite.entry.id);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(publicSite.entry.id);
trashcanPage.clickRestore();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.selectSite(publicSite.entry.title);
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(siteFolder.entry.name);
contentServicesPage.doubleClickRow(siteFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(siteFile.entry.name);
notificationHistoryPage.checkNotifyContains(publicSite.entry.id + ' item restored');
});
});
it('[C260241] Should restore the deleted library along with contents inside', async () => {
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(publicSite.entry.id);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(publicSite.entry.id);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(publicSite.entry.id);
trashcanPage.clickRestore();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.selectSite(publicSite.entry.title);
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(siteFolder.entry.name);
contentServicesPage.doubleClickRow(siteFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(siteFile.entry.name);
notificationHistoryPage.checkNotifyContains(publicSite.entry.id + ' item restored');
});
});
describe('Restore with folder hierarchies', () => {
let parentFolder, folderWithin, pdfFile, pngFile, mainFile, mainFolder;
let parentFolder, folderWithin, pdfFile, pngFile, mainFile, mainFolder;
beforeAll(async (done) => {
await this.alfrescoJsApi.login(anotherAcsUser.id, anotherAcsUser.password);
await uploadActions.createFolder(folderName, '-my-');
parentFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
folderWithin = await uploadActions.createFolder(StringUtil.generateRandomString(5), parentFolder.entry.id);
pdfFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, folderWithin.entry.id);
pngFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, folderWithin.entry.id);
mainFile = await uploadActions.uploadFile(testFileModel.location, testFileModel.name, '-my-');
mainFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
beforeAll(async (done) => {
await this.alfrescoJsApi.login(anotherAcsUser.id, anotherAcsUser.password);
await uploadActions.createFolder(folderName, '-my-');
parentFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
folderWithin = await uploadActions.createFolder(StringUtil.generateRandomString(5), parentFolder.entry.id);
pdfFile = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, folderWithin.entry.id);
pngFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, folderWithin.entry.id);
mainFile = await uploadActions.uploadFile(testFileModel.location, testFileModel.name, '-my-');
mainFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
await loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.waitForTableBody();
done();
await loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.waitForTableBody();
done();
});
afterAll(async (done) => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(parentFolder.entry.id);
await uploadActions.deleteFileOrFolder(mainFolder.entry.id);
await uploadActions.deleteFileOrFolder(mainFile.entry.id);
done();
});
it('[C216431] Should restore hierarchy of folders', async () => {
contentServicesPage.deleteContent(parentFolder.entry.name);
contentServicesPage.deleteContent(mainFolder.entry.name);
contentServicesPage.deleteContent(mainFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.checkRestoreButtonIsNotDisplayed();
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(parentFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(parentFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFile.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFile.entry.name);
trashcanPage.clickRestore();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(parentFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(mainFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(mainFile.entry.name);
contentServicesPage.doubleClickRow(parentFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(folderWithin.entry.name);
contentServicesPage.doubleClickRow(folderWithin.entry.name);
contentServicesPage.checkContentIsDisplayed(pdfFile.entry.name);
contentServicesPage.checkContentIsDisplayed(pngFile.entry.name);
});
});
afterAll(async (done) => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(parentFolder.entry.id);
await uploadActions.deleteFileOrFolder(mainFolder.entry.id);
await uploadActions.deleteFileOrFolder(mainFile.entry.id);
done();
});
it('[C216431] Should restore hierarchy of folders', async () => {
contentServicesPage.deleteContent(parentFolder.entry.name);
contentServicesPage.deleteContent(mainFolder.entry.name);
contentServicesPage.deleteContent(mainFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.checkRestoreButtonIsNotDisplayed();
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(parentFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(parentFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFile.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFile.entry.name);
trashcanPage.clickRestore();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(parentFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(mainFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(mainFile.entry.name);
contentServicesPage.doubleClickRow(parentFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(folderWithin.entry.name);
contentServicesPage.doubleClickRow(folderWithin.entry.name);
contentServicesPage.checkContentIsDisplayed(pdfFile.entry.name);
contentServicesPage.checkContentIsDisplayed(pngFile.entry.name);
});
});
});