Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions mac/common-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ handle_app_upload() {
}

upload_sample_app() {
log_msg_to "⬆️ Uploading sample app to BrowserStack..."
log_info "Uploading sample app to BrowserStack"
local upload_response
upload_response=$(curl -s -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
Expand Down Expand Up @@ -182,11 +182,11 @@ upload_custom_app() {
elif [[ "$file_path" == *.apk ]]; then
app_platform="android"
else
log_msg_to "❌ Invalid file type. Must be .apk or .ipa"
return 1
log_error "❌ Invalid file type. Must be .apk or .ipa"
exit 1
fi

log_msg_to "⬆️ Uploading app to BrowserStack..."
log_info "Uploading app to BrowserStack"
local upload_response
upload_response=$(curl -s -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
Expand All @@ -195,8 +195,8 @@ upload_custom_app() {
local app_url
app_url=$(echo "$upload_response" | grep -o '"app_url":"[^"]*' | cut -d'"' -f4)
if [ -z "$app_url" ]; then
log_msg_to "❌ Failed to upload app"
return 1
log_error "❌ Failed to upload app: $upload_response"
exit 1
fi

export BROWSERSTACK_APP=$app_url
Expand Down
5 changes: 3 additions & 2 deletions mac/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ log_section "🧭 Setup Summary – BrowserStack NOW"
log_info "Timestamp: $(date '+%Y-%m-%d %H:%M:%S')"

detect_os
setup_workspace
get_browserstack_credentials "$RUN_MODE"

log_file=""
if [[ "$RUN_MODE" == *"--silent"* || "$RUN_MODE" == *"--debug"* ]]; then
Expand All @@ -47,8 +49,7 @@ fi

log_info "Log file path: $log_file"
export NOW_RUN_LOG_FILE="$log_file"
setup_workspace
get_browserstack_credentials "$RUN_MODE"


log_section "⚙️ Platform & Tech Stack"
log_info "Platform: ${TEST_TYPE:-N/A}"
Expand Down
10 changes: 5 additions & 5 deletions mac/user-interaction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ get_browserstack_credentials() {
log_info "BrowserStack credentials loaded from environment variables for user: $username"
else
if [[ "$NOW_OS" == "macos" ]]; then
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"' \
username=$(osascript -e '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"' \
-e 'text returned of result')
else
echo "Please enter your BrowserStack Username."
Expand All @@ -25,7 +25,7 @@ get_browserstack_credentials() {
fi

if [[ "$NOW_OS" == "macos" ]]; then
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"' \
access_key=$(osascript -e '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"' \
-e 'text returned of result')
else
echo "Please enter your BrowserStack Access Key."
Expand Down Expand Up @@ -55,7 +55,7 @@ get_tech_stack() {
log_msg_to "✅ Selected Tech Stack from environment: $tech_stack"
else
if [[ "$NOW_OS" == "macos" ]]; then
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"' \
tech_stack=$(osascript -e 'display dialog "Select installed tech stack:" buttons {"java", "python", "nodejs"} default button "java" with title "Testing Framework Technology Stack"' \
-e 'button returned of result')
else
echo "Select installed tech stack:"
Expand All @@ -80,7 +80,7 @@ get_test_url() {
local test_url=$DEFAULT_TEST_URL

if [[ "$NOW_OS" == "macos" ]]; then
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"' \
test_url=$(osascript -e '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"' \
-e 'text returned of result')
else
echo "Enter the URL you want to test with BrowserStack:"
Expand Down Expand Up @@ -109,7 +109,7 @@ get_test_type() {
log_msg_to "✅ Selected Testing Type from environment: $TEST_TYPE"
else
if [[ "$NOW_OS" == "macos" ]]; then
test_type=$(osascript -e 'Tell application "System Events" to display dialog "Select testing type:" buttons {"web", "app"} default button "web" with title "Testing Type"' \
test_type=$(osascript -e 'display dialog "Select testing type:" buttons {"web", "app"} default button "web" with title "Testing Type"' \
-e 'button returned of result')
else
echo "Select testing type:"
Expand Down
Loading