Skip to content

Commit 1c3755d

Browse files
committed
[CI] Implement new mock server
1 parent 9017ac4 commit 1c3755d

29 files changed

+1134
-884
lines changed

.github/workflows/cron-checks.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ jobs:
7979
name: Test Data E2E (iOS ${{ matrix.ios }})
8080
path: |
8181
fastlane/recordings
82-
fastlane/sinatra_log.txt
83-
fastlane/test_output/report.junit
82+
fastlane/stream-chat-test-mock-server/logs/*
8483
fastlane/test_output/logs/*/Diagnostics/**/*.txt
8584
fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/*
8685

.github/workflows/smoke-checks.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ jobs:
118118
with:
119119
name: Test Data UI
120120
path: |
121-
fastlane/recordings
122-
fastlane/sinatra_log.txt
123121
fastlane/test_output/snapshots
124122
fastlane/test_output/logs/*/Diagnostics/**/*.txt
125123
fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/*
@@ -199,8 +197,7 @@ jobs:
199197
name: Test Data E2E ${{ matrix.batch }}
200198
path: |
201199
fastlane/recordings
202-
fastlane/sinatra_log.txt
203-
fastlane/test_output/report.junit
200+
fastlane/stream-chat-test-mock-server/logs/*
204201
fastlane/test_output/logs/*/Diagnostics/**/*.txt
205202
fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/*
206203

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ app-thinning.plist
9393
*.dmg
9494
yeetd-normal.pkg
9595
*LinkMap.txt
96+
stream-chat-test-mock-server
9697

9798
# VSCode
9899
.vscode

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ group :fastlane_dependencies do
2121
end
2222

2323
group :sinatra_dependencies do
24+
gem 'eventmachine'
25+
gem 'faye-websocket'
2426
gem 'puma'
2527
gem 'rackup'
2628
end

Gemfile.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ GEM
8585
dotenv (2.8.1)
8686
drb (2.2.3)
8787
emoji_regex (3.2.3)
88+
eventmachine (1.2.7)
8889
excon (0.112.0)
8990
faraday (1.10.4)
9091
faraday-em_http (~> 1.0)
@@ -172,6 +173,9 @@ GEM
172173
xcsize (= 1.2.0)
173174
fastlane-sirp (1.0.0)
174175
sysrandom (~> 1.0)
176+
faye-websocket (0.12.0)
177+
eventmachine (>= 0.12.0)
178+
websocket-driver (>= 0.8.0)
175179
gh_inspector (1.1.3)
176180
git (2.3.3)
177181
activesupport (>= 5.0)
@@ -352,6 +356,10 @@ GEM
352356
concurrent-ruby (~> 1.0)
353357
uber (0.1.0)
354358
unicode-display_width (2.6.0)
359+
websocket-driver (0.8.0)
360+
base64
361+
websocket-extensions (>= 0.1.0)
362+
websocket-extensions (0.1.5)
355363
word_wrap (1.0.0)
356364
xcodeproj (1.27.0)
357365
CFPropertyList (>= 2.3.3, < 4.0)
@@ -374,13 +382,15 @@ PLATFORMS
374382
DEPENDENCIES
375383
danger
376384
danger-commit_lint
385+
eventmachine
377386
fastlane
378387
fastlane-plugin-create_xcframework
379388
fastlane-plugin-lizard
380389
fastlane-plugin-sonarcloud_metric_kit
381390
fastlane-plugin-stream_actions (= 0.3.102)
382391
fastlane-plugin-versioning
383392
fastlane-plugin-xcsize (= 1.2.0)
393+
faye-websocket
384394
json
385395
lefthook
386396
plist

Sources/StreamChatSwiftUI/ChatChannel/MessageList/QuotedMessageView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ public struct QuotedMessageContentView<Factory: ViewFactory>: View {
247247
}
248248
.onDisappear(.cancel)
249249
.processors([ImageProcessors.Resize(width: options.attachmentSize.width)])
250-
.priority(.high) }
250+
.priority(.high)
251+
}
251252
}
252253
.frame(width: hasVoiceAttachments ? nil : options.attachmentSize.width, height: options.attachmentSize.height)
253254
.aspectRatio(1, contentMode: .fill)

Sources/StreamChatSwiftUI/ViewFactory/DefaultViewFactory.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -835,13 +835,13 @@ extension ViewFactory {
835835
}
836836

837837
public func makeQuotedMessageContentView(
838-
options: QuotedMessageContentViewOptions
839-
) -> some View {
840-
QuotedMessageContentView(
841-
factory: self,
842-
options: options
843-
)
844-
}
838+
options: QuotedMessageContentViewOptions
839+
) -> some View {
840+
QuotedMessageContentView(
841+
factory: self,
842+
options: options
843+
)
844+
}
845845

846846
public func makeCustomAttachmentQuotedView(options: CustomAttachmentQuotedViewOptions) -> some View {
847847
EmptyView()

StreamChatSwiftUI.xcodeproj/project.pbxproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
820A61A029D6D78E002257FB /* QuotedReply_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 820A619F29D6D78E002257FB /* QuotedReply_Tests.swift */; };
109109
825AADF4283CCDB000237498 /* ThreadPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 825AADF3283CCDB000237498 /* ThreadPage.swift */; };
110110
827352FD290BE91100A87385 /* NotificationsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8492974827ABDDBF00A8EEB0 /* NotificationsHandler.swift */; };
111-
829AB4D228578ACF002DC629 /* StreamTestCase+Tags.swift in Sources */ = {isa = PBXBuildFile; fileRef = 829AB4D128578ACF002DC629 /* StreamTestCase+Tags.swift */; };
112111
829AB4D42858A532002DC629 /* Reactions_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 829AB4D32858A532002DC629 /* Reactions_Tests.swift */; };
113112
829CD5CE2848CA6B003C3877 /* Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 829CD5CD2848CA6B003C3877 /* Settings.swift */; };
114113
829EF8772A9362C00045D166 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 829EF8762A9362C00045D166 /* PrivacyInfo.xcprivacy */; };
@@ -697,7 +696,6 @@
697696
4FEAB3172BFF71F70057E511 /* SwiftUI+UIAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SwiftUI+UIAlertController.swift"; sourceTree = "<group>"; };
698697
820A619F29D6D78E002257FB /* QuotedReply_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuotedReply_Tests.swift; sourceTree = "<group>"; };
699698
825AADF3283CCDB000237498 /* ThreadPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadPage.swift; sourceTree = "<group>"; };
700-
829AB4D128578ACF002DC629 /* StreamTestCase+Tags.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StreamTestCase+Tags.swift"; sourceTree = "<group>"; };
701699
829AB4D32858A532002DC629 /* Reactions_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reactions_Tests.swift; sourceTree = "<group>"; };
702700
829CD5CD2848CA6B003C3877 /* Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = "<group>"; };
703701
829EF8762A9362C00045D166 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
@@ -2240,13 +2238,12 @@
22402238
isa = PBXGroup;
22412239
children = (
22422240
A3600B3F283F651200E1C930 /* Base TestCase */,
2241+
82A1814528FD69E8005F9D43 /* Message Delivery Status */,
22432242
82A1813D28FD68A3005F9D43 /* ChannelList_Tests.swift */,
22442243
A3600B31283E9E4700E1C930 /* MessageList_Tests.swift */,
22452244
829AB4D32858A532002DC629 /* Reactions_Tests.swift */,
22462245
82A1813B28F9BA53005F9D43 /* Attachments_Tests.swift */,
22472246
82A1814328FD69AE005F9D43 /* SlowMode_Tests.swift */,
2248-
829AB4D128578ACF002DC629 /* StreamTestCase+Tags.swift */,
2249-
82A1814528FD69E8005F9D43 /* Message Delivery Status */,
22502247
82A1813F28FD691B005F9D43 /* Ephemeral_Messages_Tests.swift */,
22512248
82A1814128FD694A005F9D43 /* PushNotification_Tests.swift */,
22522249
820A619F29D6D78E002257FB /* QuotedReply_Tests.swift */,
@@ -2587,7 +2584,6 @@
25872584
82A1814728FD69F8005F9D43 /* MessageDeliveryStatus_Tests.swift in Sources */,
25882585
A3600B2F283E9E1900E1C930 /* UserRobot+Asserts.swift in Sources */,
25892586
82A1814028FD691B005F9D43 /* Ephemeral_Messages_Tests.swift in Sources */,
2590-
829AB4D228578ACF002DC629 /* StreamTestCase+Tags.swift in Sources */,
25912587
82A1813C28F9BA53005F9D43 /* Attachments_Tests.swift in Sources */,
25922588
A3600B35283E9EBA00E1C930 /* Bundle+Target.swift in Sources */,
25932589
82A1813A28F84CAA005F9D43 /* SpringBoard.swift in Sources */,
@@ -3875,7 +3871,7 @@
38753871
isa = XCRemoteSwiftPackageReference;
38763872
repositoryURL = "https://github.com/GetStream/stream-chat-swift.git";
38773873
requirement = {
3878-
branch = v5;
3874+
branch = "ci/v5-mock-server";
38793875
kind = branch;
38803876
};
38813877
};

StreamChatSwiftUITestsAppTests/Pages/ChannelListPage.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ enum ChannelListPage {
5050
cell.staticTexts["UnreadIndicatorView"]
5151
}
5252

53-
static func statusCheckmark(for status: MessageDeliveryStatus?, in cell: XCUIElement) -> XCUIElement {
53+
static func statusCheckmark(
54+
for status: StreamChatTestMockServer.MessageDeliveryStatus?,
55+
in cell: XCUIElement
56+
) -> XCUIElement {
5457
return cell.images["readIndicatorCheckmark"]
5558
}
5659
}

StreamChatSwiftUITestsAppTests/Pages/MessageListPage.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright © 2025 Stream.io Inc. All rights reserved.
2+
// Copyright © 2026 Stream.io Inc. All rights reserved.
33
//
44

55
import Foundation
@@ -110,12 +110,16 @@ class MessageListPage {
110110
}
111111

112112
enum Attributes {
113+
static func messageBubble(in messageCell: XCUIElement) -> XCUIElement {
114+
messageCell.otherElements["MessageView"]
115+
}
116+
113117
static func reactionButton(in messageCell: XCUIElement) -> XCUIElement {
114118
messageCell.otherElements["ReactionsContainer"]
115119
}
116120

117121
static func threadReplyCountButton(in messageCell: XCUIElement) -> XCUIElement {
118-
messageCell.buttons["MessageAvatarViewPlaceholder"]
122+
app.buttons.matching(NSPredicate(format: "identifier LIKE 'MessageAvatarView' or identifier LIKE 'MessageAvatarViewPlaceholder'")).firstMatch
119123
}
120124

121125
static func reactions(in messageCell: XCUIElement) -> XCUIElementQuery {
@@ -167,7 +171,10 @@ class MessageListPage {
167171
}
168172

169173
// FIXME:
170-
static func statusCheckmark(for status: MessageDeliveryStatus? = nil, in messageCell: XCUIElement) -> XCUIElement {
174+
static func statusCheckmark(
175+
for status: StreamChatTestMockServer.MessageDeliveryStatus? = nil,
176+
in messageCell: XCUIElement
177+
) -> XCUIElement {
171178
messageCell.images["readIndicatorCheckmark"]
172179
}
173180

@@ -225,7 +232,7 @@ class MessageListPage {
225232
}
226233

227234
static func files(in messageCell: XCUIElement) -> XCUIElementQuery {
228-
messageCell.buttons.matching(NSPredicate(format: "identifier LIKE 'FileAttachmentsContainer'"))
235+
messageCell.buttons.matching(NSPredicate(format: "identifier LIKE 'FileAttachmentsContainer'")).images
229236
}
230237

231238
static func videoPlayer() -> XCUIElement {

0 commit comments

Comments
 (0)