AAE-1841 - added delete directive test (#5547)

* AAE-1841 - start adding e2e for delete directive

* AAE-1841 - added delete directive test

* AAE-1841 - fixed PR review
This commit is contained in:
Vito
2020-03-17 18:57:04 +00:00
committed by GitHub
parent d720d36670
commit ec689cad3f
7 changed files with 340 additions and 1 deletions

View File

@@ -0,0 +1,52 @@
/*!
* @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 { AlfrescoApiCompatibility as AlfrescoApi, NodeEntry, NodeBodyUpdate } from '@alfresco/js-api';
export class PermissionActions {
alfrescoJsApi: AlfrescoApi = null;
constructor(alfrescoJsApi: AlfrescoApi) {
this.alfrescoJsApi = alfrescoJsApi;
}
addRoleForUser(userName: string, role: string, nodeToUpdate: NodeEntry): Promise<NodeEntry> {
const payload: NodeBodyUpdate = {
permissions: {
locallySet: [
{
accessStatus: 'ALLOWED',
name: role,
authorityId: userName
}
]
}
};
return this.alfrescoJsApi.nodes.updateNode(nodeToUpdate.entry.id, payload);
}
disableInheritedPermissionsForNode(nodeId: string): Promise<NodeEntry> {
const nodeBody = { permissions: { isInheritanceEnabled: false } };
return this.alfrescoJsApi.nodes.updateNode(nodeId, nodeBody, { include: ['permissions'] });
}
enableInheritedPermissionsForNode(nodeId: string): Promise<NodeEntry> {
const nodeBody = { permissions: { isInheritanceEnabled: true } };
return this.alfrescoJsApi.nodes.updateNode(nodeId, nodeBody, { include: ['permissions'] });
}
}

View File

@@ -16,3 +16,4 @@
*/
export * from './upload.actions';
export * from './permission.actions';

View File

@@ -57,6 +57,10 @@ export class DocumentListPage {
await this.dataTable.selectRow('Display name', nodeName);
}
async selectRowWithKeyboard(nodeName: string): Promise<void> {
await this.dataTable.selectRowWithKeyboard('Display name', nodeName);
}
async rightClickOnRow(nodeName: string): Promise<void> {
await this.dataTable.rightClickOnRow('Display name', nodeName);
}