mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
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:
@@ -22,6 +22,7 @@ import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { browser, Key } from 'protractor';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
|
||||
describe('Create folder directive', function () {
|
||||
|
||||
@@ -31,11 +32,12 @@ describe('Create folder directive', function () {
|
||||
const notificationHistoryPage = new NotificationHistoryPage();
|
||||
const metadataViewPage = new MetadataViewPage();
|
||||
const acsUser = new AcsUserModel();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf.url
|
||||
hostEcm: browser.params.testConfig.adf_acs.host
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
@@ -49,6 +51,10 @@ describe('Create folder directive', function () {
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(Key.ESCAPE).perform();
|
||||
done();
|
||||
|
@@ -24,6 +24,7 @@ import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||
import { browser } from 'protractor';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { StringUtil } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||
|
||||
describe('Create library directive', function () {
|
||||
|
||||
@@ -31,6 +32,7 @@ describe('Create library directive', function () {
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const createLibraryDialog = new CreateLibraryDialog();
|
||||
const customSourcesPage = new CustomSources();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const visibility = {
|
||||
public: 'Public',
|
||||
@@ -45,7 +47,7 @@ describe('Create library directive', function () {
|
||||
beforeAll(async (done) => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf.url
|
||||
hostEcm: browser.params.testConfig.adf_acs.host
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
@@ -62,6 +64,10 @@ describe('Create library directive', function () {
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
beforeEach((done) => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.openCreateLibraryDialog();
|
||||
|
@@ -61,7 +61,7 @@ describe('Version component actions', () => {
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf.url
|
||||
hostEcm: browser.params.testConfig.adf_acs.host
|
||||
});
|
||||
const uploadActions = new UploadActions(this.alfrescoJsApi);
|
||||
|
||||
@@ -88,6 +88,10 @@ describe('Version component actions', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
BrowserVisibility.waitUntilDialogIsClose();
|
||||
});
|
||||
|
@@ -34,9 +34,10 @@ describe('Edit folder directive', function () {
|
||||
const anotherAcsUser = new AcsUserModel();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const notificationHistoryPage = new NotificationHistoryPage();
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf.url
|
||||
hostEcm: browser.params.testConfig.adf_acs.host
|
||||
});
|
||||
|
||||
const pdfFile = new FileModel({
|
||||
@@ -77,6 +78,7 @@ describe('Edit folder directive', function () {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
await uploadActions.deleteFileOrFolder(editFolder.entry.id);
|
||||
await uploadActions.deleteFileOrFolder(anotherFolder.entry.id);
|
||||
|
@@ -37,9 +37,10 @@ describe('Favorite directive', function () {
|
||||
const trashcanPage = new TrashcanPage();
|
||||
const contentListPage = contentServicesPage.getDocumentList();
|
||||
const contentNodeSelector = new ContentNodeSelectorDialogPage();
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf.url
|
||||
hostEcm: browser.params.testConfig.adf_acs.host
|
||||
});
|
||||
const pdfFile = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
||||
@@ -66,6 +67,7 @@ describe('Favorite directive', function () {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
await uploadActions.deleteFileOrFolder(testFolder1.entry.id);
|
||||
await uploadActions.deleteFileOrFolder(testFolder2.entry.id);
|
||||
|
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user