Skip to content

Commit

Permalink
chore: test ios browserstack
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-yangy committed Nov 15, 2024
1 parent ff1c7f9 commit f1059fd
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 13 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
- targetPlatform: Android
buildMethod: MobileBuilder.BuildForAltTester
buildPath: sample/Builds/Android
- targetPlatform: iOS
buildMethod: MobileBuilder.Build
buildPath: build/iOS
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -60,19 +57,22 @@ jobs:
path: ${{ matrix.buildPath }}
test:
name: Run ${{ matrix.targetPlatform }} UI tests 🧪
needs: build
# needs: build
strategy:
matrix:
include:
- targetPlatform: StandaloneOSX
runs-on: [self-hosted, macOS]
test_script: test_mac.sh
- targetPlatform: StandaloneWindows64
runs-on: [self-hosted, windows]
test_script: test_windows.ps1
- targetPlatform: Android
# - targetPlatform: StandaloneOSX
# runs-on: [self-hosted, macOS]
# test_script: test_mac.sh
# - targetPlatform: StandaloneWindows64
# runs-on: [self-hosted, windows]
# test_script: test_windows.ps1
# - targetPlatform: Android
# runs-on: [ self-hosted, macOS ]
# test_script: browserstack-sdk pytest -s ./test/test_android.py --browserstack.config "browserstack.android.yml"
- targetPlatform: iOS
runs-on: [ self-hosted, macOS ]
test_script: browserstack-sdk pytest -s ./test/test_android.py
test_script: browserstack-sdk pytest -s ./test/ios.py --browserstack.config "browserstack.ios.yml"
concurrency:
group: test-${{ matrix.targetPlatform }}
runs-on: ${{ matrix.runs-on }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Set 'projectName' to the name of your project. Example, Marketing Website
projectName: Unity Sample App
# Set `buildName` as the name of the job / testsuite being run
buildName: browserstack build
buildName: Android build
# `buildIdentifier` is a unique id to differentiate every execution that gets appended to
# buildName. Choose your buildIdentifier format from the available expressions:
# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution
Expand Down
73 changes: 73 additions & 0 deletions sample/Tests/browserstack.ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# =============================
# Set BrowserStack Credentials
# =============================
# Add your BrowserStack userName and acccessKey here or set BROWSERSTACK_USERNAME and
# BROWSERSTACK_ACCESS_KEY as env variables
#userName: BROWSERSTACK_USERNAME
#accessKey: BROWSERSTACK_ACCESS_KEY

# ======================
# BrowserStack Reporting
# ======================
# The following capabilities are used to set up reporting on BrowserStack:
# Set 'projectName' to the name of your project. Example, Marketing Website
projectName: Unity Sample App
# Set `buildName` as the name of the job / testsuite being run
buildName: iOS build
# `buildIdentifier` is a unique id to differentiate every execution that gets appended to
# buildName. Choose your buildIdentifier format from the available expressions:
# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution
# ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30
# Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests
buildIdentifier: '#${BUILD_NUMBER}' # Supports strings along with either/both ${expression}
framework: pytest
source: pytest-browserstack:sample-sdk:v1.0

# Set `app` to define the app that is to be used for testing.
# It can either take the id of any uploaded app or the path of the app directly.
#app: ./WikipediaSample.apk
app: ./Payload.ipa #For running local tests

# =======================================
# Platforms (Browsers / Devices to test)
# =======================================
# Platforms object contains all the browser / device combinations you want to test on.
# Entire list available here -> (https://www.browserstack.com/list-of-browsers-and-platforms/automate)

platforms:
- platformName: ios
deviceName: iPhone 14 Pro Max
platformVersion: 16

# =======================
# Parallels per Platform
# =======================
# The number of parallel threads to be used for each platform set.
# BrowserStack's SDK runner will select the best strategy based on the configured value
#
# Example 1 - If you have configured 3 platforms and set `parallelsPerPlatform` as 2, a total of 6 (2 * 3) parallel threads will be used on BrowserStack
#
# Example 2 - If you have configured 1 platform and set `parallelsPerPlatform` as 5, a total of 5 (1 * 5) parallel threads will be used on BrowserStack
parallelsPerPlatform: 1

# ==========================================
# BrowserStack Local
# (For localhost, staging/private websites)
# ==========================================
# Set browserStackLocal to true if your website under test is not accessible publicly over the internet
# Learn more about how BrowserStack Local works here -> https://www.browserstack.com/docs/automate/selenium/local-testing-introduction
browserstackLocal: true # <boolean> (Default false)
browserStackLocalOptions:
#Options to be passed to BrowserStack local in-case of advanced configurations
# localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local.
forceLocal: true # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel.
# Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections

# ===================
# Debugging features
# ===================
debug: false # <boolean> # Set to true if you need screenshots for every selenium command ran
networkLogs: false # <boolean> Set to true to enable HAR logs capturing
consoleLogs: errors # <string> Remote browser's console debug levels to be printed (Default: errors)
# Available options are `disable`, `errors`, `warnings`, `info`, `verbose` (Default: errors)
acceptInsecureCerts: true

0 comments on commit f1059fd

Please sign in to comment.