You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log_msg_to "❌ Unauthorized to fetch required plan(s). Exiting."
249
269
exit 1
250
270
fi
271
+
272
+
if [[ "$RUN_MODE"==*"--silent"* ]];then
273
+
if [[ "$test_type"=="web" ]];then
274
+
TEAM_PARALLELS_MAX_ALLOWED_WEB=5
275
+
export TEAM_PARALLELS_MAX_ALLOWED_WEB=5
276
+
else
277
+
TEAM_PARALLELS_MAX_ALLOWED_MOBILE=5
278
+
export TEAM_PARALLELS_MAX_ALLOWED_MOBILE=5
279
+
fi
280
+
log_info "Resetting Plan summary: Web $WEB_PLAN_FETCHED ($TEAM_PARALLELS_MAX_ALLOWED_WEB max), Mobile $MOBILE_PLAN_FETCHED ($TEAM_PARALLELS_MAX_ALLOWED_MOBILE max)"
281
+
fi
251
282
}
252
283
253
284
# Function to check if IP is private
@@ -270,7 +301,7 @@ is_domain_private() {
270
301
export CX_TEST_URL="$CX_TEST_URL"
271
302
272
303
# Resolve domain using Cloudflare DNS
273
-
IP_ADDRESS=$(dig +short "$domain" @1.1.1.1 | head -n1)
304
+
IP_ADDRESS=$(resolve_ip "$domain")
274
305
275
306
# Determine if domain is private
276
307
if is_private_ip "$IP_ADDRESS";then
@@ -284,6 +315,31 @@ is_domain_private() {
284
315
return$is_cx_domain_private
285
316
}
286
317
318
+
resolve_ip() {
319
+
local domain=$1
320
+
local ip=""
321
+
322
+
# Try dig first (standard on macOS/Linux, optional on Windows)
323
+
ifcommand -v dig >/dev/null 2>&1;then
324
+
ip=$(dig +short "$domain" @1.1.1.1 | head -n1)
325
+
fi
326
+
327
+
# Try Python if dig failed or missing
328
+
if [ -z"$ip" ] &&command -v python3 >/dev/null 2>&1;then
log_info "BrowserStack credentials loaded from environment variables for user: $username"
12
12
else
13
+
if [[ "$NOW_OS"=="macos" ]];then
13
14
username=$(osascript -e 'Tell application "System Events" to display dialog "Please enter your BrowserStack Username.\n\nNote: Locate it in your BrowserStack account profile page.\nhttps://www.browserstack.com/accounts/profile/details" default answer "" with title "BrowserStack Setup" buttons {"OK"} default button "OK"' \
14
15
-e 'text returned of result')
16
+
else
17
+
echo"Please enter your BrowserStack Username."
18
+
echo"Note: Locate it in your BrowserStack account profile page: https://www.browserstack.com/accounts/profile/details"
19
+
read -r username
20
+
fi
15
21
16
22
if [ -z"$username" ];then
17
23
log_msg_to "❌ Username empty"
18
24
return 1
19
25
fi
20
26
27
+
if [[ "$NOW_OS"=="macos" ]];then
21
28
access_key=$(osascript -e 'Tell application "System Events" to display dialog "Please enter your BrowserStack Access Key.\n\nNote: Locate it in your BrowserStack account page.\nhttps://www.browserstack.com/accounts/profile/details" default answer "" with hidden answer with title "BrowserStack Setup" buttons {"OK"} default button "OK"' \
22
29
-e 'text returned of result')
30
+
else
31
+
echo"Please enter your BrowserStack Access Key."
32
+
echo"Note: Locate it in your BrowserStack account page: https://www.browserstack.com/accounts/profile/details"
33
+
read -rs access_key
34
+
echo""# Newline after secret input
35
+
fi
23
36
if [ -z"$access_key" ];then
24
37
log_msg_to "❌ Access Key empty"
25
38
return 1
@@ -41,8 +54,18 @@ get_tech_stack() {
41
54
tech_stack="$TSTACK"
42
55
log_msg_to "✅ Selected Tech Stack from environment: $tech_stack"
43
56
else
57
+
if [[ "$NOW_OS"=="macos" ]];then
44
58
tech_stack=$(osascript -e 'Tell application "System Events" to display dialog "Select installed tech stack:" buttons {"java", "python", "nodejs"} default button "java" with title "Testing Framework Technology Stack"' \
test_url=$(osascript -e 'Tell application "System Events" to display dialog "Enter the URL you want to test with BrowserStack:\n(Leave blank for default: '"$DEFAULT_TEST_URL"')" default answer "" with title "Test URL Setup" buttons {"OK"} default button "OK"' \
60
-
-e 'text returned of result')
82
+
if [[ "$NOW_OS"=="macos" ]];then
83
+
test_url=$(osascript -e 'Tell application "System Events" to display dialog "Enter the URL you want to test with BrowserStack:\n(Leave blank for default: '"$DEFAULT_TEST_URL"')" default answer "" with title "Test URL Setup" buttons {"OK"} default button "OK"' \
84
+
-e 'text returned of result')
85
+
else
86
+
echo"Enter the URL you want to test with BrowserStack:"
87
+
echo"(Leave blank for default: $DEFAULT_TEST_URL)"
88
+
read -r test_url
89
+
fi
61
90
62
91
if [ -n"$test_url" ];then
63
92
log_msg_to "🌐 Using custom test URL: $test_url"
@@ -79,8 +108,18 @@ get_test_type() {
79
108
test_type=$TT
80
109
log_msg_to "✅ Selected Testing Type from environment: $TEST_TYPE"
81
110
else
111
+
if [[ "$NOW_OS"=="macos" ]];then
82
112
test_type=$(osascript -e 'Tell application "System Events" to display dialog "Select testing type:" buttons {"web", "app"} default button "web" with title "Testing Type"' \
0 commit comments