Update e2e Tests to allow ADW builds to run on them as well (#1242)

* make ECM host flexible
This commit is contained in:
Martin Muller
2019-11-05 15:50:10 +01:00
committed by GitHub
parent 4cb79f5e58
commit 349a9df044
4 changed files with 12 additions and 7 deletions

View File

@@ -32,7 +32,6 @@ export const BROWSER_WAIT_TIMEOUT = 10000;
export const USE_HASH_STRATEGY = true;
// Repository configs
export const REPO_API_HOST = 'http://localhost:8080';
export const REPO_API_TENANT = '-default-';
// Admin details

View File

@@ -23,8 +23,8 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { browser } from 'protractor';
import { AlfrescoApi } from '@alfresco/js-api';
import { REPO_API_HOST } from '../../../configs';
import { RepoClientAuth } from '../repo-client-models';
export abstract class RepoApi {
@@ -34,10 +34,7 @@ export abstract class RepoApi {
private username: string = RepoClientAuth.DEFAULT_USERNAME,
private password: string = RepoClientAuth.DEFAULT_PASSWORD
) {
this.alfrescoJsApi.setConfig({
provider: 'ECM',
hostEcm: REPO_API_HOST
});
this.alfrescoJsApi.setConfig(browser.params.config);
}
apiAuth() {

View File

@@ -17,7 +17,7 @@
"lint": "ng lint && npm run spellcheck && npm run format:check && npm run e2e.typecheck",
"wd:update": "webdriver-manager update --gecko=false $VERSION_CHROME",
"e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json",
"e2e": "npm run wd:update && protractor --baseUrl=http://localhost:4000 $SUITE",
"e2e": "npm run wd:update && protractor --baseUrl=${TEST_BASE_URL:-http://localhost:4000} $SUITE",
"e2e.local": "npm run wd:update && protractor --baseUrl=http://localhost:4200 $SUITE",
"wait:app": "wait-on http://localhost:8080 && wait-on http://localhost:4000",
"start:docker": "docker-compose up -d --build && npm run wait:app",

View File

@@ -13,6 +13,8 @@ const downloadFolder = `${projectRoot}/e2e-downloads`;
const width = 1366;
const height = 768;
const REPO_API_HOST = process.env.REPO_API_HOST || 'http://localhost:8080';
function rmDir(dirPath) {
try {
var files = fs.readdirSync(dirPath);
@@ -28,10 +30,17 @@ function rmDir(dirPath) {
fs.rmdirSync(dirPath);
}
const appConfig = {
ecmHost: REPO_API_HOST,
providers: 'ECM',
authType: 'BASIC'
};
exports.config = {
allScriptsTimeout: 50000,
params: {
config: appConfig,
downloadFolder: downloadFolder
},