Skip to content

Commit

Permalink
Add SauceLabs tests to CI (#137)
Browse files Browse the repository at this point in the history
* feat: add ci script

* ci indent

* sha

* pathing

* ios version fix

* remove useless ls

* pathing

* add test script

* pass sl creds to tests

* generic build

* remove device from destination

* simulator sdk

* show sdks

* try any iphone device

* use file ids

* debug

* debug

* debug

* better steps variables

* reduce the amount of tests

* add automation name

* webdriver test

* try accessibility identifiers

* attempt finding by name

* print page source

* network tests

* better test runner

* more tests

* update sl script

* lint

* add more ios versions

* remove unused code

* relax ios versions

* update sl options

* only upload to sl once

* check out code

* add minimum deployment target for test app

* dont specify sdk version

* change minimum deployment version

* ios compatibility fixes

* make the app work on ios 13

* add ios 13 to ci

* try matching accessibility identifier

* try different accessibility identifier

* find element by accessibility id instead

* find by ids, remove ios 13

* add alamofire test

* use click not tap

* remove debug lines from ci

* use newer splunkrum api

* name desired caps explicitly

* upgrade to selenium 4 options

* use safari options

* use pinned appium client

* use older appium api
  • Loading branch information
seemk authored Nov 13, 2023
1 parent 70998a5 commit cb9fdea
Show file tree
Hide file tree
Showing 21 changed files with 1,423 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,62 @@ jobs:
with:
name: SplunkOtel.xcframework
path: ./SplunkRumWorkspace/SplunkRum/xcframeworks/SplunkOtel.xcframework
saucelabs-prepare:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Build for Sauce Labs
run: |
BUILD_FOLDER="work/splunk-otel-ios/splunk-otel-ios/SauceLabsTests"
BUILD_PATH="Build/Products/Debug-iphonesimulator"
xcodebuild -showsdks
xcodebuild -workspace SplunkRumWorkspace/SplunkRumWorkspace.xcworkspace \
-scheme SauceLabsTestApp \
-configuration Debug \
-sdk iphonesimulator \
-derivedDataPath SauceLabsTests
zip ${GITHUB_WORKSPACE}/SauceLabsTestApp.zip $(find ~/$BUILD_FOLDER/$BUILD_PATH/SauceLabsTestApp.app -type f)
- name: Upload test app to Sauce Labs
id: sl-upload
run: |
cd /Users/runner/work/splunk-otel-ios/splunk-otel-ios/
item_id=$(curl -u "${{secrets.SAUCELABS_USER}}:${{secrets.SAUCELABS_KEY}}" --location \
--request POST 'https://api.us-west-1.saucelabs.com/v1/storage/upload' \
--form 'payload=@"SauceLabsTestApp.zip"' \
--form 'name="SauceLabsTestApp.zip"' \
--form 'description="'"$GITHUB_SHA"'"' | jq -r .item.id)
echo "sl_file_id=$item_id" >> $GITHUB_OUTPUT
outputs:
sl_file_id: ${{ steps.sl-upload.outputs.sl_file_id }}
saucelabs-tests:
runs-on: macOS-latest
needs: saucelabs-prepare
strategy:
fail-fast: false
matrix:
os: ['14', '15', '16']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Run Sauce Labs test cases
working-directory: SplunkRumWorkspace
env:
SAUCELABS_USER: ${{ secrets.SAUCELABS_USER }}
SAUCELABS_KEY: ${{ secrets.SAUCELABS_KEY }}
run: |
cd SauceLabsTestApp/
python3 -m pip install Appium-Python-Client==2.11.1
python3 sl_tests.py ${{ matrix.os }} ${{ needs.saucelabs-prepare.outputs.sl_file_id }}
check_links:
runs-on: ubuntu-22.04
steps:
Expand Down
Loading

0 comments on commit cb9fdea

Please sign in to comment.