add more e2e tests (#851)

This commit is contained in:
Adina Parpalita
2018-12-04 18:33:50 +02:00
committed by Denys Vuika
parent e020dc4b77
commit d0ff69c5dc
18 changed files with 980 additions and 190 deletions

View File

@@ -46,12 +46,9 @@ export class NodesApi extends RepoApi {
return await this.alfrescoJsApi.core.nodesApi.getNode(id);
}
async getNodeDescription(name: string, relativePath: string = '/') {
relativePath = (relativePath === '/')
? `${name}`
: `${relativePath}/${name}`;
return (await this.getNodeByPath(`${relativePath}`)).entry.properties['cm:description'];
async getNodeDescription(name: string, parentId: string) {
const children = (await this.getNodeChildren(parentId)).list.entries;
return children.find(elem => elem.entry.name === name).entry.properties['cm:description'];
}
async getNodeProperty(nodeId: string, property: string) {
@@ -93,8 +90,11 @@ export class NodesApi extends RepoApi {
// children
async getNodeChildren(nodeId: string) {
const opts = {
include: [ 'properties' ]
};
await this.apiAuth();
return await this.alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId);
return await this.alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId, opts);
}
async deleteNodeChildren(parentId: string) {

View File

@@ -128,6 +128,24 @@ export class SitesApi extends RepoApi {
return await this.alfrescoJsApi.core.sitesApi.removeSiteMember(siteId, userId);
}
async requestToJoin(siteId: string) {
const body = {
id: siteId
};
await this.apiAuth();
try {
return await this.alfrescoJsApi.core.peopleApi.addSiteMembershipRequest('-me-', body);
} catch (error) {
console.log('====== requestToJoin catch ', error);
};
}
async hasMembershipRequest(siteId: string) {
await this.apiAuth();
const requests = (await this.alfrescoJsApi.core.peopleApi.getSiteMembershipRequests('-me-')).list.entries.map(e => e.entry.id);
return requests.includes(siteId);
}
async waitForApi(data) {
try {
const sites = async () => {