[ADF-4948] Move the resources config in the process cloud lib - Part 2 (#5143)

* Move the resources in the cloud lib

* Use adf cli

* Add missing process definitions

* Add debug points

* Print new class

* Use the resources under the adf-testing

* Use the resources from testing package

* Fix adf-testing bugs

* remove empty row

* Remove the npm install

* Remove log stuff

* Remove the console log

* Fix typo on process def names
Improve the debug e2e command

* Fix lowercase name

* Check the process cloud env and content env

* Add the new process definitions

* Add missing process definitions

* Use the latest simpleapp

* Rollback the bigFile

* Use relative link

* Trasnpile the adf-testing before using it
This commit is contained in:
Maurizio Vitale
2019-10-17 14:31:58 +01:00
committed by Eugenio Romano
parent ee5c90871a
commit 941df740d5
37 changed files with 130 additions and 677 deletions
+4 -49
View File
@@ -18,6 +18,8 @@
*/
import { logging } from '@angular-devkit/core';
import { ACTIVITI_CLOUD_APPS } from '@alfresco/adf-testing';
/* tslint:disable */
const alfrescoApi = require('@alfresco/js-api');
/* tslint:enable */
@@ -27,59 +29,12 @@ import * as fs from 'fs';
export interface ConfigArgs {
username: string;
password: string;
clientId: string;
host: string;
oauth: string;
identityHost: boolean;
}
const ACTIVITI_CLOUD_APPS: any = {
CANDIDATE_BASE_APP: {
name: 'candidatebaseapp',
file_location: 'https://github.com/Alfresco/alfresco-ng2-components/blob/development/e2e/resources/activiti7/candidatebaseapp.zip?raw=true',
processes: {
candidateUserProcess: 'candidateUserProcess',
candidateGroupProcess: 'candidateGroupProcess',
anotherCandidateGroupProcess: 'anotherCandidateGroupProcess',
uploadFileProcess: 'uploadFileProcess'
},
security: [
{'role': 'APS_ADMIN', 'groups': [], 'users': ['superadminuser']},
{'role': 'APS_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser']
}]
},
SIMPLE_APP: {
name: 'simpleapp',
file_location: 'https://github.com/Alfresco/alfresco-ng2-components/blob/development/e2e/resources/activiti7/simpleapp.zip?raw=true',
processes: {
processwithvariables: 'processwithvariables',
simpleProcess: 'simpleprocess',
dropdownrestprocess: 'dropdownrestprocess'
},
forms: {
tabVisibilityFields: {
name: 'tabvisibilitywithfields',
id: 'form-26b01063-4fb0-455f-b3ba-90172e013678'
},
tabVisibilityVars: {
name: 'tabvisibilitywithvars',
id: 'form-7bf363d2-83c9-4b00-853e-373d0d59963c'
}
},
security: [
{'role': 'APS_ADMIN', 'groups': [], 'users': ['superadminuser']},
{'role': 'APS_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser']
}]
},
SUB_PROCESS_APP: {
name: 'subprocessapp',
file_location: 'https://github.com/Alfresco/alfresco-ng2-components/blob/development/e2e/resources/activiti7/subprocessapp.zip?raw=true',
security: [
{'role': 'APS_ADMIN', 'groups': [], 'users': ['superadminuser']},
{'role': 'APS_USER', 'groups': ['hr', 'testgroup'], 'users': ['hruser']
}]
}
};
async function getDeployedApplicationsByStatus(args: ConfigArgs, apiService: any, status: string, logger: logging.Logger) {
const url = `${args.host}/deployment-service/v1/applications`;
@@ -106,7 +61,7 @@ function getAlfrescoJsApiInstance(args: ConfigArgs) {
authType: 'OAUTH',
oauth2: {
host: `${args.oauth}`,
clientId: 'activiti',
clientId: `${args.clientId}`,
scope: 'openid',
secret: '',
implicitFlow: false,
+18 -12
View File
@@ -1,23 +1,30 @@
{
"compilerOptions": {
"declaration": true,
"target": "es2018",
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitThis": true,
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": false,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"strict": false,
"noUnusedParameters": true,
"noUnusedLocals": true,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "./dist",
"rootDir": ".",
"skipLibCheck": true,
"strictNullChecks": true,
"target": "es2018",
"lib": [
"es2018"
"es2016",
"dom"
],
"baseUrl": ".",
"baseUrl": "./",
"typeRoots": [
"./node_modules/@types"
],
@@ -32,6 +39,5 @@
"./build.ts",
"node_modules/**/*",
"**/node_modules/**/*"
]
}
@@ -16,7 +16,6 @@
*/
export * from './lib/process-services-cloud.module';
export * from './lib/app/public-api';
export * from './lib/process/public-api';
export * from './lib/task/public-api';
@@ -18,14 +18,14 @@
import { StringUtil } from '../utils/string.util';
import { browser } from 'protractor';
const EMAIL_DOMAIN = browser.params.testConfig ? browser.params.testConfig.projectName : 'alfresco';
export class UserModel {
EMAIL_DOMAIN = browser.params.testConfig ? browser.params.testConfig.projectName : 'alfresco';
firstName: string = StringUtil.generateRandomString();
lastName: string = StringUtil.generateRandomString();
password: string = StringUtil.generateRandomString();
email: string = StringUtil.generateRandomEmail(`@${EMAIL_DOMAIN}.com`);
email: string = StringUtil.generateRandomEmail(`@${this.EMAIL_DOMAIN}.com`);
username: string = StringUtil.generateRandomString().toLowerCase();
idIdentityService: string;
@@ -17,51 +17,50 @@
import { browser, by, element, ElementFinder, protractor } from 'protractor';
const until = protractor.ExpectedConditions;
const DEFAULT_TIMEOUT = global['TestConfig'] ? global['TestConfig'].main.timeout : 40000;
export class BrowserVisibility {
static async waitUntilElementIsPresent(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT): Promise<any> {
return browser.wait(until.presenceOf(elementToCheck), waitTimeout, 'Element is not present ' + elementToCheck.locator());
return browser.wait(protractor.ExpectedConditions.presenceOf(elementToCheck), waitTimeout, 'Element is not present ' + elementToCheck.locator());
}
/*
* Wait for element to be visible
*/
static async waitUntilElementIsVisible(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT, message: string = 'Element is not visible'): Promise<any> {
return browser.wait(until.visibilityOf(elementToCheck), waitTimeout, message + elementToCheck.locator());
return browser.wait(protractor.ExpectedConditions.visibilityOf(elementToCheck), waitTimeout, message + elementToCheck.locator());
}
/*
* Wait for element to be clickable
*/
static async waitUntilElementIsClickable(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT): Promise<any> {
return browser.wait(until.elementToBeClickable(elementToCheck), waitTimeout, 'Element is not Clickable ' + elementToCheck.locator());
return browser.wait(protractor.ExpectedConditions.elementToBeClickable(elementToCheck), waitTimeout, 'Element is not Clickable ' + elementToCheck.locator());
}
/*
* Wait for element to not be present on the page
*/
static async waitUntilElementIsStale(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT): Promise<any> {
return browser.wait(until.stalenessOf(elementToCheck), waitTimeout, 'Element is not in stale ' + elementToCheck.locator());
return browser.wait(protractor.ExpectedConditions.stalenessOf(elementToCheck), waitTimeout, 'Element is not in stale ' + elementToCheck.locator());
}
/*
* Wait for element to not be visible
*/
static async waitUntilElementIsNotVisible(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT): Promise<any> {
return browser.wait(until.invisibilityOf(elementToCheck), waitTimeout, 'Element is Visible and it should not' + elementToCheck.locator());
return browser.wait(protractor.ExpectedConditions.invisibilityOf(elementToCheck), waitTimeout, 'Element is Visible and it should not' + elementToCheck.locator());
}
/*
* Wait for element to have value
*/
static async waitUntilElementHasValue(elementToCheck: ElementFinder, elementValue, waitTimeout: number = DEFAULT_TIMEOUT): Promise<any> {
return browser.wait(until.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, 'Element doesn\'t have a value ' + elementToCheck.locator());
return browser.wait(protractor.ExpectedConditions.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, 'Element doesn\'t have a value ' + elementToCheck.locator());
}
static async waitUntilElementIsNotPresent(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT): Promise<any> {
return browser.wait(until.stalenessOf(elementToCheck), waitTimeout, 'Element is present ' + elementToCheck.locator());
return browser.wait(protractor.ExpectedConditions.stalenessOf(elementToCheck), waitTimeout, 'Element is present ' + elementToCheck.locator());
}
static async waitUntilDialogIsClose(): Promise<any> {
@@ -19,11 +19,10 @@ import * as path from 'path';
import * as fs from 'fs';
import { browser } from 'protractor';
const DEFAULT_ROOT_PATH = browser.params.testConfig ? browser.params.testConfig.main.rootPath : __dirname;
export class FileBrowserUtil {
static async isFileDownloaded(fileName: string): Promise<boolean> {
const DEFAULT_ROOT_PATH = browser.params.testConfig ? browser.params.testConfig.main.rootPath : __dirname;
const file = await browser.driver.wait(() => {
return fs.existsSync(path.join(DEFAULT_ROOT_PATH, 'downloads', fileName));
@@ -21,10 +21,14 @@ export const ACTIVITI_CLOUD_APPS: any = {
name: 'candidatebaseapp',
file_location: 'https://github.com/Alfresco/alfresco-ng2-components/blob/development/e2e/resources/activiti7/candidatebaseapp.zip?raw=true',
processes: {
candidateUserProcess: 'candidateUserProcess',
candidateGroupProcess: 'candidateGroupProcess',
anotherCandidateGroupProcess: 'anotherCandidateGroupProcess',
uploadFileProcess: 'uploadFileProcess'
candidateUserProcess: 'candidateuserprocess',
candidateGroupProcess: 'candidategroupprocess',
anotherCandidateGroupProcess: 'anothercandidategroup',
uploadFileProcess: 'uploadfileprocess'
},
forms: {
starteventform: 'starteventform',
formtotestvalidations: 'formtotestvalidations'
},
security: [
{'role': 'APS_ADMIN', 'groups': [], 'users': ['superadminuser']},
@@ -39,7 +43,14 @@ export const ACTIVITI_CLOUD_APPS: any = {
simpleProcess: 'simpleprocess',
dropdownrestprocess: 'dropdownrestprocess',
multilingualprocess: 'multilingualprocess',
processWithTabVisibility: 'processwithtabvisibility'
processWithTabVisibility: 'processwithtabvisibility',
startmessageevent: 'start-message-event',
intermediatemessageevent: 'intermediate-message-event',
intboundaryevent: 'int-boundary-event',
nonintboundaryevent: 'nonint-boundary-event',
intboundarysubprocess: 'int-boundary-subprocess',
intstartmessageevent: 'int-start-message-event',
nonintstartmessageevent: 'nonint-start-message-event'
},
forms: {
tabVisibilityFields: {
@@ -49,6 +60,10 @@ export const ACTIVITI_CLOUD_APPS: any = {
tabVisibilityVars: {
name: 'tabvisibilitywithvars',
id: 'form-7bf363d2-83c9-4b00-853e-373d0d59963c'
},
usertaskform: {
name: 'usertaskform',
id: 'form-056ba4aa-90c2-48eb-ba39-7013d732503b'
}
},
security: [