Protractor cleanup for demo shell (#9019)

* [ci:force] cleanup protractor tests

* [ci:force] cleanup insights test

* [ci:force] cleanup dead demo shell e2e

* [ci:force] cleanup e2e

* [ci:force] cleanup e2e

* cleanup files component

* [ci:force] cleanup e2e

* [ci:force] remove user info SSO protractor e2e

* [ci:force] remove viewer e2e already covered by other tests

* [ci:force] remove custom font from demo shell

* [ci:force] demo shell viewer cleanup

* [ci:force] cleanup viewer in demo shell

* [ci:force] rollback model changes

* [ci:force] remove site picker from content demo

* [ci:force] cleanup files demo shell component

* [ci:force] cleanup e2e and dead code

* [ci:force] cleanup dead code

* [ci:force] fix linting

* [ci:force] standalone home component

* [ci:force] cleanup demo shell app layout

* [ci:force] cleanup css

* [ci:force] cleanup demo shell logout

* Update demo-shell/src/app/components/app-layout/app-layout.component.html

Co-authored-by: Mykyta Maliarchuk <84377976+nikita-web-ua@users.noreply.github.com>

---------

Co-authored-by: Mykyta Maliarchuk <84377976+nikita-web-ua@users.noreply.github.com>
This commit is contained in:
Denys Vuika
2023-10-27 11:56:53 -04:00
committed by GitHub
co-authored by Mykyta Maliarchuk
parent 1f94c592da
commit 620911cf70
70 changed files with 102 additions and 3343 deletions
@@ -1,413 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { PermissionsPage } from '../../content-services/pages/permissions.page';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { FileModel } from '../../models/ACS/file.model';
import {
createApiService,
BrowserActions, Logger,
LoginPage,
PermissionActions,
SearchService,
StringUtil,
UploadActions,
UserModel,
UsersActions,
ViewerPage,
SnackbarPage
} from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { FolderModel } from '../../models/ACS/folder.model';
import { MetadataViewPage } from '../../core/pages/metadata-view.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
import { GroupsApi, NodeEntry } from '@alfresco/js-api';
describe('Permissions Component', () => {
const apiService = createApiService();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const permissionsPage = new PermissionsPage();
const navigationBarPage = new NavigationBarPage();
const uploadActions = new UploadActions(apiService);
const usersActions = new UsersActions(apiService);
const snackbarPage = new SnackbarPage();
const searchService = new SearchService(apiService);
const permissionActions = new PermissionActions(apiService);
const groupsApi = new GroupsApi(apiService.getInstance());
const contentList = contentServicesPage.getDocumentList();
const viewerPage = new ViewerPage();
const metadataViewPage = new MetadataViewPage();
const uploadDialog = new UploadDialogPage();
let file;
const fileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path
});
const fileLocation = browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_location;
const testFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TEST.file_location
});
const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location
});
const groupBody = {
id: `GROUP_${StringUtil.generateRandomString()}`,
displayName: StringUtil.generateRandomString()
};
const fileOwnerUser = new UserModel();
const filePermissionUser = new UserModel();
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: NodeEntry;
let roleCoordinatorFolder: NodeEntry;
let roleContributorFolder: NodeEntry;
let roleCollaboratorFolder: NodeEntry;
let roleEditorFolder: NodeEntry;
beforeAll(async () => {
try {
await apiService.loginWithProfile('admin');
await usersActions.createUser(fileOwnerUser);
await usersActions.createUser(filePermissionUser);
await groupsApi.createGroup(groupBody);
await apiService.login(fileOwnerUser.username, fileOwnerUser.password);
roleConsumerFolder = await uploadActions.createFolder(roleConsumerFolderModel.name, '-my-');
roleCoordinatorFolder = await uploadActions.createFolder(roleCoordinatorFolderModel.name, '-my-');
roleContributorFolder = await uploadActions.createFolder(roleContributorFolderModel.name, '-my-');
roleCollaboratorFolder = await uploadActions.createFolder(roleCollaboratorFolderModel.name, '-my-');
roleEditorFolder = await uploadActions.createFolder(roleEditorFolderModel.name, '-my-');
await uploadActions.uploadFile(fileModel.location, 'RoleConsumer' + fileModel.name, roleConsumerFolder.entry.id);
await uploadActions.uploadFile(fileModel.location, 'RoleContributor' + fileModel.name, roleContributorFolder.entry.id);
await uploadActions.uploadFile(fileModel.location, 'RoleCoordinator' + fileModel.name, roleCoordinatorFolder.entry.id);
await uploadActions.uploadFile(fileModel.location, 'RoleCollaborator' + fileModel.name, roleCollaboratorFolder.entry.id);
await uploadActions.uploadFile(fileModel.location, 'RoleEditor' + fileModel.name, roleEditorFolder.entry.id);
await permissionActions.addRoleForUser(filePermissionUser.username, 'Consumer', roleConsumerFolder);
await permissionActions.addRoleForUser(filePermissionUser.username, 'Collaborator', roleCollaboratorFolder);
await permissionActions.addRoleForUser(filePermissionUser.username, 'Coordinator', roleCoordinatorFolder);
await permissionActions.addRoleForUser(filePermissionUser.username, 'Contributor', roleContributorFolder);
await permissionActions.addRoleForUser(filePermissionUser.username, 'Editor', roleEditorFolder);
// to sync user in acs
try {
await searchService.isUserSearchable(filePermissionUser);
} catch (e) {
Logger.error(`*****\n Failed to sync user \n*****`);
}
await browser.sleep(browser.params.testConfig.timeouts.index_search); // wait search index previous file/folder uploaded
} catch (e) {
fail('Failed to set up permission : \n' + JSON.stringify(e, null, 2));
}
});
describe('Inherit and assigning permissions', () => {
beforeEach(async () => {
await apiService.login(fileOwnerUser.username, fileOwnerUser.password);
file = await uploadActions.uploadFile(fileModel.location, fileModel.name, '-my-');
await loginPage.login(fileOwnerUser.username, fileOwnerUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await contentServicesPage.checkContentIsDisplayed(fileModel.name);
await contentList.rightClickOnRow(fileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.checkPermissionManagerDisplayed();
});
afterEach(async () => {
await BrowserActions.closeMenuAndDialogs();
try {
await uploadActions.deleteFileOrFolder(file.entry.id);
} catch (error) {
}
await navigationBarPage.clickLogoutButton();
});
it('[C286272] Should be able to see results when searching for a user', async () => {
await permissionsPage.addPermissionButton.waitVisible();
await permissionsPage.addPermissionsDialog.clickAddPermissionButton();
await permissionsPage.addPermissionsDialog.checkAddPermissionDialogIsDisplayed();
await permissionsPage.addPermissionsDialog.checkSearchUserInputIsDisplayed();
await permissionsPage.addPermissionsDialog.searchUserOrGroup('a');
await permissionsPage.addPermissionsDialog.checkResultListIsDisplayed();
});
it('[C276979] Should be able to give permissions to a group of people', async () => {
await permissionsPage.addPermissionButton.waitVisible();
await permissionsPage.addPermissionsDialog.clickAddPermissionButton();
await permissionsPage.addPermissionsDialog.checkAddPermissionDialogIsDisplayed();
await permissionsPage.addPermissionsDialog.checkSearchUserInputIsDisplayed();
await permissionsPage.addPermissionsDialog.searchUserOrGroup(groupBody.id);
await permissionsPage.addPermissionsDialog.clickUserOrGroup(groupBody.displayName);
await permissionsPage.addPermissionsDialog.selectRole(groupBody.displayName, 'Consumer');
await expect(await permissionsPage.addPermissionsDialog.addButtonIsEnabled()).toBe(true, 'button should be enabled');
await permissionsPage.addPermissionsDialog.clickAddButton();
await expect(await snackbarPage.getSnackBarMessage()).toEqual('Added 0 user(s) 1 group(s)');
await permissionsPage.checkUserIsAdded(groupBody.id);
});
it('[C277100] Should display EVERYONE group in the search result set', async () => {
await permissionsPage.addPermissionButton.waitVisible();
await permissionsPage.addPermissionsDialog.clickAddPermissionButton();
await permissionsPage.addPermissionsDialog.checkAddPermissionDialogIsDisplayed();
await permissionsPage.addPermissionsDialog.checkSearchUserInputIsDisplayed();
await permissionsPage.addPermissionsDialog.searchUserOrGroup(filePermissionUser.username);
await permissionsPage.addPermissionsDialog.checkResultListIsDisplayed();
await permissionsPage.addPermissionsDialog.checkUserOrGroupIsDisplayed('EVERYONE');
await permissionsPage.addPermissionsDialog.searchUserOrGroup('somerandomtext');
await permissionsPage.addPermissionsDialog.checkResultListIsDisplayed();
await permissionsPage.addPermissionsDialog.checkUserOrGroupIsDisplayed('EVERYONE');
});
it('should be able to toggle the inherited permission', async () => {
await permissionsPage.checkPermissionListDisplayed();
await expect(await permissionsPage.isInherited()).toBe(true, 'Inherited permission should be on');
await permissionsPage.toggleInheritPermission();
await expect(await snackbarPage.getSnackBarMessage()).toContain('Disabled inherited permission', 'Disabled notification not shown');
await snackbarPage.waitForSnackBarToClose();
await expect(await permissionsPage.isInherited()).toBe(false, 'Inherited permission should be off');
});
});
describe('Changing and duplicate Permissions', () => {
beforeEach(async () => {
await apiService.login(fileOwnerUser.username, fileOwnerUser.password);
file = await uploadActions.uploadFile(fileModel.location, fileModel.name, '-my-');
await loginPage.login(fileOwnerUser.username, fileOwnerUser.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.checkContentIsDisplayed(fileModel.name);
await contentServicesPage.checkSelectedSiteIsDisplayed('My files');
await contentList.rightClickOnRow(fileModel.name);
await contentServicesPage.pressContextMenuActionNamed('Permission');
await permissionsPage.checkPermissionManagerDisplayed();
await permissionsPage.addPermissionButton.waitVisible();
await permissionsPage.addPermissionsDialog.clickAddPermissionButton();
await permissionsPage.addPermissionsDialog.checkAddPermissionDialogIsDisplayed();
await permissionsPage.addPermissionsDialog.checkSearchUserInputIsDisplayed();
await permissionsPage.addPermissionsDialog.searchUserOrGroup(filePermissionUser.firstName);
await permissionsPage.addPermissionsDialog.checkResultListIsDisplayed();
await permissionsPage.addPermissionsDialog.clickUserOrGroup(filePermissionUser.firstName);
await permissionsPage.addPermissionsDialog.selectRole(filePermissionUser.fullName, 'Contributor');
await expect(await permissionsPage.addPermissionsDialog.addButtonIsEnabled()).toBe(true, 'button should be enabled');
await permissionsPage.addPermissionsDialog.clickAddButton();
await expect(await snackbarPage.getSnackBarMessage()).toEqual('Added 1 user(s) 0 group(s)');
await snackbarPage.waitForSnackBarToClose();
await permissionsPage.checkUserIsAdded(filePermissionUser.username);
});
afterEach(async () => {
await uploadActions.deleteFileOrFolder(file.entry.id);
await navigationBarPage.clickLogoutButton();
});
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.username)).toEqual('Contributor');
await permissionsPage.clickRoleDropdownByUserOrGroupName(filePermissionUser.username);
const roleDropdownOptions = permissionsPage.addPermissionsDialog.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 BrowserActions.closeMenuAndDialogs();
await permissionsPage.changePermission(filePermissionUser.username, 'Collaborator');
await snackbarPage.waitForSnackBarToClose();
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.username)).toEqual('Collaborator');
await permissionsPage.changePermission(filePermissionUser.username, 'Coordinator');
await snackbarPage.waitForSnackBarToClose();
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.username)).toEqual('Coordinator');
await permissionsPage.changePermission(filePermissionUser.username, 'Editor');
await snackbarPage.waitForSnackBarToClose();
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.username)).toEqual('Editor');
await permissionsPage.changePermission(filePermissionUser.username, 'Consumer');
await snackbarPage.waitForSnackBarToClose();
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.username)).toEqual('Consumer');
});
it('[C276980] Should not be able to duplicate User or Group to the locally set permissions', async () => {
await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(filePermissionUser.username)).toEqual('Contributor');
await permissionsPage.addPermissionsDialog.clickAddPermissionButton();
await permissionsPage.addPermissionsDialog.checkAddPermissionDialogIsDisplayed();
await permissionsPage.addPermissionsDialog.checkSearchUserInputIsDisplayed();
await permissionsPage.addPermissionsDialog.searchUserOrGroup(filePermissionUser.firstName);
await permissionsPage.addPermissionsDialog.clickUserOrGroup(filePermissionUser.firstName);
await expect(await permissionsPage.addPermissionsDialog.getRoleCellValue(filePermissionUser.fullName)).toEqual('Contributor');
await expect(await permissionsPage.addPermissionsDialog.addButtonIsEnabled()).toBe(false, 'button should not be enabled');
});
it('[C276982] Should be able to remove User or Group from the locally set permissions', async () => {
await expect(await permissionsPage.getRoleCellValue(filePermissionUser.username)).toEqual('Contributor');
await permissionsPage.clickDeletePermissionButton(filePermissionUser.username);
await permissionsPage.checkUserIsDeleted(filePermissionUser.username);
await expect(await snackbarPage.getSnackBarMessage()).toEqual('User/Group deleted');
});
});
describe('Role: Consumer, Contributor, Coordinator, Collaborator, Editor, No Permissions', () => {
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C276993] Role Consumer', async () => {
await loginPage.login(filePermissionUser.username, filePermissionUser.password);
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 expect(await snackbarPage.getSnackBarMessage()).toEqual('You don\'t have access to do this.');
await browser.sleep(3000);
await contentServicesPage.uploadFile(fileLocation);
await expect(await snackbarPage.getSnackBarMessage()).toEqual('You don\'t have the create permission to upload the content');
});
it('[C276996] Role Contributor', async () => {
await loginPage.login(filePermissionUser.username, filePermissionUser.password);
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 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.login(filePermissionUser.username, filePermissionUser.password);
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.enterPropertyText('properties.cm:title', 'newTitle1');
await expect(await metadataViewPage.getPropertyText('properties.cm:title')).toEqual('newTitle1');
await metadataViewPage.clickCloseButton();
await contentServicesPage.uploadFile(fileLocation);
});
it('[C277003] Role Collaborator', async () => {
await loginPage.login(filePermissionUser.username, filePermissionUser.password);
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.enterPropertyText('properties.cm:title', 'newTitle2');
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.login(filePermissionUser.username, filePermissionUser.password);
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.enterPropertyText('properties.cm:title', 'newTitle3');
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.login(filePermissionUser.username, filePermissionUser.password);
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.checkPermissionManagerDisplayed();
await permissionsPage.errorElement.waitPresent();
await expect(await permissionsPage.noPermissionContent()).toContain('This item no longer exists or you don\'t have permission to view it.');
});
});
});
@@ -18,7 +18,8 @@
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { createApiService,
import {
createApiService,
FileBrowserUtil,
IdentityService,
LoginPage,
@@ -33,7 +34,6 @@ import { FileModel } from '../../models/ACS/file.model';
import { NodeEntry } from '@alfresco/js-api';
describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList, implicitFlow true', () => {
const settingsPage = new SettingsPage();
const navigationBarPage = new NavigationBarPage();
const contentServicesPage = new ContentServicesPage();
@@ -56,8 +56,6 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
});
let pdfUploadedFile: NodeEntry;
let pngUploadedFile: NodeEntry;
let folder: NodeEntry;
let acsUser: UserModel;
const folderName = StringUtil.generateRandomString(5);
@@ -71,12 +69,17 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
folder = await uploadActions.createFolder(folderName, '-my-');
pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, folder.entry.id);
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, folder.entry.id);
await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, folder.entry.id);
await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, folder.entry.id);
await settingsPage.setProviderEcmSso(browser.params.testConfig.appConfig.ecmHost,
await settingsPage.setProviderEcmSso(
browser.params.testConfig.appConfig.ecmHost,
browser.params.testConfig.appConfig.oauth2.host,
browser.params.testConfig.appConfig.identityHost, false, true, browser.params.testConfig.appConfig.oauth2.clientId);
browser.params.testConfig.appConfig.identityHost,
false,
true,
browser.params.testConfig.appConfig.oauth2.clientId
);
await loginSsoPage.loginSSOIdentityService(acsUser.username, acsUser.password);
@@ -91,15 +94,13 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(folder.entry.id);
await identityService.deleteIdentityUser(acsUser.email);
} catch (error) {
}
} catch (error) {}
await apiService.getInstance().logout();
await browser.executeScript('window.sessionStorage.clear();');
await browser.executeScript('window.localStorage.clear();');
});
describe('SSO in ADF using ACS and AIS, implicit flow set', () => {
afterEach(async () => {
await browser.refresh();
await contentListPage.waitForTableBody();
@@ -136,15 +137,5 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
await contentServicesPage.clickDownloadButton();
await FileBrowserUtil.isFileDownloaded('archive.zip');
});
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);
await expect(filePdfIconUrl).toContain(`/versions/1/nodes/${pdfUploadedFile.entry.id}/renditions`);
const filePngIconUrl = await contentServicesPage.getRowIconImageUrl(pngFileModel.name);
await expect(filePngIconUrl).toContain(`/versions/1/nodes/${pngUploadedFile.entry.id}/renditions`);
});
});
});
@@ -17,7 +17,7 @@
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { browser } from 'protractor';
import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions, ViewerPage } from '@alfresco/adf-testing';
import { createApiService, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { NodeEntry } from '@alfresco/js-api';
@@ -345,31 +345,4 @@ describe('Document List Component', () => {
await contentServicesPage.checkListIsSortedByNameColumn('asc');
});
});
describe('Column Template', () => {
const file0BytesModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT_0B.file_path
});
let file: NodeEntry;
const viewer = new ViewerPage();
beforeAll(async () => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
file = await uploadActions.uploadFile(file0BytesModel.location, file0BytesModel.name, '-my-');
await loginPage.login(acsUser.username, acsUser.password);
await contentServicesPage.goToDocumentList();
});
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();
});
});
});
@@ -1,62 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { createApiService, BrowserActions, ErrorPage, LoginPage, StringUtil, UsersActions } from '@alfresco/adf-testing';
import { SiteEntry, SitesApi } from '@alfresco/js-api';
describe('Document List Component', () => {
const loginPage = new LoginPage();
const errorPage = new ErrorPage();
const navigationBarPage = new NavigationBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
let privateSite: SiteEntry;
let acsUser = null;
describe('Permission Message', () => {
beforeAll(async () => {
const siteName = `PRIVATE_TEST_SITE_${StringUtil.generateRandomString(5)}`;
const privateSiteBody = { visibility: 'PRIVATE', title: siteName };
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
const sitesApi = new SitesApi(apiService.getInstance());
privateSite = await sitesApi.createSite(privateSiteBody);
await loginPage.login(acsUser.username, acsUser.password);
});
afterAll(async () => {
await apiService.loginWithProfile('admin');
await navigationBarPage.clickLogoutButton();
const sitesApi = new SitesApi(apiService.getInstance());
await sitesApi.deleteSite(privateSite.entry.id, { permanent: true });
});
it('[C217334] Should display a message when accessing file without permissions', async () => {
await BrowserActions.getUrl(browser.baseUrl + '/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.");
});
});
});
@@ -1,320 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { createApiService,
CheckboxPage,
LocalStorageUtil,
LoginPage,
UploadActions,
UserModel,
UsersActions,
ViewerPage
} from '@alfresco/adf-testing';
import { MetadataViewPage } from '../../core/pages/metadata-view.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { CustomModelApi, NodesApi } from '@alfresco/js-api';
describe('Aspect oriented config', () => {
const loginPage = new LoginPage();
const viewerPage = new ViewerPage();
const metadataViewPage = new MetadataViewPage();
const navigationBarPage = new NavigationBarPage();
const contentServicesPage = new ContentServicesPage();
const modelOneName = 'modelOne'; const emptyAspectName = 'emptyAspect';
const defaultModel = 'cm'; const defaultEmptyPropertiesAspect = 'taggable'; const aspectName = 'Taggable';
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const nodesApi = new NodesApi(apiService.getInstance());
const customModelApi = new CustomModelApi(apiService.getInstance());
let acsUser: UserModel;
const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
});
let uploadActions;
beforeAll(async () => {
uploadActions = new UploadActions(apiService);
await apiService.loginWithProfile('admin');
try {
await customModelApi.createCustomModel('ACTIVE', modelOneName, modelOneName, modelOneName, modelOneName);
} catch (e) {
}
try {
await customModelApi.createCustomAspect(modelOneName, emptyAspectName, null, emptyAspectName, emptyAspectName);
} catch (e) {
}
acsUser = await usersActions.createUser();
await apiService.login(acsUser.username, acsUser.password);
const uploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
await loginPage.login(acsUser.username, acsUser.password);
const aspects = await nodesApi.getNode(uploadedFile.entry.id);
aspects.entry.aspectNames.push(modelOneName.concat(':', emptyAspectName));
aspects.entry.aspectNames.push(defaultModel.concat(':', defaultEmptyPropertiesAspect));
await nodesApi.updateNode(uploadedFile.entry.id, { aspectNames: aspects.entry.aspectNames });
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(async () => {
await viewerPage.clickCloseButton();
await contentServicesPage.checkAcsContainer();
});
it('[C261117] Should be possible restrict the display properties of one an aspect', async () => {
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
presets: {
default: [
{
title: 'IMAGE',
items: [
{
aspect: 'exif:exif',
properties: [
'exif:pixelXDimension',
'exif:pixelYDimension',
'exif:isoSpeedRatings'
]
}
]
}
]
}
}));
await navigationBarPage.navigateToContentServices();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
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');
await metadataViewPage.editIconClick();
await metadataViewPage.checkPropertyIsVisible('properties.exif:isoSpeedRatings', 'textitem');
});
it('[C260185] Should ignore not existing aspect when present in the configuration', async () => {
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
presets: {
default: {
'exif:exif': '*',
'cm:versionable': '*',
'not:exists': '*'
}
}
}));
await navigationBarPage.navigateToContentServices();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
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', '{}');
await navigationBarPage.navigateToContentServices();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
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 () => {
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
presets: {
default: '*'
}
}));
await navigationBarPage.navigateToContentServices();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
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 () => {
await LocalStorageUtil.setConfigField('content-metadata', '{' +
' "presets": {' +
' "default": [' +
' {' +
' "title": "GROUP-TITLE1-TRANSLATION-KEY",' +
' "items": [' +
' {' +
' "aspect": "exif:exif",' +
' "properties": "*"' +
' }' +
' ]' +
' },' +
' {' +
' "title": "GROUP-TITLE2-TRANSLATION-KEY",' +
' "items": [' +
' {' +
' "aspect": "exif:exif",' +
' "properties": "*"' +
' }' +
' ]' +
' }' +
' ]' +
' }' +
'}');
await navigationBarPage.navigateToContentServices();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
await metadataViewPage.checkMetadataGroupIsPresent('GROUP-TITLE1-TRANSLATION-KEY');
await metadataViewPage.checkMetadataGroupIsPresent('GROUP-TITLE2-TRANSLATION-KEY');
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');
});
it('[C279968] Should be possible use a custom preset', async () => {
await LocalStorageUtil.setConfigField('content-metadata', '{' +
' "presets": {' +
' "custom-preset": {' +
' "exif:exif": "*",' +
' "cm:versionable": "*"' +
' }' +
' }' +
'}');
await navigationBarPage.navigateToContentServices();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await CheckboxPage.check(metadataViewPage.presetSwitch);
await metadataViewPage.enterPresetText('custom-preset');
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
await metadataViewPage.checkMetadataGroupIsPresent('properties');
await metadataViewPage.checkMetadataGroupIsPresent('Versionable');
});
it('[C299186] The aspect without properties is not displayed', async () => {
await LocalStorageUtil.setConfigField('content-metadata', '{' +
' "presets": { "' + modelOneName +
' ": { "' + modelOneName + ':' + emptyAspectName +
' ":"*"' +
' }' +
' }' +
'}');
await navigationBarPage.navigateToContentServices();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
await metadataViewPage.checkMetadataGroupIsNotPresent(emptyAspectName);
});
it('[C299187] The aspect with empty properties is displayed when edit', async () => {
await LocalStorageUtil.setConfigField('content-metadata', '{' +
' "presets": { "' + defaultModel +
' ": { "' + defaultModel + ':' + defaultEmptyPropertiesAspect +
' ":"*"' +
' }' +
' }' +
'}');
await navigationBarPage.navigateToContentServices();
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton();
await metadataViewPage.checkMetadataGroupIsNotPresent(aspectName);
await metadataViewPage.editIconClick();
await metadataViewPage.checkMetadataGroupIsPresent(aspectName);
});
});
@@ -15,11 +15,11 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
BrowserActions,
LocalStorageUtil,
LoginPage,
StringUtil,
UploadActions,
UserModel,
UsersActions,
@@ -33,7 +33,6 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { format } from 'date-fns';
describe('Metadata component', () => {
const METADATA = {
DATA_FORMAT: 'PP',
TITLE: 'Details',
@@ -55,8 +54,6 @@ describe('Metadata component', () => {
let acsUser: UserModel;
const folderName = StringUtil.generateRandomString();
const pngFileModel = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
@@ -80,13 +77,16 @@ describe('Metadata component', () => {
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
await LocalStorageUtil.setConfigField('content-metadata', JSON.stringify({
presets: {
default: {
'exif:exif': '*'
await LocalStorageUtil.setConfigField(
'content-metadata',
JSON.stringify({
presets: {
default: {
'exif:exif': '*'
}
}
}
}));
})
);
});
afterAll(async () => {
@@ -103,7 +103,7 @@ describe('Metadata component', () => {
await contentServicesPage.waitForTableBody();
});
it('[C245652] Should be possible to display a file\'s properties', async () => {
it("[C245652] Should be possible to display a file's properties", async () => {
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await metadataViewPage.clickOnPropertiesTab();
@@ -188,7 +188,9 @@ describe('Metadata component', () => {
await metadataViewPage.enterPropertyText('properties.cm:name', 'exampleText');
await metadataViewPage.clickResetMetadata();
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual(browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name);
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual(
browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name
);
await metadataViewPage.enterPropertyText('properties.cm:name', 'exampleText.png');
await metadataViewPage.enterPropertyText('properties.cm:title', 'example title');
@@ -214,7 +216,9 @@ describe('Metadata component', () => {
await metadataViewPage.editIconClick();
await metadataViewPage.enterPropertyText('properties.cm:name', browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name);
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual(browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name);
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual(
browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name
);
await metadataViewPage.clickSaveMetadata();
});
@@ -243,48 +247,6 @@ describe('Metadata component', () => {
});
});
describe('Folder metadata', () => {
beforeAll(async () => {
await apiService.login(acsUser.username, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await uploadActions.createFolder(folderName, '-my-');
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
it('[C261157] Should be possible use the metadata component When the node is a Folder', async () => {
await contentServicesPage.metadataContent(folderName);
await expect(await metadataViewPage.getPropertyText('properties.cm: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', async () => {
await contentServicesPage.metadataContent(folderName);
await metadataViewPage.editIconClick();
await metadataViewPage.enterPropertyText('properties.cm:name', 'newnameFolder');
await metadataViewPage.clickResetButton();
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual(folderName);
await metadataViewPage.enterPropertyText('properties.cm:name', 'newnameFolder');
await metadataViewPage.clickSaveMetadata();
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual('newnameFolder');
await metadataViewPage.enterPropertyText('properties.cm:name', folderName);
await metadataViewPage.clickSaveMetadata();
await expect(await metadataViewPage.getPropertyText('properties.cm:name')).toEqual(folderName);
});
});
it('[C279960] Should show the last username modifier when modify a File', async () => {
await loginPage.loginWithProfile('admin');
@@ -1,97 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 {
AddPermissionsDialogPage,
BrowserActions,
DataTableComponentPage,
DropdownPage,
TestElement
} from '@alfresco/adf-testing';
import { browser } from 'protractor';
export class PermissionsPage {
dataTableComponentPage = new DataTableComponentPage();
addPermissionsDialog = new AddPermissionsDialogPage();
rootElement = 'adf-permission-manager-card';
inheritedButton = '[data-automation-id="adf-inherit-toggle-button"]';
errorElement = TestElement.byId('adf-permission-manager-error');
localPermissionList = TestElement.byCss('[data-automation-id="adf-locally-set-permission"]');
addPermissionButton = TestElement.byCss('button[data-automation-id=\'adf-add-permission-button\']');
async changePermission(name: string, role: string): Promise<void> {
await browser.sleep(1000);
await this.clickRoleDropdownByUserOrGroupName(name);
await new DropdownPage().selectOption(role);
await this.dataTableComponentPage.checkRowByContentIsNotSelected(name);
}
async checkUserIsAdded(id: string) {
const userOrGroupName = TestElement.byCss('div[data-automation-id="' + id + '"]');
await userOrGroupName.waitPresent();
}
async getRoleCellValue(username: string): Promise<string> {
const locator = this.dataTableComponentPage.getCellByRowContentAndColumn('Users and Groups', username, 'Role');
return BrowserActions.getText(locator);
}
async clickRoleDropdownByUserOrGroupName(name: string): Promise<void> {
const row = this.dataTableComponentPage.getRow('Users and Groups', name);
await row.click();
await BrowserActions.click(row.$('[id="adf-select-role-permission"] .mat-select-trigger'));
await TestElement.byCss('.mat-select-panel').waitVisible();
}
async clickDeletePermissionButton(username: string): Promise<void> {
const userOrGroupName = TestElement.byCss(`[data-automation-id="adf-delete-permission-button-${username}"]`);
await userOrGroupName.waitPresent();
await userOrGroupName.click();
}
async checkUserIsDeleted(username: string): Promise<void> {
const userOrGroupName = TestElement.byCss('div[data-automation-id="' + username + '"]');
await userOrGroupName.waitNotPresent();
}
async noPermissionContent(): Promise<string> {
const noPermission = TestElement.byCss('.adf-no-permission__template--text');
return noPermission.getText();
}
async checkPermissionManagerDisplayed(): Promise<void> {
await TestElement.byId(this.rootElement).waitVisible();
}
async checkPermissionListDisplayed(): Promise<void> {
await browser.sleep(500);
await this.localPermissionList.waitVisible();
}
async isInherited(): Promise<boolean> {
const inheritButton = TestElement.byCss(this.inheritedButton);
await inheritButton.waitVisible();
return (await inheritButton.getAttribute('class')).indexOf('mat-checked') !== -1;
}
async toggleInheritPermission(): Promise<void> {
const inheritButton = TestElement.byCss(`${this.inheritedButton} label`);
await inheritButton.click();
}
}
@@ -17,14 +17,7 @@
import { browser, by, element } from 'protractor';
import { createApiService,
DropActions,
LoginPage,
StringUtil,
UploadActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, DropActions, LoginPage, StringUtil, UploadActions, UserModel, UsersActions } from '@alfresco/adf-testing';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
import { UploadTogglesPage } from '../../core/pages/dialog/upload-toggles.page';
@@ -32,7 +25,6 @@ import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
describe('Upload component', () => {
const contentServicesPage = new ContentServicesPage();
const uploadDialog = new UploadDialogPage();
const uploadToggles = new UploadTogglesPage();
@@ -93,8 +85,7 @@ describe('Upload component', () => {
for (const node of nodeList) {
try {
await uploadActions.deleteFileOrFolder(node);
} catch (error) {
}
} catch (error) {}
}
});
@@ -226,14 +217,6 @@ describe('Upload component', () => {
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(fileWithSpecificSize.name);
});
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');
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', async () => {