Skip to content

UI Testing for Sanity #8

UI Testing for Sanity

UI Testing for Sanity #8

Workflow file for this run

name: iOS UI Tests
on:
pull_request:
branches: [ master ]
permissions:
contents: read
pull-requests: write
jobs:
ui-tests:
runs-on: macos-15
strategy:
fail-fast: false
matrix:
device: [ "iPhone 16" ]
os: [ "18.4" ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Downgrade Xcode project objectVersion for CocoaPods
run: |
sed -i '' 's/objectVersion = 70;/objectVersion = 60;/' Example/razorpay-customui-pod.xcodeproj/project.pbxproj
- name: List available iOS runtimes and simulators
run: |
xcrun simctl list
- name: Install pods for Example app
working-directory: Example
run: pod install
- name: Run UI tests on ${{ matrix.device }} (iOS ${{ matrix.os }})
run: |
set -o pipefail
xcodebuild \
-workspace Example/razorpay-customui-pod.xcworkspace \
-scheme razorpay-customui-pod-Example \
-destination "platform=iOS Simulator,name=${{ matrix.device }},OS=${{ matrix.os }}" \
-resultBundlePath TestResults.xcresult \
test
- name: Upload Xcode test result bundle
uses: actions/upload-artifact@v4
with:
name: ios-ui-tests-${{ matrix.device }}-iOS-${{ matrix.os }}
path: TestResults.xcresult
comment-on-success:
needs: ui-tests
runs-on: ubuntu-latest
if: ${{ needs.ui-tests.result == 'success' && github.event_name == 'pull_request' }}
steps:
- name: Comment on PR when sanity UI tests pass
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
if (!pr) {
core.info('No pull_request context, skipping comment.');
return;
}
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
body: "✅ iOS sanity UI tests passed on all configured simulators."
});