Skip to content

Commit

Permalink
refactor variable usage
Browse files Browse the repository at this point in the history
ensure passed selenium url is not overwritten
  • Loading branch information
wildone committed Oct 31, 2019
1 parent 70aa2a3 commit 49e341a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions aemdesign-testing/test-spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ SKIP_PRINT_CONFIG=true

source "../scripts/functions.sh"

# get default from exported variables
TEST_SELENIUMHUB_SCHEME=${SELENIUMHUB_SCHEME:-http}
TEST_SELENIUMHUB_PORT=${SELENIUMHUB_PORT:-32768}
TEST_SELENIUMHUB_SERVICE=${SELENIUMHUB_SERVICE:-/wd/hub}

# Test defaults
TEST_SELENIUM_URL="${SELENIUMHUB_SCHEME}://${LOCAL_IP}:${SELENIUMHUB_PORT}${SELENIUMHUB_SERVICE}"
TEST_SELENIUM_URL="" # "${TEST_SELENIUMHUB_SCHEME}://${LOCAL_IP}:${TEST_SELENIUMHUB_PORT}${TEST_SELENIUMHUB_SERVICE}"
TEST_IMAGE="aemdesign/centos-java-buildpack"
TEST_OPEN_REPORT=false
TEST_REPORT_PATH="generated-docs/summary.html"
Expand Down Expand Up @@ -311,8 +316,8 @@ main() {
processArguments $@

# update selenium url
if [[ "${SELENIUMHUB_HOST}" == "localhost" ]]; then
TEST_SELENIUM_URL="${SELENIUMHUB_SCHEME}://${LOCAL_IP}:${SELENIUMHUB_PORT}${SELENIUMHUB_SERVICE}"
if [[ "${SELENIUMHUB_HOST}" == "localhost" && "$TEST_SELENIUM_URL" == "" ]]; then
TEST_SELENIUM_URL="${TEST_SELENIUMHUB_SCHEME}://${LOCAL_IP}:${TEST_SELENIUMHUB_PORT}${TEST_SELENIUMHUB_SERVICE}"
fi

#update host
Expand Down

0 comments on commit 49e341a

Please sign in to comment.