[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

View File

@@ -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;

View File

@@ -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> {

View File

@@ -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));

View File

@@ -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: [