[Impreove e2e] Dev delete sites e2e missing (#5695)

* fix e2e sites delete

* fix lint

* permamenent
This commit is contained in:
Eugenio Romano
2020-05-13 22:35:31 +01:00
committed by GitHub
parent 0186d11fe8
commit bf729f60a2
49 changed files with 85 additions and 131 deletions
@@ -61,7 +61,7 @@ describe('Comment Component', () => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
});
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
@@ -80,12 +80,12 @@ describe('Comment Component', () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
});
});
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(nodeId);
});
});
it('[C276947] Should be able to add a comment on ACS and view on ADF', async () => {
await this.alfrescoJsApi.core.commentsApi.addComment(nodeId, { content: comments.test });
@@ -102,7 +102,7 @@ describe('Comment Component', () => {
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);
@@ -181,12 +181,11 @@ describe('Comment Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickContentServicesButton();
});
afterAll(async () => {
await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(site.entry.id, { permanent: true });
});
it('[C290147] Should NOT be able to add comments to a site file with Consumer permissions', async () => {
@@ -58,16 +58,17 @@ describe('Create library directive', () => {
title: StringUtil.generateRandomString(20).toLowerCase(),
visibility: 'PUBLIC'
});
});
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.core.sitesApi.deleteSite(createSite.entry.id, { permanent: true });
});
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.openCreateLibraryDialog();
});
});
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
@@ -246,9 +246,7 @@ describe('Delete Directive', () => {
afterAll(async () => {
try {
await this.alfrescoJsApi.core.sitesApi.deleteSite(
createdSite.entry.id
);
await this.alfrescoJsApi.core.sitesApi.deleteSite(createdSite.entry.id, { permanent: true });
} catch (error) {}
});
@@ -228,7 +228,6 @@ describe('Edit folder directive', () => {
await loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + editFolder.entry.id);
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C260167] Edit folder without permission', async () => {
@@ -125,7 +125,6 @@ describe('Restore content directive', () => {
await contentServicesPage.checkContentIsDisplayed(folderName);
await notificationHistoryPage.checkNotifyContains('Can\'t restore, ' + folderName + ' item already exists');
});
});
@@ -246,7 +245,7 @@ describe('Restore content directive', () => {
afterAll(async () => {
try {
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id, { permanent: true });
} catch (error) {
}
});
@@ -267,7 +266,6 @@ describe('Restore content directive', () => {
await contentServicesPage.doubleClickRow(siteFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(siteFile.entry.name);
await notificationHistoryPage.checkNotifyContains(publicSite.entry.id + ' item restored');
});
});
@@ -250,7 +250,6 @@ describe('Document List Component - Actions', () => {
await contentServicesPage.checkContextActionIsVisible('Info');
await contentServicesPage.checkContextActionIsVisible('Permission');
});
});
});
@@ -94,7 +94,6 @@ describe('Document List Component', () => {
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
pdfUploadedNode = await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, '-my-');
docxUploadedNode = await uploadActions.uploadFile(docxFileModel.location, docxFileModel.name, '-my-');
});
afterAll(async () => {
@@ -117,7 +116,6 @@ describe('Document List Component', () => {
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
it('[C279926] Should only display the user\'s files and folders', async () => {
@@ -142,7 +140,6 @@ describe('Document List Component', () => {
await contentServicesPage.goToDocumentList();
const dateValue = await contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created');
await expect(dateValue).toMatch(/(ago|few)/);
});
it('[C279929] Should be able to display the date with date type', async () => {
@@ -153,7 +150,6 @@ describe('Document List Component', () => {
await contentServicesPage.enableMediumTimeFormat();
const dateValue = await contentServicesPage.getColumnValueForRow(mediumFileModel.name, 'Created');
await expect(dateValue).toContain(createdDate);
});
});
@@ -191,7 +187,6 @@ describe('Document List Component', () => {
await loginPage.loginToContentServicesUsingUserModel(user);
await contentServicesPage.goToDocumentList();
});
afterAll(async () => {
@@ -351,7 +346,6 @@ describe('Document List Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkListIsSortedByNameColumn('asc');
});
});
@@ -375,7 +369,6 @@ describe('Document List Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
});
it('[C291843] Should be able to navigate using nodes hyperlink when activated', async () => {
@@ -109,7 +109,7 @@ describe('Document List Component', () => {
await uploadActions.deleteFileOrFolder(uploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(sourceFolder.entry.id);
await uploadActions.deleteFileOrFolder(destinationFolder.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(site.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(site.entry.id, { permanent: true });
});
describe('Document List Component - Actions Move and Copy', () => {
@@ -121,7 +121,6 @@ describe('Document List Component', () => {
beforeEach(async () => {
await BrowserActions.closeMenuAndDialogs();
await navigationBarPage.clickContentServicesButton();
});
it('[C260128] Move - Same name file', async () => {
@@ -76,7 +76,6 @@ describe('Document List Component', () => {
filePDFSubNode = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, folderNode.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
afterAll(async () => {
@@ -57,7 +57,7 @@ describe('Document List Component', () => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id, { permanent: true });
});
it('[C217334] Should display a message when accessing file without permissions', async () => {
@@ -59,14 +59,12 @@ describe('Document List Component - Properties', () => {
subFolder = await uploadActions.createFolder('subFolder', parentFolder.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(subFolder.entry.id);
await uploadActions.deleteFileOrFolder(parentFolder.entry.id);
});
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => {
@@ -88,7 +88,6 @@ describe('Document List Component', () => {
fileTestNode = await uploadActions.uploadFile(testFile.location, testFile.name, '-my-');
fileDocxNode = await uploadActions.uploadFile(docxFile.location, docxFile.name, '-my-');
folderNode = await uploadActions.createFolder(folderName, '-my-');
});
afterAll(async () => {
@@ -126,25 +125,21 @@ describe('Document List Component', () => {
it('[C260119] Should have a specific thumbnail for folders', async () => {
const folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName);
await expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
});
it('[C280066] Should have a specific thumbnail PDF files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
await expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
});
it('[C280067] Should have a specific thumbnail DOCX files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name);
await expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
});
it('[C280068] Should have a specific thumbnail files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name);
await expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
});
it('[C274701] Should be able to enable thumbnails', async () => {
@@ -152,7 +147,6 @@ describe('Document List Component', () => {
await contentServicesPage.checkAcsContainer();
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
await expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`);
});
});
});
+4 -2
View File
@@ -74,13 +74,16 @@ describe('Lock File', () => {
});
});
afterAll(async () => {
await this.alfrescoJsApi.core.sitesApi.deleteSite(site.entry.id, { permanent: true });
});
describe('Lock file interaction with the UI', () => {
beforeAll(async () => {
const pngLockedUploadedFile = await uploadActions.uploadFile(pngFileToLock.location, pngFileToLock.name, documentLibrary);
lockedFileNodeId = pngLockedUploadedFile.entry.id;
});
beforeEach(async () => {
@@ -177,7 +180,6 @@ describe('Lock File', () => {
await loginPage.loginToContentServicesUsingUserModel(managerUser);
await navigationBarPage.openContentServicesFolder(documentLibrary);
});
afterEach(async () => {
@@ -92,7 +92,7 @@ describe('permissions', () => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.core.sitesApi.deleteSite(site.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(site.entry.id, { permanent: true });
});
it('[C274692] Should not be possible edit metadata properties when the user is a consumer user', async () => {
@@ -183,7 +183,6 @@ describe('Permissions Component', () => {
await contentList.rightClickOnRow(fileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.checkPermissionContainerIsDisplayed();
});
afterEach(async () => {
@@ -153,8 +153,8 @@ describe('Permissions Component', () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id, { permanent: true });
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id, { permanent: true });
});
describe('Role Site Dropdown', () => {
@@ -163,7 +163,6 @@ describe('Permissions Component', () => {
await loginPage.loginToContentServicesUsingUserModel(folderOwnerUser);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + publicSite.entry.guid);
});
it('[C277002] Should display the Role Site dropdown', async () => {
@@ -228,7 +227,6 @@ describe('Permissions Component', () => {
await contentServicesPage.uploadFile(testFileModel.location);
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
it('[C276997] Role SiteContributor', async () => {
@@ -259,7 +257,6 @@ describe('Permissions Component', () => {
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C277005] Role SiteCollaborator', async () => {
@@ -106,20 +106,20 @@ describe('Unshare file', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await navBar.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
});
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.core.sitesApi.deleteSite(testSite.entry.id, { permanent: true });
});
afterEach(async () => {
await browser.refresh();
});
});
describe('with permission', () => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(nodeId);
});
it('[C286550] Should display unshare confirmation dialog', async () => {
@@ -168,7 +168,6 @@ describe('Unshare file', () => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.sitesApi.deleteSite(siteName, { permanent: true });
});
it('[C286555] Should NOT be able to unshare file without permission', async () => {
@@ -88,13 +88,17 @@ describe('Upload - User permission', () => {
id: acsUser.id,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
});
});
afterEach(async () => {
await this.alfrescoJsApi.core.sitesApi.deleteSite(this.managerSite.entry.id, { permanent: true });
await this.alfrescoJsApi.core.sitesApi.deleteSite(this.consumerSite.entry.id, { permanent: true });
});
describe('Consumer permissions', () => {
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
it('[C291921] Should display tooltip for uploading files without permissions', async () => {
@@ -128,7 +132,7 @@ describe('Upload - User permission', () => {
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
});
});
describe('full permissions', () => {
@@ -136,7 +140,6 @@ describe('Upload - User permission', () => {
await navigationBarPage.openContentServicesFolder(this.managerSite.entry.guid);
await contentServicesPage.goToDocumentList();
});
it('[C279917] Should be allowed to upload a file in a folder with manager permissions', async () => {
@@ -144,13 +147,12 @@ describe('Upload - User permission', () => {
await uploadDialog.fileIsUploaded(emptyFile.name);
});
});
});
describe('multiple users', () => {
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
it('[C260175] Should two different user upload files in the proper User Home', async () => {
@@ -60,14 +60,13 @@ describe('Version component permissions', () => {
});
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const nodeActions = new NodeActions();
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.core.peopleApi.addPerson(consumerUser);
@@ -116,6 +115,10 @@ describe('Version component permissions', () => {
await uploadActions.uploadFile(differentCreatorFile.location, differentCreatorFile.name, site.entry.guid);
});
afterAll(async () => {
await this.alfrescoJsApi.core.sitesApi.deleteSite(site.entry.id, { permanent: true });
});
describe('Manager', () => {
const sameCreatorFile = new FileModel({
@@ -172,7 +175,6 @@ describe('Version component permissions', () => {
await loginPage.loginToContentServicesUsingUserModel(consumerUser);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
});
afterAll(async () => {
@@ -189,7 +191,7 @@ describe('Version component permissions', () => {
await contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
await expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false, 'Manage version is enabled');
});
});
});
describe('Contributor', () => {
const sameCreatorFile = new FileModel({
@@ -206,7 +208,6 @@ describe('Version component permissions', () => {
await loginPage.loginToContentServicesUsingUserModel(contributorUser);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
});
afterAll(async () => {
@@ -262,7 +263,6 @@ describe('Version component permissions', () => {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
});
afterAll(async () => {