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 .github/workflows/test-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.13
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.13'
python-version: '3.12'
- name: Set up Bash
run: |
echo "Bash version:"
Expand Down Expand Up @@ -179,10 +179,10 @@ jobs:
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Set up Python 3.13
# - name: Set up Python 3.12
# uses: actions/setup-python@v5
# with:
# python-version: '3.13'
# python-version: '3.12'
# - name: Check PowerShell version
# run: |
# $PSVersionTable.PSVersion
Expand Down Expand Up @@ -322,10 +322,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.13
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.13'
python-version: '3.12'
- name: Set up Bash
run: |
echo "Bash version:"
Expand Down
4 changes: 3 additions & 1 deletion mac/device-machine-allocation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ pick_terminal_devices() {
bVersionLiteral=""
mod=$(( i % 4 ))

local hardcodedBVersion=140 # python doesn't support dynamic latest versioning yet

if [ $((i % 4)) -ne 0 ]; then
bVersionLiteral="-$mod"
else
Expand All @@ -133,7 +135,7 @@ pick_terminal_devices() {
else
yaml+=" - osVersion: $prefixEntry
browserName: $suffixEntry
browserVersion: $bVersion
browserVersion: $(( hardcodedBVersion-i ))
"
fi

Expand Down
22 changes: 13 additions & 9 deletions mac/env-setup-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ setup_web_python() {
detect_setup_python_env

pip3 install -r requirements.txt >> "$NOW_RUN_LOG_FILE" 2>&1
pip3 uninstall -y pytest-html pytest-rerunfailures >> "$NOW_RUN_LOG_FILE" 2>&1
log_success "Dependencies installed"

# Update YAML at root level (browserstack.yml)
Expand Down Expand Up @@ -262,14 +263,21 @@ setup_app_python() {
detect_setup_python_env

# Install dependencies
pip install -r requirements.txt >> "$NOW_RUN_LOG_FILE" 2>&1
pip3 install -r requirements.txt >> "$NOW_RUN_LOG_FILE" 2>&1
log_success "Dependencies installed"

local app_url=$BROWSERSTACK_APP
local platform_yaml

export BSTACK_PARALLELS=1
export BROWSERSTACK_CONFIG_FILE="./android/browserstack.yml"

# Decide which directory to run based on APP_PLATFORM (default to android)
local run_dir="android"
if [ "$APP_PLATFORM" = "ios" ]; then
run_dir="ios"
fi

export BROWSERSTACK_CONFIG_FILE="./$run_dir/browserstack.yml"
platform_yaml=$(generate_mobile_platforms "$TEAM_PARALLELS_MAX_ALLOWED_MOBILE" "yaml")

cat >> "$BROWSERSTACK_CONFIG_FILE" <<EOF
Expand All @@ -278,12 +286,6 @@ platforms:
$platform_yaml
EOF

# Decide which directory to run based on APP_PLATFORM (default to android)
local run_dir="android"
if [ "$APP_PLATFORM" = "ios" ]; then
run_dir="ios"
fi

export BSTACK_PLATFORMS=$platform_yaml
export BROWSERSTACK_LOCAL=true
export BROWSERSTACK_BUILD_NAME="now-$NOW_OS-app-python-pytest"
Expand All @@ -301,7 +303,9 @@ EOF
# Run pytest with BrowserStack SDK from the chosen platform directory
log_msg_to "🚀 Running 'cd $run_dir && browserstack-sdk pytest -s bstack_sample.py'"
(
cd "$run_dir" && browserstack-sdk pytest -s bstack_sample.py >> "$NOW_RUN_LOG_FILE" 2>&1 || return 1
cd "$run_dir" && browserstack-sdk pytest -s bstack_sample.py >> "$NOW_RUN_LOG_FILE" 2>&1 || return 1 & cmd_pid=$!|| return 1
show_spinner "$cmd_pid"
wait "$cmd_pid"
)

deactivate
Expand Down
Loading