103103 mvn install -DskipTests >> " $NOW_RUN_LOG_FILE " 2>&1 || return 1
104104 log_success " Dependencies installed"
105105
106-
107- log_section " Validate Environment Variables"
108- log_info " BrowserStack Username: $BROWSERSTACK_USERNAME "
109- log_info " BrowserStack Build: $BROWSERSTACK_BUILD_NAME "
110- log_info " Web Application Endpoint: $CX_TEST_URL "
111- log_info " BrowserStack Local Flag: $BROWSERSTACK_LOCAL "
112- log_info " Parallels per platform: $BSTACK_PARALLELS "
113- log_info " Platforms: \n$BSTACK_PLATFORMS "
106+ print_env_vars
114107
115108
116109 print_tests_running_log_section " mvn test -P sample-test"
170163 fi
171164 log_success " Dependencies installed"
172165
173- log_section " Validate Environment Variables"
174- log_info " BrowserStack Username: $BROWSERSTACK_USERNAME "
175- log_info " BrowserStack Build: $BROWSERSTACK_BUILD_NAME "
176- log_info " Native App Endpoint: $BROWSERSTACK_APP "
177- log_info " BrowserStack Local Flag: $BROWSERSTACK_LOCAL "
178- log_info " Parallels per platform: $BSTACK_PARALLELS "
179- log_info " Platforms: \n$BSTACK_PLATFORMS "
166+ print_env_vars
180167
181168 log_msg_to " 🚀 Running 'mvn test -P sample-test'. This could take a few minutes. Follow the Automaton build here: https://automation.browserstack.com/"
182169 print_tests_running_log_section " mvn test -P sample-test"
@@ -200,7 +187,7 @@ setup_web_python() {
200187
201188 clone_repository " $REPO " " $TARGET_DIR " " "
202189
203- # detect_setup_python_env
190+ detect_setup_python_env
204191
205192 pip3 install --only-binary grpcio -r requirements.txt >> " $NOW_RUN_LOG_FILE " 2>&1
206193 pip3 uninstall -y pytest-html pytest-rerunfailures >> " $NOW_RUN_LOG_FILE " 2>&1
229216 export BROWSERSTACK_PROJECT_NAME=" now-$NOW_OS -web"
230217
231218 report_bstack_local_status " $local_flag "
232-
233- log_section " Validate Environment Variables"
234- log_info " BrowserStack Username: $BROWSERSTACK_USERNAME "
235- log_info " BrowserStack Build: $BROWSERSTACK_BUILD_NAME "
236- log_info " Web Application Endpoint: $CX_TEST_URL "
237- log_info " BrowserStack Local Flag: $BROWSERSTACK_LOCAL "
238- log_info " Parallels per platform: $BSTACK_PARALLELS "
239- log_info " Platforms: \n$BSTACK_PLATFORMS "
240-
219+
220+ print_env_vars
241221
242222 print_tests_running_log_section " browserstack-sdk pytest -s tests/*.py"
243223 log_msg_to " 🚀 Running 'browserstack-sdk pytest -s tests/*.py'. This could take a few minutes. Follow the Automaton build here: https://automation.browserstack.com/"
@@ -260,7 +240,7 @@ setup_app_python() {
260240
261241 clone_repository " $REPO " " $TARGET_DIR "
262242
263- # detect_setup_python_env
243+ detect_setup_python_env
264244
265245 # Install dependencies
266246 pip install --only-binary grpcio -r requirements.txt >> " $NOW_RUN_LOG_FILE " 2>&1
291271 export BROWSERSTACK_BUILD_NAME=" now-$NOW_OS -app-python-pytest"
292272 export BROWSERSTACK_PROJECT_NAME=" now-$NOW_OS -app"
293273
294- log_section " Validate Environment Variables"
295- log_info " BrowserStack Username: $BROWSERSTACK_USERNAME "
296- log_info " BrowserStack Build: $BROWSERSTACK_BUILD_NAME "
297- log_info " Native App Endpoint: $BROWSERSTACK_APP "
298- log_info " BrowserStack Local Flag: $BROWSERSTACK_LOCAL "
299- log_info " Parallels per platform: $BSTACK_PARALLELS "
300- log_info " Platforms: \n$BSTACK_PLATFORMS "
274+ print_env_vars
301275
302276 print_tests_running_log_section " cd $run_dir && browserstack-sdk pytest -s bstack-sample.py"
303277 # Run pytest with BrowserStack SDK from the chosen platform directory
@@ -346,13 +320,7 @@ setup_web_nodejs() {
346320
347321 report_bstack_local_status " $local_flag "
348322
349- log_section " Validate Environment Variables"
350- log_info " BrowserStack Username: $BROWSERSTACK_USERNAME "
351- log_info " BrowserStack Build: $BROWSERSTACK_BUILD_NAME "
352- log_info " Web Application Endpoint: $CX_TEST_URL "
353- log_info " BrowserStack Local Flag: $BROWSERSTACK_LOCAL "
354- log_info " Parallels per platform: $BSTACK_PARALLELS "
355- log_info " Platforms: \n$BSTACK_CAPS_JSON "
323+ print_env_vars
356324
357325 # === 8️⃣ Run Tests ===
358326 log_msg_to " 🚀 Running 'npm run test'. This could take a few minutes. Follow the Automaton build here: https://automation.browserstack.com/"
@@ -400,13 +368,7 @@ setup_app_nodejs() {
400368 export BROWSERSTACK_BUILD_NAME=" now-$NOW_OS -app-nodejs-wdio"
401369 export BROWSERSTACK_PROJECT_NAME=" now-$NOW_OS -app"
402370
403- log_section " Validate Environment Variables"
404- log_info " BrowserStack Username: $BROWSERSTACK_USERNAME "
405- log_info " BrowserStack Build: $BROWSERSTACK_BUILD_NAME "
406- log_info " Native App Endpoint: $BROWSERSTACK_APP "
407- log_info " BrowserStack Local Flag: $BROWSERSTACK_LOCAL "
408- log_info " Parallels per platform: $BSTACK_PARALLELS "
409- log_info " Platforms: \n$BSTACK_CAPS_JSON "
371+ print_env_vars
410372
411373 # === 8️⃣ Run Tests ===
412374 log_msg_to " 🚀 Running 'npm run test'. This could take a few minutes. Follow the Automaton build here: https://automation.browserstack.com/"
@@ -545,4 +507,25 @@ detect_setup_python_env() {
545507 source .venv/bin/activate
546508 fi
547509 log_success " Virtual environment created and activated."
510+ }
511+
512+ print_env_vars () {
513+ log_section " ✅ Environment Variables"
514+ log_info " BrowserStack Username: $BROWSERSTACK_USERNAME "
515+ log_info " BrowserStack Project Name: $BROWSERSTACK_PROJECT_NAME "
516+ log_info " BrowserStack Build: $BROWSERSTACK_BUILD_NAME "
517+ log_info " BrowserStack Local Flag: $BROWSERSTACK_LOCAL "
518+ log_info " Parallels per platform: $BSTACK_PARALLELS "
519+
520+ if [ " $tech_stack " = " nodejs" ]; then
521+ log_info " Capabilities JSON: \n$BSTACK_CAPS_JSON "
522+ else
523+ log_info " Platforms: \n$BSTACK_PLATFORMS "
524+ fi
525+
526+ if [ " $test_type " = " app" ]; then
527+ log_info " Native App Endpoint: $BROWSERSTACK_APP "
528+ else
529+ log_info " Web Application Endpoint: $CX_TEST_URL "
530+ fi
548531}
0 commit comments