Files
status-desktop/scripts/upload_browserstack_apk.sh
Mag.andjakub 12854858ae ci(e2e_mobile): add Jenkinsfile and config for e2e mobile tests (#19163)
* refactor(e2e_appium): locators and app lifecycle management

- wallet locators
- app lifecycle management
- toast message handling (visibility checks and logging).
- saved addresses page

* refactor(e2e_appium): migrate to cloud reporting and enhance test assertions

- Replaced instances of LambdaTest reporting with Cloud reporting
- Assertion messages for clarity
- Updated test methods for toast handling

* chore(e2e_mobile): appium config for BrowserStack and Jenkins

* ci(e2e_mobile): add Jenkinsfile for mobile e2e tests

* ci(e2e_mobile): address review feeback

* ci(e2e_mobile): add E2E testing stage and update BrowserStack credentials

- Introduced a new E2E stage in the Android Jenkinsfile for PR builds.
- Updated BrowserStack credentials id

* ci(e2e_mobile): test result publishing

- Set PLATFORM environment variable for E2E Android tests.
- include package URL in the environment.
- build name to reflect PR number.

* ci(e2e_mobile): fix BrowserStack project name

* ci(e2e_mobile): update build type detection and improve stage names

- Renamed stages for clarity
- Refactored build type detection to use upstream job details.

* ci(e2e_mobile): Apply suggestions from code review for CHANGE_ID

Apply suggestions from code review for CHANGE_ID

Co-Authored-By: Jakub <jakub@status.im>
2026-01-21 16:38:25 +00:00

27 lines
916 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Upload APK to BrowserStack and output JSON response to stdout
# Usage: ./upload_browserstack_apk.sh <apk_path_or_url>
# URLs must be publicly accessible (BrowserStack fetches directly)
APK_SOURCE="${1:?Usage: $0 <apk_path_or_url>}"
: "${BROWSERSTACK_USERNAME:?required}"
: "${BROWSERSTACK_ACCESS_KEY:?required}"
APK_NAME=$(basename "${APK_SOURCE%%\?*}")
CUSTOM_ID=$(printf '%s' "${APK_NAME}" | tr -cs '[:alnum:]._-' '-' | cut -c1-100)
if [[ "${APK_SOURCE}" == http* ]]; then
FORM_KEY="url="
else
[[ -f "${APK_SOURCE}" ]] || { echo "Error: File not found: ${APK_SOURCE}" >&2; exit 1; }
FORM_KEY="file=@"
fi
curl --request POST "https://api-cloud.browserstack.com/app-automate/upload" \
--silent --show-error --fail-with-body \
--user "${BROWSERSTACK_USERNAME}:${BROWSERSTACK_ACCESS_KEY}" \
--form "${FORM_KEY}${APK_SOURCE}" \
--form "custom_id=${CUSTOM_ID}"