Skip to content

Commit 3712ca8

Browse files
authored
Merge pull request #46 from razorpay/chore/sanity-testing
UI Testing for Sanity
2 parents 43228df + aa1a131 commit 3712ca8

File tree

126 files changed

+9130
-5380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+9130
-5380
lines changed

.github/workflows/ios-ui-tests.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: iOS UI Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
ui-tests:
13+
runs-on: macos-15
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
device: [ "iPhone 16" ]
19+
os: [ "18.4" ]
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Downgrade Xcode project objectVersion for CocoaPods
26+
run: |
27+
sed -i '' 's/objectVersion = 70;/objectVersion = 60;/' Example/razorpay-customui-pod.xcodeproj/project.pbxproj
28+
29+
- name: List available iOS runtimes and simulators
30+
run: |
31+
xcrun simctl list
32+
33+
- name: Install pods for Example app
34+
working-directory: Example
35+
run: pod install
36+
37+
- name: Run UI tests on ${{ matrix.device }} (iOS ${{ matrix.os }})
38+
run: |
39+
set -o pipefail
40+
xcodebuild \
41+
-workspace Example/razorpay-customui-pod.xcworkspace \
42+
-scheme razorpay-customui-pod-Example \
43+
-destination "platform=iOS Simulator,name=${{ matrix.device }},OS=${{ matrix.os }}" \
44+
-resultBundlePath TestResults.xcresult \
45+
test
46+
47+
- name: Upload Xcode test result bundle
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: ios-ui-tests-${{ matrix.device }}-iOS-${{ matrix.os }}
51+
path: TestResults.xcresult
52+
53+
comment-on-success:
54+
needs: ui-tests
55+
runs-on: ubuntu-latest
56+
if: ${{ needs.ui-tests.result == 'success' && github.event_name == 'pull_request' }}
57+
58+
steps:
59+
- name: Comment on PR when sanity UI tests pass
60+
uses: actions/github-script@v7
61+
with:
62+
script: |
63+
const pr = context.payload.pull_request;
64+
if (!pr) {
65+
core.info('No pull_request context, skipping comment.');
66+
return;
67+
}
68+
69+
await github.rest.issues.createComment({
70+
owner: context.repo.owner,
71+
repo: context.repo.repo,
72+
issue_number: pr.number,
73+
body: "✅ iOS sanity UI tests passed on all configured simulators."
74+
});
75+
76+

Example/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ platform :ios, '11.0'
44

55
target 'razorpay-customui-pod_Example' do
66

7-
pod 'razorpay-customui-pod', :path => '../'
7+
pod 'razorpay-customui-pod', :path=> '../'
88

99
target 'razorpay-customui-pod_Tests' do
1010
inherit! :search_paths

Example/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- razorpay-customui-pod (2.0.22)
2+
- razorpay-customui-pod (2.1.1)
33

44
DEPENDENCIES:
55
- razorpay-customui-pod (from `../`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
razorpay-customui-pod: 71a68ec6b3bc165a4c5f0dc60ccb383427301445
12+
razorpay-customui-pod: 4fec3ad7118453d7ae648df90f5a2430e9dc9698
1313

14-
PODFILE CHECKSUM: 22d69d53f72a5f9581ccd712fb43b5ddba4ad1d4
14+
PODFILE CHECKSUM: f21675744a709b8e314b42564691caf867fcb0e8
1515

1616
COCOAPODS: 1.16.2

Example/Pods/Local Podspecs/razorpay-customui-pod.podspec.json

Lines changed: 7 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)