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,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');
});
});