diff --git a/e2e/configs.ts b/e2e/configs.ts index d1504f59a..5d5414620 100755 --- a/e2e/configs.ts +++ b/e2e/configs.ts @@ -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 diff --git a/e2e/utilities/repo-client/apis/repo-api.ts b/e2e/utilities/repo-client/apis/repo-api.ts index dd512d914..ec9cdc08f 100644 --- a/e2e/utilities/repo-client/apis/repo-api.ts +++ b/e2e/utilities/repo-client/apis/repo-api.ts @@ -23,8 +23,8 @@ * along with Alfresco. If not, see . */ +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() { diff --git a/package.json b/package.json index 7fcdbe80b..0b47f7323 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/protractor.conf.js b/protractor.conf.js index 4f1be31d7..1df8d849f 100755 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -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 },