Disable control flow e2e ADF (#4954)

* update project script possible different JS-API

* first commit no controll flow

* second commit no controll flow

* third commit no controll flow

* 4 commit no controll flow

* 5 commit no controll flow

* 6 commit no controll flow

* 7 commit no controll flow

* 8 commit no controll flow

* 9 commit no controll flow

* 10 commit no controll flow

* 11 commit no controll flow

* 12 commit no controll flow

* 13 commit no controll flow

* 14 commit no controll flow

* 15 commit no controll flow

* 16 commit no controll flow

* 17 commit no controll flow

* 18 commit no controll flow

* 19 commit no controll flow

* 20 commit no controll flow

* remove wdpromise, protractor promise and deferred promises

* - fixed some incorrect “expect” calls
- fixed some matchers
- removed “return this;” when not needed
- added a few more await-s

* forgot a file

* fix some failing tests

* replaced driver calls with browser calls and enabled back waitForAngular

* fix rightClick methods and hopefully some tests

* fix settings-component

* some more fixes for core and content tests

* try to fix some more issues

* linting

* revert some changes, allowing download on headless chrome won’t work with multiple browser instances

* fixes for Search tests

* try to remove some wait calls

* fix build

* increase allScriptsTimeout and try another protractor and web driver version

* improve navigation methods

* some fixes for notification history and login sso

* forgot a space

* fix packages and enable some screenshots

* navigation bar fixes

* fix some test

* some fixes for notification history and navigation bar
use correct visibility method in attachFileWidget test

* fix searching and another fix for navigation

* try solve sso login

* some more fixes

* refactor async forEach into for..of

* try fix for search tests

* resolve rebabse problems

* remove install

* fix lint

* fix core e2e

* fix core e2e

* fix core e2e

* fix ps tests

* fix some tests

* fix core e2e

* fix core e2e

* fix core

* fix some issues PS

* fix core

* fix core

* fix some ps test

* fix rebase issues

* remove save

* fix url regressed after rebase

* fix url regressed after rebase

* fix ps and core

* fix lint

* more parallel e2e ps

* fix some ps cloud test

* some cloud fix

* fix lint

* fix some test

* remove files to be ignored

* out-tsc

* improve one cs test

* fix candidate base app

* fix ps test

* remove click function

* clean methods alrady present in browser action

* try ugly wait

* move wait

* remove duplicate call

* remove underscore

* fix after review

* fix imports

* minor cosmetic fixes

* fix comments test
This commit is contained in:
Eugenio Romano
2019-08-17 14:32:02 +02:00
committed by GitHub
parent 4f3cf669f2
commit 83412bb9b6
328 changed files with 17653 additions and 18793 deletions

View File

@@ -29,18 +29,18 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
describe('Comment Component', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const viewerPage = new ViewerPage();
const commentsPage = new CommentsPage();
const loginPage: LoginPage = new LoginPage();
const contentServicesPage: ContentServicesPage = new ContentServicesPage();
const viewerPage: ViewerPage = new ViewerPage();
const commentsPage: CommentsPage = new CommentsPage();
const navigationBarPage = new NavigationBarPage();
const acsUser = new AcsUserModel();
const acsUser: AcsUserModel = new AcsUserModel();
let userFullName, nodeId;
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -60,18 +60,17 @@ describe('Comment Component', () => {
test: 'Test'
};
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async (done) => {
beforeEach(async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
@@ -82,96 +81,95 @@ describe('Comment Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(nodeId);
done();
});
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 });
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
commentsPage.checkCommentsTabIsSelected();
commentsPage.checkCommentInputIsDisplayed();
await commentsPage.checkCommentsTabIsSelected();
await commentsPage.checkCommentInputIsDisplayed();
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual(comments.test);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
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)/);
});
it('[C276948] Should be able to add a comment on a file', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
viewerPage.clickOnCommentsTab();
it('[C276948] Should be able to add a comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
commentsPage.addComment(comments.first);
commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.addComment(comments.first);
await commentsPage.checkUserIconIsDisplayed(0);
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual(comments.first);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
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)/);
});
it('[C280021] Should be able to add a multiline comment on a file', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
viewerPage.clickOnCommentsTab();
it('[C280021] Should be able to add a multiline comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
commentsPage.addComment(comments.multiline);
commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.addComment(comments.multiline);
await commentsPage.checkUserIconIsDisplayed(0);
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual(comments.multiline);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
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)/);
commentsPage.addComment(comments.second);
commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.addComment(comments.second);
await commentsPage.checkUserIconIsDisplayed(0);
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (2)');
expect(commentsPage.getMessage(0)).toEqual(comments.second);
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
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)/);
});
it('[C280022] Should not be able to add an HTML or other code input into the comment input filed', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
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.checkImgViewerIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
commentsPage.addComment(comments.codeType);
commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.addComment(comments.codeType);
await commentsPage.checkUserIconIsDisplayed(0);
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
expect(commentsPage.getMessage(0)).toEqual('First name: Last name:');
expect(commentsPage.getUserName(0)).toEqual(userFullName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
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)/);
});
describe('Consumer Permissions', () => {
let site, pngUploadedFile;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
site = await this.alfrescoJsApi.core.sitesApi.createSite({
@@ -186,31 +184,29 @@ describe('Comment Component', () => {
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, site.entry.guid);
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
done();
});
afterAll((done) => {
uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
afterAll(async () => {
await uploadActions.deleteFileOrFolder(pngUploadedFile.entry.id);
done();
});
it('[C290147] Should NOT be able to add comments to a site file with Consumer permissions', () => {
navigationBarPage.goToSite(site);
contentServicesPage.checkAcsContainer();
it('[C290147] Should NOT be able to add comments to a site file with Consumer permissions', async () => {
await navigationBarPage.goToSite(site);
await contentServicesPage.checkAcsContainer();
viewerPage.viewFile(pngUploadedFile.entry.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.checkInfoButtonIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.viewFile(pngUploadedFile.entry.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.checkInfoButtonIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
commentsPage.checkCommentsTabIsSelected();
commentsPage.checkCommentInputIsNotDisplayed();
await commentsPage.checkCommentsTabIsSelected();
await commentsPage.checkCommentInputIsNotDisplayed();
});
});
});

View File

@@ -24,7 +24,7 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { browser, Key } from 'protractor';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
describe('Create folder directive', function () {
describe('Create folder directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
@@ -34,7 +34,7 @@ describe('Create folder directive', function () {
const acsUser = new AcsUserModel();
const navigationBarPage = new NavigationBarPage();
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -46,106 +46,105 @@ describe('Create folder directive', function () {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async (done) => {
beforeEach(async () => {
await browser.actions().sendKeys(Key.ESCAPE).perform();
done();
});
afterEach(async (done) => {
afterEach(async () => {
await browser.actions().sendKeys(Key.ESCAPE).perform();
done();
});
it('[C260154] Should not create the folder if cancel button is clicked', () => {
it('[C260154] Should not create the folder if cancel button is clicked', async () => {
const folderName = 'cancelFolder';
contentServicesPage.clickOnCreateNewFolder();
await contentServicesPage.clickOnCreateNewFolder();
createFolderDialog.addFolderName(folderName);
createFolderDialog.clickOnCancelButton();
await createFolderDialog.addFolderName(folderName);
await createFolderDialog.clickOnCancelButton();
contentServicesPage.checkContentIsNotDisplayed(folderName);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
});
it('[C260155] Should enable the Create button only when a folder name is present', () => {
it('[C260155] Should enable the Create button only when a folder name is present', async () => {
const folderName = 'NotEnableFolder';
contentServicesPage.clickOnCreateNewFolder();
await contentServicesPage.clickOnCreateNewFolder();
createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName(folderName);
await createFolderDialog.addFolderName(folderName);
createFolderDialog.checkCreateUpdateBtnIsEnabled();
await createFolderDialog.checkCreateUpdateBtnIsEnabled();
});
it('[C260156] Should not be possible create two folder with the same name', () => {
it('[C260156] Should not be possible create two folder with the same name', async () => {
const folderName = 'duplicate';
contentServicesPage.createNewFolder(folderName);
await contentServicesPage.createNewFolder(folderName);
contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.createNewFolder(folderName);
await contentServicesPage.createNewFolder(folderName);
notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
await notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
});
it('[C260157] Should be possible create a folder under a folder with the same name', () => {
it('[C260157] Should be possible create a folder under a folder with the same name', async () => {
const folderName = 'sameSubFolder';
contentServicesPage.createNewFolder(folderName);
contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.doubleClickRow(folderName);
contentServicesPage.createNewFolder(folderName);
contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
});
it('[C260158] Should be possible add a folder description when create a new folder', () => {
it('[C260158] Should be possible add a folder description when create a new folder', async () => {
const folderName = 'folderDescription';
const description = 'this is the description';
contentServicesPage.clickOnCreateNewFolder();
await contentServicesPage.clickOnCreateNewFolder();
createFolderDialog.addFolderName(folderName);
createFolderDialog.addFolderDescription(description);
await createFolderDialog.addFolderName(folderName);
await createFolderDialog.addFolderDescription(description);
createFolderDialog.clickOnCreateUpdateButton();
await createFolderDialog.clickOnCreateUpdateButton();
contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.metadataContent(folderName);
await contentServicesPage.metadataContent(folderName);
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('this is the description');
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('this is the description');
});
it('[C260159] Should not be possible create a folder with banned character', () => {
browser.refresh();
contentServicesPage.clickOnCreateNewFolder();
it('[C260159] Should not be possible create a folder with banned character', async () => {
await browser.refresh();
await contentServicesPage.clickOnCreateNewFolder();
createFolderDialog.addFolderName('*');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('<');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('>');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('\\');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('/');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('?');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName(':');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
createFolderDialog.addFolderName('|');
createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('*');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('<');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('>');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('\\');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('/');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('?');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName(':');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
await createFolderDialog.addFolderName('|');
await createFolderDialog.checkCreateUpdateBtnIsDisabled();
});
});

View File

@@ -26,7 +26,7 @@ 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 () {
describe('Create library directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
@@ -44,7 +44,7 @@ describe('Create library directive', function () {
const acsUser = new AcsUserModel();
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -57,222 +57,221 @@ describe('Create library directive', function () {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
createSite = await this.alfrescoJsApi.core.sitesApi.createSite({
'title': StringUtil.generateRandomString(20).toLowerCase(),
'visibility': 'PUBLIC'
title: StringUtil.generateRandomString(20).toLowerCase(),
visibility: 'PUBLIC'
});
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach((done) => {
contentServicesPage.goToDocumentList();
contentServicesPage.openCreateLibraryDialog();
done();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.openCreateLibraryDialog();
});
afterEach(() => {
BrowserActions.closeMenuAndDialogs();
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
});
it('[C290158] Should display the Create Library defaults', () => {
expect(createLibraryDialog.getTitle()).toMatch('Create Library');
expect(createLibraryDialog.isNameDisplayed()).toBe(true, 'Name input field is not displayed');
expect(createLibraryDialog.isLibraryIdDisplayed()).toBe(true, 'Library ID field is not displayed');
expect(createLibraryDialog.isDescriptionDisplayed()).toBe(true, 'Library description is not displayed');
expect(createLibraryDialog.isPublicDisplayed()).toBe(true, 'Public radio button is not displayed');
expect(createLibraryDialog.isPrivateDisplayed()).toBe(true, 'Private radio button is not displayed');
expect(createLibraryDialog.isModeratedDisplayed()).toBe(true, 'Moderated radio button is not displayed');
expect(createLibraryDialog.isCreateEnabled()).toBe(false, 'Create button is not disabled');
expect(createLibraryDialog.isCancelEnabled()).toBe(true, 'Cancel button is disabled');
expect(createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The default visibility is not public');
it('[C290158] Should display the Create Library defaults', async () => {
await expect(await createLibraryDialog.getTitle()).toMatch('Create Library');
await expect(await createLibraryDialog.isNameDisplayed()).toBe(true, 'Name input field is not displayed');
await expect(await createLibraryDialog.isLibraryIdDisplayed()).toBe(true, 'Library ID field is not displayed');
await expect(await createLibraryDialog.isDescriptionDisplayed()).toBe(true, 'Library description is not displayed');
await expect(await createLibraryDialog.isPublicDisplayed()).toBe(true, 'Public radio button is not displayed');
await expect(await createLibraryDialog.isPrivateDisplayed()).toBe(true, 'Private radio button is not displayed');
await expect(await createLibraryDialog.isModeratedDisplayed()).toBe(true, 'Moderated radio button is not displayed');
await expect(await createLibraryDialog.isCreateEnabled()).toBe(false, 'Create button is not disabled');
await expect(await createLibraryDialog.isCancelEnabled()).toBe(true, 'Cancel button is disabled');
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The default visibility is not public');
});
it('[C290159] Should close the dialog when clicking Cancel button', () => {
it('[C290159] Should close the dialog when clicking Cancel button', async () => {
const libraryName = 'cancelLibrary';
createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.clickCancel();
await createLibraryDialog.clickCancel();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.waitForDialogToClose();
});
it('[C290160] Should create a public library', () => {
it('[C290160] Should create a public library', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.typeLibraryDescription(libraryDescription);
createLibraryDialog.selectPublic();
await createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.typeLibraryDescription(libraryDescription);
await createLibraryDialog.selectPublic();
expect(createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The visibility is not public');
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.public, 'The visibility is not public');
createLibraryDialog.clickCreate();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
expect(createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectMySitesSourceType();
customSourcesPage.checkRowIsDisplayed(libraryName);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
expect(customSourcesPage.getStatusCell(libraryName)).toMatch('PUBLIC', 'Wrong library status.');
await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('PUBLIC', 'Wrong library status.');
});
it('[C290173] Should create a private library', () => {
it('[C290173] Should create a private library', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.typeLibraryDescription(libraryDescription);
createLibraryDialog.selectPrivate();
await createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.typeLibraryDescription(libraryDescription);
await createLibraryDialog.selectPrivate();
expect(createLibraryDialog.getSelectedRadio()).toMatch(visibility.private, 'The visibility is not private');
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.private, 'The visibility is not private');
createLibraryDialog.clickCreate();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
expect(createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectMySitesSourceType();
customSourcesPage.checkRowIsDisplayed(libraryName);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
expect(customSourcesPage.getStatusCell(libraryName)).toMatch('PRIVATE', 'Wrong library status.');
await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('PRIVATE', 'Wrong library status.');
});
it('[C290174, C290175] Should create a moderated library with a given Library ID', () => {
it('[C290174, C290175] Should create a moderated library with a given Library ID', async () => {
const libraryName = StringUtil.generateRandomString();
const libraryId = StringUtil.generateRandomString();
const libraryDescription = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.typeLibraryId(libraryId);
createLibraryDialog.typeLibraryDescription(libraryDescription);
createLibraryDialog.selectModerated();
await createLibraryDialog.typeLibraryName(libraryName);
await createLibraryDialog.typeLibraryId(libraryId);
await createLibraryDialog.typeLibraryDescription(libraryDescription);
await createLibraryDialog.selectModerated();
expect(createLibraryDialog.getSelectedRadio()).toMatch(visibility.moderated, 'The visibility is not moderated');
await expect(await createLibraryDialog.getSelectedRadio()).toMatch(visibility.moderated, 'The visibility is not moderated');
createLibraryDialog.clickCreate();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
expect(createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create Library dialog is not closed');
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectMySitesSourceType();
customSourcesPage.checkRowIsDisplayed(libraryName);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectMySitesSourceType();
await customSourcesPage.checkRowIsDisplayed(libraryName);
expect(customSourcesPage.getStatusCell(libraryName)).toMatch('MODERATED', 'Wrong library status.');
await expect(await customSourcesPage.getStatusCell(libraryName)).toMatch('MODERATED', 'Wrong library status.');
});
it('[C290163] Should disable Create button when a mandatory field is not filled in', () => {
it('[C290163] Should disable Create button when a mandatory field is not filled in', async () => {
const inputValue = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(inputValue);
createLibraryDialog.clearLibraryId();
expect(createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
createLibraryDialog.clearLibraryName();
await createLibraryDialog.typeLibraryName(inputValue);
await createLibraryDialog.clearLibraryId();
await expect(await createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
await createLibraryDialog.clearLibraryName();
createLibraryDialog.typeLibraryId(inputValue);
expect(createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
createLibraryDialog.clearLibraryId();
await createLibraryDialog.typeLibraryId(inputValue);
await expect(await createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
await createLibraryDialog.clearLibraryId();
createLibraryDialog.typeLibraryDescription(inputValue);
expect(createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
await createLibraryDialog.typeLibraryDescription(inputValue);
await expect(await createLibraryDialog.isCreateEnabled()).not.toBe(true, 'The Create button is enabled');
});
it('[C290164] Should auto-fill in the Library Id built from library name', () => {
it('[C290164] Should auto-fill in the Library Id built from library name', async () => {
const name: string[] = ['abcd1234', 'ab cd 12 34', 'ab cd&12+34_@link/*'];
const libraryId: string[] = ['abcd1234', 'ab-cd-12-34', 'ab-cd1234link'];
for (let _i = 0; _i < 3; _i++) {
createLibraryDialog.typeLibraryName(name[_i]);
expect(createLibraryDialog.getLibraryIdText()).toMatch(libraryId[_i]);
createLibraryDialog.clearLibraryName();
for (let i = 0; i < 3; i++) {
await createLibraryDialog.typeLibraryName(name[i]);
await expect(await createLibraryDialog.getLibraryIdText()).toMatch(libraryId[i]);
await createLibraryDialog.clearLibraryName();
}
});
it('[C290176] Should not accept special characters for Library Id', () => {
it('[C290176] Should not accept special characters for Library Id', async () => {
const name = 'My Library';
const libraryId: string[] = ['My New Library', 'My+New+Library123!', '<>'];
createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryName(name);
for (let _i = 0; _i < 3; _i++) {
createLibraryDialog.typeLibraryId(libraryId[_i]);
expect(createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
expect(createLibraryDialog.getErrorMessage()).toMatch('Use numbers and letters only');
for (let i = 0; i < 3; i++) {
await createLibraryDialog.typeLibraryId(libraryId[i]);
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await expect(await createLibraryDialog.getErrorMessage()).toMatch('Use numbers and letters only');
}
});
it('[C291985] Should not accept less than one character name for Library name', () => {
it('[C291985] Should not accept less than 2 characters for Library name', async () => {
const name = 'x';
const libraryId = 'My New Library';
const libraryId = 'my-library-id';
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
expect(createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
expect(createLibraryDialog.getErrorMessage()).toMatch('Title must be at least 2 characters long');
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await expect(await createLibraryDialog.getErrorMessage()).toMatch('Title must be at least 2 characters long');
});
it('[C291793] Should display error for Name field filled in with spaces only', () => {
it('[C291793] Should display error for Name field filled in with spaces only', async () => {
const name = ' ';
const libraryId = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
expect(createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
expect(createLibraryDialog.getErrorMessage()).toMatch("Library name can't contain only spaces");
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await expect(await createLibraryDialog.getErrorMessage()).toMatch("Library name can't contain only spaces");
});
it('[C290177] Should not accept a duplicate Library Id', () => {
it('[C290177] Should not accept a duplicate Library Id', async () => {
const name = 'My Library';
const libraryId = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
createLibraryDialog.clickCreate();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
contentServicesPage.openCreateLibraryDialog();
await contentServicesPage.openCreateLibraryDialog();
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
expect(createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
expect(createLibraryDialog.getErrorMessage()).toMatch("This Library ID isn't available. Try a different Library ID.");
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await expect(await createLibraryDialog.isErrorMessageDisplayed()).toBe(true, 'Error message is not displayed');
await expect(await createLibraryDialog.getErrorMessage()).toMatch("This Library ID isn't available. Try a different Library ID.");
});
it('[C290178] Should accept the same library name but different Library Ids', () => {
it('[C290178] Should accept the same library name but different Library Ids', async () => {
const name = createSite.entry.title;
const libraryId = StringUtil.generateRandomString();
createLibraryDialog.typeLibraryName(name.toUpperCase());
createLibraryDialog.typeLibraryId(libraryId);
await createLibraryDialog.typeLibraryName(name.toUpperCase());
await createLibraryDialog.typeLibraryId(libraryId);
createLibraryDialog.waitForLibraryNameHint();
expect(createLibraryDialog.getLibraryNameHint()).toMatch('Library name already in use', 'The library name hint is wrong');
await createLibraryDialog.waitForLibraryNameHint();
await expect(await createLibraryDialog.getLibraryNameHint()).toMatch('Library name already in use', 'The library name hint is wrong');
createLibraryDialog.clickCreate();
createLibraryDialog.waitForDialogToClose();
await createLibraryDialog.clickCreate();
await createLibraryDialog.waitForDialogToClose();
expect(createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create library dialog remained open');
await expect(await createLibraryDialog.isDialogOpen()).not.toBe(true, 'The Create library dialog remained open');
});
it('[C290179] Should not accept more than the expected characters for input fields', () => {
it('[C290179] Should not accept more than the expected characters for input fields', async () => {
const name = StringUtil.generateRandomString(257);
const libraryId = StringUtil.generateRandomString(73);
const libraryDescription = StringUtil.generateRandomString(513);
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
createLibraryDialog.typeLibraryDescription(libraryDescription);
await createLibraryDialog.typeLibraryName(name);
await createLibraryDialog.typeLibraryId(libraryId);
await createLibraryDialog.typeLibraryDescription(libraryDescription);
createLibraryDialog.selectPublic();
await createLibraryDialog.selectPublic();
expect(createLibraryDialog.getErrorMessages(0)).toMatch('Use 256 characters or less for title');
expect(createLibraryDialog.getErrorMessages(1)).toMatch('Use 72 characters or less for the URL name');
expect(createLibraryDialog.getErrorMessages(2)).toMatch('Use 512 characters or less for description');
await expect(await createLibraryDialog.getErrorMessages(0)).toMatch('Use 256 characters or less for title');
await expect(await createLibraryDialog.getErrorMessages(1)).toMatch('Use 72 characters or less for the URL name');
await expect(await createLibraryDialog.getErrorMessages(2)).toMatch('Use 512 characters or less for description');
});
});

View File

@@ -35,28 +35,28 @@ describe('Version component actions', () => {
const acsUser = new AcsUserModel();
const txtFileComma = new FileModel({
'name': 'comma,name',
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
name: 'comma,name',
location: resources.Files.ADF_DOCUMENTS.TXT.file_location
});
const txtFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
name: resources.Files.ADF_DOCUMENTS.TXT.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT.file_location
});
const file0BytesModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
name: resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
const folderInfo = new FolderModel({
'name': 'myFolder',
'location': resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
name: 'myFolder',
location: resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
});
const folderSecond = new FolderModel({
'name': 'myrSecondFolder',
'location': resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
name: 'myrSecondFolder',
location: resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
});
this.alfrescoJsApi = new AlfrescoApi({
@@ -65,7 +65,7 @@ describe('Version component actions', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -82,10 +82,9 @@ describe('Version component actions', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
done();
});
afterAll(async () => {
@@ -93,48 +92,48 @@ describe('Version component actions', () => {
});
afterEach(async () => {
BrowserVisibility.waitUntilDialogIsClose();
await BrowserVisibility.waitUntilDialogIsClose();
});
it('[C260083] Download files - Different size values', () => {
contentListPage.selectRow(txtFileModel.name);
contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded(txtFileModel.name);
BrowserVisibility.waitUntilDialogIsClose();
it('[C260083] Download files - Different size values', async () => {
await contentListPage.selectRow(txtFileModel.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(txtFileModel.name);
await BrowserVisibility.waitUntilDialogIsClose();
contentListPage.selectRow(file0BytesModel.name);
contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded(file0BytesModel.name);
await contentListPage.selectRow(file0BytesModel.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(file0BytesModel.name);
});
it('[C260084] Download folder', () => {
contentListPage.selectRow(folderInfo.name);
contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded(folderInfo.name + '.zip');
it('[C260084] Download folder', async () => {
await contentListPage.selectRow(folderInfo.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(folderInfo.name + '.zip');
});
it('[C261032] File and Folder', () => {
contentServicesPage.clickMultiSelectToggle();
contentServicesPage.checkAcsContainer();
contentListPage.dataTablePage().checkAllRows();
contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded('archive.zip');
it('[C261032] File and Folder', async () => {
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.checkAcsContainer();
await contentListPage.dataTablePage().checkAllRows();
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded('archive.zip');
});
it('[C261033] Folder and Folder', () => {
contentListPage.selectRow(folderInfo.name);
contentListPage.selectRow(folderSecond.name);
it('[C261033] Folder and Folder', async () => {
await contentListPage.selectRow(folderInfo.name);
await contentListPage.selectRow(folderSecond.name);
contentServicesPage.clickDownloadButton();
await contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded('archive.zip');
BrowserVisibility.waitUntilDialogIsClose();
await FileBrowserUtil.isFileDownloaded('archive.zip');
await BrowserVisibility.waitUntilDialogIsClose();
});
it('[C277757] Download file - Comma in file name', () => {
contentListPage.selectRow(txtFileComma.name);
contentServicesPage.clickDownloadButton();
FileBrowserUtil.isFileDownloaded(txtFileComma.name);
it('[C277757] Download file - Comma in file name', async () => {
await contentListPage.selectRow(txtFileComma.name);
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded(txtFileComma.name);
});
});

View File

@@ -25,7 +25,7 @@ import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { FileModel } from '../../models/ACS/fileModel';
import resources = require('../../util/resources');
describe('Edit folder directive', function () {
describe('Edit folder directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
@@ -41,15 +41,15 @@ describe('Edit folder directive', function () {
});
const pdfFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const updateFolderName = StringUtil.generateRandomString(5);
let editFolder, anotherFolder, filePdfNode, subFolder;
beforeAll(async (done) => {
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(anotherAcsUser);
@@ -74,171 +74,173 @@ describe('Edit folder directive', function () {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
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(editFolder.entry.id);
await uploadActions.deleteFileOrFolder(anotherFolder.entry.id);
await uploadActions.deleteFileOrFolder(filePdfNode.entry.id);
done();
});
beforeEach(async (done) => {
navigationBarPage.clickHomeButton();
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
done();
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
});
it('[C260161] Update folder - Cancel button', async () => {
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
contentServicesPage.clickOnEditFolder();
editFolderDialog.checkFolderDialogIsDisplayed();
expect(editFolderDialog.getDialogTitle()).toBe('Edit folder');
expect(editFolderDialog.getFolderName()).toBe(editFolder.entry.name);
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.checkCancelBtnIsEnabled();
editFolderDialog.clickOnCancelButton();
editFolderDialog.checkFolderDialogIsNotDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await expect(await editFolderDialog.getDialogTitle()).toBe('Edit folder');
await expect(await editFolderDialog.getFolderName()).toBe(editFolder.entry.name);
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.checkCancelBtnIsEnabled();
await editFolderDialog.clickOnCancelButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
});
it('[C260162] Update folder - Introducing letters', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(true);
contentServicesPage.clickOnEditFolder();
editFolderDialog.checkFolderDialogIsDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.addFolderName(editFolder.entry.name + 'a');
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.clickOnCancelButton();
editFolderDialog.checkFolderDialogIsNotDisplayed();
contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName(editFolder.entry.name + 'a');
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCancelButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
});
it('[C260163] Update folder name with an existing one', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(true);
contentServicesPage.clickOnEditFolder();
editFolderDialog.checkFolderDialogIsDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.addFolderName(anotherFolder.entry.name);
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.clickOnCreateUpdateButton();
editFolderDialog.checkFolderDialogIsDisplayed();
notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName(anotherFolder.entry.name);
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCreateUpdateButton();
await editFolderDialog.checkFolderDialogIsDisplayed();
await notificationHistoryPage.checkNotifyContains('There\'s already a folder with this name. Try a different name.');
});
it('[C260164] Edit Folder - Unsupported characters', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
contentServicesPage.clickOnEditFolder();
editFolderDialog.checkFolderDialogIsDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
editFolderDialog.addFolderName('a*"<>\\/?:|');
expect(editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain these characters * " < > \\ / ? : |');
editFolderDialog.checkCreateUpdateBtnIsDisabled();
await editFolderDialog.addFolderName('a*"<>\\/?:|');
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain these characters * " < > \\ / ? : |');
await editFolderDialog.checkCreateUpdateBtnIsDisabled();
editFolderDialog.addFolderName('a.a');
editFolderDialog.checkValidationMessageIsNotDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName('a.a');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.addFolderName('a.');
expect(editFolderDialog.getValidationMessage()).toBe('Folder name can\'t end with a period .');
editFolderDialog.checkCreateUpdateBtnIsDisabled();
await editFolderDialog.addFolderName('a.');
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t end with a period .');
await editFolderDialog.checkCreateUpdateBtnIsDisabled();
editFolderDialog.getFolderNameField().clear();
editFolderDialog.getFolderNameField().sendKeys(protractor.Key.SPACE);
expect(editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain only spaces');
editFolderDialog.checkCreateUpdateBtnIsDisabled();
await BrowserActions.clearSendKeys(editFolderDialog.getFolderNameField(), protractor.Key.SPACE);
await expect(await editFolderDialog.getValidationMessage()).toBe('Folder name can\'t contain only spaces');
await editFolderDialog.checkCreateUpdateBtnIsDisabled();
editFolderDialog.addFolderName(editFolder.entry.name);
editFolderDialog.addFolderDescription('a*"<>\\/?:|');
editFolderDialog.checkValidationMessageIsNotDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderName(editFolder.entry.name);
await editFolderDialog.addFolderDescription('a*"<>\\/?:|');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.addFolderDescription('a.');
editFolderDialog.checkValidationMessageIsNotDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderDescription('a.');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.addFolderDescription('a.a');
editFolderDialog.checkValidationMessageIsNotDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.addFolderDescription('a.a');
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.getFolderDescriptionField().sendKeys(protractor.Key.SPACE);
editFolderDialog.checkValidationMessageIsNotDisplayed();
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.clickOnCancelButton();
editFolderDialog.checkFolderDialogIsNotDisplayed();
await editFolderDialog.getFolderDescriptionField().sendKeys(protractor.Key.SPACE);
await editFolderDialog.checkValidationMessageIsNotDisplayed();
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCancelButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
});
it('[C260166] Enable/Disable edit folder icon - when file selected', async () => {
expect(contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', filePdfNode.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', filePdfNode.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', filePdfNode.entry.name);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', filePdfNode.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', filePdfNode.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', filePdfNode.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
});
it('[C260166] Enable/Disable edit folder icon - when multiple folders selected', async () => {
contentServicesPage.clickMultiSelectToggle();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().checkAllRowsButtonIsDisplayed().checkAllRows();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().checkRowIsChecked('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsChecked('Display name', anotherFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', filePdfNode.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsNotChecked('Display name', filePdfNode.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkAllRowsButtonIsDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkAllRows();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsChecked('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsChecked('Display name', anotherFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', filePdfNode.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotChecked('Display name', filePdfNode.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
});
it('[C260166] Enable/Disable edit folder icon - when single folder selected', async () => {
expect(contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(true);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(true);
});
it('[C260165] Update folder name with non-existing one', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
contentServicesPage.clickOnEditFolder();
editFolderDialog.checkFolderDialogIsDisplayed();
editFolderDialog.addFolderName(updateFolderName);
editFolderDialog.checkCreateUpdateBtnIsEnabled();
editFolderDialog.clickOnCreateUpdateButton();
editFolderDialog.checkFolderDialogIsNotDisplayed();
contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', updateFolderName);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', editFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', editFolder.entry.name);
await contentServicesPage.clickOnEditFolder();
await editFolderDialog.checkFolderDialogIsDisplayed();
await editFolderDialog.addFolderName(updateFolderName);
await editFolderDialog.checkCreateUpdateBtnIsEnabled();
await editFolderDialog.clickOnCreateUpdateButton();
await editFolderDialog.checkFolderDialogIsNotDisplayed();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', updateFolderName);
});
describe('Edit Folder - no permission', () => {
beforeEach(async (done) => {
loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + editFolder.entry.id);
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
done();
beforeEach(async () => {
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 () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', subFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', subFolder.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', subFolder.entry.name);
expect(contentServicesPage.checkEditFolderButtonIsEnabled()).toBe(false);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', subFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', subFolder.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', subFolder.entry.name);
await expect(await contentServicesPage.isEditFolderButtonEnabled()).toBe(false);
});
});

View File

@@ -27,7 +27,7 @@ import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { CustomSources } from '../../pages/adf/demo-shell/customSourcesPage';
import { TrashcanPage } from '../../pages/adf/trashcanPage';
describe('Favorite directive', function () {
describe('Favorite directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
@@ -43,14 +43,14 @@ describe('Favorite directive', function () {
hostEcm: browser.params.testConfig.adf_acs.host
});
const pdfFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
let testFolder1, testFolder2, testFolder3, testFolder4, testFile;
beforeAll(async (done) => {
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.login(acsUser.id, acsUser.password);
@@ -62,161 +62,161 @@ describe('Favorite directive', function () {
testFile = await uploadActions.uploadFile(pdfFile.location, pdfFile.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
done();
await contentServicesPage.goToDocumentList();
});
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(testFolder1.entry.id);
await uploadActions.deleteFileOrFolder(testFolder2.entry.id);
await uploadActions.deleteFileOrFolder(testFolder3.entry.id);
await uploadActions.deleteFileOrFolder(testFolder4.entry.id);
done();
});
beforeEach(async (done) => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
done();
beforeEach(async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C260247] Should be able to mark a file as favorite', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsDisplayed(testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsDisplayed(testFile.entry.name);
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsNotMarkedFavorite();
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsNotMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
});
it('[C260249] Should be able to mark a folder as favorite', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsDisplayed(testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsDisplayed(testFolder1.entry.name);
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsNotMarkedFavorite();
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsNotDisplayed(testFolder1.entry.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsNotMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsNotDisplayed(testFolder1.entry.name);
});
it('[C260251] Should retain the restored file as favorite', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
contentListPage.rightClickOnRow(testFile.entry.name);
contentServicesPage.pressContextMenuActionNamed('Delete');
contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
await contentListPage.rightClickOnRow(testFile.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Delete');
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsNotDisplayed(testFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
expect(trashcanPage.numberOfResultsDisplayed()).toBe(1);
trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
trashcanPage.clickRestore();
trashcanPage.checkTrashcanIsEmpty();
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(1);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
await trashcanPage.clickRestore();
await trashcanPage.checkTrashcanIsEmpty();
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.checkIsMarkedFavorite();
customSourcesPage.navigateToCustomSources();
customSourcesPage.selectFavoritesSourceType();
customSourcesPage.checkRowIsDisplayed(testFile.entry.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.checkIsMarkedFavorite();
await customSourcesPage.navigateToCustomSources();
await customSourcesPage.selectFavoritesSourceType();
await customSourcesPage.checkRowIsDisplayed(testFile.entry.name);
});
it('[C260252] Should retain the moved file as favorite', async () => {
contentServicesPage.getContentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().checkContentIsDisplayed('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
contentServicesPage.getDocumentList().rightClickOnRow(testFile.entry.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(testFolder1.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(testFolder1.entry.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
contentServicesPage.doubleClickRow(testFolder1.entry.name);
contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(testFile.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(testFolder1.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(testFolder1.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await contentServicesPage.doubleClickRow(testFolder1.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().selectRow('Display name', testFile.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().selectRow('Display name', testFile.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFile.entry.name);
await contentServicesPage.checkIsMarkedFavorite();
});
it('[C217216] Should be able to mark and unmark multiple folders as favorite', async () => {
contentServicesPage.clickMultiSelectToggle();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder2.entry.name);
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(3);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder2.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(3);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsNotSelected('Display name', testFolder3.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsNotSelected('Display name', testFolder3.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(2);
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder4.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(3);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder4.entry.name);
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder4.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(3);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder1.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder2.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder4.entry.name);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsMarkedFavorite();
contentServicesPage.clickOnFavoriteButton();
contentServicesPage.checkIsNotMarkedFavorite();
contentServicesPage.getContentList().dataTablePage().checkAllRows();
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBeGreaterThanOrEqual(4);
contentServicesPage.getContentList().dataTablePage().uncheckAllRows();
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
await contentServicesPage.clickOnFavoriteButton();
await contentServicesPage.checkIsNotMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().checkAllRows();
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBeGreaterThanOrEqual(4);
await contentServicesPage.getDocumentList().dataTablePage().uncheckAllRows();
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(0);
contentServicesPage.getContentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
contentServicesPage.getContentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name);
expect(contentServicesPage.getContentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
contentServicesPage.checkIsMarkedFavorite();
await contentServicesPage.getDocumentList().dataTablePage().clickCheckbox('Display name', testFolder3.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().checkRowIsSelected('Display name', testFolder3.entry.name);
await expect(await contentServicesPage.getDocumentList().dataTablePage().getNumberOfSelectedRows()).toBe(1);
await contentServicesPage.checkIsMarkedFavorite();
});
});

View File

@@ -24,10 +24,10 @@ import { FileModel } from '../../models/ACS/fileModel';
import resources = require('../../util/resources');
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { TrashcanPage } from '../../pages/adf/trashcanPage';
import { LoginPage, NotificationHistoryPage, StringUtil, UploadActions } from '@alfresco/adf-testing';
import { LoginPage, NotificationHistoryPage, StringUtil, UploadActions, BrowserActions } from '@alfresco/adf-testing';
import { BreadCrumbPage } from '../../pages/adf/content-services/breadcrumb/breadCrumbPage';
describe('Restore content directive', function () {
describe('Restore content directive', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
@@ -44,18 +44,18 @@ describe('Restore content directive', function () {
});
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const folderName = StringUtil.generateRandomString(5);
@@ -64,7 +64,7 @@ describe('Restore content directive', function () {
let folderWithContent, folderWithFolder, subFolder, subFile, testFile, restoreFile, publicSite, siteFolder,
siteFile;
beforeAll(async (done) => {
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(anotherAcsUser);
@@ -79,171 +79,163 @@ describe('Restore content directive', function () {
restoreFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
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);
});
beforeEach(async (done) => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
beforeEach(async () => {
await BrowserActions.closeMenuAndDialogs();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
});
describe('Restore same name folders', function () {
describe('Restore same name folders', () => {
beforeAll(async (done) => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.deleteContent(folderName);
contentServicesPage.checkContentIsNotDisplayed(folderName);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
done();
beforeAll(async () => {
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.deleteContent(folderName);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
});
it('[C260227] Should validate when restoring Folders with same name', async () => {
await uploadActions.createFolder(folderName, '-my-');
navigationBarPage.clickContentServicesButton();
browser.refresh();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.deleteContent(folderName);
contentServicesPage.checkContentIsNotDisplayed(folderName);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
await navigationBarPage.clickContentServicesButton();
await browser.refresh();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.deleteContent(folderName);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
trashcanPage.getDocumentList().dataTablePage().checkAllRows();
trashcanPage.clickRestore();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
navigationBarPage.clickContentServicesButton();
contentServicesPage.getContentList().dataTablePage().waitTillContentLoaded();
contentServicesPage.checkContentIsDisplayed(folderName);
await trashcanPage.getDocumentList().dataTablePage().checkAllRows();
await trashcanPage.clickRestore();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderName);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
await contentServicesPage.checkContentIsDisplayed(folderName);
notificationHistoryPage.checkNotifyContains('Can\'t restore, ' + folderName + ' item already exists');
await notificationHistoryPage.checkNotifyContains('Can\'t restore, ' + folderName + ' item already exists');
});
});
it('[C260238] Should restore a file', async () => {
contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
contentServicesPage.deleteContent(testFile.entry.name);
contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
trashcanPage.clickRestore();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(testFile.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
await contentServicesPage.deleteContent(testFile.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(testFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(testFile.entry.name);
await trashcanPage.clickRestore();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(testFile.entry.name);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
contentServicesPage.deleteContent(testFile.entry.name);
contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFile.entry.name);
notificationHistoryPage.checkNotifyContains(testFile.entry.name + ' item restored');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(testFile.entry.name);
await contentServicesPage.deleteContent(testFile.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(testFile.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(testFile.entry.name);
await notificationHistoryPage.checkNotifyContains(testFile.entry.name + ' item restored');
});
it('[C260239] Should restore folder with content', async () => {
contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name);
contentServicesPage.deleteContent(folderWithContent.entry.name);
contentServicesPage.checkContentIsNotDisplayed(folderWithContent.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().clickRowByContent(folderWithContent.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithContent.entry.name);
trashcanPage.clickRestore();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(folderWithContent.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name);
await contentServicesPage.deleteContent(folderWithContent.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(folderWithContent.entry.name);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(folderWithContent.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithContent.entry.name);
await trashcanPage.clickRestore();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsNotDisplayed(folderWithContent.entry.name);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name);
contentServicesPage.getContentList().dataTablePage().doubleClickRow('Display name', folderWithContent.entry.name);
contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
notificationHistoryPage.checkNotifyContains(folderWithContent.entry.name + ' item restored');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderWithContent.entry.name);
await contentServicesPage.getDocumentList().dataTablePage().doubleClickRow('Display name', folderWithContent.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
await notificationHistoryPage.checkNotifyContains(folderWithContent.entry.name + ' item restored');
});
it('[C260240] Should validate restore when the original location no longer exists', async () => {
contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
contentServicesPage.doubleClickRow(folderWithFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.deleteContent(subFolder.entry.name);
contentServicesPage.checkContentIsNotDisplayed(subFolder.entry.name);
breadCrumbPage.chooseBreadCrumb(acsUser.id);
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
contentServicesPage.deleteContent(folderWithFolder.entry.name);
contentServicesPage.checkContentIsNotDisplayed(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.doubleClickRow(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.deleteContent(subFolder.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(subFolder.entry.name);
await breadCrumbPage.chooseBreadCrumb(acsUser.id);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.deleteContent(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(folderWithFolder.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContent(subFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
trashcanPage.clickRestore();
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(subFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderWithFolder.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithFolder.entry.name);
trashcanPage.clickRestore();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
contentServicesPage.doubleClickRow(folderWithFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationIsPresent('Can\'t restore ' + subFolder.entry.name + ' item, the original location no longer exists');
notificationHistoryPage.checkNotificationIsPresent('Restore successful');
notificationHistoryPage.clickMarkAsRead();
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContent(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
await trashcanPage.clickRestore();
await notificationHistoryPage.checkNotifyContains(`Can't restore ${subFolder.entry.name} item, the original location no longer exists`);
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(folderWithFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderWithFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderWithFolder.entry.name);
await trashcanPage.clickRestore();
await notificationHistoryPage.checkNotifyContains('Restore successful');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(folderWithFolder.entry.name);
await contentServicesPage.doubleClickRow(folderWithFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
});
it('[C260241] Should display restore icon both for file and folder', async () => {
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.checkContentIsDisplayed(restoreFile.entry.name);
contentServicesPage.deleteContent(folderName);
contentServicesPage.deleteContent(restoreFile.entry.name);
contentServicesPage.checkContentIsNotDisplayed(folderName);
contentServicesPage.checkContentIsNotDisplayed(restoreFile.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.checkContentIsDisplayed(restoreFile.entry.name);
await contentServicesPage.deleteContent(folderName);
await contentServicesPage.deleteContent(restoreFile.entry.name);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
await contentServicesPage.checkContentIsNotDisplayed(restoreFile.entry.name);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
trashcanPage.checkRestoreButtonIsNotDisplayed();
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderName);
trashcanPage.checkRestoreButtonIsDisplayed();
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsNotSelected(folderName);
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.checkRestoreButtonIsNotDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderName);
await trashcanPage.checkRestoreButtonIsDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsNotSelected(folderName);
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(restoreFile.entry.name);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(restoreFile.entry.name);
trashcanPage.checkRestoreButtonIsDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(restoreFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(restoreFile.entry.name);
await trashcanPage.checkRestoreButtonIsDisplayed();
trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderName);
trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(restoreFile.entry.name);
trashcanPage.checkRestoreButtonIsDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(folderName);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(folderName);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(restoreFile.entry.name);
await trashcanPage.checkRestoreButtonIsDisplayed();
});
describe('Restore deleted library', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const publicSiteName = `00${StringUtil.generateRandomString(5)}`;
const publicSiteBody = { visibility: 'PUBLIC', title: publicSiteName };
@@ -251,25 +243,31 @@ describe('Restore content directive', function () {
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();
});
afterAll(async () => {
try {
await this.alfrescoJsApi.core.sitesApi.deleteSite(publicSite.entry.id);
} catch (error) {
}
});
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();
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.getDocumentList().dataTablePage().checkRowContentIsDisplayed(publicSite.entry.id);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(publicSite.entry.id);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(publicSite.entry.id);
await 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');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.selectSite(publicSite.entry.title);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(siteFolder.entry.name);
await contentServicesPage.doubleClickRow(siteFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(siteFile.entry.name);
await notificationHistoryPage.checkNotifyContains(publicSite.entry.id + ' item restored');
});
});
@@ -278,7 +276,7 @@ describe('Restore content directive', function () {
let parentFolder, folderWithin, pdfFile, pngFile, mainFile, mainFolder;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(anotherAcsUser.id, anotherAcsUser.password);
await uploadActions.createFolder(folderName, '-my-');
parentFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
@@ -289,45 +287,43 @@ describe('Restore content directive', function () {
mainFolder = await uploadActions.createFolder(StringUtil.generateRandomString(5), '-my-');
await loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.waitForTableBody();
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
});
afterAll(async (done) => {
afterAll(async () => {
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);
await contentServicesPage.deleteContent(parentFolder.entry.name);
await contentServicesPage.deleteContent(mainFolder.entry.name);
await 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();
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
await trashcanPage.checkRestoreButtonIsNotDisplayed();
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(parentFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(parentFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFolder.entry.name);
await trashcanPage.getDocumentList().dataTablePage().clickRowByContentCheckbox(mainFile.entry.name);
await trashcanPage.getDocumentList().dataTablePage().checkRowByContentIsSelected(mainFile.entry.name);
await 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);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(parentFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(mainFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(mainFile.entry.name);
await contentServicesPage.doubleClickRow(parentFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderWithin.entry.name);
await contentServicesPage.doubleClickRow(folderWithin.entry.name);
await contentServicesPage.checkContentIsDisplayed(pdfFile.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.entry.name);
});
});

View File

@@ -16,7 +16,13 @@
*/
import { browser, by, element } from 'protractor';
import { LoginPage, PaginationPage, UploadActions, StringUtil, ContentNodeSelectorDialogPage } from '@alfresco/adf-testing';
import {
LoginPage,
PaginationPage,
UploadActions,
StringUtil,
ContentNodeSelectorDialogPage
} from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
@@ -56,12 +62,12 @@ describe('Document List Component - Actions', () => {
const nrOfFiles = 5;
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const files = {
@@ -69,7 +75,7 @@ describe('Document List Component - Actions', () => {
extension: '.txt'
};
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
folderName = `TATSUMAKY_${StringUtil.generateRandomString(5)}_SENPOUKYAKU`;
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -85,150 +91,150 @@ describe('Document List Component - Actions', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
browser.driver.sleep(12000);
done();
await browser.sleep(10000);
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach(async(done) => {
beforeEach(async () => {
await navigationBarPage.clickContentServicesButton();
done();
});
describe('File Actions', () => {
it('[C213257] Should be able to copy a file', () => {
contentServicesPage.checkContentIsDisplayed(pdfUploadedNode.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.clickContentNodeSelectorResult(folderName);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
it('[C213257] Should be able to copy a file', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfUploadedNode.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
});
it('[C260131] Copy - Destination picker search', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
it('[C260131] Copy - Destination picker search', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
});
it('[C297491] Should be able to move a file', () => {
contentServicesPage.checkContentIsDisplayed(testFileModel.name);
it('[C297491] Should be able to move a file', async () => {
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(testFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.clickContentNodeSelectorResult(folderName);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed(testFileModel.name);
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(testFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(testFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(testFileModel.name);
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
});
it('[C260127] Move - Destination picker search', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
it('[C260127] Move - Destination picker search', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.contentListPage().dataTablePage().checkCellByHighlightContent(folderName);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
});
it('[C280561] Should be able to delete a file via dropdown menu', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
it('[C280561] Should be able to delete a file via dropdown menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(fileNames[0]);
contentServicesPage.deleteContent(fileNames[0]);
contentServicesPage.checkContentIsNotDisplayed(fileNames[0]);
await contentServicesPage.checkContentIsDisplayed(fileNames[0]);
await contentServicesPage.deleteContent(fileNames[0]);
await contentServicesPage.checkContentIsNotDisplayed(fileNames[0]);
});
it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
it('[C280562] Only one file is deleted when multiple files are selected using dropdown menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentListPage.selectRow(fileNames[1]);
contentListPage.selectRow(fileNames[2]);
contentServicesPage.deleteContent(fileNames[1]);
contentServicesPage.checkContentIsNotDisplayed(fileNames[1]);
contentServicesPage.checkContentIsDisplayed(fileNames[2]);
await contentServicesPage.getDocumentList().selectRow(fileNames[1]);
await contentServicesPage.getDocumentList().selectRow(fileNames[2]);
await contentServicesPage.deleteContent(fileNames[1]);
await contentServicesPage.checkContentIsNotDisplayed(fileNames[1]);
await contentServicesPage.checkContentIsDisplayed(fileNames[2]);
});
it('[C280565] Should be able to delete a file using context menu', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentListPage.rightClickOnRow(fileNames[2]);
contentServicesPage.pressContextMenuActionNamed('Delete');
contentServicesPage.checkContentIsNotDisplayed(fileNames[2]);
it('[C280565] Should be able to delete a file using context menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(fileNames[2]);
await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[2]);
await contentServicesPage.pressContextMenuActionNamed('Delete');
await contentServicesPage.checkContentIsNotDisplayed(fileNames[2]);
});
it('[C280567] Only one file is deleted when multiple files are selected using context menu', () => {
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
it('[C280567] Only one file is deleted when multiple files are selected using context menu', async () => {
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentListPage.selectRow(fileNames[3]);
contentListPage.selectRow(fileNames[4]);
contentListPage.rightClickOnRow(fileNames[3]);
contentServicesPage.pressContextMenuActionNamed('Delete');
contentServicesPage.checkContentIsNotDisplayed(fileNames[3]);
contentServicesPage.checkContentIsDisplayed(fileNames[4]);
await contentServicesPage.getDocumentList().selectRow(fileNames[3]);
await contentServicesPage.getDocumentList().selectRow(fileNames[4]);
await contentServicesPage.getDocumentList().rightClickOnRow(fileNames[3]);
await contentServicesPage.pressContextMenuActionNamed('Delete');
await contentServicesPage.checkContentIsNotDisplayed(fileNames[3]);
await contentServicesPage.checkContentIsDisplayed(fileNames[4]);
});
it('[C280566] Should be able to open context menu with right click', () => {
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.checkContextActionIsVisible('Download');
contentServicesPage.checkContextActionIsVisible('Copy');
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.checkContextActionIsVisible('Delete');
contentServicesPage.checkContextActionIsVisible('Info');
contentServicesPage.checkContextActionIsVisible('Manage versions');
contentServicesPage.checkContextActionIsVisible('Permission');
contentServicesPage.checkContextActionIsVisible('Lock');
contentServicesPage.closeActionContext();
it('[C280566] Should be able to open context menu with right click', async () => {
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.checkContextActionIsVisible('Download');
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.checkContextActionIsVisible('Delete');
await contentServicesPage.checkContextActionIsVisible('Info');
await contentServicesPage.checkContextActionIsVisible('Manage versions');
await contentServicesPage.checkContextActionIsVisible('Permission');
await contentServicesPage.checkContextActionIsVisible('Lock');
await contentServicesPage.closeActionContext();
});
});
describe('Folder Actions', () => {
it('[C260138] Should be able to copy a folder', () => {
contentServicesPage.copyContent(folderName);
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(secondUploadedFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(secondUploadedFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.doubleClickRow(secondUploadedFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(folderName);
it('[C260138] Should be able to copy a folder', async () => {
await contentServicesPage.copyContent(folderName);
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(secondUploadedFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(secondUploadedFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.doubleClickRow(secondUploadedFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(folderName);
});
it('[C260123] Should be able to delete a folder using context menu', () => {
contentServicesPage.deleteContent(folderName);
contentServicesPage.checkContentIsNotDisplayed(folderName);
it('[C260123] Should be able to delete a folder using context menu', async () => {
await contentServicesPage.deleteContent(folderName);
await contentServicesPage.checkContentIsNotDisplayed(folderName);
});
it('[C280568] Should be able to open context menu with right click', () => {
contentServicesPage.checkContentIsDisplayed(secondUploadedFolder.entry.name);
it('[C280568] Should be able to open context menu with right click', async () => {
await contentServicesPage.checkContentIsDisplayed(secondUploadedFolder.entry.name);
contentListPage.rightClickOnRow(secondUploadedFolder.entry.name);
contentServicesPage.checkContextActionIsVisible('Download');
contentServicesPage.checkContextActionIsVisible('Copy');
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.checkContextActionIsVisible('Delete');
contentServicesPage.checkContextActionIsVisible('Info');
contentServicesPage.checkContextActionIsVisible('Permission');
await contentServicesPage.getDocumentList().rightClickOnRow(secondUploadedFolder.entry.name);
await contentServicesPage.checkContextActionIsVisible('Download');
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.checkContextActionIsVisible('Delete');
await contentServicesPage.checkContextActionIsVisible('Info');
await contentServicesPage.checkContextActionIsVisible('Permission');
});
});
@@ -236,19 +242,19 @@ describe('Document List Component - Actions', () => {
describe('Folder Actions - Copy and Move', () => {
const folderModel1 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel2 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel3 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel4 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel5 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel6 = new FolderModel({'name': StringUtil.generateRandomString()});
const folderModel1 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel2 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel3 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel4 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel5 = new FolderModel({ name: StringUtil.generateRandomString() });
const folderModel6 = new FolderModel({ name: StringUtil.generateRandomString() });
let folder1, folder2, folder3, folder4, folder5, folder6;
let folders;
const contentServicesUser = new AcsUserModel();
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(contentServicesUser);
@@ -260,118 +266,117 @@ describe('Document List Component - Actions', () => {
folder5 = await uploadActions.createFolder('E' + folderModel5.name, '-my-');
folder6 = await uploadActions.createFolder('F' + folderModel6.name, '-my-');
folders = [folder1, folder2, folder3, folder4, folder5, folder6];
done();
});
beforeEach(async (done) => {
loginPage.loginToContentServicesUsingUserModel(contentServicesUser);
contentServicesPage.goToDocumentList();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage('5');
contentServicesPage.checkAcsContainer();
contentListPage.waitForTableBody();
done();
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(contentServicesUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage('5');
await contentServicesPage.checkAcsContainer();
await contentListPage.waitForTableBody();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await folders.forEach(function (folder) {
uploadActions.deleteFileOrFolder(folder.entry.id);
});
done();
});
it('[C260132] Move action on folder with - Load more', () => {
expect(paginationPage.getCurrentItemsPerPage()).toEqual('5');
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
expect(contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
contentNodeSelector.checkSearchInputIsDisplayed();
expect(contentNodeSelector.getSearchLabel()).toBe('Search');
contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
contentNodeSelector.checkCancelButtonIsDisplayed();
contentNodeSelector.checkMoveCopyButtonIsDisplayed();
expect(contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE');
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
infinitePaginationPage.clickLoadMoreButton();
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
infinitePaginationPage.clickLoadMoreButton();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
contentServicesPage.doubleClickRow('F' + folderModel6.name);
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Move');
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
breadCrumbDropdownPage.clickParentFolder();
breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed();
breadCrumbDropdownPage.choosePath(contentServicesUser.id);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
breadCrumbPage.chooseBreadCrumb(contentServicesUser.id);
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
for (const folder of folders) {
await uploadActions.deleteFileOrFolder(folder.entry.id);
}
});
it('[C305051] Copy action on folder with - Load more', () => {
it('[C260132] Move action on folder with - Load more', async () => {
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Move \'' + 'A' + folderModel1.name + '\' to...');
await contentNodeSelector.checkSearchInputIsDisplayed();
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
await contentNodeSelector.checkCancelButtonIsDisplayed();
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('MOVE');
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
expect(paginationPage.getCurrentItemsPerPage()).toEqual('5');
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Copy');
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
expect(contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...');
contentNodeSelector.checkSearchInputIsDisplayed();
expect(contentNodeSelector.getSearchLabel()).toBe('Search');
contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
contentNodeSelector.checkCancelButtonIsDisplayed();
contentNodeSelector.checkMoveCopyButtonIsDisplayed();
expect(contentNodeSelector.getMoveCopyButtonText()).toBe('COPY');
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
infinitePaginationPage.clickLoadMoreButton();
expect(contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickCancelButton();
contentNodeSelector.checkDialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await infinitePaginationPage.clickLoadMoreButton();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
await contentServicesPage.doubleClickRow('F' + folderModel6.name);
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
contentListPage.rightClickOnRow('A' + folderModel1.name);
contentServicesPage.checkContextActionIsVisible('Copy');
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
infinitePaginationPage.clickLoadMoreButton();
contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
paginationPage.clickOnNextPage();
contentListPage.waitForTableBody();
contentServicesPage.doubleClickRow('F' + folderModel6.name);
contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await breadCrumbDropdownPage.clickParentFolder();
await breadCrumbDropdownPage.checkBreadCrumbDropdownIsDisplayed();
await breadCrumbDropdownPage.choosePath(contentServicesUser.id);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed('A' + folderModel1.name);
await breadCrumbPage.chooseBreadCrumb(contentServicesUser.id);
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});
it('[C305051] Copy action on folder with - Load more', async () => {
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual('5');
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + 5 + ' of ' + 6);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await expect(await contentNodeSelector.getDialogHeaderText()).toBe('Copy \'' + 'A' + folderModel1.name + '\' to...');
await contentNodeSelector.checkSearchInputIsDisplayed();
await expect(await contentNodeSelector.getSearchLabel()).toBe('Search');
await contentNodeSelector.checkSelectedSiteIsDisplayed('My files');
await contentNodeSelector.checkCancelButtonIsDisplayed();
await contentNodeSelector.checkMoveCopyButtonIsDisplayed();
await expect(await contentNodeSelector.getMoveCopyButtonText()).toBe('COPY');
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(5);
await infinitePaginationPage.clickLoadMoreButton();
await expect(await contentNodeSelector.numberOfResultsDisplayed()).toBe(6);
await infinitePaginationPage.checkLoadMoreButtonIsNotDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickCancelButton();
await contentNodeSelector.checkDialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await contentServicesPage.getDocumentList().rightClickOnRow('A' + folderModel1.name);
await contentServicesPage.checkContextActionIsVisible('Copy');
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await infinitePaginationPage.clickLoadMoreButton();
await contentNodeSelector.contentListPage().dataTablePage().selectRowByContent('F' + folderModel6.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected('F' + folderModel6.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
await paginationPage.clickOnNextPage();
await contentServicesPage.getDocumentList().waitForTableBody();
await contentServicesPage.doubleClickRow('F' + folderModel6.name);
await contentServicesPage.checkContentIsDisplayed('A' + folderModel1.name);
});

View File

@@ -38,7 +38,7 @@ describe('Document List Component', () => {
let acsUser = null;
let testFileNode, pdfBFileNode;
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (uploadedFolder) {
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
@@ -56,32 +56,32 @@ describe('Document List Component', () => {
await uploadActions.deleteFileOrFolder(pdfBFileNode.entry.id);
pdfBFileNode = null;
}
done();
});
describe('Custom Column', () => {
let folderName;
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const docxFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
name: resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const timeAgoFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const mediumFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location
name: resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF_B.file_location
});
let pdfUploadedNode, docxUploadedNode, timeAgoUploadedNode, mediumDateUploadedNode;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
@@ -96,10 +96,10 @@ 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-');
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (pdfUploadedNode) {
@@ -114,71 +114,71 @@ describe('Document List Component', () => {
if (mediumDateUploadedNode) {
await uploadActions.deleteFileOrFolder(mediumDateUploadedNode.entry.id);
}
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
it('[C279926] Should only display the user\'s files and folders', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(folderName);
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
expect(contentServicesPage.getDocumentListRowNumber()).toBe(4);
it('[C279926] Should only display the user\'s files and folders', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await expect(await contentServicesPage.getDocumentListRowNumber()).toBe(4);
});
it('[C279927] Should display default columns', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkColumnNameHeader();
contentServicesPage.checkColumnSizeHeader();
contentServicesPage.checkColumnCreatedByHeader();
contentServicesPage.checkColumnCreatedHeader();
it('[C279927] Should display default columns', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkColumnNameHeader();
await contentServicesPage.checkColumnSizeHeader();
await contentServicesPage.checkColumnCreatedByHeader();
await contentServicesPage.checkColumnCreatedHeader();
});
it('[C279928] Should be able to display date with timeAgo', async (done) => {
it('[C279928] Should be able to display date with timeAgo', async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
timeAgoUploadedNode = await uploadActions.uploadFile(timeAgoFileModel.location, timeAgoFileModel.name, '-my-');
contentServicesPage.goToDocumentList();
const dateValue = contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created');
expect(dateValue).toMatch(/(ago|few)/);
done();
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 (done) => {
it('[C279929] Should be able to display the date with date type', async () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
mediumDateUploadedNode = await uploadActions.uploadFile(mediumFileModel.location, mediumFileModel.name, '-my-');
const createdDate = moment(mediumDateUploadedNode.createdAt).format('ll');
contentServicesPage.goToDocumentList();
contentServicesPage.enableMediumTimeFormat();
const dateValue = contentServicesPage.getColumnValueForRow(mediumFileModel.name, 'Created');
expect(dateValue).toContain(createdDate);
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.enableMediumTimeFormat();
const dateValue = await contentServicesPage.getColumnValueForRow(mediumFileModel.name, 'Created');
await expect(dateValue).toContain(createdDate);
});
});
describe('Column Sorting', () => {
const fakeFileA = new FileModel({
'name': 'A',
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: 'A',
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const fakeFileB = new FileModel({
'name': 'B',
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: 'B',
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const fakeFileC = new FileModel({
'name': 'C',
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: 'C',
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
let fileANode, fileBNode, fileCNode;
beforeAll(async (done) => {
beforeAll(async () => {
const user = new AcsUserModel();
@@ -192,12 +192,11 @@ describe('Document List Component', () => {
fileCNode = await uploadActions.uploadFile(fakeFileC.location, fakeFileC.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(user);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (fileANode) {
await uploadActions.deleteFileOrFolder(fileANode.entry.id);
@@ -208,53 +207,53 @@ describe('Document List Component', () => {
if (fileCNode) {
await uploadActions.deleteFileOrFolder(fileCNode.entry.id);
}
done();
});
it('[C260112] Should be able to sort by name (Ascending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByName('asc')).toBe(true, 'List is not sorted.');
it('[C260112] Should be able to sort by name (Ascending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByName('asc')).toBe(true, 'List is not sorted.');
});
it('[C272770] Should be able to sort by name (Descending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByName('desc')).toBe(true, 'List is not sorted.');
it('[C272770] Should be able to sort by name (Descending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByName('desc')).toBe(true, 'List is not sorted.');
});
it('[C272771] Should be able to sort by author (Ascending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByAuthor('asc')).toBe(true, 'List is not sorted.');
it('[C272771] Should be able to sort by author (Ascending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByAuthor('asc')).toBe(true, 'List is not sorted.');
});
it('[C272772] Should be able to sort by author (Descending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByAuthor('desc')).toBe(true, 'List is not sorted.');
it('[C272772] Should be able to sort by author (Descending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByAuthor('desc')).toBe(true, 'List is not sorted.');
});
it('[C272773] Should be able to sort by date (Ascending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByCreated('asc')).toBe(true, 'List is not sorted.');
it('[C272773] Should be able to sort by date (Ascending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByCreated('asc')).toBe(true, 'List is not sorted.');
});
it('[C272774] Should be able to sort by date (Descending)', () => {
expect(contentServicesPage.sortAndCheckListIsOrderedByCreated('desc')).toBe(true, 'List is not sorted.');
it('[C272774] Should be able to sort by date (Descending)', async () => {
await expect(await contentServicesPage.sortAndCheckListIsOrderedByCreated('desc')).toBe(true, 'List is not sorted.');
});
});
it('[C279959] Should display empty folder state for new folders', async (done) => {
it('[C279959] Should display empty folder state for new folders', async () => {
acsUser = new AcsUserModel();
const folderName = 'BANANA';
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.createNewFolder(folderName);
contentServicesPage.doubleClickRow(folderName);
contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
contentServicesPage.checkEmptyFolderImageUrlToContain('/assets/images/empty_doc_lib.svg');
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.createNewFolder(folderName);
await contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
await contentServicesPage.checkEmptyFolderImageUrlToContain('/assets/images/empty_doc_lib.svg');
});
it('[C272775] Should be able to upload a file in new folder', async (done) => {
it('[C272775] Should be able to upload a file in new folder', async () => {
const testFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
acsUser = new AcsUserModel();
/* cspell:disable-next-line */
@@ -264,30 +263,30 @@ describe('Document List Component', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name);
contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
contentServicesPage.uploadFile(testFile.location);
contentServicesPage.checkContentIsDisplayed(testFile.name);
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(uploadedFolder.entry.name);
await contentServicesPage.doubleClickRow(uploadedFolder.entry.name);
await contentServicesPage.uploadFile(testFile.location);
await contentServicesPage.checkContentIsDisplayed(testFile.name);
});
it('[C261997] Should be able to clean Recent Files history', async (done) => {
it('[C261997] Should be able to clean Recent Files history', async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.clickOnContentServices();
contentServicesPage.checkRecentFileToBeShowed();
await contentServicesPage.clickOnContentServices();
await contentServicesPage.checkRecentFileToBeShowed();
const icon = await contentServicesPage.getRecentFileIcon();
expect(icon).toBe('history');
contentServicesPage.expandRecentFiles();
contentServicesPage.checkEmptyRecentFileIsDisplayed();
contentServicesPage.closeRecentFiles();
done();
await expect(icon).toBe('history');
await contentServicesPage.expandRecentFiles();
await contentServicesPage.checkEmptyRecentFileIsDisplayed();
await contentServicesPage.closeRecentFiles();
});
it('[C279970] Should display Islocked field for folders', async (done) => {
it('[C279970] Should display Islocked field for folders', async () => {
acsUser = new AcsUserModel();
const folderNameA = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
const folderNameB = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
@@ -297,22 +296,22 @@ describe('Document List Component', () => {
uploadedFolder = await uploadActions.createFolder(folderNameA, '-my-');
uploadedFolderExtra = await uploadActions.createFolder(folderNameB, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(folderNameA);
contentServicesPage.checkContentIsDisplayed(folderNameB);
contentServicesPage.checkLockIsDisplayedForElement(folderNameA);
contentServicesPage.checkLockIsDisplayedForElement(folderNameB);
done();
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 (done) => {
it('[C269086] Should display Islocked field for files', async () => {
const testFileA = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const testFileB = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location
name: resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF_B.file_location
});
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -321,19 +320,19 @@ describe('Document List Component', () => {
testFileNode = await uploadActions.uploadFile(testFileA.location, testFileA.name, '-my-');
pdfBFileNode = await uploadActions.uploadFile(testFileB.location, testFileB.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(testFileA.name);
contentServicesPage.checkContentIsDisplayed(testFileB.name);
contentServicesPage.checkLockIsDisplayedForElement(testFileA.name);
contentServicesPage.checkLockIsDisplayedForElement(testFileB.name);
done();
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', () => {
let folderCreated;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
folderCreated = [];
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -346,22 +345,19 @@ describe('Document List Component', () => {
folder = await uploadActions.createFolder(folderName, '-my-');
folderCreated.push(folder);
}
done();
});
afterAll(async (done) => {
Promise.all(folderCreated.map((folder) =>
uploadActions.deleteFileOrFolder(folder.entry.id)
)).then(() => {
done();
});
afterAll(async () => {
for (let i = 0; i <= folderCreated.length; i++) {
await uploadActions.deleteFileOrFolder(folderCreated[i].entry.id);
}
});
it('[C277093] Should sort files with Items per page set to default', async (done) => {
it('[C277093] Should sort files with Items per page set to default', async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkListIsSortedByNameColumn('asc');
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkListIsSortedByNameColumn('asc');
});
});
@@ -369,14 +365,14 @@ describe('Document List Component', () => {
describe('Column Template', () => {
const file0BytesModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
name: resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
let file;
const viewer = new ViewerPage();
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -384,16 +380,16 @@ describe('Document List Component', () => {
file = await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList()
.waitForTableBody();
done();
await contentServicesPage.goToDocumentList();
await contentServicesPage.waitForTableBody();
});
it('[C291843] Should be able to navigate using nodes hyperlink when activated', () => {
contentServicesPage.clickHyperlinkNavigationToggle()
.checkFileHyperlinkIsEnabled(file.entry.name)
.clickFileHyperlink(file.entry.name);
viewer.checkFileIsLoaded();
it('[C291843] Should be able to navigate using nodes hyperlink when activated', async () => {
await contentServicesPage.clickHyperlinkNavigationToggle();
await contentServicesPage.checkFileHyperlinkIsEnabled(file.entry.name);
await contentServicesPage.clickFileHyperlink(file.entry.name);
await viewer.checkFileIsLoaded();
});
});
});

View File

@@ -50,16 +50,16 @@ describe('Document List Component', () => {
let folderName, sameNameFolder;
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
anotherAcsUser = new AcsUserModel();
folderName = StringUtil.generateRandomString(5);
@@ -90,131 +90,129 @@ describe('Document List Component', () => {
}
});
browser.driver.sleep(12000);
done();
await browser.driver.sleep(12000);
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
try {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
await uploadActions.deleteFileOrFolder(uploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(sourceFolder.entry.id);
await uploadActions.deleteFileOrFolder(destinationFolder.entry.id);
} catch (error) {
// tslint:disable-next-line:no-console
console.log('Error delete file or folder' + error);
}
done();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
await uploadActions.deleteFileOrFolder(uploadedFile.entry.id);
await uploadActions.deleteFileOrFolder(sourceFolder.entry.id);
await uploadActions.deleteFileOrFolder(destinationFolder.entry.id);
});
describe('Document List Component - Actions Move and Copy', () => {
beforeEach(async (done) => {
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
done();
});
it('[C260128] Move - Same name file', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.clickContentNodeSelectorResult(folderName);
contentNodeSelector.clickMoveCopyButton();
notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
beforeEach(async () => {
await BrowserActions.closeMenuAndDialogs();
await navigationBarPage.clickContentServicesButton();
});
it('[C260134] Move - folder with subfolder and file within it', () => {
contentServicesPage.checkContentIsDisplayed(destinationFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(sourceFolder.entry.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(destinationFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
contentServicesPage.checkContentIsNotDisplayed(sourceFolder.entry.name);
contentServicesPage.doubleClickRow(destinationFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
contentServicesPage.doubleClickRow(sourceFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.doubleClickRow(subFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
it('[C260128] Move - Same name file', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
it('[C260135] Move - Same name folder', () => {
contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
contentServicesPage.pressContextMenuActionNamed('Move');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
it('[C260134] Move - folder with subfolder and file within it', async () => {
await contentServicesPage.checkContentIsDisplayed(destinationFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(sourceFolder.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(destinationFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(destinationFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await contentServicesPage.checkContentIsNotDisplayed(sourceFolder.entry.name);
await contentServicesPage.doubleClickRow(destinationFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(sourceFolder.entry.name);
await contentServicesPage.doubleClickRow(sourceFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(subFile.entry.name);
});
it('[C260129] Copy - Same name file', () => {
contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
contentNodeSelector.clickContentNodeSelectorResult(folderName);
contentNodeSelector.clickMoveCopyButton();
notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
it('[C260135] Move - Same name folder', async () => {
await contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Move');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
it('[C260136] Copy - Same name folder', () => {
contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
contentNodeSelector.clickMoveCopyButton();
notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
it('[C260129] Copy - Same name file', async () => {
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.getDocumentList().rightClickOnRow(pdfFileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(folderName);
await contentNodeSelector.clickContentNodeSelectorResult(folderName);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
it('[C260136] Copy - Same name folder', async () => {
await contentServicesPage.checkContentIsDisplayed(duplicateFolderName.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(duplicateFolderName.entry.name);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.typeIntoNodeSelectorSearchField(sourceFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(sourceFolder.entry.name);
await contentNodeSelector.clickMoveCopyButton();
await notificationHistoryPage.checkNotifyContains('This name is already in use, try a different name.');
});
});
describe('Document List actionns - Move, Copy on no permission folder', () => {
beforeAll((done) => {
loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + sourceFolder.entry.id);
contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
done();
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(anotherAcsUser);
await BrowserActions.getUrl(`${browser.params.testConfig.adf.url}/files/${sourceFolder.entry.id}`);
await contentServicesPage.getDocumentList().dataTablePage().waitTillContentLoaded();
});
it('[C260133] Move - no permission folder', () => {
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(subFolder.entry.name);
contentServicesPage.checkContextActionIsVisible('Move');
expect(contentServicesPage.checkContentActionIsEnabled('Move')).toBe(false);
contentServicesPage.closeActionContext();
it('[C260133] Move - no permission folder', async () => {
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(subFolder.entry.name);
await contentServicesPage.checkContextActionIsVisible('Move');
await expect(await contentServicesPage.isContextActionEnabled('Move')).toBe(false);
await contentServicesPage.closeActionContext();
});
it('[C260140] Copy - No permission folder', () => {
contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(copyFolder.entry.name);
contentServicesPage.getDocumentList().rightClickOnRow(copyFolder.entry.name);
contentServicesPage.checkContextActionIsVisible('Copy');
expect(contentServicesPage.checkContentActionIsEnabled('Copy')).toBe(true);
contentServicesPage.pressContextMenuActionNamed('Copy');
contentNodeSelector.checkDialogIsDisplayed();
contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisabled(subFolder.entry.name);
contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name);
contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
expect(contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
contentNodeSelector.contentListPage().dataTablePage().doubleClickRowByContent(subFolder.entry.name);
contentNodeSelector.contentListPage().dataTablePage().waitTillContentLoaded();
contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder2.entry.name);
it('[C260140] Copy - No permission folder', async () => {
await contentServicesPage.checkContentIsDisplayed(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(copyFolder.entry.name);
await contentServicesPage.getDocumentList().rightClickOnRow(copyFolder.entry.name);
await contentServicesPage.checkContextActionIsVisible('Copy');
await expect(await contentServicesPage.isContextActionEnabled('Copy')).toBe(true);
await contentServicesPage.pressContextMenuActionNamed('Copy');
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder.entry.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisabled(subFolder.entry.name);
await contentNodeSelector.clickContentNodeSelectorResult(subFolder.entry.name);
await contentNodeSelector.contentListPage().dataTablePage().checkRowByContentIsSelected(subFolder.entry.name);
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
await contentNodeSelector.contentListPage().dataTablePage().doubleClickRowByContent(subFolder.entry.name);
await contentNodeSelector.contentListPage().dataTablePage().waitTillContentLoaded();
await contentNodeSelector.contentListPage().dataTablePage().checkRowContentIsDisplayed(subFolder2.entry.name);
});
});

View File

@@ -34,7 +34,6 @@ describe('Document List Component', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
let acsUser = null;
const navBar = new NavigationBarPage();
const navigationBarPage = new NavigationBarPage();
describe('Gallery View', () => {
@@ -50,23 +49,23 @@ describe('Document List Component', () => {
let funnyUser;
const pdfFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const docxFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
name: resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
let filePdfNode, fileTestNode, fileDocxNode, folderNode, filePDFSubNode;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
funnyUser = await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -79,7 +78,6 @@ describe('Document List Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async () => {
@@ -87,92 +85,94 @@ describe('Document List Component', () => {
});
beforeEach(async () => {
navBar.clickHomeButton();
contentServicesPage.goToDocumentList();
contentServicesPage.clickGridViewButton();
contentServicesPage.checkCardViewContainerIsDisplayed();
await navigationBarPage.clickHomeButton();
await contentServicesPage.goToDocumentList();
await contentServicesPage.clickGridViewButton();
await contentServicesPage.checkCardViewContainerIsDisplayed();
});
it('[C280016] Should be able to choose Gallery View', () => {
expect(contentServicesPage.getCardElementShowedInPage()).toBe(4);
it('[C280016] Should be able to choose Gallery View', async () => {
await expect(await contentServicesPage.getCardElementShowedInPage()).toBe(4);
});
it('[C280023] Gallery Card should show details', () => {
expect(contentServicesPage.getDocumentCardIconForElement(folderName)).toContain('/assets/images/ft_ic_folder.svg');
expect(contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
expect(contentServicesPage.getDocumentCardIconForElement(docxFile.name)).toContain('/assets/images/ft_ic_ms_word.svg');
expect(contentServicesPage.getDocumentCardIconForElement(testFile.name)).toContain('/assets/images/ft_ic_document.svg');
contentServicesPage.checkMenuIsShowedForElementIndex(0);
contentServicesPage.checkMenuIsShowedForElementIndex(1);
contentServicesPage.checkMenuIsShowedForElementIndex(2);
contentServicesPage.checkMenuIsShowedForElementIndex(3);
it('[C280023] Gallery Card should show details', async () => {
await expect(await contentServicesPage.getDocumentCardIconForElement(folderName)).toContain('/assets/images/ft_ic_folder.svg');
await expect(await contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
await expect(await contentServicesPage.getDocumentCardIconForElement(docxFile.name)).toContain('/assets/images/ft_ic_ms_word.svg');
await expect(await contentServicesPage.getDocumentCardIconForElement(testFile.name)).toContain('/assets/images/ft_ic_document.svg');
await contentServicesPage.checkMenuIsShowedForElementIndex(0);
await contentServicesPage.checkMenuIsShowedForElementIndex(1);
await contentServicesPage.checkMenuIsShowedForElementIndex(2);
await contentServicesPage.checkMenuIsShowedForElementIndex(3);
});
it('[C280069] Gallery Card should show attributes', () => {
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.DISPLAY_NAME);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.SIZE);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED_BY);
contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED);
it('[C280069] Gallery Card should show attributes', async () => {
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.DISPLAY_NAME);
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.SIZE);
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED_BY);
await contentServicesPage.checkDocumentCardPropertyIsShowed(folderName, cardProperties.CREATED);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName);
await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`105.02 KB`);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`105.02 KB`);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`81.05 KB`);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`81.05 KB`);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY))
.toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY))
.toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
await expect(await contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/);
});
it('[C280129] Should keep Gallery View when accessing a folder', () => {
contentServicesPage.navigateToCardFolder(folderName);
it('[C280129] Should keep Gallery View when accessing a folder', async () => {
await contentServicesPage.navigateToCardFolder(folderName);
expect(contentServicesPage.getCardElementShowedInPage()).toBe(1);
expect(contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
await expect(await contentServicesPage.getCardElementShowedInPage()).toBe(1);
await expect(await contentServicesPage.getDocumentCardIconForElement(pdfFile.name)).toContain('/assets/images/ft_ic_pdf.svg');
});
it('[C280130] Should be able to go back to List View', () => {
contentServicesPage.clickGridViewButton();
contentServicesPage.checkAcsContainer();
contentServicesPage.doubleClickRow(folderName);
contentServicesPage.checkRowIsDisplayed(pdfFile.name);
it('[C280130] Should be able to go back to List View', async () => {
await contentServicesPage.clickGridViewButton();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.doubleClickRow(folderName);
await contentServicesPage.checkRowIsDisplayed(pdfFile.name);
});
it('[C261993] Should be able to sort Gallery Cards by display name', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME);
contentServicesPage.checkListIsSortedByNameColumn('asc');
it('[C261993] Should be able to sort Gallery Cards by display name', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.DISPLAY_NAME);
await contentServicesPage.checkListIsSortedByNameColumn('asc');
});
it('[C261994] Should be able to sort Gallery Cards by size', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.SIZE);
contentServicesPage.checkListIsSortedBySizeColumn('asc');
it('[C261994] Should be able to sort Gallery Cards by size', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.SIZE);
await contentServicesPage.checkListIsSortedBySizeColumn('asc');
});
it('[C261995] Should be able to sort Gallery Cards by author', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED_BY);
contentServicesPage.checkListIsSortedByAuthorColumn('asc');
it('[C261995] Should be able to sort Gallery Cards by author', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED_BY);
await contentServicesPage.checkListIsSortedByAuthorColumn('asc');
});
it('[C261996] Should be able to sort Gallery Cards by created date', () => {
contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED);
contentServicesPage.checkListIsSortedByCreatedColumn('asc');
it('[C261996] Should be able to sort Gallery Cards by created date', async () => {
await contentServicesPage.selectGridSortingFromDropdown(cardProperties.CREATED);
await contentServicesPage.checkListIsSortedByCreatedColumn('asc');
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (filePdfNode) {
await uploadActions.deleteFileOrFolder(filePdfNode.entry.id);
@@ -189,7 +189,7 @@ describe('Document List Component', () => {
if (folderNode) {
await uploadActions.deleteFileOrFolder(folderNode.entry.id);
}
done();
});
});

View File

@@ -24,7 +24,7 @@ import { Util } from '../../util/util';
import { browser } from 'protractor';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
describe('Document List - Pagination', function () {
describe('Document List - Pagination', () => {
const pagination = {
base: 'newFile',
secondSetBase: 'secondSet',
@@ -49,21 +49,21 @@ describe('Document List - Pagination', function () {
const navigationBarPage = new NavigationBarPage();
const acsUser = new AcsUserModel();
const newFolderModel = new FolderModel({ 'name': 'newFolder' });
const newFolderModel = new FolderModel({ name: 'newFolder' });
let fileNames = [];
const nrOfFiles = 20;
let currentPage = 1;
let secondSetOfFiles = [];
const secondSetNumber = 25;
const folderTwoModel = new FolderModel({ 'name': 'folderTwo' });
const folderThreeModel = new FolderModel({ 'name': 'folderThree' });
const folderTwoModel = new FolderModel({ name: 'folderTwo' });
const folderThreeModel = new FolderModel({ name: 'folderThree' });
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);
beforeAll(async (done) => {
beforeAll(async () => {
fileNames = Util.generateSequenceFiles(10, nrOfFiles + 9, pagination.base, pagination.extension);
secondSetOfFiles = Util.generateSequenceFiles(10, secondSetNumber + 9, pagination.secondSetBase, pagination.extension);
@@ -80,270 +80,256 @@ describe('Document List - Pagination', function () {
await uploadActions.createEmptyFiles(secondSetOfFiles, folderThreeUploadedModel.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
beforeEach((done) => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
done();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
});
it('[C260062] Should use default pagination settings', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
});
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C260062] Should use default pagination settings', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
const list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C274713] Should be able to set Items per page to 20', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
});
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C274713] Should be able to set Items per page to 20', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
const list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames)).toEqual(true);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
it('[C260069] Should be able to set Items per page to 5', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
});
paginationPage.clickOnNextPage();
it('[C260069] Should be able to set Items per page to 5', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
});
paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(5, 10))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
});
paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(10, 15))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
});
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
browser.refresh();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.refresh();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
});
it('[C260067] Should be able to set Items per page to 10', () => {
it('[C260067] Should be able to set Items per page to 10', async () => {
currentPage = 1;
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.ten);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
});
paginationPage.clickOnNextPage();
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 10))).toEqual(true);
await paginationPage.clickOnNextPage();
currentPage++;
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
});
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(10, 20))).toEqual(true);
browser.refresh();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
navigationBarPage.clickLogoutButton();
loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.refresh();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await navigationBarPage.clickLogoutButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
currentPage = 1;
});
it('[C260065] Should be able to set Items per page to 15', () => {
it('[C260065] Should be able to set Items per page to 15', async () => {
currentPage = 1;
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
});
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(0, 15))).toEqual(true);
currentPage++;
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfFiles + ' of ' + nrOfFiles);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
});
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfFiles + ' of ' + nrOfFiles);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles - itemsPerPage.fifteenValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, fileNames.slice(15, 20))).toEqual(true);
browser.refresh();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await browser.refresh();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
});
it('[C91320] Pagination should preserve sorting', () => {
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
it('[C91320] Pagination should preserve sorting', async () => {
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('ASC', 'Display name'));
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('ASC', 'Display name'));
contentServicesPage.sortByName('DESC');
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await contentServicesPage.sortByName('DESC');
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
paginationPage.selectItemsPerPage(itemsPerPage.ten);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getContentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getDocumentList().dataTablePage().checkListIsSorted('DESC', 'Display name'));
});
it('[C260107] Should not display pagination bar when a folder is empty', () => {
paginationPage.selectItemsPerPage(itemsPerPage.five);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
contentServicesPage.doubleClickRow(newFolderModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
contentServicesPage.createNewFolder(folderTwoModel.name).checkContentIsDisplayed(folderTwoModel.name);
contentServicesPage.doubleClickRow(folderTwoModel.name);
contentServicesPage.checkPaginationIsNotDisplayed();
it('[C260107] Should not display pagination bar when a folder is empty', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await contentServicesPage.doubleClickRow(newFolderModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(newFolderModel.name);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await contentServicesPage.createNewFolder(folderTwoModel.name);
await contentServicesPage.checkContentIsDisplayed(folderTwoModel.name);
await contentServicesPage.doubleClickRow(folderTwoModel.name);
await contentServicesPage.checkPaginationIsNotDisplayed();
});
it('[C260071] Should be able to change pagination when having 25 files', () => {
it('[C260071] Should be able to change pagination when having 25 files', async () => {
currentPage = 1;
contentServicesPage.doubleClickRow(folderThreeModel.name);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name);
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
});
await contentServicesPage.doubleClickRow(folderThreeModel.name);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await contentServicesPage.getActiveBreadcrumb()).toEqual(folderThreeModel.name);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 15))).toEqual(true);
currentPage++;
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + secondSetNumber + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.fifteenValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
});
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + secondSetNumber + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.fifteenValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(15, 25))).toEqual(true);
currentPage = 1;
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyValue * currentPage + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
});
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.twentyValue * currentPage + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.twentyValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(0, 20))).toEqual(true);
currentPage++;
paginationPage.clickOnNextPage();
contentServicesPage.checkAcsContainer();
contentServicesPage.waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 21-' + secondSetNumber + ' of ' + secondSetNumber);
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue);
contentServicesPage.getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
});
await paginationPage.clickOnNextPage();
await contentServicesPage.checkAcsContainer();
await contentServicesPage.waitForTableBody();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 21-' + secondSetNumber + ' of ' + secondSetNumber);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(secondSetNumber - itemsPerPage.twentyValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(Util.arrayContainsArray(list, secondSetOfFiles.slice(20, 25))).toEqual(true);
});
});

View File

@@ -40,9 +40,9 @@ describe('Document List Component', () => {
});
});
describe('Permission Message', async () => {
describe('Permission Message', () => {
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
const siteName = `PRIVATE_TEST_SITE_${StringUtil.generateRandomString(5)}`;
const privateSiteBody = { visibility: 'PRIVATE', title: siteName };
@@ -55,36 +55,35 @@ describe('Document List Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
navBar.openLanguageMenu();
navBar.chooseLanguage('English');
done();
await navBar.openLanguageMenu();
await navBar.chooseLanguage('English');
});
it('[C217334] Should display a message when accessing file without permissions', () => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
expect(errorPage.getErrorCode()).toBe('403');
expect(errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
it('[C217334] Should display a message when accessing file without permissions', async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
await expect(await errorPage.getErrorCode()).toBe('403');
await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
});
it('[C279924] Should display custom message when accessing a file without permissions', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.enableCustomPermissionMessage();
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
expect(errorPage.getErrorCode()).toBe('403');
it('[C279924] Should display custom message when accessing a file without permissions', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.enableCustomPermissionMessage();
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
await expect(await errorPage.getErrorCode()).toBe('403');
});
it('[C279925] Should display translated message when accessing a file without permissions if language is changed', () => {
navBar.openLanguageMenu();
navBar.chooseLanguage('Italiano');
browser.sleep(2000);
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
expect(errorPage.getErrorDescription()).toBe('Accesso alla risorsa sul server non consentito.');
it('[C279925] Should display translated message when accessing a file without permissions if language is changed', async () => {
await navBar.openLanguageMenu();
await navBar.chooseLanguage('Italiano');
await browser.sleep(2000);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + privateSite.entry.guid);
await expect(await errorPage.getErrorDescription()).toBe('Accesso alla risorsa sul server non consentito.');
});
});

View File

@@ -29,7 +29,7 @@ describe('Document List Component - Properties', () => {
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const navigationBarPage = new NavigationBarPage();
const navigationBar = new NavigationBarPage();
let subFolder, parentFolder;
this.alfrescoJsApi = new AlfrescoApi({
@@ -40,13 +40,13 @@ describe('Document List Component - Properties', () => {
let acsUser = null;
const pngFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
describe('Allow drop files property', async () => {
describe('Allow drop files property', () => {
beforeEach(async (done) => {
beforeEach(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -61,46 +61,44 @@ describe('Document List Component - Properties', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterEach(async (done) => {
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);
done();
});
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', () => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.doubleClickRow(parentFolder.entry.name);
it('[C299154] Should disallow upload content on a folder row if allowDropFiles is false', async () => {
await navigationBar.clickContentServicesButton();
await contentServicesPage.doubleClickRow(parentFolder.entry.name);
contentServicesPage.disableDropFilesInAFolder();
await contentServicesPage.disableDropFilesInAFolder();
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
const dragAndDrop = new DropActions();
dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
contentServicesPage.checkContentIsDisplayed(pngFile.name);
contentServicesPage.doubleClickRow(subFolder.entry.name);
contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
await dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.checkEmptyFolderTextToBe('This folder is empty');
});
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', () => {
navigationBarPage.clickContentServicesButton();
contentServicesPage.doubleClickRow(parentFolder.entry.name);
it('[C91319] Should allow upload content on a folder row if allowDropFiles is true', async () => {
await navigationBar.clickContentServicesButton();
await contentServicesPage.doubleClickRow(parentFolder.entry.name);
contentServicesPage.enableDropFilesInAFolder();
await contentServicesPage.enableDropFilesInAFolder();
const dragAndDropArea = contentServicesPage.getRowByName(subFolder.entry.name);
const dragAndDrop = new DropActions();
dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
await dragAndDrop.dropFile(dragAndDropArea, pngFile.location);
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
contentServicesPage.doubleClickRow(subFolder.entry.name);
contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.doubleClickRow(subFolder.entry.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
});
});
});

View File

@@ -38,7 +38,7 @@ describe('Document List Component', () => {
let testFileNode, pdfBFileNode;
const navigationBarPage = new NavigationBarPage();
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
if (uploadedFolder) {
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
@@ -56,29 +56,29 @@ describe('Document List Component', () => {
await uploadActions.deleteFileOrFolder(pdfBFileNode.entry.id);
pdfBFileNode = null;
}
done();
});
describe('Thumbnails and tooltips', () => {
const pdfFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
name: resources.Files.ADF_DOCUMENTS.PDF.file_name,
location: resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const testFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const docxFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
name: resources.Files.ADF_DOCUMENTS.DOCX.file_name,
location: resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const folderName = `MEESEEKS_${StringUtil.generateRandomString(5)}_LOOK_AT_ME`;
let filePdfNode, fileTestNode, fileDocxNode, folderNode;
beforeAll(async (done) => {
beforeAll(async () => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -90,10 +90,9 @@ describe('Document List Component', () => {
fileDocxNode = await uploadActions.uploadFile(docxFile.location, docxFile.name, '-my-');
folderNode = await uploadActions.createFolder(folderName, '-my-');
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -109,52 +108,52 @@ describe('Document List Component', () => {
if (folderNode) {
await uploadActions.deleteFileOrFolder(folderNode.entry.id);
}
done();
});
beforeEach(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
});
it('[C260108] Should display tooltip for file\'s name', () => {
expect(contentServicesPage.getContentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name);
it('[C260108] Should display tooltip for file\'s name', async () => {
await expect(await contentServicesPage.getDocumentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name);
});
it('[C260109] Should display tooltip for folder\'s name', () => {
expect(contentServicesPage.getContentList().getTooltip(folderName)).toEqual(folderName);
it('[C260109] Should display tooltip for folder\'s name', async () => {
await expect(await contentServicesPage.getDocumentList().getTooltip(folderName)).toEqual(folderName);
});
it('[C260119] Should have a specific thumbnail for folders', async (done) => {
it('[C260119] Should have a specific thumbnail for folders', async () => {
const folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName);
expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
done();
await expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg');
});
it('[C280066] Should have a specific thumbnail PDF files', async (done) => {
it('[C280066] Should have a specific thumbnail PDF files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
done();
await expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg');
});
it('[C280067] Should have a specific thumbnail DOCX files', async (done) => {
it('[C280067] Should have a specific thumbnail DOCX files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name);
expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
done();
await expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg');
});
it('[C280068] Should have a specific thumbnail files', async (done) => {
it('[C280068] Should have a specific thumbnail files', async () => {
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name);
expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
done();
await expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg');
});
it('[C274701] Should be able to enable thumbnails', async (done) => {
contentServicesPage.enableThumbnails();
contentServicesPage.checkAcsContainer();
it('[C274701] Should be able to enable thumbnails', async () => {
await contentServicesPage.enableThumbnails();
await contentServicesPage.checkAcsContainer();
const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name);
expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`);
done();
await expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`);
});
});

View File

@@ -41,18 +41,18 @@ describe('Lock File', () => {
const uploadActions = new UploadActions(this.alfrescoJsApi);
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const pngFileToLock = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location
name: resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG_B.file_location
});
let nodeId, site, documentLibrary, lockedFileNodeId;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(adminUser);
@@ -73,36 +73,32 @@ describe('Lock File', () => {
id: managerUser.id,
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
done();
});
describe('Lock file interaction with the UI', () => {
beforeAll(async (done) => {
beforeAll(async () => {
const pngLockedUploadedFile = await uploadActions.uploadFile(pngFileToLock.location, pngFileToLock.name, documentLibrary);
lockedFileNodeId = pngLockedUploadedFile.entry.id;
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
try {
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
nodeId = pngUploadedFile.entry.id;
await loginPage.loginToContentServicesUsingUserModel(adminUser);
await navigationBarPage.openContentServicesFolder(documentLibrary);
contentServices.waitForTableBody();
await contentServices.waitForTableBody();
} catch (error) {
}
done();
});
afterEach(async (done) => {
afterEach(async () => {
try {
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
@@ -111,10 +107,10 @@ describe('Lock File', () => {
} catch (error) {
}
done();
});
afterAll(async (done) => {
afterAll(async () => {
try {
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
@@ -125,57 +121,57 @@ describe('Lock File', () => {
} catch (error) {
}
done();
});
it('[C286604] Should be able to open Lock file option by clicking the lock image', () => {
contentServices.lockContent(pngFileModel.name);
it('[C286604] Should be able to open Lock file option by clicking the lock image', async () => {
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.checkCancelButtonIsDisplayed();
lockFilePage.checkSaveButtonIsDisplayed();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.checkCancelButtonIsDisplayed();
await lockFilePage.checkSaveButtonIsDisplayed();
});
it('[C286625] Should be able to click Cancel to cancel lock file operation', () => {
contentServices.lockContent(pngFileModel.name);
it('[C286625] Should be able to click Cancel to cancel lock file operation', async () => {
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickCancelButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickCancelButton();
contentServices.checkUnlockedIcon(pngFileModel.name);
await contentServices.checkUnlockedIcon(pngFileModel.name);
});
it('[C286603] Should be able to click on Lock file checkbox and lock a file', () => {
contentServices.lockContent(pngFileToLock.name);
it('[C286603] Should be able to click on Lock file checkbox and lock a file', async () => {
await contentServices.lockContent(pngFileToLock.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
contentServices.checkLockedIcon(pngFileToLock.name);
await contentServices.checkLockedIcon(pngFileToLock.name);
});
it('[C286618] Should be able to uncheck Lock file checkbox and unlock a file', () => {
contentServices.lockContent(pngFileModel.name);
it('[C286618] Should be able to uncheck Lock file checkbox and unlock a file', async () => {
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
contentServices.checkLockedIcon(pngFileModel.name);
contentServices.lockContent(pngFileModel.name);
await contentServices.checkLockedIcon(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
contentServices.checkUnlockedIcon(pngFileModel.name);
await contentServices.checkUnlockedIcon(pngFileModel.name);
});
});
describe('Locked file without owner permissions', () => {
beforeEach(async (done) => {
beforeEach(async () => {
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
nodeId = pngUploadedFile.entry.id;
@@ -184,10 +180,9 @@ describe('Lock File', () => {
await navigationBarPage.openContentServicesFolder(documentLibrary);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
try {
@@ -196,67 +191,66 @@ describe('Lock File', () => {
} catch (error) {
}
done();
});
it('[C286610] Should not be able to delete a locked file', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
try {
await this.alfrescoJsApi.core.nodesApi.deleteNode(nodeId);
} catch (error) {
expect(error.status).toEqual(409);
await expect(error.status).toEqual(409);
}
});
it('[C286611] Should not be able to rename a locked file', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
try {
await this.alfrescoJsApi.core.nodesApi.updateNode(nodeId, { name: 'My new name' });
} catch (error) {
expect(error.status).toEqual(409);
await expect(error.status).toEqual(409);
}
});
it('[C286612] Should not be able to move a locked file', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
try {
await this.alfrescoJsApi.core.nodesApi.moveNode(nodeId, { targetParentId: '-my-' });
} catch (error) {
expect(error.status).toEqual(409);
await expect(error.status).toEqual(409);
}
});
it('[C286613] Should not be able to update a new version on a locked file', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickSaveButton();
try {
await this.alfrescoJsApi.core.nodesApi.updateNodeContent(nodeId, 'NEW FILE CONTENT');
} catch (error) {
expect(error.status).toEqual(409);
await expect(error.status).toEqual(409);
}
});
@@ -266,27 +260,27 @@ describe('Lock File', () => {
let pngFileToBeLocked;
beforeAll(async (done) => {
beforeAll(async () => {
try {
pngFileToBeLocked = await uploadActions.uploadFile(pngFileToLock.location, pngFileToLock.name, documentLibrary);
lockedFileNodeId = pngFileToBeLocked.entry.id;
} catch (error) {
}
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
try {
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, documentLibrary);
nodeId = pngUploadedFile.entry.id;
await loginPage.loginToContentServicesUsingUserModel(adminUser);
navigationBarPage.openContentServicesFolder(documentLibrary);
await navigationBarPage.openContentServicesFolder(documentLibrary);
} catch (error) {
}
done();
});
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.login(adminUser.id, adminUser.password);
try {
@@ -294,71 +288,69 @@ describe('Lock File', () => {
} catch (error) {
}
done();
});
it('[C286614] Owner of the locked file should be able to rename if Allow owner to modify is checked', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickAllowOwnerCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickAllowOwnerCheckbox();
await lockFilePage.clickSaveButton();
try {
const response = await this.alfrescoJsApi.core.nodesApi.updateNode(nodeId, { name: 'My new name' });
expect(response.entry.name).toEqual('My new name');
await expect(response.entry.name).toEqual('My new name');
} catch (error) {
}
});
it('[C286615] Owner of the locked file should be able to update a new version if Allow owner to modify is checked', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickAllowOwnerCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickAllowOwnerCheckbox();
await lockFilePage.clickSaveButton();
try {
const response = await this.alfrescoJsApi.core.nodesApi.updateNodeContent(nodeId, 'NEW FILE CONTENT');
expect(response.entry.modifiedAt).toBeGreaterThan(response.entry.createdAt);
await expect(response.entry.modifiedAt).toBeGreaterThan(response.entry.createdAt);
} catch (error) {
}
});
it('[C286616] Owner of the locked file should be able to move if Allow owner to modify is checked', async () => {
contentServices.lockContent(pngFileModel.name);
await contentServices.lockContent(pngFileModel.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickAllowOwnerCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickAllowOwnerCheckbox();
await lockFilePage.clickSaveButton();
try {
await this.alfrescoJsApi.core.nodesApi.moveNode(nodeId, { targetParentId: '-my-' });
const movedFile = await this.alfrescoJsApi.core.nodesApi.getNode(nodeId);
expect(movedFile.entry.parentId).not.toEqual(documentLibrary);
await expect(movedFile.entry.parentId).not.toEqual(documentLibrary);
} catch (error) {
}
});
it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', () => {
contentServices.lockContent(pngFileToLock.name);
it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', async () => {
await contentServices.lockContent(pngFileToLock.name);
lockFilePage.checkLockFileCheckboxIsDisplayed();
lockFilePage.clickLockFileCheckbox();
lockFilePage.clickAllowOwnerCheckbox();
lockFilePage.clickSaveButton();
await lockFilePage.checkLockFileCheckboxIsDisplayed();
await lockFilePage.clickLockFileCheckbox();
await lockFilePage.clickAllowOwnerCheckbox();
await lockFilePage.clickSaveButton();
contentServices.deleteContent(pngFileToBeLocked.entry.name);
contentServices.checkContentIsNotDisplayed(pngFileToBeLocked.entry.name);
await contentServices.deleteContent(pngFileToBeLocked.entry.name);
await contentServices.checkContentIsNotDisplayed(pngFileToBeLocked.entry.name);
});
});

View File

@@ -43,12 +43,12 @@ describe('Aspect oriented config', () => {
const acsUser = new AcsUserModel();
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
let uploadActions;
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -81,19 +81,18 @@ describe('Aspect oriented config', () => {
aspects.entry.aspectNames.push(defaultModel.concat(':', defaultEmptyPropertiesAspect));
await this.alfrescoJsApi.core.nodesApi.updateNode(uploadedFile.entry.id, {'aspectNames': aspects.entry.aspectNames});
await this.alfrescoJsApi.core.nodesApi.updateNode(uploadedFile.entry.id, { aspectNames: aspects.entry.aspectNames });
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(async (done) => {
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
done();
afterEach(async () => {
await viewerPage.clickCloseButton();
await contentServicesPage.checkAcsContainer();
});
it('[C261117] Should be possible restrict the display properties of one an aspect', async () => {
@@ -118,23 +117,23 @@ describe('Aspect oriented config', () => {
}
}));
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.clickMetadataGroup('IMAGE');
metadataViewPage.checkPropertyIsVisible('properties.exif:pixelXDimension', 'textitem');
metadataViewPage.checkPropertyIsVisible('properties.exif:pixelYDimension', 'textitem');
metadataViewPage.checkPropertyIsNotVisible('properties.exif:isoSpeedRatings', 'textitem');
await metadataViewPage.clickMetadataGroup('IMAGE');
await metadataViewPage.checkPropertyIsVisible('properties.exif:pixelXDimension', 'textitem');
await metadataViewPage.checkPropertyIsVisible('properties.exif:pixelYDimension', 'textitem');
await metadataViewPage.checkPropertyIsNotVisible('properties.exif:isoSpeedRatings', 'textitem');
metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
metadataViewPage.checkPropertyIsVisible('properties.exif:isoSpeedRatings', 'textitem');
await metadataViewPage.checkPropertyIsVisible('properties.exif:isoSpeedRatings', 'textitem');
});
it('[C260185] Should ignore not existing aspect when present in the configuration', async () => {
@@ -149,37 +148,37 @@ describe('Aspect oriented config', () => {
}
}));
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsPresent('Versionable');
metadataViewPage.checkMetadataGroupIsNotPresent('exists');
await metadataViewPage.checkMetadataGroupIsPresent('EXIF');
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
await metadataViewPage.checkMetadataGroupIsNotPresent('exists');
});
it('[C260183] Should show all the aspect if the content-metadata configuration is NOT provided', async () => {
await LocalStorageUtil.setConfigField('content-metadata', '{}');
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsPresent('Versionable');
await metadataViewPage.checkMetadataGroupIsPresent('EXIF');
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
});
it('[C260182] Should show all the aspects if the default configuration contains the star symbol', async () => {
@@ -190,19 +189,18 @@ describe('Aspect oriented config', () => {
}
}));
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsPresent('Versionable');
await metadataViewPage.checkMetadataGroupIsPresent('EXIF');
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
});
it('[C268899] Should be possible use a Translation key as Title of a metadata group', async () => {
@@ -232,21 +230,21 @@ describe('Aspect oriented config', () => {
' }' +
'}');
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsPresent('GROUP-TITLE1-TRANSLATION-KEY');
metadataViewPage.checkMetadataGroupIsPresent('GROUP-TITLE2-TRANSLATION-KEY');
await metadataViewPage.checkMetadataGroupIsPresent('GROUP-TITLE1-TRANSLATION-KEY');
await metadataViewPage.checkMetadataGroupIsPresent('GROUP-TITLE2-TRANSLATION-KEY');
expect(metadataViewPage.getMetadataGroupTitle('GROUP-TITLE1-TRANSLATION-KEY')).toBe('CUSTOM TITLE TRANSLATION ONE');
expect(metadataViewPage.getMetadataGroupTitle('GROUP-TITLE2-TRANSLATION-KEY')).toBe('CUSTOM TITLE TRANSLATION TWO');
await expect(await metadataViewPage.getMetadataGroupTitle('GROUP-TITLE1-TRANSLATION-KEY')).toBe('CUSTOM TITLE TRANSLATION ONE');
await expect(await metadataViewPage.getMetadataGroupTitle('GROUP-TITLE2-TRANSLATION-KEY')).toBe('CUSTOM TITLE TRANSLATION TWO');
});
@@ -261,23 +259,22 @@ describe('Aspect oriented config', () => {
' }' +
'}');
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
check(metadataViewPage.presetSwitch);
await check(metadataViewPage.presetSwitch);
metadataViewPage.enterPresetText('custom-preset');
await metadataViewPage.enterPresetText('custom-preset');
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
metadataViewPage.checkMetadataGroupIsPresent('Versionable');
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
});
it('[C299186] The aspect without properties is not displayed', async () => {
@@ -290,17 +287,17 @@ describe('Aspect oriented config', () => {
' }' +
'}');
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsNotPresent(emptyAspectName);
await metadataViewPage.checkMetadataGroupIsNotPresent(emptyAspectName);
});
it('[C299187] The aspect with empty properties is displayed when edit', async () => {
@@ -313,20 +310,20 @@ describe('Aspect oriented config', () => {
' }' +
'}');
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsNotPresent(aspectName);
await metadataViewPage.checkMetadataGroupIsNotPresent(aspectName);
metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
metadataViewPage.checkMetadataGroupIsPresent(aspectName);
await metadataViewPage.checkMetadataGroupIsPresent(aspectName);
});
});

View File

@@ -52,8 +52,8 @@ describe('permissions', () => {
let site;
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -61,7 +61,7 @@ describe('permissions', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -91,7 +91,6 @@ describe('permissions', () => {
await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, site.entry.guid);
done();
});
afterAll(async () => {
@@ -102,52 +101,52 @@ describe('permissions', () => {
it('[C274692] Should not be possible edit metadata properties when the user is a consumer user', async () => {
await loginPage.loginToContentServicesUsingUserModel(consumerUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsNotDisplayed();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsNotDisplayed();
});
it('[C279971] Should be possible edit metadata properties when the user is a collaborator user', async () => {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.clickOnInformationButton();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.clickMetadataGroup('EXIF');
await metadataViewPage.clickMetadataGroup('EXIF');
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconIsDisplayed();
});
it('[C279972] Should be possible edit metadata properties when the user is a contributor user', async () => {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.clickOnInformationButton();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.clickMetadataGroup('EXIF');
await metadataViewPage.clickMetadataGroup('EXIF');
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconIsDisplayed();
});
});

View File

@@ -51,8 +51,8 @@ describe('CardView Component - properties', () => {
const acsUser = new AcsUserModel();
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -60,7 +60,7 @@ describe('CardView Component - properties', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -74,139 +74,133 @@ describe('CardView Component - properties', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(() => {
viewerPage.clickCloseButton();
});
it('[C246516] Should show/hide the empty metadata when the property displayEmpty is true/false', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.clickOnInformationButton();
metadataViewPage.clickMetadataGroup('EXIF');
metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
metadataViewPage.checkPropertyIsNotVisible('properties.exif:model', 'textitem');
check(metadataViewPage.displayEmptySwitch);
metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
metadataViewPage.checkPropertyIsVisible('properties.exif:model', 'textitem');
});
it('[C260179] Should not be possible edit the basic property when readOnly is true', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
check(metadataViewPage.readonlySwitch);
metadataViewPage.editIconIsNotDisplayed();
});
it('[C268965] Should multi property allow expand multi accordion at the same time when set', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.clickOnInformationButton();
metadataViewPage.checkMetadataGroupIsNotExpand('EXIF');
metadataViewPage.checkMetadataGroupIsNotExpand('properties');
metadataViewPage.clickMetadataGroup('properties');
metadataViewPage.checkMetadataGroupIsNotExpand('EXIF');
metadataViewPage.checkMetadataGroupIsExpand('properties');
metadataViewPage.clickMetadataGroup('EXIF');
metadataViewPage.checkMetadataGroupIsExpand('EXIF');
metadataViewPage.checkMetadataGroupIsNotExpand('properties');
check(metadataViewPage.multiSwitch);
metadataViewPage.clickMetadataGroup('properties');
metadataViewPage.checkMetadataGroupIsExpand('EXIF');
metadataViewPage.checkMetadataGroupIsExpand('properties');
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
});
it('[C280559] Should show/hide the default metadata properties when displayDefaultProperties is true/false', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
uncheck(metadataViewPage.defaultPropertiesSwitch);
metadataViewPage.checkMetadataGroupIsNotPresent('properties');
metadataViewPage.checkMetadataGroupIsPresent('EXIF');
metadataViewPage.checkMetadataGroupIsExpand('EXIF');
check(metadataViewPage.defaultPropertiesSwitch);
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsExpand('properties');
afterEach(async () => {
await viewerPage.clickCloseButton();
});
it('[C280560] Should show/hide the more properties button when displayDefaultProperties is true/false', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
it('[C246516] Should show/hide the empty metadata when the property displayEmpty is true/false', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
metadataViewPage.informationButtonIsDisplayed();
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
uncheck(metadataViewPage.defaultPropertiesSwitch);
await metadataViewPage.clickOnInformationButton();
metadataViewPage.informationButtonIsNotDisplayed();
await metadataViewPage.clickMetadataGroup('EXIF');
await metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
await metadataViewPage.checkPropertyIsNotVisible('properties.exif:model', 'textitem');
await check(metadataViewPage.displayEmptySwitch);
await metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
await metadataViewPage.checkPropertyIsVisible('properties.exif:model', 'textitem');
});
it('[C307975] Should be able to choose which aspect to show expanded in the info-drawer', () => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
it('[C260179] Should not be possible edit the basic property when readOnly is true', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
metadataViewPage.typeAspectName('EXIF');
metadataViewPage.clickApplyAspect();
await check(metadataViewPage.readonlySwitch);
metadataViewPage.checkMetadataGroupIsExpand('EXIF');
metadataViewPage.checkMetadataGroupIsNotExpand('properties');
check(metadataViewPage.displayEmptySwitch);
await metadataViewPage.editIconIsNotDisplayed();
});
metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
metadataViewPage.checkPropertyIsVisible('properties.exif:model', 'textitem');
it('[C268965] Should multi property allow expand multi accordion at the same time when set', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
metadataViewPage.typeAspectName('nonexistent');
metadataViewPage.clickApplyAspect();
metadataViewPage.checkMetadataGroupIsNotPresent('nonexistent');
await metadataViewPage.clickOnInformationButton();
metadataViewPage.typeAspectName('Properties');
metadataViewPage.clickApplyAspect();
metadataViewPage.checkMetadataGroupIsPresent('properties');
metadataViewPage.checkMetadataGroupIsExpand('properties');
await metadataViewPage.checkMetadataGroupIsNotExpand('EXIF');
await metadataViewPage.checkMetadataGroupIsNotExpand('properties');
await metadataViewPage.clickMetadataGroup('properties');
await metadataViewPage.checkMetadataGroupIsNotExpand('EXIF');
await metadataViewPage.checkMetadataGroupIsExpand('properties');
await metadataViewPage.clickMetadataGroup('EXIF');
await metadataViewPage.checkMetadataGroupIsExpand('EXIF');
await metadataViewPage.checkMetadataGroupIsNotExpand('properties');
await check(metadataViewPage.multiSwitch);
await metadataViewPage.clickMetadataGroup('properties');
await metadataViewPage.checkMetadataGroupIsExpand('EXIF');
await metadataViewPage.checkMetadataGroupIsExpand('properties');
});
it('[C280559] Should show/hide the default metadata properties when displayDefaultProperties is true/false', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await uncheck(metadataViewPage.defaultPropertiesSwitch);
await metadataViewPage.checkMetadataGroupIsNotPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('EXIF');
await metadataViewPage.checkMetadataGroupIsExpand('EXIF');
await check(metadataViewPage.defaultPropertiesSwitch);
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsExpand('properties');
});
it('[C280560] Should show/hide the more properties button when displayDefaultProperties is true/false', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await uncheck(metadataViewPage.defaultPropertiesSwitch);
await metadataViewPage.informationButtonIsNotDisplayed();
});
it('[C307975] Should be able to choose which aspect to show expanded in the info-drawer', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.typeAspectName('EXIF');
await metadataViewPage.clickApplyAspect();
await metadataViewPage.checkMetadataGroupIsExpand('EXIF');
await metadataViewPage.checkMetadataGroupIsNotExpand('properties');
await check(metadataViewPage.displayEmptySwitch);
await metadataViewPage.checkPropertyIsVisible('properties.exif:flash', 'boolean');
await metadataViewPage.checkPropertyIsVisible('properties.exif:model', 'textitem');
await metadataViewPage.typeAspectName('nonexistent');
await metadataViewPage.clickApplyAspect();
await metadataViewPage.checkMetadataGroupIsNotPresent('nonexistent');
await metadataViewPage.typeAspectName('Properties');
await metadataViewPage.clickApplyAspect();
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsExpand('properties');
});
});

View File

@@ -56,8 +56,8 @@ describe('Metadata component', () => {
const folderName = 'Metadata Folder';
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
this.alfrescoJsApi = new AlfrescoApi({
@@ -67,21 +67,14 @@ describe('Metadata component', () => {
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
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.login(acsUser.id, acsUser.password);
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
Object.assign(pngFileModel, pngUploadedFile.entry);
pngFileModel.update(pngUploadedFile.entry);
done();
});
afterAll(async () => {
@@ -92,9 +85,8 @@ describe('Metadata component', () => {
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
presets: {
default: {
@@ -104,194 +96,193 @@ describe('Metadata component', () => {
}));
});
beforeEach(async (done) => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkFileIsLoaded();
done();
beforeEach(async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkFileIsLoaded();
});
afterEach(() => {
viewerPage.clickCloseButton();
contentServicesPage.waitForTableBody();
afterEach(async () => {
await viewerPage.clickCloseButton();
await contentServicesPage.waitForTableBody();
});
it('[C245652] Should be possible to display a file\'s properties', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
it('[C245652] Should be possible to display a file\'s properties', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
expect(metadataViewPage.getTitle()).toEqual(METADATA.TITLE);
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
expect(metadataViewPage.getExpandedAspectName()).toEqual(METADATA.DEFAULT_ASPECT);
expect(metadataViewPage.getName()).toEqual(pngFileModel.name);
expect(metadataViewPage.getCreator()).toEqual(pngFileModel.getCreatedByUser().displayName);
expect(metadataViewPage.getCreatedDate()).toEqual(dateFormat(pngFileModel.createdAt, METADATA.DATA_FORMAT));
expect(metadataViewPage.getModifier()).toEqual(pngFileModel.getCreatedByUser().displayName);
expect(metadataViewPage.getModifiedDate()).toEqual(dateFormat(pngFileModel.createdAt, METADATA.DATA_FORMAT));
expect(metadataViewPage.getMimetypeName()).toEqual(pngFileModel.getContent().mimeTypeName);
expect(metadataViewPage.getSize()).toEqual(pngFileModel.getContent().getSizeInBytes());
await expect(await metadataViewPage.getTitle()).toEqual(METADATA.TITLE);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await metadataViewPage.getExpandedAspectName()).toEqual(METADATA.DEFAULT_ASPECT);
await expect(await metadataViewPage.getName()).toEqual(pngFileModel.name);
await expect(await metadataViewPage.getCreator()).toEqual(pngFileModel.getCreatedByUser().displayName);
await expect(await metadataViewPage.getCreatedDate()).toEqual(dateFormat(pngFileModel.createdAt, METADATA.DATA_FORMAT));
await expect(await metadataViewPage.getModifier()).toEqual(pngFileModel.getCreatedByUser().displayName);
await expect(await metadataViewPage.getModifiedDate()).toEqual(dateFormat(pngFileModel.createdAt, METADATA.DATA_FORMAT));
await expect(await metadataViewPage.getMimetypeName()).toEqual(pngFileModel.getContent().mimeTypeName);
await expect(await metadataViewPage.getSize()).toEqual(pngFileModel.getContent().getSizeInBytes());
metadataViewPage.editIconIsDisplayed();
metadataViewPage.informationButtonIsDisplayed();
expect(metadataViewPage.getInformationButtonText()).toEqual(METADATA.LESS_INFO_BUTTON);
expect(metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_UP);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.informationButtonIsDisplayed();
await expect(await metadataViewPage.getInformationButtonText()).toEqual(METADATA.LESS_INFO_BUTTON);
await expect(await metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_UP);
});
it('[C272769] Should be possible to display more details when clicking on More Information button', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.informationButtonIsDisplayed();
metadataViewPage.clickOnInformationButton();
expect(metadataViewPage.getInformationButtonText()).toEqual(METADATA.MORE_INFO_BUTTON);
expect(metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_DOWN);
it('[C272769] Should be possible to display more details when clicking on More Information button', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
await expect(await metadataViewPage.getInformationButtonText()).toEqual(METADATA.MORE_INFO_BUTTON);
await expect(await metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_DOWN);
});
it('[C270952] Should be possible to open/close properties using info icon', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab().informationButtonIsDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsNotDisplayed();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.COMMENTS_TAB);
metadataViewPage.clickOnPropertiesTab();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
expect(metadataViewPage.getEditIconTooltip()).toEqual(METADATA.EDIT_BUTTON_TOOLTIP);
it('[C270952] Should be possible to open/close properties using info icon', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsNotDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.COMMENTS_TAB);
await metadataViewPage.clickOnPropertiesTab();
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await metadataViewPage.getEditIconTooltip()).toEqual(METADATA.EDIT_BUTTON_TOOLTIP);
});
it('[C245654] Should be possible edit the basic Metadata Info of a Document', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
it('[C245654] Should be possible edit the basic Metadata Info of a Document', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.editIconClick();
metadataViewPage.editPropertyIconIsDisplayed('name');
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('name');
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
expect(metadataViewPage.getPropertyIconTooltip('name')).toEqual('Edit');
expect(metadataViewPage.getPropertyIconTooltip('properties.cm:title')).toEqual('Edit');
expect(metadataViewPage.getPropertyIconTooltip('properties.cm:description')).toEqual('Edit');
await expect(await metadataViewPage.getPropertyIconTooltip('name')).toEqual('Edit');
await expect(await metadataViewPage.getPropertyIconTooltip('properties.cm:title')).toEqual('Edit');
await expect(await metadataViewPage.getPropertyIconTooltip('properties.cm:description')).toEqual('Edit');
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.updatePropertyIconIsDisplayed('name');
metadataViewPage.clearPropertyIconIsDisplayed('name');
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.updatePropertyIconIsDisplayed('name');
await metadataViewPage.clearPropertyIconIsDisplayed('name');
metadataViewPage.enterPropertyText('name', 'exampleText');
metadataViewPage.clickClearPropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
await metadataViewPage.enterPropertyText('name', 'exampleText');
await metadataViewPage.clickClearPropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.enterPropertyText('name', 'exampleText.png');
metadataViewPage.clickUpdatePropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual('exampleText.png');
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.enterPropertyText('name', 'exampleText.png');
await metadataViewPage.clickUpdatePropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual('exampleText.png');
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
metadataViewPage.enterPropertyText('properties.cm:title', 'example title');
metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
await metadataViewPage.clickEditPropertyIcons('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'example title');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
metadataViewPage.clickEditPropertyIcons('properties.cm:description');
metadataViewPage.enterDescriptionText('example description');
metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
await metadataViewPage.clickEditPropertyIcons('properties.cm:description');
await metadataViewPage.enterDescriptionText('example description');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
viewerPage.clickCloseButton();
contentServicesPage.waitForTableBody();
await viewerPage.clickCloseButton();
await contentServicesPage.waitForTableBody();
viewerPage.viewFile('exampleText.png');
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
await viewerPage.viewFile('exampleText.png');
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(metadataViewPage.getPropertyText('name')).toEqual('exampleText.png');
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
await expect(await metadataViewPage.getPropertyText('name')).toEqual('exampleText.png');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('example title');
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('example description');
metadataViewPage.editIconClick();
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.enterPropertyText('name', resources.Files.ADF_DOCUMENTS.PNG.file_name);
metadataViewPage.clickUpdatePropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
await metadataViewPage.editIconClick();
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.enterPropertyText('name', resources.Files.ADF_DOCUMENTS.PNG.file_name);
await metadataViewPage.clickUpdatePropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual(resources.Files.ADF_DOCUMENTS.PNG.file_name);
});
it('[C260181] Should be possible edit all the metadata aspect', () => {
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
it('[C260181] Should be possible edit all the metadata aspect', async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.clickOnInformationButton();
await metadataViewPage.clickOnInformationButton();
metadataViewPage.clickMetadataGroup('EXIF');
await metadataViewPage.clickMetadataGroup('EXIF');
metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
metadataViewPage.clickEditPropertyIcons('properties.exif:software');
metadataViewPage.enterPropertyText('properties.exif:software', 'test custom text software');
metadataViewPage.clickUpdatePropertyIcon('properties.exif:software');
expect(metadataViewPage.getPropertyText('properties.exif:software')).toEqual('test custom text software');
await metadataViewPage.clickEditPropertyIcons('properties.exif:software');
await metadataViewPage.enterPropertyText('properties.exif:software', 'test custom text software');
await metadataViewPage.clickUpdatePropertyIcon('properties.exif:software');
await expect(await metadataViewPage.getPropertyText('properties.exif:software')).toEqual('test custom text software');
metadataViewPage.clickEditPropertyIcons('properties.exif:isoSpeedRatings');
metadataViewPage.enterPropertyText('properties.exif:isoSpeedRatings', 'test custom text isoSpeedRatings');
metadataViewPage.clickUpdatePropertyIcon('properties.exif:isoSpeedRatings');
expect(metadataViewPage.getPropertyText('properties.exif:isoSpeedRatings')).toEqual('test custom text isoSpeedRatings');
await metadataViewPage.clickEditPropertyIcons('properties.exif:isoSpeedRatings');
await metadataViewPage.enterPropertyText('properties.exif:isoSpeedRatings', 'test custom text isoSpeedRatings');
await metadataViewPage.clickUpdatePropertyIcon('properties.exif:isoSpeedRatings');
await expect(await metadataViewPage.getPropertyText('properties.exif:isoSpeedRatings')).toEqual('test custom text isoSpeedRatings');
metadataViewPage.clickEditPropertyIcons('properties.exif:fNumber');
metadataViewPage.enterPropertyText('properties.exif:fNumber', 22);
metadataViewPage.clickUpdatePropertyIcon('properties.exif:fNumber');
expect(metadataViewPage.getPropertyText('properties.exif:fNumber')).toEqual('22');
await metadataViewPage.clickEditPropertyIcons('properties.exif:fNumber');
await metadataViewPage.enterPropertyText('properties.exif:fNumber', 22);
await metadataViewPage.clickUpdatePropertyIcon('properties.exif:fNumber');
await expect(await metadataViewPage.getPropertyText('properties.exif:fNumber')).toEqual('22');
});
});
describe('Folder metadata', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await uploadActions.createFolder(folderName, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
done();
});
it('[C261157] Should be possible use the metadata component When the node is a Folder', () => {
contentServicesPage.metadataContent(folderName);
it('[C261157] Should be possible use the metadata component When the node is a Folder', async () => {
await contentServicesPage.metadataContent(folderName);
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
expect(metadataViewPage.getPropertyText('createdByUser.displayName')).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
BrowserActions.closeMenuAndDialogs();
await expect(await metadataViewPage.getPropertyText('name')).toEqual(folderName);
await expect(await metadataViewPage.getPropertyText('createdByUser.displayName')).toEqual(acsUser.firstName + ' ' + acsUser.lastName);
await BrowserActions.closeMenuAndDialogs();
});
it('[C261158] Should be possible edit the metadata When the node is a Folder', () => {
contentServicesPage.metadataContent(folderName);
it('[C261158] Should be possible edit the metadata When the node is a Folder', async () => {
await contentServicesPage.metadataContent(folderName);
metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.enterPropertyText('name', 'newnameFolder');
metadataViewPage.clickClearPropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.enterPropertyText('name', 'newnameFolder');
await metadataViewPage.clickClearPropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual(folderName);
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.enterPropertyText('name', 'newnameFolder');
metadataViewPage.clickUpdatePropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual('newnameFolder');
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.enterPropertyText('name', 'newnameFolder');
await metadataViewPage.clickUpdatePropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual('newnameFolder');
metadataViewPage.clickEditPropertyIcons('name');
metadataViewPage.enterPropertyText('name', folderName);
metadataViewPage.clickUpdatePropertyIcon('name');
expect(metadataViewPage.getPropertyText('name')).toEqual(folderName);
await metadataViewPage.clickEditPropertyIcons('name');
await metadataViewPage.enterPropertyText('name', folderName);
await metadataViewPage.clickUpdatePropertyIcon('name');
await expect(await metadataViewPage.getPropertyText('name')).toEqual(folderName);
});
});
@@ -299,36 +290,36 @@ describe('Metadata component', () => {
it('[C279960] Should show the last username modifier when modify a File', async () => {
await loginPage.loginToContentServices(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
BrowserActions.getUrl(browser.params.testConfig.adf.url + `/(overlay:files/${pngFileModel.id}/view)`);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + `/(overlay:files/${pngFileModel.id}/view)`);
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
metadataViewPage.editIconIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.editIconIsDisplayed();
expect(viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
await expect(await viewerPage.getActiveTab()).toEqual(METADATA.PROPERTY_TAB);
metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
metadataViewPage.clickEditPropertyIcons('properties.cm:description');
metadataViewPage.enterDescriptionText('check author example description');
metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('check author example description');
await metadataViewPage.clickEditPropertyIcons('properties.cm:description');
await metadataViewPage.enterDescriptionText('check author example description');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('check author example description');
loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickContentServicesButton();
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkFileIsLoaded();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkFileIsLoaded();
viewerPage.clickInfoButton();
viewerPage.checkInfoSideBarIsDisplayed();
metadataViewPage.clickOnPropertiesTab();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
expect(metadataViewPage.getPropertyText('modifiedByUser.displayName')).toEqual('Administrator');
await expect(await metadataViewPage.getPropertyText('modifiedByUser.displayName')).toEqual('Administrator');
viewerPage.clickCloseButton();
contentServicesPage.waitForTableBody();
await viewerPage.clickCloseButton();
await contentServicesPage.waitForTableBody();
});
});

View File

@@ -25,12 +25,12 @@ import { NavigationBarPage } from '../pages/adf/navigationBarPage';
describe('Notifications Component', () => {
const loginPage = new LoginPage();
const notificationHistoryPage = new NotificationPage();
const notificationPage = new NotificationPage();
const navigationBarPage = new NavigationBarPage();
const acsUser = new AcsUserModel();
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -45,78 +45,76 @@ describe('Notifications Component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
notificationHistoryPage.goToNotificationsPage();
await notificationPage.goToNotificationsPage();
notificationHistoryPage.enterDurationField(3000);
done();
await notificationPage.enterDurationField(3000);
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach( () => {
browser.executeScript(`document.querySelector('button[data-automation-id="notification-custom-dismiss-button"]').click();`);
notificationHistoryPage.enterDurationField(3000);
afterEach(async () => {
await browser.executeScript(`document.querySelector('button[data-automation-id="notification-custom-dismiss-button"]').click();`);
await notificationPage.enterDurationField(3000);
});
it('[C279977] Should show notification when the message is not empty and button is clicked', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
it('[C279977] Should show notification when the message is not empty and button is clicked', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
});
it('[C279979] Should not show notification when the message is empty and button is clicked', () => {
notificationHistoryPage.clearMessage();
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsNotDisplayed();
it('[C279979] Should not show notification when the message is empty and button is clicked', async () => {
await notificationPage.clearMessage();
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsNotDisplayed();
});
it('[C279978] Should show notification with action when the message is not empty and button is clicked', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.clickActionToggle();
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
notificationHistoryPage.clickActionButton();
notificationHistoryPage.checkActionEvent();
notificationHistoryPage.clickActionToggle();
it('[C279978] Should show notification with action when the message is not empty and button is clicked', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.clickActionToggle();
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
await notificationPage.clickActionButton();
await notificationPage.checkActionEvent();
await notificationPage.clickActionToggle();
});
it('[C279981] Should show notification with action when the message is not empty and custom configuration button is clicked', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsDisplayed();
it('[C279981] Should show notification with action when the message is not empty and custom configuration button is clicked', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayed();
});
it('[C279987] Should show custom notification during a limited time when a duration is added', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.enterDurationField(1000);
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsDisplayed();
browser.sleep(1500);
notificationHistoryPage.checkNotificationSnackBarIsNotDisplayed();
it('[C279987] Should show custom notification during a limited time when a duration is added', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.enterDurationField(1000);
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayed();
await browser.sleep(1500);
await notificationPage.checkNotificationSnackBarIsNotDisplayed();
});
it('[C280000] Should show notification with action when the message is not empty and custom button is clicked', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.clickActionToggle();
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
notificationHistoryPage.checkNotificationSnackBarIsNotDisplayed();
notificationHistoryPage.clickNotificationButton();
notificationHistoryPage.clickActionButton();
notificationHistoryPage.checkActionEvent();
notificationHistoryPage.clickActionToggle();
it('[C280000] Should show notification with action when the message is not empty and custom button is clicked', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.clickActionToggle();
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayedWithMessage('Notification test');
await notificationPage.checkNotificationSnackBarIsNotDisplayed();
await notificationPage.clickNotificationButton();
await notificationPage.clickActionButton();
await notificationPage.checkActionEvent();
await notificationPage.clickActionToggle();
});
it('[C280001] Should meet configuration when a custom notification is set', () => {
notificationHistoryPage.enterMessageField('Notification test');
notificationHistoryPage.enterDurationField(1000);
notificationHistoryPage.selectHorizontalPosition('Right');
notificationHistoryPage.selectVerticalPosition('Top');
notificationHistoryPage.selectDirection('Left to right');
notificationHistoryPage.clickNotificationButton();
expect(notificationHistoryPage.getConfigObject()).toBe('{"direction": "ltr", "duration": "1000", "horizontalPosition": "right", "verticalPosition": "top"}');
it('[C280001] Should meet configuration when a custom notification is set', async () => {
await notificationPage.enterMessageField('Notification test');
await notificationPage.enterDurationField(1000);
await notificationPage.selectHorizontalPosition('Right');
await notificationPage.selectVerticalPosition('Top');
await notificationPage.selectDirection('Left to right');
await notificationPage.clickNotificationButton();
await expect(await notificationPage.getConfigObject()).toBe('{"direction": "ltr", "duration": "1000", "horizontalPosition": "right", "verticalPosition": "top"}');
});
});

View File

@@ -29,7 +29,7 @@ import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
describe('Permissions Component', function () {
describe('Permissions Component', () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -44,22 +44,22 @@ describe('Permissions Component', function () {
const contentList = contentServicesPage.getDocumentList();
const viewerPage = new ViewerPage();
const metadataViewPage = new MetadataViewPage();
const notificationPage = new NotificationHistoryPage();
const notificationHistoryPage = new NotificationHistoryPage();
const uploadDialog = new UploadDialog();
let fileOwnerUser, filePermissionUser, file;
const fileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
name: resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
const testFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const groupBody = {
@@ -67,11 +67,11 @@ describe('Permissions Component', function () {
displayName: StringUtil.generateRandomString()
};
const roleConsumerFolderModel = new FolderModel({ 'name': 'roleConsumer' + StringUtil.generateRandomString() });
const roleCoordinatorFolderModel = new FolderModel({ 'name': 'roleCoordinator' + StringUtil.generateRandomString() });
const roleCollaboratorFolderModel = new FolderModel({ 'name': 'roleCollaborator' + StringUtil.generateRandomString() });
const roleContributorFolderModel = new FolderModel({ 'name': 'roleContributor' + StringUtil.generateRandomString() });
const roleEditorFolderModel = new FolderModel({ 'name': 'roleEditor' + StringUtil.generateRandomString() });
const roleConsumerFolderModel = new FolderModel({ name: 'roleConsumer' + StringUtil.generateRandomString() });
const roleCoordinatorFolderModel = new FolderModel({ name: 'roleCoordinator' + StringUtil.generateRandomString() });
const roleCollaboratorFolderModel = new FolderModel({ name: 'roleCollaborator' + StringUtil.generateRandomString() });
const roleContributorFolderModel = new FolderModel({ name: 'roleContributor' + StringUtil.generateRandomString() });
const roleEditorFolderModel = new FolderModel({ name: 'roleEditor' + StringUtil.generateRandomString() });
let roleConsumerFolder, roleCoordinatorFolder, roleContributorFolder, roleCollaboratorFolder, roleEditorFolder;
let folders;
@@ -81,7 +81,7 @@ describe('Permissions Component', function () {
const duplicateUserPermissionMessage = 'One or more of the permissions you have set is already present : authority -> ' + filePermissionUser.getId() + ' / role -> Contributor';
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(fileOwnerUser);
@@ -161,189 +161,150 @@ describe('Permissions Component', function () {
await uploadActions.uploadFile(fileModel.location, 'RoleCollaborator' + fileModel.name, roleCollaboratorFolder.entry.id);
await uploadActions.uploadFile(fileModel.location, 'RoleEditor' + fileModel.name, roleEditorFolder.entry.id);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await folders.forEach(function (folder) {
uploadActions.deleteFileOrFolder(folder.entry.id);
for (const folder of folders) {
await uploadActions.deleteFileOrFolder(folder.entry.id);
}
});
done();
});
describe('Inherit and assigning permissions', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await this.alfrescoJsApi.login(fileOwnerUser.id, fileOwnerUser.password);
file = await uploadActions.uploadFile(fileModel.location, fileModel.name, '-my-');
loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(fileModel.name);
contentServicesPage.checkSelectedSiteIsDisplayed('My files');
contentList.rightClickOnRow(fileModel.name);
contentServicesPage.pressContextMenuActionNamed('Permission');
permissionsPage.checkPermissionContainerIsDisplayed();
done();
await loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(fileModel.name);
await contentServicesPage.checkSelectedSiteIsDisplayed('My files');
await contentList.rightClickOnRow(fileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.checkPermissionContainerIsDisplayed();
});
afterEach(async (done) => {
await uploadActions.deleteFileOrFolder(file.entry.id);
done();
});
it('[C268974] Inherit Permission', () => {
permissionsPage.checkPermissionInheritedButtonIsDisplayed();
expect(permissionsPage.getPermissionInheritedButtonText()).toBe('Permission Inherited');
permissionsPage.checkPermissionsDatatableIsDisplayed();
permissionsPage.clickPermissionInheritedButton();
expect(permissionsPage.getPermissionInheritedButtonText()).toBe('Inherit Permission');
permissionsPage.checkNoPermissionsIsDisplayed();
permissionsPage.clickPermissionInheritedButton();
expect(permissionsPage.getPermissionInheritedButtonText()).toBe('Permission Inherited');
permissionsPage.checkPermissionsDatatableIsDisplayed();
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
try {
await uploadActions.deleteFileOrFolder(file.entry.id);
} catch (error) {
}
});
it('[C286272] Should be able to see results when searching for a user', () => {
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.searchUserOrGroup('a');
permissionsPage.checkResultListIsDisplayed();
it('[C268974] Inherit Permission', async () => {
await permissionsPage.checkPermissionInheritedButtonIsDisplayed();
await expect(await permissionsPage.getPermissionInheritedButtonText()).toBe('Permission Inherited');
await permissionsPage.checkPermissionsDatatableIsDisplayed();
await permissionsPage.clickPermissionInheritedButton();
await expect(await permissionsPage.getPermissionInheritedButtonText()).toBe('Inherit Permission');
await permissionsPage.checkNoPermissionsIsDisplayed();
await permissionsPage.clickPermissionInheritedButton();
await expect(await permissionsPage.getPermissionInheritedButtonText()).toBe('Permission Inherited');
await permissionsPage.checkPermissionsDatatableIsDisplayed();
});
it('[C276979] Should be able to give permissions to a group of people', () => {
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.searchUserOrGroup('GROUP_' + groupBody.id);
permissionsPage.clickUserOrGroup('GROUP_' + groupBody.id);
permissionsPage.checkUserOrGroupIsAdded('GROUP_' + groupBody.id);
it('[C286272] Should be able to see results when searching for a user', async () => {
await permissionsPage.checkAddPermissionButtonIsDisplayed();
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.searchUserOrGroup('a');
await permissionsPage.checkResultListIsDisplayed();
});
it('[C277100] Should display EVERYONE group in the search result set', () => {
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.searchUserOrGroup(filePermissionUser.getId());
permissionsPage.checkResultListIsDisplayed();
permissionsPage.checkUserOrGroupIsDisplayed('EVERYONE');
permissionsPage.searchUserOrGroup('somerandomtext');
permissionsPage.checkResultListIsDisplayed();
permissionsPage.checkUserOrGroupIsDisplayed('EVERYONE');
it('[C276979] Should be able to give permissions to a group of people', async () => {
await permissionsPage.checkAddPermissionButtonIsDisplayed();
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.searchUserOrGroup('GROUP_' + groupBody.id);
await permissionsPage.clickUserOrGroup('GROUP_' + groupBody.id);
await permissionsPage.checkUserOrGroupIsAdded('GROUP_' + groupBody.id);
});
it('[C277100] Should display EVERYONE group in the search result set', async () => {
await permissionsPage.checkAddPermissionButtonIsDisplayed();
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.searchUserOrGroup(filePermissionUser.getId());
await permissionsPage.checkResultListIsDisplayed();
await permissionsPage.checkUserOrGroupIsDisplayed('EVERYONE');
await permissionsPage.searchUserOrGroup('somerandomtext');
await permissionsPage.checkResultListIsDisplayed();
await permissionsPage.checkUserOrGroupIsDisplayed('EVERYONE');
});
});
describe('Changing and duplicate Permissions', () => {
beforeEach(async (done) => {
beforeEach(async () => {
await this.alfrescoJsApi.login(fileOwnerUser.id, fileOwnerUser.password);
file = await uploadActions.uploadFile(fileModel.location, fileModel.name, '-my-');
loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsDisplayed(fileModel.name);
contentServicesPage.checkSelectedSiteIsDisplayed('My files');
contentList.rightClickOnRow(fileModel.name);
contentServicesPage.pressContextMenuActionNamed('Permission');
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.searchUserOrGroup(filePermissionUser.getId());
permissionsPage.clickUserOrGroup(filePermissionUser.getFirstName());
permissionsPage.checkUserOrGroupIsAdded(filePermissionUser.getId());
done();
await loginPage.loginToContentServicesUsingUserModel(fileOwnerUser);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(fileModel.name);
await contentServicesPage.checkSelectedSiteIsDisplayed('My files');
await contentList.rightClickOnRow(fileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.checkAddPermissionButtonIsDisplayed();
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.searchUserOrGroup(filePermissionUser.getId());
await permissionsPage.clickUserOrGroup(filePermissionUser.getFirstName());
await permissionsPage.checkUserOrGroupIsAdded(filePermissionUser.getId());
});
afterEach(async (done) => {
afterEach(async () => {
await uploadActions.deleteFileOrFolder(file.entry.id);
done();
});
it('[C274691] Should be able to add a new User with permission to the file and also change locally set permissions', () => {
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
expect(permissionsPage.getRoleDropdownOptions().count()).toBe(5);
expect(permissionsPage.getRoleDropdownOptions().get(0).getText()).toBe('Contributor');
expect(permissionsPage.getRoleDropdownOptions().get(1).getText()).toBe('Collaborator');
expect(permissionsPage.getRoleDropdownOptions().get(2).getText()).toBe('Coordinator');
expect(permissionsPage.getRoleDropdownOptions().get(3).getText()).toBe('Editor');
expect(permissionsPage.getRoleDropdownOptions().get(4).getText()).toBe('Consumer');
permissionsPage.selectOption('Collaborator');
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Collaborator');
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
permissionsPage.selectOption('Coordinator');
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Coordinator');
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
permissionsPage.selectOption('Editor');
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Editor');
permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
permissionsPage.selectOption('Consumer');
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Consumer');
it('[C274691] Should be able to add a new User with permission to the file and also change locally set permissions', async () => {
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
await permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
const roleDropdownOptions = permissionsPage.getRoleDropdownOptions();
await expect(await roleDropdownOptions.count()).toBe(5);
await expect(await BrowserActions.getText(roleDropdownOptions.get(0))).toBe('Contributor');
await expect(await BrowserActions.getText(roleDropdownOptions.get(1))).toBe('Collaborator');
await expect(await BrowserActions.getText(roleDropdownOptions.get(2))).toBe('Coordinator');
await expect(await BrowserActions.getText(roleDropdownOptions.get(3))).toBe('Editor');
await expect(await BrowserActions.getText(roleDropdownOptions.get(4))).toBe('Consumer');
await permissionsPage.selectOption('Collaborator');
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Collaborator');
await permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
await permissionsPage.selectOption('Coordinator');
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Coordinator');
await permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
await permissionsPage.selectOption('Editor');
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Editor');
await permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.getId());
await permissionsPage.selectOption('Consumer');
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Consumer');
});
it('[C276980] Should not be able to duplicate User or Group to the locally set permissions', () => {
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.searchUserOrGroup(filePermissionUser.getId());
permissionsPage.clickUserOrGroup(filePermissionUser.getFirstName());
expect(permissionsPage.getAssignPermissionErrorText()).toBe(duplicateUserPermissionMessage);
it('[C276980] Should not be able to duplicate User or Group to the locally set permissions', async () => {
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.searchUserOrGroup(filePermissionUser.getId());
await permissionsPage.clickUserOrGroup(filePermissionUser.getFirstName());
await notificationHistoryPage.checkNotifyContains(duplicateUserPermissionMessage);
});
it('[C276982] Should be able to remove User or Group from the locally set permissions', () => {
expect(permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
permissionsPage.clickDeletePermissionButton();
permissionsPage.checkUserOrGroupIsDeleted(filePermissionUser.getId());
it('[C276982] Should be able to remove User or Group from the locally set permissions', async () => {
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.getId())).toEqual('Contributor');
await permissionsPage.clickDeletePermissionButton();
await permissionsPage.checkUserOrGroupIsDeleted(filePermissionUser.getId());
});
});
@@ -351,231 +312,133 @@ describe('Permissions Component', function () {
describe('Role: Consumer, Contributor, Coordinator, Collaborator, Editor, No Permissions', () => {
it('[C276993] Role Consumer', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleConsumer' + fileModel.name);
contentList.doubleClickRow('RoleConsumer' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('RoleConsumer' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('RoleConsumer' + fileModel.name);
notificationPage.checkNotifyContains('You don\'t have access to do this.');
contentServicesPage.uploadFile(fileModel.location);
notificationPage.checkNotifyContains('You don\'t have the create permission to upload the content');
await navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleConsumer' + fileModel.name);
await contentList.doubleClickRow('RoleConsumer' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('RoleConsumer' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('RoleConsumer' + fileModel.name);
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await contentServicesPage.uploadFile(fileModel.location);
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
it('[C276996] Role Contributor', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleContributorFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleContributor' + fileModel.name);
contentList.doubleClickRow('RoleContributor' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('RoleContributor' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('RoleContributor' + fileModel.name);
notificationPage.checkNotifyContains('You don\'t have access to do this.');
contentServicesPage.uploadFile(testFileModel.location).checkContentIsDisplayed(testFileModel.name);
uploadDialog.fileIsUploaded(testFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await navigationBarPage.openContentServicesFolder(roleContributorFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleContributor' + fileModel.name);
await contentList.doubleClickRow('RoleContributor' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('RoleContributor' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('RoleContributor' + fileModel.name);
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C277000] Role Editor', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleEditorFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleEditor' + fileModel.name);
contentList.doubleClickRow('RoleEditor' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('RoleEditor' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
browser.controlFlow().execute(async () => {
contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('RoleEditor' + fileModel.name);
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle1');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle1');
metadataViewPage.clickCloseButton();
contentServicesPage.uploadFile(fileModel.location);
notificationPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
await navigationBarPage.openContentServicesFolder(roleEditorFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleEditor' + fileModel.name);
await contentList.doubleClickRow('RoleEditor' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('RoleEditor' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('RoleEditor' + fileModel.name);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.clickEditPropertyIcons('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle1');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle1');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(fileModel.location);
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
it('[C277003] Role Collaborator', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleCollaboratorFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleCollaborator' + fileModel.name);
contentList.doubleClickRow('RoleCollaborator' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('RoleCollaborator' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
browser.controlFlow().execute(async () => {
contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('RoleCollaborator' + fileModel.name);
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle2');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle2');
metadataViewPage.clickCloseButton();
contentServicesPage.uploadFile(testFileModel.location).checkContentIsDisplayed(testFileModel.name);
uploadDialog.fileIsUploaded(testFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
});
await navigationBarPage.openContentServicesFolder(roleCollaboratorFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleCollaborator' + fileModel.name);
await contentList.doubleClickRow('RoleCollaborator' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.checkDeleteIsDisabled('RoleCollaborator' + fileModel.name);
await BrowserActions.closeMenuAndDialogs();
await contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('RoleCollaborator' + fileModel.name);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.clickEditPropertyIcons('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle2');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle2');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C277004] Role Coordinator', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleCoordinatorFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleCoordinator' + fileModel.name);
contentList.doubleClickRow('RoleCoordinator' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.metadataContent('RoleCoordinator' + fileModel.name);
metadataViewPage.editIconIsDisplayed();
browser.controlFlow().execute(async () => {
await metadataViewPage.editIconClick();
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle3');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle3');
metadataViewPage.clickCloseButton();
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsDisplayed(pngFileModel.name);
uploadDialog.fileIsUploaded(pngFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed('RoleCoordinator' + fileModel.name);
contentServicesPage.deleteContent('RoleCoordinator' + fileModel.name);
contentServicesPage.checkContentIsNotDisplayed('RoleCoordinator' + fileModel.name);
});
await navigationBarPage.openContentServicesFolder(roleCoordinatorFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleCoordinator' + fileModel.name);
await contentList.doubleClickRow('RoleCoordinator' + fileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
await contentList.waitForTableBody();
await contentServicesPage.metadataContent('RoleCoordinator' + fileModel.name);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.clickEditPropertyIcons('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle3');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle3');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('RoleCoordinator' + fileModel.name);
await contentServicesPage.deleteContent('RoleCoordinator' + fileModel.name);
await contentServicesPage.checkContentIsNotDisplayed('RoleCoordinator' + fileModel.name);
});
it('[C279881] No Permission User', async () => {
await loginPage.loginToContentServicesUsingUserModel(filePermissionUser);
navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('RoleConsumer' + fileModel.name);
contentServicesPage.checkSelectedSiteIsDisplayed('My files');
contentList.rightClickOnRow('RoleConsumer' + fileModel.name);
contentServicesPage.pressContextMenuActionNamed('Permission');
permissionsPage.checkPermissionInheritedButtonIsDisplayed();
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickPermissionInheritedButton();
notificationPage.checkNotifyContains('You are not allowed to change permissions');
permissionsPage.clickAddPermissionButton();
notificationPage.checkNotifyContains('You are not allowed to change permissions');
await navigationBarPage.openContentServicesFolder(roleConsumerFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('RoleConsumer' + fileModel.name);
await contentServicesPage.checkSelectedSiteIsDisplayed('My files');
await contentList.rightClickOnRow('RoleConsumer' + fileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.checkPermissionInheritedButtonIsDisplayed();
await permissionsPage.checkAddPermissionButtonIsDisplayed();
await permissionsPage.clickPermissionInheritedButton();
await notificationHistoryPage.checkNotifyContains('You are not allowed to change permissions');
await permissionsPage.clickAddPermissionButton();
await notificationHistoryPage.checkNotifyContains('You are not allowed to change permissions');
});
});

View File

@@ -29,7 +29,7 @@ import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
describe('Permissions Component', function () {
describe('Permissions Component', () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
@@ -53,18 +53,18 @@ describe('Permissions Component', function () {
let publicSite, privateSite, folderName;
const fileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
name: resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
const testFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.TEST.file_name,
'location': resources.Files.ADF_DOCUMENTS.TEST.file_location
name: resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
let siteFolder, privateSiteFile;
@@ -76,7 +76,7 @@ describe('Permissions Component', function () {
contributorUser = new AcsUserModel();
managerUser = new AcsUserModel();
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(folderOwnerUser);
@@ -87,7 +87,7 @@ describe('Permissions Component', function () {
await this.alfrescoJsApi.core.peopleApi.addPerson(managerUser);
await this.alfrescoJsApi.login(folderOwnerUser.id, folderOwnerUser.password);
browser.sleep(15000);
await browser.sleep(15000);
const publicSiteName = `PUBLIC_TEST_SITE_${StringUtil.generateRandomString(5)}`;
@@ -144,121 +144,125 @@ describe('Permissions Component', function () {
await uploadActions.uploadFile(fileModel.location, 'Site' + fileModel.name, siteFolder.entry.id);
done();
});
afterAll(async (done) => {
afterAll(async () => {
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);
done();
});
describe('Role Site Dropdown', function () {
describe('Role Site Dropdown', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(folderOwnerUser);
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/files/' + publicSite.entry.guid);
done();
});
it('[C277002] Should display the Role Site dropdown', async () => {
contentServicesPage.checkContentIsDisplayed(folderName);
await contentServicesPage.checkContentIsDisplayed(folderName);
contentList.rightClickOnRow(folderName);
await contentList.rightClickOnRow(folderName);
contentServicesPage.pressContextMenuActionNamed('Permission');
await contentServicesPage.pressContextMenuActionNamed('Permission');
permissionsPage.checkPermissionInheritedButtonIsDisplayed();
permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.clickAddPermissionButton();
permissionsPage.checkAddPermissionDialogIsDisplayed();
permissionsPage.checkSearchUserInputIsDisplayed();
await permissionsPage.checkPermissionInheritedButtonIsDisplayed();
await permissionsPage.checkAddPermissionButtonIsDisplayed();
permissionsPage.searchUserOrGroup(consumerUser.getId());
permissionsPage.clickUserOrGroup(consumerUser.getFirstName());
permissionsPage.checkUserOrGroupIsAdded(consumerUser.getId());
await browser.sleep(5000);
expect(permissionsPage.getRoleCellValue(consumerUser.getId())).toEqual('SiteCollaborator');
await permissionsPage.clickAddPermissionButton();
await permissionsPage.checkAddPermissionDialogIsDisplayed();
await permissionsPage.checkSearchUserInputIsDisplayed();
permissionsPage.clickRoleDropdownByUserOrGroupName(consumerUser.getId());
await permissionsPage.searchUserOrGroup(consumerUser.getId());
expect(permissionsPage.getRoleDropdownOptions().count()).toBe(4);
expect(permissionsPage.getRoleDropdownOptions().get(0).getText()).toBe(CONSTANTS.CS_USER_ROLES.COLLABORATOR);
expect(permissionsPage.getRoleDropdownOptions().get(1).getText()).toBe(CONSTANTS.CS_USER_ROLES.CONSUMER);
expect(permissionsPage.getRoleDropdownOptions().get(2).getText()).toBe(CONSTANTS.CS_USER_ROLES.CONTRIBUTOR);
expect(permissionsPage.getRoleDropdownOptions().get(3).getText()).toBe(CONSTANTS.CS_USER_ROLES.MANAGER);
await permissionsPage.clickUserOrGroup(consumerUser.getFirstName());
await permissionsPage.checkUserOrGroupIsAdded(consumerUser.getId());
await expect(await permissionsPage.getRoleCellValue(consumerUser.getId())).toEqual('SiteCollaborator');
await permissionsPage.clickRoleDropdownByUserOrGroupName(consumerUser.getId());
const roleDropdownOptions = permissionsPage.getRoleDropdownOptions();
await expect(await roleDropdownOptions.count()).toBe(4);
await expect(await BrowserActions.getText(roleDropdownOptions.get(0))).toBe(CONSTANTS.CS_USER_ROLES.COLLABORATOR);
await expect(await BrowserActions.getText(roleDropdownOptions.get(1))).toBe(CONSTANTS.CS_USER_ROLES.CONSUMER);
await expect(await BrowserActions.getText(roleDropdownOptions.get(2))).toBe(CONSTANTS.CS_USER_ROLES.CONTRIBUTOR);
await expect(await BrowserActions.getText(roleDropdownOptions.get(3))).toBe(CONSTANTS.CS_USER_ROLES.MANAGER);
});
});
describe('Roles: SiteConsumer, SiteCollaborator, SiteContributor, SiteManager', function () {
describe('Roles: SiteConsumer, SiteCollaborator, SiteContributor, SiteManager', () => {
it('[C276994] Role SiteConsumer', async () => {
await loginPage.loginToContentServicesUsingUserModel(siteConsumerUser);
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
contentList.doubleClickRow('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
contentList.waitForTableBody();
await contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
await BrowserActions.closeMenuAndDialogs();
contentList.checkActionMenuIsNotDisplayed();
await contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('Site' + fileModel.name);
await contentServicesPage.metadataContent('Site' + fileModel.name);
notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
contentServicesPage.uploadFile(fileModel.location);
await contentServicesPage.uploadFile(fileModel.location);
notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
it('[C276997] Role SiteContributor', async () => {
await loginPage.loginToContentServicesUsingUserModel(contributorUser);
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
contentList.doubleClickRow('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
contentList.waitForTableBody();
await contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
await BrowserActions.closeMenuAndDialogs();
contentList.checkActionMenuIsNotDisplayed();
await contentList.checkActionMenuIsNotDisplayed();
contentServicesPage.metadataContent('Site' + fileModel.name);
await contentServicesPage.metadataContent('Site' + fileModel.name);
notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
await notificationHistoryPage.checkNotifyContains('You don\'t have access to do this.');
contentServicesPage.uploadFile(testFileModel.location).checkContentIsDisplayed(testFileModel.name);
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
uploadDialog.fileIsUploaded(testFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
@@ -266,86 +270,81 @@ describe('Permissions Component', function () {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
contentList.doubleClickRow('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
contentList.waitForTableBody();
await contentList.waitForTableBody();
contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
await contentServicesPage.checkDeleteIsDisabled('Site' + fileModel.name);
BrowserActions.closeMenuAndDialogs();
await BrowserActions.closeMenuAndDialogs();
browser.controlFlow().execute(async () => {
await contentList.checkActionMenuIsNotDisplayed();
contentList.checkActionMenuIsNotDisplayed();
await contentServicesPage.metadataContent('Site' + fileModel.name);
contentServicesPage.metadataContent('Site' + fileModel.name);
await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
await metadataViewPage.clickEditPropertyIcons('properties.cm:title');
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:title');
metadataViewPage.clickEditPropertyIcons('properties.cm:title');
await metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
metadataViewPage.enterPropertyText('properties.cm:title', 'newTitle');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:title');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle');
await metadataViewPage.clickCloseButton();
expect(metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle');
metadataViewPage.clickCloseButton();
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsDisplayed(pngFileModel.name);
uploadDialog.fileIsUploaded(pngFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
});
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C277006] Role SiteManager', async () => {
await loginPage.loginToContentServicesUsingUserModel(managerUser);
navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await navigationBarPage.openContentServicesFolder(siteFolder.entry.id);
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
contentList.doubleClickRow('Site' + fileModel.name);
await contentList.doubleClickRow('Site' + fileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.clickCloseButton();
await viewerPage.checkFileIsLoaded();
await viewerPage.clickCloseButton();
contentList.waitForTableBody();
contentServicesPage.metadataContent('Site' + fileModel.name);
await contentList.waitForTableBody();
await contentServicesPage.metadataContent('Site' + fileModel.name);
metadataViewPage.editIconIsDisplayed();
await metadataViewPage.editIconIsDisplayed();
browser.controlFlow().execute(async () => {
await metadataViewPage.editIconClick();
await metadataViewPage.editIconClick();
await metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
await metadataViewPage.clickEditPropertyIcons('properties.cm:description');
await metadataViewPage.enterDescriptionText('newDescription');
metadataViewPage.editPropertyIconIsDisplayed('properties.cm:description');
metadataViewPage.clickEditPropertyIcons('properties.cm:description');
metadataViewPage.enterDescriptionText('newDescription');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
await metadataViewPage.clickUpdatePropertyIcon('properties.cm:description');
await expect(await metadataViewPage.getPropertyText('properties.cm:description')).toEqual('newDescription');
expect(metadataViewPage.getPropertyText('properties.cm:description')).toEqual('newDescription');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(testFileModel.location);
await contentServicesPage.checkContentIsDisplayed(testFileModel.name);
metadataViewPage.clickCloseButton();
contentServicesPage.uploadFile(testFileModel.location).checkContentIsDisplayed(testFileModel.name);
uploadDialog.fileIsUploaded(testFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
contentServicesPage.deleteContent('Site' + fileModel.name);
contentServicesPage.checkContentIsNotDisplayed('Site' + fileModel.name);
});
await uploadDialog.fileIsUploaded(testFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed('Site' + fileModel.name);
await contentServicesPage.deleteContent('Site' + fileModel.name);
await contentServicesPage.checkContentIsNotDisplayed('Site' + fileModel.name);
});
});

View File

@@ -48,13 +48,13 @@ describe('Share file', () => {
const acsUser = new AcsUserModel();
const uploadActions = new UploadActions(this.alfrescoJsApi);
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
let nodeId;
beforeAll(async (done) => {
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.login(acsUser.id, acsUser.password);
@@ -67,147 +67,144 @@ describe('Share file', () => {
await navigationBarPage.clickContentServicesButton();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(nodeId);
done();
});
describe('Shared link dialog', () => {
beforeAll(() => {
contentListPage.selectRow(pngFileModel.name);
beforeAll(async () => {
await contentListPage.selectRow(pngFileModel.name);
});
afterEach(() => {
BrowserActions.closeMenuAndDialogs();
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
});
it('[C286549] Should check automatically toggle button in Share dialog', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.shareToggleButtonIsChecked();
it('[C286549] Should check automatically toggle button in Share dialog', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.shareToggleButtonIsChecked();
});
it('[C286544] Should display notification when clicking URL copy button', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
it('[C286544] Should display notification when clicking URL copy button', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
await notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
});
it('[C286543] Should be possible to close Share dialog', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.checkShareLinkIsDisplayed();
it('[C286543] Should be possible to close Share dialog', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.checkShareLinkIsDisplayed();
});
it('[C286578] Should disable today option in expiration day calendar', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
shareDialog.calendarTodayDayIsDisabled();
it('[C286578] Should disable today option in expiration day calendar', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickDateTimePickerButton();
await shareDialog.calendarTodayDayIsDisabled();
});
it('[C286548] Should be possible to set expiry date for link', async () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
shareDialog.setDefaultDay();
shareDialog.setDefaultHour();
shareDialog.setDefaultMinutes();
shareDialog.dateTimePickerDialogIsClosed();
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickDateTimePickerButton();
await shareDialog.setDefaultDay();
await shareDialog.setDefaultHour();
await shareDialog.setDefaultMinutes();
await shareDialog.dateTimePickerDialogIsClosed();
const value = await shareDialog.getExpirationDate();
shareDialog.clickCloseButton();
shareDialog.dialogIsClosed();
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.expirationDateInputHasValue(value);
BrowserActions.closeMenuAndDialogs();
await shareDialog.clickCloseButton();
await shareDialog.dialogIsClosed();
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.expirationDateInputHasValue(value);
await BrowserActions.closeMenuAndDialogs();
});
it('[C286578] Should disable today option in expiration day calendar', () => {
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
shareDialog.calendarTodayDayIsDisabled();
it('[C286578] Should disable today option in expiration day calendar', async () => {
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickDateTimePickerButton();
await shareDialog.calendarTodayDayIsDisabled();
});
it('[C310329] Should be possible to set expiry date only for link', async () => {
await LocalStorageUtil.setConfigField('sharedLinkDateTimePickerType', JSON.stringify('date'));
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickDateTimePickerButton();
shareDialog.setDefaultDay();
shareDialog.dateTimePickerDialogIsClosed();
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickDateTimePickerButton();
await shareDialog.setDefaultDay();
await shareDialog.dateTimePickerDialogIsClosed();
const value = await shareDialog.getExpirationDate();
shareDialog.clickCloseButton();
shareDialog.dialogIsClosed();
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.expirationDateInputHasValue(value);
BrowserActions.closeMenuAndDialogs();
await shareDialog.clickCloseButton();
await shareDialog.dialogIsClosed();
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.expirationDateInputHasValue(value);
await BrowserActions.closeMenuAndDialogs();
});
});
describe('Shared link preview', () => {
afterEach((done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
done();
afterEach(async() => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickContentServicesButton();
});
beforeAll(async (done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser);
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
});
it('[C286565] Should open file when logged user access shared link', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const sharedLink = await shareDialog.getShareLink();
BrowserActions.getUrl(sharedLink);
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
await notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
it('[C287803] Should the URL be kept the same when opening the share dialog multiple times', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const sharedLink = await shareDialog.getShareLink();
shareDialog.clickCloseButton();
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickShareLinkButton();
notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await shareDialog.clickCloseButton();
await notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickShareLinkButton();
const secondSharedLink = await shareDialog.getShareLink();
expect(sharedLink).toEqual(secondSharedLink);
BrowserActions.getUrl(sharedLink);
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
await notificationHistoryPage.checkNotifyContains('Link copied to the clipboard');
await expect(sharedLink).toEqual(secondSharedLink);
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
it('[C286539] Should open file when non-logged user access shared link', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.checkShareLinkIsDisplayed();
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.checkShareLinkIsDisplayed();
const sharedLink = await shareDialog.getShareLink();
shareDialog.clickCloseButton();
navigationBarPage.clickLogoutButton();
BrowserActions.getUrl(sharedLink);
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
await shareDialog.clickCloseButton();
await navigationBarPage.clickLogoutButton();
await BrowserActions.getUrl(sharedLink);
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
});
});
});

View File

@@ -16,7 +16,14 @@
*/
import CONSTANTS = require('../../util/constants');
import { StringUtil, BrowserActions, NotificationHistoryPage, LoginPage, ErrorPage, UploadActions } from '@alfresco/adf-testing';
import {
StringUtil,
BrowserActions,
NotificationHistoryPage,
LoginPage,
ErrorPage,
UploadActions
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
@@ -48,11 +55,11 @@ describe('Unshare file', () => {
let nodeId;
let testSite;
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
name: resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
const site = {
title: siteName,
visibility: 'PRIVATE',
@@ -98,88 +105,88 @@ describe('Unshare file', () => {
nodeId = pngUploadedFile.entry.id;
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navBar.clickContentServicesButton();
contentServicesPage.waitForTableBody();
done();
await navBar.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(async (done) => {
afterEach(async () => {
await browser.refresh();
done();
});
describe('with permission', () => {
afterAll(async (done) => {
afterAll(async () => {
await uploadActions.deleteFileOrFolder(nodeId);
done();
});
it('[C286550] Should display unshare confirmation dialog', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickUnShareFile();
shareDialog.confirmationDialogIsDisplayed();
it('[C286550] Should display unshare confirmation dialog', async () => {
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
});
it('[C286551] Should be able to cancel unshare action', () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickUnShareFile();
shareDialog.confirmationDialogIsDisplayed();
shareDialog.clickConfirmationDialogCancelButton();
shareDialog.shareToggleButtonIsChecked();
it('[C286551] Should be able to cancel unshare action', async () => {
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogCancelButton();
await shareDialog.shareToggleButtonIsChecked();
});
it('[C286552] Should be able to confirm unshare action', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.clickUnShareFile();
shareDialog.confirmationDialogIsDisplayed();
shareDialog.clickConfirmationDialogRemoveButton();
shareDialog.dialogIsClosed();
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogRemoveButton();
await shareDialog.dialogIsClosed();
});
it('[C280556] Should redirect to 404 when trying to access an unshared file', async () => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
const sharedLink = await shareDialog.getShareLink();
shareDialog.clickUnShareFile();
shareDialog.confirmationDialogIsDisplayed();
shareDialog.clickConfirmationDialogRemoveButton();
shareDialog.dialogIsClosed();
BrowserActions.getUrl(sharedLink.replace(browser.params.testConfig.adf_acs.host, browser.params.testConfig.adf.host));
errorPage.checkErrorCode();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogRemoveButton();
await shareDialog.dialogIsClosed();
await BrowserActions.getUrl(sharedLink.replace(browser.params.testConfig.adf_acs.host, browser.params.testConfig.adf.host));
await errorPage.checkErrorCode();
});
});
describe('without permission', () => {
afterAll(async (done) => {
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 });
done();
});
it('[C286555] Should NOT be able to unshare file without permission', () => {
navBar.goToSite(testSite);
contentListPage.doubleClickRow('documentLibrary');
contentListPage.selectRow(nodeBody.name);
contentServicesPage.clickShareButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.shareToggleButtonIsChecked();
shareDialog.clickUnShareFile();
shareDialog.confirmationDialogIsDisplayed();
shareDialog.clickConfirmationDialogRemoveButton();
shareDialog.checkDialogIsDisplayed();
shareDialog.shareToggleButtonIsChecked();
notificationHistoryPage.checkNotifyContains(`You don't have permission to unshare this file`);
it('[C286555] Should NOT be able to unshare file without permission', async () => {
await navBar.goToSite(testSite);
await contentListPage.doubleClickRow('documentLibrary');
await contentListPage.selectRow(nodeBody.name);
await contentServicesPage.clickShareButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.shareToggleButtonIsChecked();
await shareDialog.clickUnShareFile();
await shareDialog.confirmationDialogIsDisplayed();
await shareDialog.clickConfirmationDialogRemoveButton();
await shareDialog.checkDialogIsDisplayed();
await shareDialog.shareToggleButtonIsChecked();
await notificationHistoryPage.checkNotifyContains(`You don't have permission to unshare this file`);
});
});
});

View File

@@ -52,7 +52,7 @@ describe('Social component', () => {
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(componentOwner);
@@ -81,13 +81,12 @@ describe('Social component', () => {
}
});
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await uploadActions.deleteFileOrFolder(emptyFile.entry.id);
done();
});
describe('User interaction on their own components', () => {
@@ -97,21 +96,21 @@ describe('Social component', () => {
await navigationBarPage.clickSocialButton();
});
it('[C203006] Should be able to like and unlike their components but not rate them,', () => {
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
likePage.clickLike();
expect(likePage.getLikeCounter()).toBe('1');
likePage.removeHoverFromLikeButton();
expect(likePage.getLikedIconColor()).toBe(blueLikeColor);
ratePage.rateComponent(4);
expect(ratePage.getRatingCounter()).toBe('0');
expect(ratePage.isNotStarRated(4));
expect(ratePage.getUnratedStarColor(4)).toBe(averageStarColor);
likePage.clickUnlike();
expect(likePage.getLikeCounter()).toBe('0');
likePage.removeHoverFromLikeButton();
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
it('[C203006] Should be able to like and unlike their components but not rate them,', async () => {
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await likePage.clickLike();
await expect(await likePage.getLikeCounter()).toBe('1');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
await ratePage.rateComponent(4);
await expect(await ratePage.getRatingCounter()).toBe('0');
await expect(await ratePage.isNotStarRated(4));
await expect(await ratePage.getUnratedStarColor(4)).toBe(averageStarColor);
await likePage.clickUnlike();
await expect(await likePage.getLikeCounter()).toBe('0');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
});
});
@@ -123,32 +122,32 @@ describe('Social component', () => {
await navigationBarPage.clickSocialButton();
});
it('[C260324] Should be able to like and unlike a component', () => {
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
expect(likePage.getLikeCounter()).toEqual('0');
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
likePage.clickLike();
expect(likePage.getLikeCounter()).toBe('1');
likePage.removeHoverFromLikeButton();
expect(likePage.getLikedIconColor()).toBe(blueLikeColor);
likePage.clickUnlike();
expect(likePage.getLikeCounter()).toBe('0');
likePage.removeHoverFromLikeButton();
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
it('[C260324] Should be able to like and unlike a component', async () => {
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await expect(await likePage.getLikeCounter()).toEqual('0');
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
await likePage.clickLike();
await expect(await likePage.getLikeCounter()).toBe('1');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
await likePage.clickUnlike();
await expect(await likePage.getLikeCounter()).toBe('0');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
});
it('[C310198] Should be able to rate and unRate a component', () => {
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
expect(ratePage.getRatingCounter()).toBe('0');
ratePage.rateComponent(4);
expect(ratePage.getRatingCounter()).toBe('1');
expect(ratePage.isStarRated(4));
expect(ratePage.getRatedStarColor(4)).toBe(yellowRatedStarColor);
ratePage.removeRating(4);
expect(ratePage.getRatingCounter()).toBe('0');
expect(ratePage.isNotStarRated(4));
it('[C310198] Should be able to rate and unRate a component', async () => {
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await expect(await ratePage.getRatingCounter()).toBe('0');
await ratePage.rateComponent(4);
await expect(await ratePage.getRatingCounter()).toBe('1');
await expect(await ratePage.isStarRated(4));
await expect(await ratePage.getRatedStarColor(4)).toBe(yellowRatedStarColor);
await ratePage.removeRating(4);
await expect(await ratePage.getRatingCounter()).toBe('0');
await expect(await ratePage.isNotStarRated(4));
});
});
@@ -161,48 +160,48 @@ describe('Social component', () => {
});
it('[C310197] Should be able to like, unLike, display total likes', async () => {
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
likePage.clickLike();
expect(likePage.getLikeCounter()).toBe('1');
likePage.removeHoverFromLikeButton();
expect(likePage.getLikedIconColor()).toBe(blueLikeColor);
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
await likePage.clickLike();
await expect(await likePage.getLikeCounter()).toBe('1');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
await loginPage.loginToContentServicesUsingUserModel(secondComponentVisitor);
navigationBarPage.clickSocialButton();
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
likePage.clickLike();
expect(likePage.getLikeCounter()).toEqual('2');
likePage.removeHoverFromLikeButton();
expect(likePage.getLikedIconColor()).toBe(blueLikeColor);
likePage.clickUnlike();
expect(likePage.getLikeCounter()).toEqual('1');
likePage.removeHoverFromLikeButton();
expect(likePage.getUnLikedIconColor()).toBe(greyLikeColor);
await navigationBarPage.clickSocialButton();
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
await likePage.clickLike();
await expect(await likePage.getLikeCounter()).toEqual('2');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getLikedIconColor()).toBe(blueLikeColor);
await likePage.clickUnlike();
await expect(await likePage.getLikeCounter()).toEqual('1');
await likePage.removeHoverFromLikeButton();
await expect(await likePage.getUnLikedIconColor()).toBe(greyLikeColor);
});
it('[C260327] Should be able to rate, unRate, display total ratings, display average rating', async () => {
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
ratePage.rateComponent(4);
expect(ratePage.getRatingCounter()).toEqual('1');
expect(ratePage.isStarRated(4));
expect(ratePage.getRatedStarColor(4)).toBe(yellowRatedStarColor);
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await ratePage.rateComponent(4);
await expect(await ratePage.getRatingCounter()).toEqual('1');
await expect(await ratePage.isStarRated(4));
await expect(await ratePage.getRatedStarColor(4)).toBe(yellowRatedStarColor);
await loginPage.loginToContentServicesUsingUserModel(secondComponentVisitor);
navigationBarPage.clickSocialButton();
socialPage.writeCustomNodeId(emptyFile.entry.id);
expect(socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
expect(ratePage.getRatingCounter()).toEqual('1');
expect(ratePage.getAverageStarColor(4)).toBe(averageStarColor);
ratePage.rateComponent(0);
expect(ratePage.getRatingCounter()).toEqual('2');
expect(ratePage.isStarRated(2));
ratePage.removeRating(0);
expect(ratePage.getRatingCounter()).toEqual('1');
expect(ratePage.getAverageStarColor(4)).toBe(averageStarColor);
await navigationBarPage.clickSocialButton();
await socialPage.writeCustomNodeId(emptyFile.entry.id);
await expect(await socialPage.getNodeIdFieldValue()).toEqual(emptyFile.entry.id);
await expect(await ratePage.getRatingCounter()).toEqual('1');
await expect(await ratePage.getAverageStarColor(4)).toBe(averageStarColor);
await ratePage.rateComponent(0);
await expect(await ratePage.getRatingCounter()).toEqual('2');
await expect(await ratePage.isStarRated(2));
await ratePage.removeRating(0);
await expect(await ratePage.getRatingCounter()).toEqual('1');
await expect(await ratePage.getAverageStarColor(4)).toBe(averageStarColor);
});
});
});

View File

@@ -18,13 +18,20 @@
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { ApiService, LoginSSOPage, UploadActions, IdentityService, SettingsPage, StringUtil, UserModel } from '@alfresco/adf-testing';
import {
ApiService,
LoginSSOPage,
UploadActions,
IdentityService,
SettingsPage,
StringUtil,
UserModel,
FileBrowserUtil
} from '@alfresco/adf-testing';
import { FileModel } from '../../models/ACS/fileModel';
import { ViewerPage } from '../../pages/adf/viewerPage';
import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import * as path from 'path';
import { Util } from '../../util/util';
describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList, implicitFlow true', () => {
@@ -65,15 +72,13 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
}
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const downloadedPngFile = path.join(__dirname, 'downloads', pngFileModel.name);
const downloadedMultipleFiles = path.join(__dirname, 'downloads', 'archive.zip');
const folderName = StringUtil.generateRandomString(5);
const acsUser = new UserModel();
let identityService: IdentityService;
describe('SSO in ADF using ACS and AIS, implicit flow set', () => {
beforeAll(async (done) => {
beforeAll(async () => {
const apiService = new ApiService(browser.params.config.oauth2.clientId, browser.params.testConfig.adf_acs.host, browser.params.testConfig.adf.hostSso, 'ECM');
await apiService.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -100,12 +105,11 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.checkAcsContainer();
contentListPage.doubleClickRow(folderName);
await contentListPage.doubleClickRow(folderName);
await contentListPage.waitForTableBody();
done();
});
afterAll(async (done) => {
afterAll(async () => {
try {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFileOrFolder(folder.entry.id);
@@ -113,62 +117,55 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
} catch (error) {
}
await this.alfrescoJsApi.logout();
browser.executeScript('window.sessionStorage.clear();');
browser.executeScript('window.localStorage.clear();');
done();
await browser.executeScript('window.sessionStorage.clear();');
await browser.executeScript('window.localStorage.clear();');
});
afterEach(async (done) => {
browser.refresh();
contentListPage.waitForTableBody();
done();
afterEach(async () => {
await browser.refresh();
await contentListPage.waitForTableBody();
});
it('[C291936] Should be able to download a file', async (done) => {
contentListPage.selectRow(pngFileModel.name);
contentServicesPage.clickDownloadButton();
expect(Util.fileExists(downloadedPngFile, 30)).toBe(true);
done();
it('[C291936] Should be able to download a file', async () => {
await contentListPage.selectRow(pngFileModel.name);
await contentServicesPage.clickDownloadButton();
await expect(await FileBrowserUtil.isFileDownloaded(pngFileModel.name)).toBe(true, `${pngFileModel.name} not downloaded`);
});
it('[C291938] Should be able to open a document', async (done) => {
contentServicesPage.doubleClickRow(firstPdfFileModel.name);
viewerPage.checkFileIsLoaded();
viewerPage.checkFileNameIsDisplayed(firstPdfFileModel.name);
viewerPage.clickCloseButton();
contentListPage.waitForTableBody();
done();
it('[C291938] Should be able to open a document', async () => {
await contentServicesPage.doubleClickRow(firstPdfFileModel.name);
await viewerPage.checkFileIsLoaded();
await viewerPage.checkFileNameIsDisplayed(firstPdfFileModel.name);
await viewerPage.clickCloseButton();
await contentListPage.waitForTableBody();
});
it('[C291942] Should be able to open an image', async (done) => {
viewerPage.viewFile(pngFileModel.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
viewerPage.clickCloseButton();
contentListPage.waitForTableBody();
done();
it('[C291942] Should be able to open an image', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.checkImgViewerIsDisplayed();
await viewerPage.checkFileNameIsDisplayed(pngFileModel.name);
await viewerPage.clickCloseButton();
await contentListPage.waitForTableBody();
});
it('[C291941] Should be able to download multiple files', async (done) => {
contentServicesPage.clickMultiSelectToggle();
contentServicesPage.checkAcsContainer();
contentListPage.dataTablePage().checkAllRows();
contentListPage.dataTablePage().checkRowIsChecked('Display name', pngFileModel.name);
contentListPage.dataTablePage().checkRowIsChecked('Display name', firstPdfFileModel.name);
contentServicesPage.clickDownloadButton();
expect(Util.fileExists(downloadedMultipleFiles, 30)).toBe(true);
done();
it('[C291941] Should be able to download multiple files', async () => {
await contentServicesPage.clickMultiSelectToggle();
await contentServicesPage.checkAcsContainer();
await contentListPage.dataTablePage().checkAllRows();
await contentListPage.dataTablePage().checkRowIsChecked('Display name', pngFileModel.name);
await contentListPage.dataTablePage().checkRowIsChecked('Display name', firstPdfFileModel.name);
await contentServicesPage.clickDownloadButton();
await expect(await FileBrowserUtil.isFileDownloaded('archive.zip')).toBe(true, `archive.zip not downloaded`);
});
it('[C291940] Should be able to view thumbnails when enabled', async (done) => {
contentServicesPage.enableThumbnails();
contentServicesPage.checkAcsContainer();
contentListPage.waitForTableBody();
it('[C291940] Should be able to view thumbnails when enabled', async () => {
await contentServicesPage.enableThumbnails();
await contentServicesPage.checkAcsContainer();
await contentListPage.waitForTableBody();
const filePdfIconUrl = await contentServicesPage.getRowIconImageUrl(firstPdfFileModel.name);
expect(filePdfIconUrl).toContain(`/versions/1/nodes/${pdfUploadedFile.entry.id}/renditions`);
await expect(filePdfIconUrl).toContain(`/versions/1/nodes/${pdfUploadedFile.entry.id}/renditions`);
const filePngIconUrl = await contentServicesPage.getRowIconImageUrl(pngFileModel.name);
expect(filePngIconUrl).toContain(`/versions/1/nodes/${pngUploadedFile.entry.id}/renditions`);
done();
await expect(filePngIconUrl).toContain(`/versions/1/nodes/${pngUploadedFile.entry.id}/renditions`);
});
});
});

View File

@@ -36,8 +36,8 @@ describe('Tag component', () => {
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const pdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name });
const deleteFile = new FileModel({ 'name': StringUtil.generateRandomString() });
const pdfFileModel = new FileModel({ name: resources.Files.ADF_DOCUMENTS.PDF.file_name });
const deleteFile = new FileModel({ name: StringUtil.generateRandomString() });
const sameTag = StringUtil.generateRandomString().toLowerCase();
const tagList = [
@@ -56,7 +56,7 @@ describe('Tag component', () => {
const nonLatinTag = StringUtil.generateRandomStringNonLatin();
let pdfUploadedFile, nodeId;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -77,122 +77,121 @@ describe('Tag component', () => {
await this.alfrescoJsApi.core.tagsApi.addTag(nodeId, tags);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
await uploadActions.deleteFileOrFolder(pdfUploadedFile.entry.id);
done();
});
it('[C260374] Should NOT be possible to add a new tag without Node ID', () => {
navigationBarPage.clickTagButton();
it('[C260374] Should NOT be possible to add a new tag without Node ID', async () => {
await navigationBarPage.clickTagButton();
expect(tagPage.getNodeId()).toEqual('');
expect(tagPage.getNewTagPlaceholder()).toEqual('New Tag');
expect(tagPage.addTagButtonIsEnabled()).toEqual(false);
tagPage.checkTagListIsEmpty();
tagPage.checkTagListByNodeIdIsEmpty();
expect(tagPage.addNewTagInput('a').addTagButtonIsEnabled()).toEqual(false);
expect(tagPage.getNewTagInput()).toEqual('a');
await expect(await tagPage.getNodeId()).toEqual('');
await expect(await tagPage.getNewTagPlaceholder()).toEqual('New Tag');
await expect(await tagPage.addTagButtonIsEnabled()).toEqual(false);
await tagPage.checkTagListIsEmpty();
await tagPage.checkTagListByNodeIdIsEmpty();
await tagPage.addNewTagInput('a');
await expect(await tagPage.addTagButtonIsEnabled()).toEqual(false);
await expect(await tagPage.getNewTagInput()).toEqual('a');
});
it('[C268151] Should be possible to add a new tag to a Node', () => {
tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(tagList[0]);
it('[C268151] Should be possible to add a new tag to a Node', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
await tagPage.addTag(tagList[0]);
tagPage.checkTagIsDisplayedInTagList(tagList[0]);
tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[0]);
await tagPage.checkTagIsDisplayedInTagList(tagList[0]);
await tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[0]);
});
it('[C260377] Should NOT be possible to add a tag that already exists', () => {
tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(sameTag);
tagPage.checkTagIsDisplayedInTagList(sameTag);
tagPage.addTag(sameTag);
expect(tagPage.getErrorMessage()).toEqual('Tag already exists');
it('[C260377] Should NOT be possible to add a tag that already exists', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
await tagPage.addTag(sameTag);
await tagPage.checkTagIsDisplayedInTagList(sameTag);
await tagPage.addTag(sameTag);
await expect(await tagPage.getErrorMessage()).toEqual('Tag already exists');
});
it('[C91326] Should be possible to create a tag with different characters', () => {
tagPage.insertNodeId(pdfFileModel.id);
it('[C91326] Should be possible to create a tag with different characters', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(uppercaseTag + digitsTag + nonLatinTag);
await tagPage.addTag(uppercaseTag + digitsTag + nonLatinTag);
browser.driver.sleep(5000); // wait CS return tags
await browser.sleep(5000); // wait CS return tags
tagPage.checkTagIsDisplayedInTagList(uppercaseTag.toLowerCase() + digitsTag + nonLatinTag);
tagPage.checkTagIsDisplayedInTagListByNodeId(uppercaseTag.toLowerCase() + digitsTag + nonLatinTag);
await tagPage.checkTagIsDisplayedInTagList(uppercaseTag.toLowerCase() + digitsTag + nonLatinTag);
await tagPage.checkTagIsDisplayedInTagListByNodeId(uppercaseTag.toLowerCase() + digitsTag + nonLatinTag);
tagPage.checkTagIsNotDisplayedInTagList(uppercaseTag + digitsTag + nonLatinTag);
await tagPage.checkTagIsNotDisplayedInTagList(uppercaseTag + digitsTag + nonLatinTag);
});
it('[C260375] Should be possible to delete a tag', () => {
it('[C260375] Should be possible to delete a tag', async () => {
const deleteTag = StringUtil.generateRandomString().toUpperCase();
tagPage.insertNodeId(deleteFile.id);
await tagPage.insertNodeId(deleteFile.id);
tagPage.addTag(deleteTag);
await tagPage.addTag(deleteTag);
tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
await tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
await tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
tagPage.deleteTagFromTagListByNodeId(deleteTag.toLowerCase());
await tagPage.deleteTagFromTagListByNodeId(deleteTag.toLowerCase());
tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
await tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
await tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
tagPage.insertNodeId(deleteFile.id);
await tagPage.insertNodeId(deleteFile.id);
tagPage.addTag(deleteTag);
await tagPage.addTag(deleteTag);
tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
await tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
await tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
tagPage.deleteTagFromTagList(deleteTag.toLowerCase());
await tagPage.deleteTagFromTagList(deleteTag.toLowerCase());
tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
await tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
await tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
});
it('[C286290] Should be able to hide the delete option from a tag component', () => {
tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(tagList[3]);
it('[C286290] Should be able to hide the delete option from a tag component', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
await tagPage.addTag(tagList[3]);
tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[3]);
tagPage.checkDeleteTagFromTagListByNodeIdIsDisplayed(tagList[3]);
await tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[3]);
await tagPage.checkDeleteTagFromTagListByNodeIdIsDisplayed(tagList[3]);
tagPage.clickShowDeleteButtonSwitch();
await tagPage.clickShowDeleteButtonSwitch();
tagPage.checkDeleteTagFromTagListByNodeIdIsNotDisplayed(tagList[3]);
await tagPage.checkDeleteTagFromTagListByNodeIdIsNotDisplayed(tagList[3]);
});
it('[C286472] Should be able to click Show more/less button on List Tags Content Services', () => {
tagPage.insertNodeId(pdfFileModel.id);
it('[C286472] Should be able to click Show more/less button on List Tags Content Services', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
tagPage.checkShowMoreButtonIsDisplayed();
tagPage.checkShowLessButtonIsNotDisplayed();
await tagPage.checkShowMoreButtonIsDisplayed();
await tagPage.checkShowLessButtonIsNotDisplayed();
expect(tagPage.checkTagsOnList()).toEqual(10);
await expect(await tagPage.checkTagsOnList()).toEqual(10);
tagPage.clickShowMoreButton();
tagPage.checkShowLessButtonIsDisplayed();
await tagPage.clickShowMoreButton();
await tagPage.checkShowLessButtonIsDisplayed();
tagPage.clickShowLessButton();
tagPage.checkShowLessButtonIsNotDisplayed();
await tagPage.clickShowLessButton();
await tagPage.checkShowLessButtonIsNotDisplayed();
});
it('[C260378] Should be possible to add multiple tags', () => {
tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(tagList[2]);
it('[C260378] Should be possible to add multiple tags', async () => {
await tagPage.insertNodeId(pdfFileModel.id);
await tagPage.addTag(tagList[2]);
browser.driver.sleep(5000); // wait CS return tags
await browser.sleep(5000); // wait CS return tags
tagPage.checkTagListIsOrderedAscending();
tagPage.checkTagListByNodeIdIsOrderedAscending();
tagPage.checkTagListContentServicesIsOrderedAscending();
await tagPage.checkTagListIsOrderedAscending();
await tagPage.checkTagListByNodeIdIsOrderedAscending();
await tagPage.checkTagListContentServicesIsOrderedAscending();
});
});

View File

@@ -54,97 +54,84 @@ describe('Trashcan - Pagination', () => {
const navigationBarPage = new NavigationBarPage();
const acsUser = new AcsUserModel();
const newFolderModel = new FolderModel({ 'name': 'newFolder' });
const nrOfFiles = 20;
const newFolderModel = new FolderModel({ name: 'newFolder' });
const noOfFiles = 20;
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const fileNames = Util.generateSequenceFiles(10, nrOfFiles + 9, pagination.base, pagination.extension);
const fileNames = Util.generateSequenceFiles(10, noOfFiles + 9, pagination.base, pagination.extension);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const folderUploadedModel = await uploadActions.createFolder(newFolderModel.name, '-my-');
const emptyFiles = await uploadActions.createEmptyFiles(fileNames, folderUploadedModel.entry.id);
await emptyFiles.list.entries.forEach(async (node) => {
await this.alfrescoJsApi.node.deleteNode(node.entry.id).then(() => {
}, () => {
this.alfrescoJsApi.node.deleteNode(node.entry.id);
const emptyFiles: any = await uploadActions.createEmptyFiles(fileNames, folderUploadedModel.entry.id);
for (const entry of emptyFiles.list.entries) {
await this.alfrescoJsApi.node.deleteNode(entry.entry.id).then(() => {}, () => {
this.alfrescoJsApi.node.deleteNode(entry.entry.id);
});
});
}
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickTrashcanButton();
trashcanPage.waitForTableBody();
done();
await navigationBarPage.clickTrashcanButton();
await trashcanPage.waitForTableBody();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
afterEach((done) => {
browser.refresh();
trashcanPage.waitForTableBody();
done();
afterEach(async () => {
await browser.refresh();
await trashcanPage.waitForTableBody();
});
it('[C272811] Should be able to set Items per page to 20', () => {
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
expect(trashcanPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C272811] Should be able to set Items per page to 20', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + noOfFiles + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(noOfFiles);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C276742] Should be able to set Items per page to 15', () => {
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + nrOfFiles);
expect(trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C276742] Should be able to set Items per page to 15', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C276743] Should be able to set Items per page to 10', () => {
paginationPage.selectItemsPerPage(itemsPerPage.ten);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue + ' of ' + nrOfFiles);
expect(trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C276743] Should be able to set Items per page to 10', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C276744] Should be able to set Items per page to 5', () => {
paginationPage.selectItemsPerPage(itemsPerPage.five);
trashcanPage.waitForTableBody();
trashcanPage.waitForPagination();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + nrOfFiles);
expect(trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
it('[C276744] Should be able to set Items per page to 5', async () => {
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await trashcanPage.waitForTableBody();
await trashcanPage.waitForPagination();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + noOfFiles);
await expect(await trashcanPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
})
;

View File

@@ -45,7 +45,7 @@ describe('Tree View Component', () => {
document: 'MyFile'
};
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -69,78 +69,75 @@ describe('Tree View Component', () => {
nodeType: 'cm:content'
});
loginPage.loginToContentServicesUsingUserModel(acsUser);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickTreeViewButton();
done();
await navigationBarPage.clickTreeViewButton();
});
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(treeFolder.entry.id);
await uploadActions.deleteFileOrFolder(secondTreeFolder.entry.id);
done();
});
it('[C289972] Should be able to show folders and sub-folders of a node as a tree view', () => {
treeViewPage.checkTreeViewTitleIsDisplayed();
it('[C289972] Should be able to show folders and sub-folders of a node as a tree view', async () => {
await treeViewPage.checkTreeViewTitleIsDisplayed();
expect(treeViewPage.getNodeId()).toEqual(nodeNames.parentFolder);
await expect(await treeViewPage.getNodeId()).toEqual(nodeNames.parentFolder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.folder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.folder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
treeViewPage.clickNode(nodeNames.secondFolder);
await treeViewPage.clickNode(nodeNames.secondFolder);
treeViewPage.checkClickedNodeName(nodeNames.secondFolder);
treeViewPage.checkNodeIsDisplayedAsOpen(nodeNames.secondFolder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
await treeViewPage.checkClickedNodeName(nodeNames.secondFolder);
await treeViewPage.checkNodeIsDisplayedAsOpen(nodeNames.secondFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
treeViewPage.clickNode(nodeNames.thirdFolder);
await treeViewPage.clickNode(nodeNames.thirdFolder);
treeViewPage.checkClickedNodeName(nodeNames.thirdFolder);
treeViewPage.checkNodeIsDisplayedAsOpen(nodeNames.thirdFolder);
await treeViewPage.checkClickedNodeName(nodeNames.thirdFolder);
await treeViewPage.checkNodeIsDisplayedAsOpen(nodeNames.thirdFolder);
treeViewPage.clickNode(nodeNames.secondFolder);
await treeViewPage.clickNode(nodeNames.secondFolder);
treeViewPage.checkClickedNodeName(nodeNames.secondFolder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
treeViewPage.checkNodeIsNotDisplayed(nodeNames.thirdFolder);
await treeViewPage.checkClickedNodeName(nodeNames.secondFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
await treeViewPage.checkNodeIsNotDisplayed(nodeNames.thirdFolder);
});
it('[C289973] Should be able to change the default nodeId', () => {
treeViewPage.clearNodeIdInput();
it('[C289973] Should be able to change the default nodeId', async () => {
await treeViewPage.clearNodeIdInput();
treeViewPage.checkNoNodeIdMessageIsDisplayed();
treeViewPage.addNodeId(secondTreeFolder.entry.id);
await treeViewPage.checkNoNodeIdMessageIsDisplayed();
await treeViewPage.addNodeId(secondTreeFolder.entry.id);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
treeViewPage.addNodeId('ThisIdDoesNotExist');
treeViewPage.checkErrorMessageIsDisplayed();
await treeViewPage.addNodeId('ThisIdDoesNotExist');
await treeViewPage.checkErrorMessageIsDisplayed();
treeViewPage.addNodeId(nodeNames.parentFolder);
await treeViewPage.addNodeId(nodeNames.parentFolder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.folder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.folder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.secondFolder);
treeViewPage.clickNode(nodeNames.secondFolder);
await treeViewPage.clickNode(nodeNames.secondFolder);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
});
it('[C290071] Should not be able to display files', () => {
treeViewPage.addNodeId(secondTreeFolder.entry.id);
it('[C290071] Should not be able to display files', async () => {
await treeViewPage.addNodeId(secondTreeFolder.entry.id);
treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
await treeViewPage.checkNodeIsDisplayedAsClosed(nodeNames.thirdFolder);
treeViewPage.clickNode(nodeNames.thirdFolder);
await treeViewPage.clickNode(nodeNames.thirdFolder);
expect(treeViewPage.getTotalNodes()).toEqual(1);
await expect(await treeViewPage.getTotalNodes()).toEqual(1);
});
});

View File

@@ -26,12 +26,12 @@ import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
describe('Upload component', () => {
describe('Upload component', async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const contentServicesPage = new ContentServicesPage();
const uploadDialog = new UploadDialog();
const uploadToggles = new UploadToggles();
@@ -53,7 +53,7 @@ describe('Upload component', () => {
'location': resources.Files.ADF_DOCUMENTS.LARGE_FILE.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -62,55 +62,57 @@ describe('Upload component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(() => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
it('[C272792] Should be possible to cancel upload of a big file using row cancel icon', () => {
browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 3000)');
it('[C272792] Should be possible to cancel upload of a big file using row cancel icon', async () => {
await browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 3000)');
contentServicesPage.uploadFile(largeFile.location);
await contentServicesPage.uploadFile(largeFile.location);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
});
it('[C287790] Should be possible to cancel upload of a big file through the cancel uploads button', () => {
browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
it('[C287790] Should be possible to cancel upload of a big file through the cancel uploads button', async () => {
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
contentServicesPage.uploadFile(largeFile.location);
await contentServicesPage.uploadFile(largeFile.location);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
});
it('[C272793] Should be able to cancel multiple files upload', () => {
browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
it('[C272793] Should be able to cancel multiple files upload', async () => {
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
uploadToggles.enableMultipleFileUpload();
contentServicesPage.uploadMultipleFile([pngFileModel.location, largeFile.location]);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name).checkContentIsNotDisplayed(largeFile.name);
uploadToggles.disableMultipleFileUpload();
await uploadToggles.enableMultipleFileUpload();
await contentServicesPage.uploadMultipleFile([pngFileModel.location, largeFile.location]);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
await contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
await uploadToggles.disableMultipleFileUpload();
});
});

View File

@@ -55,7 +55,7 @@ describe('Upload component - Excluded Files', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
@@ -69,42 +69,39 @@ describe('Upload component - Excluded Files', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
afterEach(async (done) => {
contentServicesPage.goToDocumentList();
afterEach(async () => {
await contentServicesPage.goToDocumentList();
done();
});
it('[C279914] Should not allow upload default excluded files using D&D', () => {
contentServicesPage.checkDragAndDropDIsDisplayed();
it('[C279914] Should not allow upload default excluded files using D&D', async () => {
await contentServicesPage.checkDragAndDropDIsDisplayed();
const dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
const dragAndDrop = new DropActions();
dragAndDrop.dropFile(dragAndDropArea, iniExcludedFile.location);
await dragAndDrop.dropFile(dragAndDropArea, iniExcludedFile.location);
browser.driver.sleep(5000);
await browser.sleep(5000);
uploadDialog.dialogIsNotDisplayed();
await uploadDialog.dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(iniExcludedFile.name);
await contentServicesPage.checkContentIsNotDisplayed(iniExcludedFile.name);
});
it('[C260122] Should not allow upload default excluded files using Upload button', () => {
contentServicesPage
.uploadFile(iniExcludedFile.location)
.checkContentIsNotDisplayed(iniExcludedFile.name);
it('[C260122] Should not allow upload default excluded files using Upload button', async () => {
await contentServicesPage.uploadFile(iniExcludedFile.location);
await contentServicesPage.checkContentIsNotDisplayed(iniExcludedFile.name);
});
it('[C212862] Should not allow upload file excluded in the files extension of app.config.json', async () => {
@@ -113,11 +110,12 @@ describe('Upload component - Excluded Files', () => {
'match-options': { 'nocase': true }
}));
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
contentServicesPage
.uploadFile(txtFileModel.location)
.checkContentIsNotDisplayed(txtFileModel.name);
await contentServicesPage
.uploadFile(txtFileModel.location);
await contentServicesPage.checkContentIsNotDisplayed(txtFileModel.name);
});
it('[C274688] Should extension type added as excluded and accepted not be uploaded', async () => {
@@ -126,14 +124,14 @@ describe('Upload component - Excluded Files', () => {
'match-options': { 'nocase': true }
}));
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
uploadToggles.enableExtensionFilter();
browser.driver.sleep(1000);
uploadToggles.addExtension('.png');
await uploadToggles.enableExtensionFilter();
await browser.sleep(1000);
await uploadToggles.addExtension('.png');
contentServicesPage.uploadFile(pngFile.location);
browser.driver.sleep(1000);
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.uploadFile(pngFile.location);
await browser.sleep(1000);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
});
});

View File

@@ -0,0 +1,185 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BrowserActions, LoginPage, UploadActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
import { FileModel } from '../../models/ACS/fileModel';
import { browser } from 'protractor';
import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
describe('Upload component', () => {
const contentServicesPage = new ContentServicesPage();
const uploadDialog = new UploadDialog();
const uploadToggles = new UploadToggles();
const loginPage = new LoginPage();
const acsUser = new AcsUserModel();
const versionManagePage = new VersionManagePage();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const firstPdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location
});
const docxFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name,
'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location
});
const pdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
});
const pngFileModelTwo = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location
});
const pngFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const filesLocation = [pdfFileModel.location, docxFileModel.location, pngFileModel.location, firstPdfFileModel.location];
const filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name];
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.login(acsUser.id, acsUser.password);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await contentServicesPage.goToDocumentList();
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
});
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
afterEach(async () => {
const nbResults = await contentServicesPage.numberOfResultsDisplayed();
if (nbResults > 1) {
const nodesPromise = await contentServicesPage.getElementsDisplayedId();
for (const node of nodesPromise) {
const nodeId = await node;
await uploadActions.deleteFileOrFolder(nodeId);
}
}
});
it('[C260143] Should be possible to maximize/minimize the upload dialog', async () => {
await contentServicesPage
.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.minimizeUploadDialog();
await uploadDialog.dialogIsMinimized();
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.maximizeUploadDialog();
await uploadDialog.dialogIsDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C291902] Should be shown upload counter display in dialog box', async () => {
await contentServicesPage
.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(await uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260168] Should be possible to cancel upload using dialog icon', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.removeUploadedFile(pdfFileModel.name);
await uploadDialog.fileIsCancelled(pdfFileModel.name);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
});
it('[C260176] Should remove files from upload dialog box when closed', async () => {
await contentServicesPage.uploadFile(pngFileModelTwo.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModelTwo.name);
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage .checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260170] Should be possible to upload multiple files', async () => {
await contentServicesPage.checkAcsContainer();
await uploadToggles.enableMultipleFileUpload();
await contentServicesPage.uploadMultipleFile(filesLocation);
await contentServicesPage.checkContentsAreDisplayed(filesName);
await uploadDialog.filesAreUploaded(filesName);
await expect(await uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableMultipleFileUpload();
});
it('[C311305] Should NOT be able to remove uploaded version', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await contentServicesPage.versionManagerContent(docxFileModel.name);
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.uploadNewVersionFile(pngFileModel.location);
await versionManagePage.closeVersionDialog();
await uploadDialog.removeUploadedFile(pngFileModel.name);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
});
});

View File

@@ -66,28 +66,28 @@ describe('Upload component', () => {
const filesLocation = [pdfFileModel.location, docxFileModel.location, pngFileModel.location, firstPdfFileModel.location];
const filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name];
beforeAll(async (done) => {
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.login(acsUser.id, acsUser.password);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(() => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
afterEach(async (done) => {
afterEach(async () => {
const nbResults = await contentServicesPage.numberOfResultsDisplayed();
if (nbResults > 1) {
const nodesPromise = await contentServicesPage.getElementsDisplayedId();
@@ -97,80 +97,99 @@ describe('Upload component', () => {
await uploadActions.deleteFileOrFolder(nodeId);
});
}
done();
});
it('[C260143] Should be possible to maximize/minimize the upload dialog', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
it('[C260143] Should be possible to maximize/minimize the upload dialog', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
uploadDialog.fileIsUploaded(docxFileModel.name).checkCloseButtonIsDisplayed();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.minimizeUploadDialog().dialogIsMinimized();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.maximizeUploadDialog().dialogIsDisplayed().fileIsUploaded(docxFileModel.name);
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.checkCloseButtonIsDisplayed().clickOnCloseButton().dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.minimizeUploadDialog();
await uploadDialog.dialogIsMinimized();
await expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.maximizeUploadDialog();
await uploadDialog.dialogIsDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C291902] Should be shown upload counter display in dialog box', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
it('[C291902] Should be shown upload counter display in dialog box', async () => {
await contentServicesPage
.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(docxFileModel.name).checkCloseButtonIsDisplayed();
expect(uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
uploadDialog.checkCloseButtonIsDisplayed().clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(uploadDialog.getTitleText()).toEqual('Uploaded 1 / 1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260168] Should be possible to cancel upload using dialog icon', () => {
contentServicesPage.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
uploadDialog.removeUploadedFile(pdfFileModel.name).fileIsCancelled(pdfFileModel.name);
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
it('[C260168] Should be possible to cancel upload using dialog icon', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.removeUploadedFile(pdfFileModel.name);
await uploadDialog.fileIsCancelled(pdfFileModel.name);
await expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
});
it('[C260176] Should remove files from upload dialog box when closed', () => {
contentServicesPage.uploadFile(pngFileModelTwo.location).checkContentIsDisplayed(pngFileModelTwo.name);
it('[C260176] Should remove files from upload dialog box when closed', async () => {
await contentServicesPage.uploadFile(pngFileModelTwo.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModelTwo.name);
uploadDialog.fileIsUploaded(pngFileModelTwo.name);
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsDisplayed(pngFileModel.name);
uploadDialog.fileIsUploaded(pngFileModel.name).fileIsUploaded(pngFileModelTwo.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.uploadFile(pdfFileModel.location).checkContentIsDisplayed(pdfFileModel.name);
uploadDialog.fileIsUploaded(pdfFileModel.name).fileIsNotDisplayedInDialog(pngFileModel.name).fileIsNotDisplayedInDialog(pngFileModelTwo.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.fileIsUploaded(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModel.name);
await uploadDialog.fileIsNotDisplayedInDialog(pngFileModelTwo.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260170] Should be possible to upload multiple files', () => {
contentServicesPage.checkAcsContainer();
uploadToggles.enableMultipleFileUpload();
contentServicesPage.uploadMultipleFile(filesLocation).checkContentsAreDisplayed(filesName);
uploadDialog.filesAreUploaded(filesName);
expect(uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
uploadToggles.disableMultipleFileUpload();
it('[C260170] Should be possible to upload multiple files', async () => {
await contentServicesPage.checkAcsContainer();
await uploadToggles.enableMultipleFileUpload();
await contentServicesPage.uploadMultipleFile(filesLocation);
await contentServicesPage.checkContentsAreDisplayed(filesName);
await uploadDialog.filesAreUploaded(filesName);
await expect(uploadDialog.getTitleText()).toEqual('Uploaded 4 / 4');
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableMultipleFileUpload();
});
it('[C311305] Should NOT be able to remove uploaded version', () => {
contentServicesPage.uploadFile(docxFileModel.location);
uploadDialog.fileIsUploaded(docxFileModel.name);
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
it('[C311305] Should NOT be able to remove uploaded version', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await uploadDialog.fileIsUploaded(docxFileModel.name);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
contentServicesPage.versionManagerContent(docxFileModel.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(
await contentServicesPage.versionManagerContent(docxFileModel.name);
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.uploadNewVersionFile(
pngFileModel.location
);
versionManagePage.closeVersionDialog();
uploadDialog.removeUploadedFile(pngFileModel.name);
contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
await versionManagePage.closeVersionDialog();
await uploadDialog.removeUploadedFile(pngFileModel.name);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
});
});

View File

@@ -36,9 +36,9 @@ describe('Upload component', () => {
const loginPage = new LoginPage();
const acsUser = new AcsUserModel();
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 navigationBarPage = new NavigationBarPage();
@@ -67,7 +67,7 @@ describe('Upload component', () => {
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -75,259 +75,255 @@ describe('Upload component', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
const pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, '-my-');
Object.assign(firstPdfFileModel, pdfUploadedFile.entry);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
done();
});
beforeEach(() => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
});
describe('', () => {
beforeEach(() => {
contentServicesPage.goToDocumentList();
afterEach(async () => {
const nodeList = await contentServicesPage.getElementsDisplayedId();
for (const node of nodeList) {
try {
await uploadActions.deleteFileOrFolder(node);
} catch (error) {
}
}
});
afterEach(async (done) => {
it('[C272788] Should display upload button', async () => {
await expect(await contentServicesPage.getSingleFileButtonTooltip()).toEqual('Custom tooltip');
contentServicesPage.getElementsDisplayedId().then((nodeList) => {
nodeList.forEach(async (currentNode) => {
await uploadActions.deleteFileOrFolder(currentNode);
});
});
done();
await contentServicesPage.checkUploadButton();
await contentServicesPage.checkContentIsDisplayed(firstPdfFileModel.name);
});
it('[C272788] Should display upload button', () => {
expect(contentServicesPage.getSingleFileButtonTooltip()).toEqual('Custom tooltip');
it('[C272789] Should be able to upload PDF file', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
contentServicesPage
.checkUploadButton()
.checkContentIsDisplayed(firstPdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C272789] Should be able to upload PDF file', () => {
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
it('[C272790] Should be able to upload text file', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(pdfFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C272790] Should be able to upload text file', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
it('[C260141] Should be possible to upload PNG file', async () => {
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pngFileModel.name);
uploadDialog.fileIsUploaded(docxFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(pngFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260141] Should be possible to upload PNG file', () => {
contentServicesPage
.uploadFile(pngFileModel.location)
.checkContentIsDisplayed(pngFileModel.name);
it('[C260143] Should be possible to maximize/minimize the upload dialog', async () => {
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(pngFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await uploadDialog.checkCloseButtonIsDisplayed();
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.minimizeUploadDialog();
await uploadDialog.dialogIsMinimized();
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.maximizeUploadDialog();
await uploadDialog.dialogIsDisplayed();
await uploadDialog.fileIsUploaded(docxFileModel.name);
await expect(await uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
await expect(await uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
await uploadDialog.checkCloseButtonIsDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
});
it('[C260143] Should be possible to maximize/minimize the upload dialog', () => {
contentServicesPage
.uploadFile(docxFileModel.location)
.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.fileIsUploaded(docxFileModel.name).checkCloseButtonIsDisplayed();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.minimizeUploadDialog().dialogIsMinimized();
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.maximizeUploadDialog().dialogIsDisplayed().fileIsUploaded(docxFileModel.name);
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
uploadDialog.checkCloseButtonIsDisplayed().clickOnCloseButton().dialogIsNotDisplayed();
it('[C272794] Should display tooltip for uploading files', async () => {
await uploadToggles.enableMultipleFileUpload();
await uploadToggles.checkMultipleFileUploadToggleIsEnabled();
await expect(await contentServicesPage.getMultipleFileButtonTooltip()).toEqual('Custom tooltip');
await uploadToggles.disableMultipleFileUpload();
});
it('[C272794] Should display tooltip for uploading files', () => {
uploadToggles.enableMultipleFileUpload();
uploadToggles.checkMultipleFileUploadToggleIsEnabled();
browser.driver.sleep(1000);
expect(contentServicesPage.getMultipleFileButtonTooltip()).toEqual('Custom tooltip');
uploadToggles.disableMultipleFileUpload();
});
it('[C279920] Should rename a file uploaded twice', () => {
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
it('[C279920] Should rename a file uploaded twice', async () => {
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
pdfFileModel.setVersion('1');
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.getVersionName());
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.getVersionName());
uploadDialog
.clickOnCloseButton()
.dialogIsNotDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
pdfFileModel.setVersion('');
});
it('[C260172] Should be possible to enable versioning', () => {
uploadToggles.enableVersioning();
uploadToggles.checkVersioningToggleIsEnabled();
it('[C260172] Should be possible to enable versioning', async () => {
await uploadToggles.enableVersioning();
await uploadToggles.checkVersioningToggleIsEnabled();
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
pdfFileModel.setVersion('1');
contentServicesPage
.uploadFile(pdfFileModel.location)
.checkContentIsDisplayed(pdfFileModel.name);
await contentServicesPage.uploadFile(pdfFileModel.location);
await contentServicesPage.checkContentIsDisplayed(pdfFileModel.name);
uploadDialog
.fileIsUploaded(pdfFileModel.name);
await uploadDialog.fileIsUploaded(pdfFileModel.name);
uploadDialog
.clickOnCloseButton()
.dialogIsNotDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
contentServicesPage
.checkContentIsNotDisplayed(pdfFileModel.getVersionName());
await contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.getVersionName());
pdfFileModel.setVersion('');
uploadToggles.disableVersioning();
await uploadToggles.disableVersioning();
});
it('[C260174] Should be possible to set a max size', () => {
contentServicesPage.goToDocumentList();
contentServicesPage.checkAcsContainer();
uploadToggles.enableMaxSize();
uploadToggles.checkMaxSizeToggleIsEnabled();
uploadToggles.addMaxSize('400');
contentServicesPage.uploadFile(fileWithSpecificSize.location);
uploadDialog.fileIsUploaded(fileWithSpecificSize.name).clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.deleteContent(fileWithSpecificSize.name);
contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
uploadToggles.addMaxSize('399');
contentServicesPage.uploadFile(fileWithSpecificSize.location);
it('[C260174] Should be possible to set a max size', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkAcsContainer();
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await uploadToggles.addMaxSize('400');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
await uploadDialog.fileIsUploaded(fileWithSpecificSize.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.deleteContent(fileWithSpecificSize.name);
await contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
await uploadToggles.addMaxSize('399');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
// expect(contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
// await expect(await contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
uploadDialog.fileIsUploaded(emptyFile.name).clickOnCloseButton().dialogIsNotDisplayed();
await contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
await uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
await contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableMaxSize();
await uploadToggles.disableMaxSize();
});
it('[C272796] Should be possible to set max size to 0', () => {
contentServicesPage.goToDocumentList();
uploadToggles.enableMaxSize();
uploadToggles.checkMaxSizeToggleIsEnabled();
uploadToggles.addMaxSize('0');
contentServicesPage.uploadFile(fileWithSpecificSize.location);
// expect(contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
it('[C272796] Should be possible to set max size to 0', async () => {
await contentServicesPage.goToDocumentList();
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await uploadToggles.addMaxSize('0');
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
// await expect(await contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
uploadDialog.fileIsUploaded(emptyFile.name).clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
await contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableMaxSize();
await uploadToggles.disableMaxSize();
});
it('[C272797] Should be possible to set max size to 1', () => {
uploadToggles.enableMaxSize();
uploadToggles.checkMaxSizeToggleIsEnabled();
browser.driver.sleep(1000);
uploadToggles.addMaxSize('1');
uploadToggles.disableMaxSize();
contentServicesPage.uploadFile(fileWithSpecificSize.location);
uploadDialog.fileIsUploaded(fileWithSpecificSize.name).clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.checkContentIsDisplayed(fileWithSpecificSize.name);
it('[C272797] Should be possible to set max size to 1', async () => {
await uploadToggles.enableMaxSize();
await uploadToggles.checkMaxSizeToggleIsEnabled();
await browser.sleep(1000);
await uploadToggles.addMaxSize('1');
await uploadToggles.disableMaxSize();
await contentServicesPage.uploadFile(fileWithSpecificSize.location);
await uploadDialog.fileIsUploaded(fileWithSpecificSize.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(fileWithSpecificSize.name);
});
it('[C91318] Should Enable/Disable upload button when change the disable property', () => {
uploadToggles.clickCheckboxDisableUpload();
expect(contentServicesPage.uploadButtonIsEnabled()).toBeFalsy();
it('[C91318] Should Enable/Disable upload button when change the disable property', async () => {
await uploadToggles.clickCheckboxDisableUpload();
await expect(await contentServicesPage.uploadButtonIsEnabled()).toBe(false, 'Upload button is enabled');
uploadToggles.clickCheckboxDisableUpload();
expect(contentServicesPage.uploadButtonIsEnabled()).toBeTruthy();
await uploadToggles.clickCheckboxDisableUpload();
await expect(await contentServicesPage.uploadButtonIsEnabled()).toBe(true, 'Upload button not enabled');
});
});
it('[C260171] Should upload only the extension filter allowed when Enable extension filter is enabled', () => {
uploadToggles.enableExtensionFilter();
browser.driver.sleep(1000);
uploadToggles.addExtension('.docx');
contentServicesPage.uploadFile(docxFileModel.location).checkContentIsDisplayed(docxFileModel.name);
uploadDialog.removeUploadedFile(docxFileModel.name).fileIsCancelled(docxFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsNotDisplayed(pngFileModel.name);
uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableExtensionFilter();
it('[C260171] Should upload only the extension filter allowed when Enable extension filter is enabled', async () => {
await uploadToggles.enableExtensionFilter();
await browser.sleep(1000);
await uploadToggles.addExtension('.docx');
await contentServicesPage.uploadFile(docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await uploadDialog.removeUploadedFile(docxFileModel.name);
await uploadDialog.fileIsCancelled(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.uploadFile(pngFileModel.location);
await contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableExtensionFilter();
});
it('[C274687] Should upload with drag and drop only the extension filter allowed when Enable extension filter is enabled', () => {
uploadToggles.enableExtensionFilter();
browser.driver.sleep(1000);
uploadToggles.addExtension('.docx');
it('[C274687] Should upload with drag and drop only the extension filter allowed when Enable extension filter is enabled', async () => {
await uploadToggles.enableExtensionFilter();
await browser.sleep(1000);
await uploadToggles.addExtension('.docx');
const dragAndDrop = new DropActions();
const dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
dragAndDrop.dropFile(dragAndDropArea, docxFileModel.location);
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
await dragAndDrop.dropFile(dragAndDropArea, docxFileModel.location);
await contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
uploadDialog.removeUploadedFile(docxFileModel.name).fileIsCancelled(docxFileModel.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.removeUploadedFile(docxFileModel.name);
await uploadDialog.fileIsCancelled(docxFileModel.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
dragAndDrop.dropFile(dragAndDropArea, pngFileModel.location);
contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
uploadDialog.dialogIsNotDisplayed();
uploadToggles.disableExtensionFilter();
await dragAndDrop.dropFile(dragAndDropArea, pngFileModel.location);
await contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
await uploadDialog.dialogIsNotDisplayed();
await uploadToggles.disableExtensionFilter();
});
it('[C291921] Should display tooltip for uploading files on a not found location', async () => {
const folderName = StringUtil.generateRandomString(8);
const folderUploadedModel = await browser.controlFlow().execute(async () => {
return await uploadActions.createFolder(folderName, '-my-');
});
const folderUploadedModel = await uploadActions.createFolder(folderName, '-my-');
await navigationBarPage.openContentServicesFolder(folderUploadedModel.entry.id);
await contentServicesPage.checkUploadButton();
navigationBarPage.openContentServicesFolder(folderUploadedModel.entry.id);
contentServicesPage.checkUploadButton();
await uploadActions.deleteFileOrFolder(folderUploadedModel.entry.id);
browser.controlFlow().execute(async () => {
await uploadActions.deleteFileOrFolder(folderUploadedModel.entry.id);
});
await contentServicesPage.uploadFile(pdfFileModel.location);
contentServicesPage.uploadFile(pdfFileModel.location);
uploadDialog.displayTooltip();
expect(uploadDialog.getTooltip()).toEqual('Upload location no longer exists [404]');
await uploadDialog.displayTooltip();
await expect(await uploadDialog.getTooltip()).toEqual('Upload location no longer exists [404]');
});
});

View File

@@ -56,14 +56,14 @@ describe('Upload - User permission', () => {
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
});
beforeAll(() => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
});
beforeEach(async (done) => {
beforeEach(async () => {
acsUser = new AcsUserModel();
acsUserTwo = new AcsUserModel();
@@ -95,106 +95,99 @@ describe('Upload - User permission', () => {
role: CONSTANTS.CS_USER_ROLES.MANAGER
});
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
done();
});
describe('Consumer permissions', () => {
beforeEach(async (done) => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
done();
});
it('[C291921] Should display tooltip for uploading files without permissions', () => {
navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
it('[C291921] Should display tooltip for uploading files without permissions', async () => {
await navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
contentServicesPage.checkDragAndDropDIsDisplayed();
await contentServicesPage.checkDragAndDropDIsDisplayed();
contentServicesPage.dragAndDropFile(emptyFile.location);
await contentServicesPage.dragAndDropFile(emptyFile.location);
uploadDialog.fileIsError(emptyFile.name);
await uploadDialog.fileIsError(emptyFile.name);
uploadDialog.displayTooltip();
await uploadDialog.displayTooltip();
expect(uploadDialog.getTooltip()).toEqual('Insufficient permissions to upload in this location [403]');
await expect(await uploadDialog.getTooltip()).toEqual('Insufficient permissions to upload in this location [403]');
});
it('[C279915] Should not be allowed to upload a file in folder with consumer permissions', () => {
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
it('[C279915] Should not be allowed to upload a file in folder with consumer permissions', async () => {
await contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
await navigationBarPage.openContentServicesFolder(this.consumerSite.entry.guid);
browser.sleep(3000);
await browser.sleep(3000);
contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.uploadFile(emptyFile.location);
notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
await notificationHistoryPage.checkNotifyContains('You don\'t have the create permission to upload the content');
});
});
describe('full permissions', () => {
beforeEach(async (done) => {
navigationBarPage.openContentServicesFolder(this.managerSite.entry.guid);
beforeEach(async () => {
await navigationBarPage.openContentServicesFolder(this.managerSite.entry.guid);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
done();
});
it('[C279917] Should be allowed to upload a file in a folder with manager permissions', () => {
contentServicesPage.uploadFile(emptyFile.location);
it('[C279917] Should be allowed to upload a file in a folder with manager permissions', async () => {
await contentServicesPage.uploadFile(emptyFile.location);
uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
});
});
describe('multiple users', () => {
beforeEach(async (done) => {
contentServicesPage.goToDocumentList();
beforeEach(async () => {
await contentServicesPage.goToDocumentList();
done();
});
it('[C260175] Should two different user upload files in the proper User Home', async () => {
contentServicesPage.uploadFile(emptyFile.location);
await contentServicesPage.uploadFile(emptyFile.location);
uploadDialog.fileIsUploaded(emptyFile.name);
await uploadDialog.fileIsUploaded(emptyFile.name);
contentServicesPage.checkContentIsDisplayed(emptyFile.name);
await contentServicesPage.checkContentIsDisplayed(emptyFile.name);
navigationBarPage.clickLoginButton();
await navigationBarPage.clickLoginButton();
await loginPage.loginToContentServicesUsingUserModel(acsUserTwo);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsNotDisplayed(emptyFile.name);
await contentServicesPage.checkContentIsNotDisplayed(emptyFile.name);
contentServicesPage.uploadFile(pngFile.location);
await contentServicesPage.uploadFile(pngFile.location);
contentServicesPage.checkContentIsDisplayed(pngFile.name);
await contentServicesPage.checkContentIsDisplayed(pngFile.name);
navigationBarPage.clickLoginButton();
await navigationBarPage.clickLoginButton();
await loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
await contentServicesPage.goToDocumentList();
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
await contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
contentServicesPage.uploadFile(pdfFile.location);
await contentServicesPage.uploadFile(pdfFile.location);
contentServicesPage.checkContentIsDisplayed(pdfFile.name);
await contentServicesPage.checkContentIsDisplayed(pdfFile.name);
});
});

View File

@@ -28,10 +28,8 @@ import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { UploadActions } from '@alfresco/adf-testing';
import { Util } from '../../util/util';
import path = require('path');
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { BrowserVisibility } from '@alfresco/adf-testing';
import { BrowserVisibility, FileBrowserUtil, BrowserActions } from '@alfresco/adf-testing';
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
describe('Version component actions', () => {
@@ -40,6 +38,7 @@ describe('Version component actions', () => {
const contentServicesPage = new ContentServicesPage();
const versionManagePage = new VersionManagePage();
const navigationBarPage = new NavigationBarPage();
const uploadDialog = new UploadDialog();
const acsUser = new AcsUserModel();
@@ -49,8 +48,8 @@ describe('Version component actions', () => {
});
const fileModelVersionTwo = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
'name': resources.Files.ADF_DOCUMENTS.TXT.file_name,
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
});
let uploadActions;
@@ -59,122 +58,119 @@ describe('Version component actions', () => {
'location': resources.Files.ADF_DOCUMENTS.LARGE_FILE.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf_acs.host
});
uploadActions = new UploadActions(this.alfrescoJsApi);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
const txtUploadedFile = await uploadActions.uploadFile(txtFileModel.location, txtFileModel.name, '-my-');
Object.assign(txtFileModel, txtUploadedFile.entry);
txtFileModel.update(txtUploadedFile.entry);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.versionManagerContent(txtFileModel.name);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
beforeEach(async () => {
await contentServicesPage.versionManagerContent(txtFileModel.name);
});
it('[C280003] Should not be possible delete a file version if there is only one version', () => {
versionManagePage.clickActionButton('1.0');
expect(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)).isEnabled()).toBe(false);
versionManagePage.closeActionsMenu();
BrowserVisibility.waitUntilElementIsNotOnPage(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)));
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
});
it('[C280004] Should not be possible restore the version if there is only one version', () => {
versionManagePage.clickActionButton('1.0');
expect(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)).isEnabled()).toBe(false);
versionManagePage.closeActionsMenu();
BrowserVisibility.waitUntilElementIsNotOnPage(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)));
it('[C280003] Should not be possible delete a file version if there is only one version', async () => {
await versionManagePage.clickActionButton('1.0');
await expect(await element(by.css(`[id="adf-version-list-action-delete-1.0"]`)).isEnabled()).toBe(false);
await versionManagePage.closeActionsMenu();
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)));
});
it('[C280005] Should be showed all the default action when you have more then one version', () => {
versionManagePage.showNewVersionButton.click();
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
versionManagePage.clickActionButton('1.1').checkActionsArePresent('1.1');
versionManagePage.closeActionsMenu();
it('[C280004] Should not be possible restore the version if there is only one version', async () => {
await versionManagePage.clickActionButton('1.0');
await expect(await element(by.css(`[id="adf-version-list-action-restore-1.0"]`)).isEnabled()).toBe(false);
await versionManagePage.closeActionsMenu();
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)));
});
it('[C269081] Should be possible download all the version of a file', () => {
versionManagePage.downloadFileVersion('1.0');
it('[C280005] Should be showed all the default action when you have more then one version', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
expect(Util.fileExists(path.join(__dirname, 'downloads', txtFileModel.name), 20)).toBe(true);
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
versionManagePage.downloadFileVersion('1.1');
await versionManagePage.clickActionButton('1.1');
await versionManagePage.checkActionsArePresent('1.1');
expect(Util.fileExists(path.join(__dirname, 'downloads', fileModelVersionTwo.name), 20)).toBe(true);
await versionManagePage.closeActionsMenu();
await versionManagePage.closeVersionDialog();
await uploadDialog.clickOnCloseButton();
});
it('[C272819] Should be possible delete a version when click on delete version action', () => {
versionManagePage.deleteFileVersion('1.1');
versionManagePage.clickAcceptConfirm();
versionManagePage.checkFileVersionNotExist('1.1');
versionManagePage.checkFileVersionExist('1.0');
it('[C269081] Should be possible download all the version of a file', async () => {
await versionManagePage.downloadFileVersion('1.0');
await expect(await FileBrowserUtil.isFileDownloaded(txtFileModel.name)).toBe(true, `${txtFileModel.name} not downloaded`);
await versionManagePage.downloadFileVersion('1.1');
await expect(await FileBrowserUtil.isFileDownloaded(fileModelVersionTwo.name)).toBe(true, `${fileModelVersionTwo.name} not downloaded`);
});
it('[C280006] Should be possible prevent a version to be deleted when click on No on the confirm dialog', () => {
versionManagePage.showNewVersionButton.click();
it('[C272819] Should be possible delete a version when click on delete version action', async () => {
await versionManagePage.deleteFileVersion('1.1');
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
await versionManagePage.clickAcceptConfirm();
versionManagePage.checkFileVersionExist('1.1');
await versionManagePage.checkFileVersionNotExist('1.1');
await versionManagePage.checkFileVersionExist('1.0');
});
versionManagePage.deleteFileVersion('1.1');
it('[C280006] Should be possible prevent a version to be deleted when click on No on the confirm dialog', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.clickCancelConfirm();
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
versionManagePage.checkFileVersionExist('1.1');
versionManagePage.checkFileVersionExist('1.0');
versionManagePage.closeVersionDialog();
await versionManagePage.checkFileVersionExist('1.1');
await versionManagePage.deleteFileVersion('1.1');
await versionManagePage.clickCancelConfirm();
await versionManagePage.checkFileVersionExist('1.1');
await versionManagePage.checkFileVersionExist('1.0');
await versionManagePage.closeVersionDialog();
});
it('[C280007] Should be possible to restore an old version of your file and the document list updated', async () => {
contentServicesPage.versionManagerContent(fileModelVersionTwo.name);
versionManagePage.restoreFileVersion('1.0');
versionManagePage.checkFileVersionExist('2.0');
versionManagePage.closeVersionDialog();
contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(txtFileModel.name);
await contentServicesPage.versionManagerContent(fileModelVersionTwo.name);
await versionManagePage.restoreFileVersion('1.0');
await versionManagePage.checkFileVersionExist('2.0');
await versionManagePage.closeVersionDialog();
await contentServicesPage.waitForTableBody();
await contentServicesPage.checkContentIsDisplayed(txtFileModel.name);
});
it('[C307033] Should be possible to cancel the upload of a new version', async () => {
await browser.refresh();
contentServicesPage.versionManagerContent(txtFileModel.name);
browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 1000)');
await contentServicesPage.versionManagerContent(txtFileModel.name);
await browser.executeScript(' setTimeout(() => {document.querySelector(\'mat-icon[class*="adf-file-uploading-row__action"]\').click();}, 1000)');
versionManagePage.showNewVersionButton.click();
versionManagePage.uploadNewVersionFile(bigFileToCancel.location);
versionManagePage.closeVersionDialog();
await BrowserActions.click(versionManagePage.showNewVersionButton);
await expect(new UploadDialog().getTitleText()).toEqual('Upload canceled');
await versionManagePage.uploadNewVersionFile(bigFileToCancel.location);
await versionManagePage.closeVersionDialog();
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
await browser.refresh();
navigationBarPage.clickContentServicesButton();
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
contentServicesPage.checkContentIsDisplayed(txtFileModel.name);
await contentServicesPage.checkContentIsDisplayed(txtFileModel.name);
});
});

View File

@@ -69,7 +69,7 @@ describe('Version component permissions', () => {
const uploadActions = new UploadActions(this.alfrescoJsApi);
const nodeActions = new NodeActions();
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -117,8 +117,6 @@ describe('Version component permissions', () => {
await this.alfrescoJsApi.login(fileCreatorUser.id, fileCreatorUser.password);
await uploadActions.uploadFile(differentCreatorFile.location, differentCreatorFile.name, site.entry.guid);
done();
});
describe('Manager', () => {
@@ -128,7 +126,7 @@ describe('Version component permissions', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(managerUser.id, managerUser.password);
const sameCreatorFileUploaded = await uploadActions.uploadFile(sameCreatorFile.location, sameCreatorFile.name, site.entry.guid);
@@ -136,70 +134,63 @@ describe('Version component permissions', () => {
await loginPage.loginToContentServicesUsingUserModel(managerUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
done();
await navigationBarPage.openContentServicesFolder(site.entry.guid);
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
afterAll(async () => {
await this.alfrescoJsApi.nodes.deleteNode(sameCreatorFile.id);
done();
await navigationBarPage.clickLogoutButton();
});
it('[C277200] should a user with Manager permission be able to upload a new version for a file with different creator', () => {
contentServices.versionManagerContent(differentCreatorFile.name);
it('[C277200] should a user with Manager permission be able to upload a new version for a file with different creator', async () => {
await contentServices.versionManagerContent(differentCreatorFile.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(newVersionFile.location);
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
versionManagePage.deleteFileVersion('1.1');
versionManagePage.clickAcceptConfirm();
await versionManagePage.deleteFileVersion('1.1');
await versionManagePage.clickAcceptConfirm();
versionManagePage.checkFileVersionNotExist('1.1');
await versionManagePage.checkFileVersionNotExist('1.1');
versionManagePage.closeVersionDialog();
await versionManagePage.closeVersionDialog();
uploadDialog.clickOnCloseButton();
await uploadDialog.clickOnCloseButton();
});
it('[C277204] Should be disabled the option for locked file', () => {
contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
const actionVersion = contentServices.checkContextActionIsVisible('Manage versions');
expect(actionVersion.isEnabled()).toBeFalsy();
it('[C277204] Should be disabled the option for locked file', async () => {
await contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
await expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false, 'Manage versions is enabled');
});
});
describe('Consumer', () => {
beforeAll(async (done) => {
beforeAll(async () => {
await loginPage.loginToContentServicesUsingUserModel(consumerUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C277197] Should a user with Consumer permission not be able to upload a new version for a file with different creator', () => {
contentServices.versionManagerContent(differentCreatorFile.name);
it('[C277197] Should a user with Consumer permission not be able to upload a new version for a file with different creator', async () => {
await contentServices.versionManagerContent(differentCreatorFile.name);
notificationHistoryPage.checkNotifyContains(`You don't have access to do this`);
await notificationHistoryPage.checkNotifyContains(`You don't have access to do this`);
});
it('[C277201] Should a user with Consumer permission not be able to upload a new version for a locked file', () => {
contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
const actionVersion = contentServices.checkContextActionIsVisible('Manage versions');
expect(actionVersion.isEnabled()).toBeFalsy();
it('[C277201] Should a user with Consumer permission not be able to upload a new version for a locked file', async () => {
await contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
await expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false, 'Manage version is enabled');
});
});
@@ -210,7 +201,7 @@ describe('Version component permissions', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(contributorUser.id, contributorUser.password);
const sameCreatorFileUploaded = await uploadActions.uploadFile(sameCreatorFile.location, sameCreatorFile.name, site.entry.guid);
@@ -218,49 +209,45 @@ describe('Version component permissions', () => {
await loginPage.loginToContentServicesUsingUserModel(contributorUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
afterAll(async () => {
await this.alfrescoJsApi.nodes.deleteNode(sameCreatorFile.id);
done();
await navigationBarPage.clickLogoutButton();
});
it('[C277177] Should a user with Contributor permission be able to upload a new version for the created file', () => {
contentServices.versionManagerContent(sameCreatorFile.name);
it('[C277177] Should a user with Contributor permission be able to upload a new version for the created file', async () => {
await contentServices.versionManagerContent(sameCreatorFile.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(newVersionFile.location);
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
versionManagePage.deleteFileVersion('1.1');
versionManagePage.clickAcceptConfirm();
await versionManagePage.deleteFileVersion('1.1');
await versionManagePage.clickAcceptConfirm();
versionManagePage.checkFileVersionNotExist('1.1');
await versionManagePage.checkFileVersionNotExist('1.1');
versionManagePage.closeVersionDialog();
await versionManagePage.closeVersionDialog();
uploadDialog.clickOnCloseButton();
await uploadDialog.clickOnCloseButton();
});
it('[C277198] Should a user with Contributor permission not be able to upload a new version for a file with different creator', () => {
contentServices.versionManagerContent(differentCreatorFile.name);
it('[C277198] Should a user with Contributor permission not be able to upload a new version for a file with different creator', async () => {
await contentServices.versionManagerContent(differentCreatorFile.name);
notificationHistoryPage.checkNotifyContains(`You don't have access to do this`);
await notificationHistoryPage.checkNotifyContains(`You don't have access to do this`);
});
it('[C277202] Should be disabled the option for a locked file', () => {
contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
const actionVersion = contentServices.checkContextActionIsVisible('Manage versions');
expect(actionVersion.isEnabled()).toBeFalsy();
it('[C277202] Should be disabled the option for a locked file', async () => {
await contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
await expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false, 'Manage versions is enabled');
});
});
@@ -270,7 +257,7 @@ describe('Version component permissions', () => {
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(collaboratorUser.id, collaboratorUser.password);
const sameCreatorFileUploaded = await uploadActions.uploadFile(sameCreatorFile.location, sameCreatorFile.name, site.entry.guid);
@@ -278,62 +265,59 @@ describe('Version component permissions', () => {
await loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
navigationBarPage.openContentServicesFolder(site.entry.guid);
await navigationBarPage.openContentServicesFolder(site.entry.guid);
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
afterAll(async () => {
await this.alfrescoJsApi.nodes.deleteNode(sameCreatorFile.id);
done();
await navigationBarPage.clickLogoutButton();
});
it('[C277195] Should a user with Collaborator permission be able to upload a new version for the created file', () => {
contentServices.versionManagerContent(sameCreatorFile.name);
it('[C277195] Should a user with Collaborator permission be able to upload a new version for the created file', async () => {
await contentServices.versionManagerContent(sameCreatorFile.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(newVersionFile.location);
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
versionManagePage.deleteFileVersion('1.1');
versionManagePage.clickAcceptConfirm();
await versionManagePage.deleteFileVersion('1.1');
await versionManagePage.clickAcceptConfirm();
versionManagePage.checkFileVersionNotExist('1.1');
await versionManagePage.checkFileVersionNotExist('1.1');
versionManagePage.closeVersionDialog();
await versionManagePage.closeVersionDialog();
uploadDialog.clickOnCloseButton();
await uploadDialog.clickOnCloseButton();
});
it('[C277199] should a user with Collaborator permission be able to upload a new version for a file with different creator', () => {
contentServices.versionManagerContent(differentCreatorFile.name);
it('[C277199] should a user with Collaborator permission be able to upload a new version for a file with different creator', async () => {
await contentServices.versionManagerContent(differentCreatorFile.name);
BrowserActions.click(versionManagePage.showNewVersionButton);
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.uploadNewVersionFile(newVersionFile.location);
await versionManagePage.uploadNewVersionFile(newVersionFile.location);
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
versionManagePage.clickActionButton('1.1');
await versionManagePage.clickActionButton('1.1');
expect(element(by.css(`[id="adf-version-list-action-delete-1.1"]`)).isEnabled()).toBe(false);
await expect(await element(by.css(`[id="adf-version-list-action-delete-1.1"]`)).isEnabled()).toBe(false);
versionManagePage.closeActionsMenu();
await versionManagePage.closeActionsMenu();
versionManagePage.closeVersionDialog();
await versionManagePage.closeVersionDialog();
});
it('[C277203] Should a user with Collaborator permission not be able to upload a new version for a locked file', () => {
contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
const actionVersion = contentServices.checkContextActionIsVisible('Manage versions');
expect(actionVersion.isEnabled()).toBeFalsy();
it('[C277203] Should a user with Collaborator permission not be able to upload a new version for a locked file', async () => {
await contentServices.getDocumentList().rightClickOnRow(lockFileModel.name);
await expect(await contentServices.isContextActionEnabled('Manage versions')).toBe(false, 'Manage versions is enabled');
});
});

View File

@@ -49,7 +49,7 @@ describe('Version Properties', () => {
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -65,73 +65,50 @@ describe('Version Properties', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.versionManagerContent(txtFileModel.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.versionManagerContent(txtFileModel.name);
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
done();
it('[C272817] Should NOT be present the download action when allowDownload property is false', async () => {
await versionManagePage.disableDownload();
await versionManagePage.clickActionButton('1.0');
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
await versionManagePage.closeDisabledActionsMenu();
});
it('[C272817] Should NOT be present the download action when allowDownload property is false', () => {
versionManagePage.disableDownload();
versionManagePage.clickActionButton('1.0');
BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
versionManagePage.closeDisabledActionsMenu();
it('[C279992] Should be present the download action when allowDownload property is true', async () => {
await versionManagePage.enableDownload();
await versionManagePage.clickActionButton('1.0');
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
await versionManagePage.closeActionsMenu();
});
it('[C279992] Should be present the download action when allowDownload property is true', () => {
versionManagePage.enableDownload();
versionManagePage.clickActionButton('1.0');
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
versionManagePage.closeActionsMenu();
it('[C269085] Should show/hide comments when showComments true/false', async () => {
await versionManagePage.enableComments();
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.enterCommentText('Example comment text');
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionComment('1.1')).toEqual('Example comment text');
await versionManagePage.disableComments();
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-item-comment-1.1"]`)));
});
it('[C269085] Should show/hide comments when showComments true/false', () => {
versionManagePage.enableComments();
BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.enterCommentText('Example comment text');
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionComment('1.1')).toEqual('Example comment text');
versionManagePage.disableComments();
BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-item-comment-1.1"]`)));
it('[C277277] Should show/hide actions menu when readOnly is true/false', async () => {
await versionManagePage.disableReadOnly();
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-menu-button-1.0"]`)));
await versionManagePage.enableReadOnly();
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-menu-button-1.0"]`)));
});
it('[C277277] Should show/hide actions menu when readOnly is true/false', () => {
versionManagePage.disableReadOnly();
BrowserVisibility.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-menu-button-1.0"]`)));
versionManagePage.enableReadOnly();
BrowserVisibility.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-menu-button-1.0"]`)));
});
it('[C279994] Should show/hide upload new version button when readOnly is true/false', () => {
versionManagePage.disableReadOnly();
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.showNewVersionButton);
versionManagePage.enableReadOnly();
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.showNewVersionButton);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.uploadNewVersionButton);
it('[C279994] Should show/hide upload new version button when readOnly is true/false', async () => {
await versionManagePage.disableReadOnly();
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.showNewVersionButton);
await versionManagePage.enableReadOnly();
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.showNewVersionButton);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.uploadNewVersionButton);
});
});

View File

@@ -17,7 +17,7 @@
import { browser } from 'protractor';
import { LoginPage, UploadActions, BrowserVisibility } from '@alfresco/adf-testing';
import { LoginPage, UploadActions, BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
@@ -67,7 +67,7 @@ describe('Version component', () => {
const uploadActions = new UploadActions(this.alfrescoJsApi);
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
@@ -81,92 +81,82 @@ describe('Version component', () => {
await loginPage.loginToContentServicesUsingUserModel(acsUser);
navigationBarPage.clickContentServicesButton();
contentServicesPage.waitForTableBody();
contentServicesPage.versionManagerContent(txtFileModel.name);
await navigationBarPage.clickContentServicesButton();
await contentServicesPage.waitForTableBody();
await contentServicesPage.versionManagerContent(txtFileModel.name);
done();
});
afterAll(async (done) => {
await navigationBarPage.clickLogoutButton();
done();
it('[C272768] Should be visible the first file version when you upload a file', async () => {
await versionManagePage.checkUploadNewVersionsButtonIsDisplayed();
await versionManagePage.checkFileVersionExist('1.0');
await expect(await versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
await expect(await versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
});
it('[C272768] Should be visible the first file version when you upload a file', () => {
versionManagePage.checkUploadNewVersionsButtonIsDisplayed();
it('[C279995] Should show/hide the new upload file options when click on add New version/cancel button', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
versionManagePage.checkFileVersionExist('1.0');
expect(versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
expect(versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.cancelButton);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.majorRadio);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.minorRadio);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.cancelButton);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.commentText);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.uploadNewVersionButton);
await BrowserActions.click(versionManagePage.cancelButton);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.cancelButton);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.majorRadio);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.minorRadio);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.cancelButton);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.commentText);
await BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.uploadNewVersionButton);
await BrowserVisibility.waitUntilElementIsVisible(versionManagePage.showNewVersionButton);
});
it('[C279995] Should show/hide the new upload file options when click on add New version/cancel button', () => {
versionManagePage.showNewVersionButton.click();
it('[C260244] Should show the version history when select a file with multiple version', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
browser.driver.sleep(300);
await versionManagePage.checkFileVersionExist('1.0');
await expect(await versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
await expect(await versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.cancelButton);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.majorRadio);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.minorRadio);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.cancelButton);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.commentText);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.uploadNewVersionButton);
versionManagePage.cancelButton.click();
browser.driver.sleep(300);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.cancelButton);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.majorRadio);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.minorRadio);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.cancelButton);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.commentText);
BrowserVisibility.waitUntilElementIsNotVisible(versionManagePage.uploadNewVersionButton);
BrowserVisibility.waitUntilElementIsVisible(versionManagePage.showNewVersionButton);
await versionManagePage.checkFileVersionExist('1.1');
await expect(await versionManagePage.getFileVersionName('1.1')).toEqual(fileModelVersionTwo.name);
await expect(await versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
});
it('[C260244] Should show the version history when select a file with multiple version', () => {
versionManagePage.showNewVersionButton.click();
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
it('[C269084] Should be possible add a comment when add a new version', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.enterCommentText('Example comment text');
await versionManagePage.uploadNewVersionFile(fileModelVersionThree.location);
versionManagePage.checkFileVersionExist('1.0');
expect(versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
expect(versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
versionManagePage.checkFileVersionExist('1.1');
expect(versionManagePage.getFileVersionName('1.1')).toEqual(fileModelVersionTwo.name);
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
await versionManagePage.checkFileVersionExist('1.2');
await expect(await versionManagePage.getFileVersionName('1.2')).toEqual(fileModelVersionThree.name);
await expect(await versionManagePage.getFileVersionDate('1.2')).not.toBeUndefined();
await expect(await versionManagePage.getFileVersionComment('1.2')).toEqual('Example comment text');
});
it('[C269084] Should be possible add a comment when add a new version', () => {
versionManagePage.showNewVersionButton.click();
versionManagePage.enterCommentText('Example comment text');
versionManagePage.uploadNewVersionFile(fileModelVersionThree.location);
it('[C275719] Should be possible preview the file when you add a new version', async () => {
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.clickMajorChange();
versionManagePage.checkFileVersionExist('1.2');
expect(versionManagePage.getFileVersionName('1.2')).toEqual(fileModelVersionThree.name);
expect(versionManagePage.getFileVersionDate('1.2')).not.toBeUndefined();
expect(versionManagePage.getFileVersionComment('1.2')).toEqual('Example comment text');
});
await versionManagePage.uploadNewVersionFile(fileModelVersionFor.location);
it('[C275719] Should be possible preview the file when you add a new version', () => {
versionManagePage.showNewVersionButton.click();
versionManagePage.clickMajorChange();
await versionManagePage.checkFileVersionExist('2.0');
await expect(await versionManagePage.getFileVersionName('2.0')).toEqual(fileModelVersionFor.name);
versionManagePage.uploadNewVersionFile(fileModelVersionFor.location);
await BrowserActions.click(versionManagePage.showNewVersionButton);
await versionManagePage.clickMinorChange();
versionManagePage.checkFileVersionExist('2.0');
expect(versionManagePage.getFileVersionName('2.0')).toEqual(fileModelVersionFor.name);
await versionManagePage.uploadNewVersionFile(fileModelVersionFive.location);
versionManagePage.showNewVersionButton.click();
versionManagePage.clickMinorChange();
versionManagePage.uploadNewVersionFile(fileModelVersionFive.location);
versionManagePage.checkFileVersionExist('2.1');
expect(versionManagePage.getFileVersionName('2.1')).toEqual(fileModelVersionFive.name);
await versionManagePage.checkFileVersionExist('2.1');
await expect(await versionManagePage.getFileVersionName('2.1')).toEqual(fileModelVersionFive.name);
});
});