Skip to content

Commit 08128d4

Browse files
Make tests work on iOS 17 (#356)
1 parent b64cf6c commit 08128d4

File tree

148 files changed

+132
-136
lines changed

Some content is hidden

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

148 files changed

+132
-136
lines changed

.github/workflows/cron-checks.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ on:
55
# Runs "At 02:00 every night"
66
- cron: '0 2 * * *'
77

8-
pull_request:
9-
branches:
10-
- 'main'
8+
# TODO: commented until `develop` branch is in place
9+
# pull_request:
10+
# branches:
11+
# - 'main'
1112

1213
workflow_dispatch:
1314

@@ -24,6 +25,12 @@ jobs:
2425
strategy:
2526
matrix:
2627
include:
28+
# TODO: uncomment this block as soon as Xcode 15 is stable on CI
29+
# - ios: 17.0
30+
# xcode: 15.0
31+
# os: macos-13
32+
# device: "iPhone 14 Pro Max"
33+
# setup_runtime: false
2734
- ios: 16.4
2835
xcode: 14.3.1
2936
os: macos-13
@@ -83,6 +90,8 @@ jobs:
8390
strategy:
8491
matrix:
8592
include:
93+
- xcode: 15.0
94+
os: macos-13
8695
- xcode: 14.3.1
8796
os: macos-13
8897
- xcode: 14.2

.github/workflows/smoke-checks.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
branches:
66
- '**'
7-
- '!main'
7+
# - '!main' TODO: commented until `develop` branch is in place
88

99
workflow_dispatch:
1010

@@ -14,7 +14,7 @@ concurrency:
1414

1515
env:
1616
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI
17-
IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (16.4)"
17+
IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (17.0)"
1818

1919
jobs:
2020
automated-code-review:
@@ -51,7 +51,7 @@ jobs:
5151
INSTALL_XCPARSE: true
5252
- name: Run UI Tests (Debug)
5353
run: bundle exec fastlane test_ui device:"${{ env.IOS_SIMULATOR_DEVICE }}"
54-
timeout-minutes: 30
54+
timeout-minutes: 40
5555
env:
5656
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5757
GITHUB_PR_NUM: ${{ github.event.number }}
@@ -112,6 +112,8 @@ jobs:
112112
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113113
GITHUB_PR_NUM: ${{ github.event.number }}
114114
MATRIX_SIZE: ${{ strategy.job-total }}
115+
IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (16.4)" # TODO: delete this line as soon as Xcode 15 is stable on CI
116+
XCODE_VERSION: "14.3.1" # TODO: delete this line as soon as Xcode 15 is stable on CI
115117
- name: Allure TestOps Upload
116118
if: env.LAUNCH_ID != '' && (success() || failure())
117119
run: bundle exec fastlane allure_upload launch_id:$LAUNCH_ID

Sources/StreamChatSwiftUI/ChatChannel/Reactions/ReactionsOverlayView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public struct ReactionsOverlayView<Factory: ViewFactory>: View {
218218
}
219219
.accessibilityElement(children: .contain)
220220
.accessibilityIdentifier("ReactionsOverlayView")
221-
.onRotate { orientation in
221+
.onRotate { _ in
222222
if isIPad {
223223
self.orientationChanged = true
224224
}
@@ -362,6 +362,6 @@ struct DeviceRotationViewModifier: ViewModifier {
362362

363363
extension View {
364364
func onRotate(perform action: @escaping (UIDeviceOrientation) -> Void) -> some View {
365-
self.modifier(DeviceRotationViewModifier(action: action))
365+
modifier(DeviceRotationViewModifier(action: action))
366366
}
367367
}

StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersViewModel_Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class AddUsersViewModel_Tests: StreamChatTestCase {
4646
}
4747
.store(in: &cancellables)
4848

49-
waitForExpectations(timeout: 1)
49+
waitForExpectations(timeout: defaultTimeout)
5050
}
5151

5252
func test_addUsersViewModel_onUserAppear() {

StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersView_Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ class AddUsersView_Tests: StreamChatTestCase {
2525
.applyDefaultSize()
2626

2727
// Then
28-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
28+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
2929
}
3030
}

StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
2626
.applyDefaultSize()
2727

2828
// Then
29-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
29+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
3030
}
3131

3232
func test_chatChannelInfoView_directChannelOnlineSnapshot() {
@@ -46,7 +46,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
4646
.applyDefaultSize()
4747

4848
// Then
49-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
49+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
5050
}
5151

5252
func test_chatChannelInfoView_directChannelMutedSnapshot() {
@@ -66,7 +66,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
6666
.applyDefaultSize()
6767

6868
// Then
69-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
69+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
7070
}
7171

7272
func test_chatChannelInfoView_groupCollapsedSnapshot() {
@@ -89,7 +89,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
8989
.applyDefaultSize()
9090

9191
// Then
92-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
92+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
9393
}
9494

9595
func test_chatChannelInfoView_smallGroupSnapshot() {
@@ -112,7 +112,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
112112
.applyDefaultSize()
113113

114114
// Then
115-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
115+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
116116
}
117117

118118
func test_chatChannelInfoView_groupExpandedSnapshot() {
@@ -137,7 +137,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
137137
.applyDefaultSize()
138138

139139
// Then
140-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
140+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
141141
}
142142

143143
func test_chatChannelInfoView_navBarSnapshot() {
@@ -166,7 +166,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
166166
.applyDefaultSize()
167167

168168
// Then
169-
assertSnapshot(matching: navigationView, as: .image(perceptualPrecision: 0.98))
169+
assertSnapshot(matching: navigationView, as: .image(perceptualPrecision: snapshotPrecision))
170170
}
171171

172172
func test_chatChannelInfoView_addUsersShownSnapshot() {
@@ -191,6 +191,6 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
191191
.applyDefaultSize()
192192

193193
// Then
194-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
194+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
195195
}
196196
}

StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/FileAttachmentsView_Tests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
2525
.applyDefaultSize()
2626

2727
// Then
28-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
28+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
2929
}
3030

3131
func test_fileAttachmentsView_emptySnapshot() {
@@ -40,7 +40,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
4040
.applyDefaultSize()
4141

4242
// Then
43-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
43+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
4444
}
4545

4646
func test_fileAttachmentsView_loadingSnapshot() {
@@ -55,7 +55,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
5555
.applyDefaultSize()
5656

5757
// Then
58-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
58+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
5959
}
6060

6161
func test_fileAttachmentsPickerView_snapshot() {
@@ -64,6 +64,6 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
6464
.applyDefaultSize()
6565

6666
// Then
67-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
67+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
6868
}
6969
}

StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MediaAttachmentsView_Tests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class MediaAttachmentsView_Tests: StreamChatTestCase {
2828
.applyDefaultSize()
2929

3030
// Then
31-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
31+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
3232
}
3333

3434
func test_mediaAttachmentsView_emptySnapshot() {
@@ -41,7 +41,7 @@ class MediaAttachmentsView_Tests: StreamChatTestCase {
4141
.applyDefaultSize()
4242

4343
// Then
44-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
44+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
4545
}
4646

4747
func test_mediaAttachmentsView_loading() {
@@ -54,6 +54,6 @@ class MediaAttachmentsView_Tests: StreamChatTestCase {
5454
.applyDefaultSize()
5555

5656
// Then
57-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
57+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
5858
}
5959
}

StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/PinnedMessagesView_Tests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PinnedMessagesView_Tests: StreamChatTestCase {
2727
.applyDefaultSize()
2828

2929
// Then
30-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
30+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
3131
}
3232

3333
func test_pinnedMessagesView_emptySnapshot() {
@@ -39,7 +39,7 @@ class PinnedMessagesView_Tests: StreamChatTestCase {
3939
.applyDefaultSize()
4040

4141
// Then
42-
assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98))
42+
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
4343
}
4444
}
4545

Loading

0 commit comments

Comments
 (0)