From 3aff8382aa42ed7d65c85cb98625880dca459a84 Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Mon, 9 Oct 2023 12:51:57 +0100 Subject: [PATCH 1/8] Update StreamSwiftTestHelpers --- StreamChatSwiftUI.xcodeproj/project.pbxproj | 46 +++++++++++-------- .../ChannelInfo/AddUsersView_Tests.swift | 3 +- .../ChatChannelInfoView_Tests.swift | 17 +++---- .../FileAttachmentsView_Tests.swift | 9 ++-- .../MediaAttachmentsView_Tests.swift | 7 +-- .../PinnedMessagesView_Tests.swift | 5 +- .../ChatChannel/ChatChannelHeader_Tests.swift | 7 +-- .../ChatChannelViewDateOverlay_Tests.swift | 3 +- .../ChatChannel/ChatChannelView_Tests.swift | 9 ++-- .../Tests/ChatChannel/GalleryView_Tests.swift | 7 +-- .../LazyImageExtensions_Tests.swift | 7 +-- .../MessageComposerView_Tests.swift | 23 +++++----- .../MessageContainerView_Tests.swift | 15 +++--- .../MessageListViewAvatars_Tests.swift | 9 ++-- ...MessageListViewLastGroupHeader_Tests.swift | 3 +- .../MessageListViewNewMessages_Tests.swift | 9 ++-- .../ChatChannel/MessageListView_Tests.swift | 13 +++--- .../MessageReadIndicatorView_Tests.swift | 9 ++-- .../MessageViewMultiRowReactions_Tests.swift | 3 +- .../Tests/ChatChannel/MessageView_Tests.swift | 31 +++++++------ .../ChatChannel/QuotedMessageView_Tests.swift | 5 +- .../ReactionsOverlayView_Tests.swift | 15 +++--- .../ReactionsUsersView_Tests.swift | 5 +- .../InstantCommandsView_Tests.swift | 9 ++-- .../TypingIndicatorView_Tests.swift | 3 +- .../Tests/ChatChannel/WebView_Tests.swift | 3 +- .../ChatChannelListView_Tests.swift | 9 ++-- .../ChatChannelList/LoadingView_Tests.swift | 5 +- .../MoreChannelActionsView_Tests.swift | 3 +- .../Tests/StreamChatTestCase.swift | 3 +- 30 files changed, 165 insertions(+), 130 deletions(-) diff --git a/StreamChatSwiftUI.xcodeproj/project.pbxproj b/StreamChatSwiftUI.xcodeproj/project.pbxproj index 59e34f65..654576fd 100644 --- a/StreamChatSwiftUI.xcodeproj/project.pbxproj +++ b/StreamChatSwiftUI.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 8205B4142AD41CC700265B84 /* StreamSwiftTestHelpers in Frameworks */ = {isa = PBXBuildFile; productRef = 8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */; }; + 8205B4162AD41CD600265B84 /* StreamSwiftTestHelpers in Frameworks */ = {isa = PBXBuildFile; productRef = 8205B4152AD41CD600265B84 /* StreamSwiftTestHelpers */; }; 820A61A029D6D78E002257FB /* QuotedReply_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 820A619F29D6D78E002257FB /* QuotedReply_Tests.swift */; }; 825AADF4283CCDB000237498 /* ThreadPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 825AADF3283CCDB000237498 /* ThreadPage.swift */; }; 827352FD290BE91100A87385 /* NotificationsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8492974827ABDDBF00A8EEB0 /* NotificationsHandler.swift */; }; @@ -216,7 +218,6 @@ 847CEFEE27C38ABE00606257 /* MessageCachingUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847CEFED27C38ABE00606257 /* MessageCachingUtils.swift */; }; 847F7949282A91AD0009F74C /* ChatChannelView_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847F7948282A91AD0009F74C /* ChatChannelView_Tests.swift */; }; 8482094E2ACFFCD900EF3261 /* Throttler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8482094D2ACFFCD900EF3261 /* Throttler.swift */; }; - 848399EA275FB3E9003075E4 /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 848399E9275FB3E9003075E4 /* SnapshotTesting */; }; 848399EC275FB41B003075E4 /* ChatChannelListView_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848399EB275FB41B003075E4 /* ChatChannelListView_Tests.swift */; }; 848399F227601231003075E4 /* ReactionsOverlayView_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848399F127601231003075E4 /* ReactionsOverlayView_Tests.swift */; }; 8492974B27ABDDCB00A8EEB0 /* NotificationsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8492974827ABDDBF00A8EEB0 /* NotificationsHandler.swift */; }; @@ -788,6 +789,7 @@ buildActionMask = 2147483647; files = ( A35D803B283E89F50084FE25 /* StreamChatSwiftUI.framework in Frameworks */, + 8205B4162AD41CD600265B84 /* StreamSwiftTestHelpers in Frameworks */, 8400A34C282C081E0067D3A0 /* OHHTTPStubs in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -807,8 +809,8 @@ buildActionMask = 2147483647; files = ( 8465FBBE2746873A00AF091E /* StreamChatSwiftUI.framework in Frameworks */, + 8205B4142AD41CC700265B84 /* StreamSwiftTestHelpers in Frameworks */, 84E95A7D284A491000699FD3 /* StreamChatTestTools in Frameworks */, - 848399EA275FB3E9003075E4 /* SnapshotTesting in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1617,6 +1619,7 @@ name = StreamChatSwiftUITestsApp; packageProductDependencies = ( 8400A34B282C081E0067D3A0 /* OHHTTPStubs */, + 8205B4152AD41CD600265B84 /* StreamSwiftTestHelpers */, ); productName = StreamChatSwiftUITestsApp; productReference = 8402EAC3282BF69900CCA696 /* StreamChatSwiftUITestsApp.app */; @@ -1662,8 +1665,8 @@ ); name = StreamChatSwiftUITests; packageProductDependencies = ( - 848399E9275FB3E9003075E4 /* SnapshotTesting */, 84E95A7C284A491000699FD3 /* StreamChatTestTools */, + 8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */, ); productName = StreamChatSwiftUITests; productReference = 8465FBBD2746873A00AF091E /* StreamChatSwiftUITests.xctest */; @@ -1732,12 +1735,12 @@ ); mainGroup = 8465FBAB2746873A00AF091E; packageReferences = ( - 848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */, E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */, 8400A346282C06F90067D3A0 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */, A3571601283E9D9F0014E3B0 /* XCRemoteSwiftPackageReference "swifter" */, 84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */, 842ADEA228EADC6600F2BE36 /* XCRemoteSwiftPackageReference "Nuke" */, + 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */, ); productRefGroup = 8465FBB62746873A00AF091E /* Products */; projectDirPath = ""; @@ -2708,6 +2711,14 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ + 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/GetStream/stream-chat-swift-test-helpers.git"; + requirement = { + kind = exactVersion; + version = 0.3.0; + }; + }; 8400A346282C06F90067D3A0 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/AliSoftware/OHHTTPStubs.git"; @@ -2732,20 +2743,12 @@ version = 4.10.1; }; }; - 848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing.git"; - requirement = { - kind = exactVersion; - version = 1.11.0; - }; - }; 84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/GetStream/stream-chat-swift.git"; requirement = { - kind = upToNextMajorVersion; - minimumVersion = 4.39.0; + branch = ci/spm; + kind = branch; }; }; A3571601283E9D9F0014E3B0 /* XCRemoteSwiftPackageReference "swifter" */ = { @@ -2767,6 +2770,16 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + 8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */ = { + isa = XCSwiftPackageProductDependency; + package = 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */; + productName = StreamSwiftTestHelpers; + }; + 8205B4152AD41CD600265B84 /* StreamSwiftTestHelpers */ = { + isa = XCSwiftPackageProductDependency; + package = 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */; + productName = StreamSwiftTestHelpers; + }; 8400A34B282C081E0067D3A0 /* OHHTTPStubs */ = { isa = XCSwiftPackageProductDependency; package = 8400A346282C06F90067D3A0 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */; @@ -2797,11 +2810,6 @@ package = 84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */; productName = StreamChatTestTools; }; - 848399E9275FB3E9003075E4 /* SnapshotTesting */ = { - isa = XCSwiftPackageProductDependency; - package = 848399E6275FB3BE003075E4 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */; - productName = SnapshotTesting; - }; 84B87F222861C0C900959CBE /* StreamChat */ = { isa = XCSwiftPackageProductDependency; package = 84E95A75284A486600699FD3 /* XCRemoteSwiftPackageReference "stream-chat-swift" */; diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersView_Tests.swift index 5412218e..fc3b0dee 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/AddUsersView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -25,6 +26,6 @@ class AddUsersView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift index 725e6366..f23cfbba 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/ChatChannelInfoView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -26,7 +27,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_directChannelOnlineSnapshot() { @@ -46,7 +47,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_directChannelMutedSnapshot() { @@ -66,7 +67,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_groupCollapsedSnapshot() { @@ -89,7 +90,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_smallGroupSnapshot() { @@ -112,7 +113,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_groupExpandedSnapshot() { @@ -137,7 +138,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_navBarSnapshot() { @@ -166,7 +167,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: navigationView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: navigationView, as: .image(perceptualPrecision: precision)) } func test_chatChannelInfoView_addUsersShownSnapshot() { @@ -191,6 +192,6 @@ class ChatChannelInfoView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/FileAttachmentsView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/FileAttachmentsView_Tests.swift index 9ceb4472..9185ead6 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/FileAttachmentsView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/FileAttachmentsView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -25,7 +26,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_fileAttachmentsView_emptySnapshot() { @@ -40,7 +41,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_fileAttachmentsView_loadingSnapshot() { @@ -55,7 +56,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_fileAttachmentsPickerView_snapshot() { @@ -64,6 +65,6 @@ class FileAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MediaAttachmentsView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MediaAttachmentsView_Tests.swift index 2ed3173a..c34149c7 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MediaAttachmentsView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/MediaAttachmentsView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -28,7 +29,7 @@ class MediaAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_mediaAttachmentsView_emptySnapshot() { @@ -41,7 +42,7 @@ class MediaAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_mediaAttachmentsView_loading() { @@ -54,6 +55,6 @@ class MediaAttachmentsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/PinnedMessagesView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/PinnedMessagesView_Tests.swift index 2c71dac9..23fa6b91 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/PinnedMessagesView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/PinnedMessagesView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -27,7 +28,7 @@ class PinnedMessagesView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_pinnedMessagesView_emptySnapshot() { @@ -39,7 +40,7 @@ class PinnedMessagesView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelHeader_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelHeader_Tests.swift index 1caf1e74..0119dc04 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelHeader_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelHeader_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -23,7 +24,7 @@ class ChatChannelHeader_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelHeader_snapshot() { @@ -41,7 +42,7 @@ class ChatChannelHeader_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_channelTitleView_snapshot() { @@ -53,6 +54,6 @@ class ChatChannelHeader_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelViewDateOverlay_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelViewDateOverlay_Tests.swift index d4004923..2c825e92 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelViewDateOverlay_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelViewDateOverlay_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -62,6 +63,6 @@ class ChatChannelViewDateOverlay_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelView_Tests.swift index 1314f725..d7554f1a 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -51,7 +52,7 @@ class ChatChannelView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelView_snapshotEmpty() { @@ -82,7 +83,7 @@ class ChatChannelView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelView_snapshotLoading() { @@ -107,7 +108,7 @@ class ChatChannelView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_defaultChannelHeader_snapshot() { @@ -126,6 +127,6 @@ class ChatChannelView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/GalleryView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/GalleryView_Tests.swift index ea933730..3ed10215 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/GalleryView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/GalleryView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -30,7 +31,7 @@ class GalleryView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_galleryHeader_snapshot() { @@ -43,7 +44,7 @@ class GalleryView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 44) // Then - assertSnapshot(matching: header, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: header, as: .image(perceptualPrecision: precision)) } func test_gridView_snapshotLoading() { @@ -55,6 +56,6 @@ class GalleryView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/LazyImageExtensions_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/LazyImageExtensions_Tests.swift index f3a770fd..34c82732 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/LazyImageExtensions_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/LazyImageExtensions_Tests.swift @@ -6,6 +6,7 @@ import NukeUI import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -18,7 +19,7 @@ final class LazyImageExtensions_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: precision)) } func test_imageURL_nonEmpty() { @@ -29,7 +30,7 @@ final class LazyImageExtensions_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: precision)) } func test_imageRequest_emptyURL() { @@ -40,6 +41,6 @@ final class LazyImageExtensions_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: lazyImageView, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift index b692f4c6..3449253b 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift @@ -6,6 +6,7 @@ import Photos import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -36,7 +37,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 100) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_composerInputView_slowMode() { @@ -60,7 +61,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 100) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_trailingComposerView_snapshot() { @@ -76,7 +77,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: 40, height: 40) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_trailingComposerView_slowMode() { @@ -92,7 +93,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: 40, height: 40) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_composerInputView_inputTextView() { @@ -106,7 +107,7 @@ class MessageComposerView_Tests: StreamChatTestCase { view.selectedRange.location = 3 // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_composerInputView_composerInputTextView() { @@ -122,7 +123,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 50) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_composerInputView_rangeSelection() { @@ -187,7 +188,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 36) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_composerInputView_snapshot() { @@ -210,7 +211,7 @@ class MessageComposerView_Tests: StreamChatTestCase { coordinator.updateHeight(inputView, shouldAnimate: false) // Then - assertSnapshot(matching: viewWithSize, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: viewWithSize, as: .image(perceptualPrecision: precision)) XCTAssert(coordinator.textInput.height == 100) } @@ -243,7 +244,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .background(.black) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_videoDurationIndicatorView_snapshot() { @@ -253,7 +254,7 @@ class MessageComposerView_Tests: StreamChatTestCase { .background(.black) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_photosPickerView_snapshot() { @@ -266,6 +267,6 @@ class MessageComposerView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageContainerView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageContainerView_Tests.swift index 5674da41..b51e716d 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageContainerView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageContainerView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -30,7 +31,7 @@ class MessageContainerView_Tests: StreamChatTestCase { let view = testMessageViewContainer(message: message) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageContainerViewSentOtherUser_snapshot() { @@ -46,7 +47,7 @@ class MessageContainerView_Tests: StreamChatTestCase { let view = testMessageViewContainer(message: message) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageContainerViewPinned_snapshot() { @@ -67,7 +68,7 @@ class MessageContainerView_Tests: StreamChatTestCase { let view = testMessageViewContainer(message: message) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_videoAttachment_snapshotNoText() { @@ -89,7 +90,7 @@ class MessageContainerView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_videoAttachment_snapshotText() { @@ -113,7 +114,7 @@ class MessageContainerView_Tests: StreamChatTestCase { .padding() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_imageAttachments_snapshot() { @@ -137,7 +138,7 @@ class MessageContainerView_Tests: StreamChatTestCase { .frame(width: 200) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_imageAttachments_snapshotFiveImages() { @@ -163,7 +164,7 @@ class MessageContainerView_Tests: StreamChatTestCase { .frame(width: 200) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } // MARK: - private diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewAvatars_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewAvatars_Tests.swift index 88ecd295..388b070d 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewAvatars_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewAvatars_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class MessageListViewAvatars_Tests: StreamChatTestCase { @@ -18,7 +19,7 @@ class MessageListViewAvatars_Tests: StreamChatTestCase { let view = makeMessageListView(with: channel).applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageListView_defaultGroupsChannel() { @@ -30,7 +31,7 @@ class MessageListViewAvatars_Tests: StreamChatTestCase { let view = makeMessageListView(with: channel).applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageListView_dmChannelAvatarsOff() { @@ -42,7 +43,7 @@ class MessageListViewAvatars_Tests: StreamChatTestCase { let view = makeMessageListView(with: channel).applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageListView_groupsChannelAvatarsOff() { @@ -54,7 +55,7 @@ class MessageListViewAvatars_Tests: StreamChatTestCase { let view = makeMessageListView(with: channel).applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } private func setupConfig(showAvatars: Bool, showAvatarsInGroups: Bool?) { diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewLastGroupHeader_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewLastGroupHeader_Tests.swift index f61aec81..cf1c0251 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewLastGroupHeader_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewLastGroupHeader_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -58,7 +59,7 @@ class MessageListViewLastGroupHeader_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewNewMessages_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewNewMessages_Tests.swift index 3687479b..5b3f94b3 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewNewMessages_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListViewNewMessages_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -30,7 +31,7 @@ final class MessageListViewNewMessages_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_messageListViewNewMessages_moreMessages() { @@ -48,7 +49,7 @@ final class MessageListViewNewMessages_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_messageListViewNewMessages_moreMessagesInBetween() { @@ -66,7 +67,7 @@ final class MessageListViewNewMessages_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_messageListViewNewMessages_noMessages() { @@ -84,7 +85,7 @@ final class MessageListViewNewMessages_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } // MARK: - private diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListView_Tests.swift index 50eac8d2..b6ea9358 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageListView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageListView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -17,7 +18,7 @@ class MessageListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_messageListView_noReactions() { @@ -27,7 +28,7 @@ class MessageListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_scrollToBottomButton_snapshotUnreadCount() { @@ -35,7 +36,7 @@ class MessageListView_Tests: StreamChatTestCase { let button = ScrollToBottomButton(unreadCount: 3, onScrollToBottom: {}) // Then - assertSnapshot(matching: button, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: button, as: .image(perceptualPrecision: precision)) } func test_scrollToBottomButton_snapshotEmptyCount() { @@ -43,7 +44,7 @@ class MessageListView_Tests: StreamChatTestCase { let button = ScrollToBottomButton(unreadCount: 0, onScrollToBottom: {}) // Then - assertSnapshot(matching: button, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: button, as: .image(perceptualPrecision: precision)) } func test_messageListView_typingIndicator() { @@ -57,7 +58,7 @@ class MessageListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: messageListView, as: .image(perceptualPrecision: precision)) } func test_messageListView_snapshotFallback() { @@ -72,7 +73,7 @@ class MessageListView_Tests: StreamChatTestCase { let view = Image(uiImage: snapshot) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } // MARK: - private diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageReadIndicatorView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageReadIndicatorView_Tests.swift index e9f06bf2..f26fdfa3 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageReadIndicatorView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageReadIndicatorView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class MessageReadIndicatorView_Tests: StreamChatTestCase { @@ -18,7 +19,7 @@ class MessageReadIndicatorView_Tests: StreamChatTestCase { .frame(width: 50, height: 16) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageReadIndicatorView_snapshotMessageReadDirect() { @@ -30,7 +31,7 @@ class MessageReadIndicatorView_Tests: StreamChatTestCase { .frame(width: 50, height: 16) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageReadIndicatorView_snapshotMessageReadGroup() { @@ -42,7 +43,7 @@ class MessageReadIndicatorView_Tests: StreamChatTestCase { .frame(width: 50, height: 16) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageReadIndicatorView_snapshotPendingSend() { @@ -55,6 +56,6 @@ class MessageReadIndicatorView_Tests: StreamChatTestCase { .frame(width: 50, height: 16) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageViewMultiRowReactions_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageViewMultiRowReactions_Tests.swift index b69ba2d0..6c566e1a 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageViewMultiRowReactions_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageViewMultiRowReactions_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -60,7 +61,7 @@ final class MessageViewMultiRowReactions_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift index 9ccd775a..56744f77 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/MessageView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -30,7 +31,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewImage_snapshot() { @@ -54,7 +55,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewImage_snapshot2Images() { @@ -81,7 +82,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewImage_snapshot3Images() { @@ -109,7 +110,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewImage_snapshotQuoted() { @@ -140,7 +141,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewGiphy_snapshot() { @@ -164,7 +165,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewVideo_snapshot() { @@ -188,7 +189,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewFile_snapshot() { @@ -212,7 +213,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewFileText_snapshot() { @@ -236,7 +237,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageViewJumboEmoji_snapshot() { @@ -259,7 +260,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_linkAttachmentView_snapshot() { @@ -282,7 +283,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_deletedMessageView_snapshot() { @@ -299,7 +300,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_deletedMessageViewContainer_snapshot() { @@ -322,7 +323,7 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_messageRepliesView_snapshot() { @@ -345,7 +346,7 @@ class MessageView_Tests: StreamChatTestCase { .frame(width: 300, height: 60) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_topLeftView_snapshot() { @@ -359,6 +360,6 @@ class MessageView_Tests: StreamChatTestCase { .applyDefaultSize() // When - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/QuotedMessageView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/QuotedMessageView_Tests.swift index 58c54852..d9b2eda1 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/QuotedMessageView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/QuotedMessageView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -28,7 +29,7 @@ class QuotedMessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_quotedMessageView_snapshot() { @@ -42,6 +43,6 @@ class QuotedMessageView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsOverlayView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsOverlayView_Tests.swift index 3b728af4..4f459433 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsOverlayView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsOverlayView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -45,7 +46,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { } // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsOverlayView_noReactions() { @@ -64,7 +65,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { } // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsOverlayView_usersReactions() { @@ -107,7 +108,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { } // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsOverlay_veryLongMessage() { @@ -143,7 +144,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { } // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionAnimatableView_snapshot() { @@ -162,7 +163,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { .frame(width: 24, height: 24) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsOverlayContainer_snapshot() { @@ -177,7 +178,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { ) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsAnimatableView_snapshot() { @@ -193,7 +194,7 @@ class ReactionsOverlayView_Tests: StreamChatTestCase { ) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatMessage_reactionOffsetCurrentUser() { diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsUsersView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsUsersView_Tests.swift index 02bd814e..a51828a0 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsUsersView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/ReactionsUsersView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -34,7 +35,7 @@ class ReactionsUsersView_Tests: StreamChatTestCase { .frame(width: 250) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_reactionsUsersView_snapshotTwoRows() { @@ -66,6 +67,6 @@ class ReactionsUsersView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 320) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/InstantCommandsView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/InstantCommandsView_Tests.swift index eb73fd2f..80f3c3d1 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/InstantCommandsView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/InstantCommandsView_Tests.swift @@ -5,6 +5,7 @@ @testable import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class InstantCommandsView_Tests: StreamChatTestCase { @@ -23,7 +24,7 @@ class InstantCommandsView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width, height: 100) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_instantCommandsContainerViewEmpty_snapshot() { @@ -35,7 +36,7 @@ class InstantCommandsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_instantCommandsContainerView_snapshot() { @@ -47,7 +48,7 @@ class InstantCommandsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_instantCommandsContainerMaxSize_snapshot() { @@ -62,7 +63,7 @@ class InstantCommandsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } private func defaultCommands(suffix: String = "") -> [CommandHandler] { diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/TypingIndicatorView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/TypingIndicatorView_Tests.swift index e1932c97..db90acab 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/TypingIndicatorView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/TypingIndicatorView_Tests.swift @@ -4,6 +4,7 @@ import SnapshotTesting @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class TypingIndicatorView_Tests: StreamChatTestCase { @@ -14,6 +15,6 @@ class TypingIndicatorView_Tests: StreamChatTestCase { .frame(width: 20, height: 16) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/WebView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannel/WebView_Tests.swift index e7510eba..6136da5e 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannel/WebView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannel/WebView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class WebView_Tests: StreamChatTestCase { @@ -27,6 +28,6 @@ class WebView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: webView, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: webView, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListView_Tests.swift index 5132466d..a2684e16 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import SwiftUI import XCTest @@ -19,7 +20,7 @@ class ChatChannelListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelListView_snapshot() { @@ -34,7 +35,7 @@ class ChatChannelListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_chatChannelListViewSansNavigation_snapshot() { @@ -52,7 +53,7 @@ class ChatChannelListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_trailingSwipeActionsView_snapshot() { @@ -67,7 +68,7 @@ class ChatChannelListView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } private func makeChannelListController() -> ChatChannelListController_Mock { diff --git a/StreamChatSwiftUITests/Tests/ChatChannelList/LoadingView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannelList/LoadingView_Tests.swift index 7e9e7ac7..774d4ef9 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannelList/LoadingView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannelList/LoadingView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class LoadingView_Tests: StreamChatTestCase { @@ -18,7 +19,7 @@ class LoadingView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_loadingView_snapshot() { @@ -27,6 +28,6 @@ class LoadingView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/ChatChannelList/MoreChannelActionsView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannelList/MoreChannelActionsView_Tests.swift index 7fbfde51..1ad98bf9 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannelList/MoreChannelActionsView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannelList/MoreChannelActionsView_Tests.swift @@ -5,6 +5,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI +@testable import StreamSwiftTestHelpers import XCTest class MoreChannelActionsView_Tests: StreamChatTestCase { @@ -29,6 +30,6 @@ class MoreChannelActionsView_Tests: StreamChatTestCase { .applyDefaultSize() // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: 0.98)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } } diff --git a/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift b/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift index 88a5487a..793ba562 100644 --- a/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift +++ b/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift @@ -4,15 +4,14 @@ @testable import StreamChat @testable import StreamChatSwiftUI -@_exported import StreamChatTestHelpers @_exported import StreamChatTestTools +@_exported import StreamSwiftTestHelpers import XCTest /// Base class that sets up the `StreamChat` object. open class StreamChatTestCase: XCTestCase { public static var currentUserId: String = .unique - public let snapshotPrecision: Float = 0.97 public var chatClient: ChatClient = { let client = ChatClient.mock(isLocalStorageEnabled: false) From d9fa59a5eeecff0ffa3b28cae3b5e34effc48257 Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Mon, 9 Oct 2023 13:20:32 +0100 Subject: [PATCH 2/8] Fix --- StreamChatSwiftUI.xcodeproj/project.pbxproj | 8 ++++---- .../StreamChatSwiftUITests.swift | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/StreamChatSwiftUI.xcodeproj/project.pbxproj b/StreamChatSwiftUI.xcodeproj/project.pbxproj index 654576fd..57c6664b 100644 --- a/StreamChatSwiftUI.xcodeproj/project.pbxproj +++ b/StreamChatSwiftUI.xcodeproj/project.pbxproj @@ -8,7 +8,7 @@ /* Begin PBXBuildFile section */ 8205B4142AD41CC700265B84 /* StreamSwiftTestHelpers in Frameworks */ = {isa = PBXBuildFile; productRef = 8205B4132AD41CC700265B84 /* StreamSwiftTestHelpers */; }; - 8205B4162AD41CD600265B84 /* StreamSwiftTestHelpers in Frameworks */ = {isa = PBXBuildFile; productRef = 8205B4152AD41CD600265B84 /* StreamSwiftTestHelpers */; }; + 8205B4182AD4267200265B84 /* StreamSwiftTestHelpers in Frameworks */ = {isa = PBXBuildFile; productRef = 8205B4172AD4267200265B84 /* StreamSwiftTestHelpers */; }; 820A61A029D6D78E002257FB /* QuotedReply_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 820A619F29D6D78E002257FB /* QuotedReply_Tests.swift */; }; 825AADF4283CCDB000237498 /* ThreadPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 825AADF3283CCDB000237498 /* ThreadPage.swift */; }; 827352FD290BE91100A87385 /* NotificationsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8492974827ABDDBF00A8EEB0 /* NotificationsHandler.swift */; }; @@ -780,6 +780,7 @@ files = ( A3571603283E9D9F0014E3B0 /* Swifter in Frameworks */, 846AD4D2284F89B10074A0DD /* StreamChatTestTools in Frameworks */, + 8205B4182AD4267200265B84 /* StreamSwiftTestHelpers in Frameworks */, 846AD4D0284F89B10074A0DD /* StreamChatTestMockServer in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -789,7 +790,6 @@ buildActionMask = 2147483647; files = ( A35D803B283E89F50084FE25 /* StreamChatSwiftUI.framework in Frameworks */, - 8205B4162AD41CD600265B84 /* StreamSwiftTestHelpers in Frameworks */, 8400A34C282C081E0067D3A0 /* OHHTTPStubs in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1597,6 +1597,7 @@ A3571602283E9D9F0014E3B0 /* Swifter */, 846AD4CF284F89B10074A0DD /* StreamChatTestMockServer */, 846AD4D1284F89B10074A0DD /* StreamChatTestTools */, + 8205B4172AD4267200265B84 /* StreamSwiftTestHelpers */, ); productName = StreamChatSwiftUITestsAppTests; productReference = 8400A351282E6BE30067D3A0 /* StreamChatSwiftUITestsAppTests.xctest */; @@ -1619,7 +1620,6 @@ name = StreamChatSwiftUITestsApp; packageProductDependencies = ( 8400A34B282C081E0067D3A0 /* OHHTTPStubs */, - 8205B4152AD41CD600265B84 /* StreamSwiftTestHelpers */, ); productName = StreamChatSwiftUITestsApp; productReference = 8402EAC3282BF69900CCA696 /* StreamChatSwiftUITestsApp.app */; @@ -2775,7 +2775,7 @@ package = 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */; productName = StreamSwiftTestHelpers; }; - 8205B4152AD41CD600265B84 /* StreamSwiftTestHelpers */ = { + 8205B4172AD4267200265B84 /* StreamSwiftTestHelpers */ = { isa = XCSwiftPackageProductDependency; package = 82543C7B2AD41B0400D5F6CD /* XCRemoteSwiftPackageReference "stream-chat-swift-test-helpers" */; productName = StreamSwiftTestHelpers; diff --git a/StreamChatSwiftUITestsAppTests/StreamChatSwiftUITests.swift b/StreamChatSwiftUITestsAppTests/StreamChatSwiftUITests.swift index a6b8c219..81a25c35 100644 --- a/StreamChatSwiftUITestsAppTests/StreamChatSwiftUITests.swift +++ b/StreamChatSwiftUITestsAppTests/StreamChatSwiftUITests.swift @@ -2,8 +2,8 @@ // Copyright © 2023 Stream.io Inc. All rights reserved. // -@_exported import StreamChatTestHelpers @_exported import StreamChatTestMockServer +@_exported import StreamSwiftTestHelpers import Foundation final class StreamChatSwiftUITests {} From bf7f7fd8473734ac9f61055a8a677899d7ab87d9 Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Mon, 9 Oct 2023 16:30:32 +0100 Subject: [PATCH 3/8] Return StreamChat 4.39.0 version --- StreamChatSwiftUI.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/StreamChatSwiftUI.xcodeproj/project.pbxproj b/StreamChatSwiftUI.xcodeproj/project.pbxproj index 57c6664b..aa11b289 100644 --- a/StreamChatSwiftUI.xcodeproj/project.pbxproj +++ b/StreamChatSwiftUI.xcodeproj/project.pbxproj @@ -2747,8 +2747,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/GetStream/stream-chat-swift.git"; requirement = { - branch = ci/spm; - kind = branch; + kind = upToNextMajorVersion; + minimumVersion = 4.39.0; }; }; A3571601283E9D9F0014E3B0 /* XCRemoteSwiftPackageReference "swifter" */ = { From 38f939983dfbe6dc3f244673f31fd017ca8b6a53 Mon Sep 17 00:00:00 2001 From: martinmitrevski Date: Thu, 26 Oct 2023 10:15:32 +0200 Subject: [PATCH 4/8] Fixed linting issue --- .../ChatChannel/MessageList/MessageBubble.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageBubble.swift b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageBubble.swift index 42a4386a..6acbac77 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageBubble.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageBubble.swift @@ -58,7 +58,7 @@ public struct MessageBubbleModifier: ViewModifier { if utils.messageListConfig.messageListAlignment == .leftAligned { self.forceLeftToRight = true } else { - self.forceLeftToRight = forceLeftToRight + self.forceLeftToRight = forceLeftToRight } self.topPadding = topPadding self.bottomPadding = bottomPadding From 1046372aa11658e4f5d22b755d3fd4876d0c01c2 Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Thu, 26 Oct 2023 09:28:10 +0100 Subject: [PATCH 5/8] Bump test helpers version --- StreamChatSwiftUI.xcodeproj/project.pbxproj | 2 +- .../ChatChannelListItemView_Tests.swift | 11 ++++++----- StreamChatSwiftUITests/Tests/StreamChatTestCase.swift | 1 - 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/StreamChatSwiftUI.xcodeproj/project.pbxproj b/StreamChatSwiftUI.xcodeproj/project.pbxproj index 1375865c..12420e4d 100644 --- a/StreamChatSwiftUI.xcodeproj/project.pbxproj +++ b/StreamChatSwiftUI.xcodeproj/project.pbxproj @@ -3229,7 +3229,7 @@ repositoryURL = "https://github.com/GetStream/stream-chat-swift-test-helpers.git"; requirement = { kind = exactVersion; - version = 0.3.0; + version = 0.3.1; }; }; 8400A346282C06F90067D3A0 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = { diff --git a/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListItemView_Tests.swift b/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListItemView_Tests.swift index ca785665..976a3caa 100644 --- a/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListItemView_Tests.swift +++ b/StreamChatSwiftUITests/Tests/ChatChannelList/ChatChannelListItemView_Tests.swift @@ -6,6 +6,7 @@ import SnapshotTesting @testable import StreamChat @testable import StreamChatSwiftUI @testable import StreamChatTestTools +@testable import StreamSwiftTestHelpers import XCTest final class ChatChannelListItemView_Tests: StreamChatTestCase { @@ -26,7 +27,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_channelListItem_imageMessage() throws { @@ -45,7 +46,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_channelListItem_videoMessage() throws { @@ -64,7 +65,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_channelListItem_fileMessage() throws { @@ -83,7 +84,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } func test_channelListItem_giphyMessage() throws { @@ -102,7 +103,7 @@ final class ChatChannelListItemView_Tests: StreamChatTestCase { .frame(width: defaultScreenSize.width) // Then - assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision)) + assertSnapshot(matching: view, as: .image(perceptualPrecision: precision)) } // MARK: - private diff --git a/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift b/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift index 03c94bd8..793ba562 100644 --- a/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift +++ b/StreamChatSwiftUITests/Tests/StreamChatTestCase.swift @@ -12,7 +12,6 @@ import XCTest open class StreamChatTestCase: XCTestCase { public static var currentUserId: String = .unique - public let snapshotPrecision: Float = 0.95 public var chatClient: ChatClient = { let client = ChatClient.mock(isLocalStorageEnabled: false) From f1b2c0665bf5edf4b67b917ade809f596a0d76bf Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Thu, 26 Oct 2023 10:12:49 +0100 Subject: [PATCH 6/8] Fix pods on Xcode 15 --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index d9ac0242..682c8d36 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -22,7 +22,7 @@ before_all do |lane| setup_ci ENV['FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT'] = '180' ENV['FASTLANE_XCODEBUILD_SETTINGS_RETRIES'] = '10' - xcversion(version: xcode_version) unless [:publish_release, :allure_launch].include?(lane) + xcversion(version: xcode_version) unless [:publish_release, :allure_launch, :pod_lint].include?(lane) end end From de74a65c546514adfc9c8045ac60d3f5e1a0b134 Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Thu, 26 Oct 2023 13:53:04 +0100 Subject: [PATCH 7/8] Comment jobs and solve Snapshots CI issue --- .github/workflows/smoke-checks.yml | 212 ++++++++++++++--------------- 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/.github/workflows/smoke-checks.yml b/.github/workflows/smoke-checks.yml index 3eb9c024..57c5c858 100644 --- a/.github/workflows/smoke-checks.yml +++ b/.github/workflows/smoke-checks.yml @@ -14,27 +14,27 @@ concurrency: env: HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI - IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (17.0)" + IOS_SIMULATOR_DEVICE: "iPhone 14 Pro" jobs: - automated-code-review: - name: Automated Code Review - runs-on: macos-13 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_PR_NUM: ${{ github.event.number }} - if: ${{ github.event_name != 'push' }} - steps: - - uses: actions/checkout@v3.1.0 - - uses: ./.github/actions/bootstrap - - name: Run Danger - run: bundle exec danger - - name: Run Fastlane Linting - run: bundle exec fastlane rubocop - - name: Run SwiftFormat Linting - run: ./Scripts/run-linter.sh - - name: Run Podspec Linting - run: bundle exec fastlane pod_lint + # automated-code-review: + # name: Automated Code Review + # runs-on: macos-13 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # GITHUB_PR_NUM: ${{ github.event.number }} + # if: ${{ github.event_name != 'push' }} + # steps: + # - uses: actions/checkout@v3.1.0 + # - uses: ./.github/actions/bootstrap + # - name: Run Danger + # run: bundle exec danger + # - name: Run Fastlane Linting + # run: bundle exec fastlane rubocop + # - name: Run SwiftFormat Linting + # run: ./Scripts/run-linter.sh + # - name: Run Podspec Linting + # run: bundle exec fastlane pod_lint build-test-app-and-frameworks: name: Build Test App and Frameworks @@ -107,92 +107,92 @@ jobs: path: | fastlane/test_output/snapshots - test-e2e-debug: - name: Test E2E UI (Debug) - runs-on: macos-13 - if: ${{ github.event_name != 'push' }} - needs: - - allure_testops_launch - - build-test-app-and-frameworks - env: - LAUNCH_ID: ${{ needs.allure_testops_launch.outputs.launch_id }} - strategy: - matrix: - batch: [0, 1] - fail-fast: false - steps: - - uses: actions/checkout@v3.1.0 - - uses: actions/download-artifact@v3 - with: - name: cache-derived-data - path: derived_data/Build/ - - uses: ./.github/actions/bootstrap - env: - INSTALL_ALLURE: true - - name: Run UI Tests (Debug) - run: bundle exec fastlane test_e2e_mock device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}' test_without_building:true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_PR_NUM: ${{ github.event.number }} - MATRIX_SIZE: ${{ strategy.job-total }} - IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (16.4)" # TODO: delete this line as soon as Xcode 15 is stable on CI - XCODE_VERSION: "14.3.1" # TODO: delete this line as soon as Xcode 15 is stable on CI - - name: Allure TestOps Upload - if: env.LAUNCH_ID != '' && (success() || failure()) - run: bundle exec fastlane allure_upload launch_id:$LAUNCH_ID - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} - - name: Allure TestOps Launch Removal - if: env.LAUNCH_ID != '' && cancelled() - run: bundle exec fastlane allure_launch_removal launch_id:$LAUNCH_ID - env: - ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} - - name: Parse xcresult - if: failure() - run: | - brew install chargepoint/xcparse/xcparse - xcparse logs fastlane/test_output/StreamChatSwiftUITestsApp.xcresult fastlane/test_output/logs/ - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: Test Data - path: | - fastlane/recordings - fastlane/sinatra_log.txt - fastlane/test_output/logs/*/Diagnostics/StreamChatSwiftUITestsAppUITests-*/*/*.txt + # test-e2e-debug: + # name: Test E2E UI (Debug) + # runs-on: macos-13 + # if: ${{ github.event_name != 'push' }} + # needs: + # - allure_testops_launch + # - build-test-app-and-frameworks + # env: + # LAUNCH_ID: ${{ needs.allure_testops_launch.outputs.launch_id }} + # strategy: + # matrix: + # batch: [0, 1] + # fail-fast: false + # steps: + # - uses: actions/checkout@v3.1.0 + # - uses: actions/download-artifact@v3 + # with: + # name: cache-derived-data + # path: derived_data/Build/ + # - uses: ./.github/actions/bootstrap + # env: + # INSTALL_ALLURE: true + # - name: Run UI Tests (Debug) + # run: bundle exec fastlane test_e2e_mock device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}' test_without_building:true + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # GITHUB_PR_NUM: ${{ github.event.number }} + # MATRIX_SIZE: ${{ strategy.job-total }} + # IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (16.4)" # TODO: delete this line as soon as Xcode 15 is stable on CI + # XCODE_VERSION: "14.3.1" # TODO: delete this line as soon as Xcode 15 is stable on CI + # - name: Allure TestOps Upload + # if: env.LAUNCH_ID != '' && (success() || failure()) + # run: bundle exec fastlane allure_upload launch_id:$LAUNCH_ID + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} + # - name: Allure TestOps Launch Removal + # if: env.LAUNCH_ID != '' && cancelled() + # run: bundle exec fastlane allure_launch_removal launch_id:$LAUNCH_ID + # env: + # ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} + # - name: Parse xcresult + # if: failure() + # run: | + # brew install chargepoint/xcparse/xcparse + # xcparse logs fastlane/test_output/StreamChatSwiftUITestsApp.xcresult fastlane/test_output/logs/ + # - uses: actions/upload-artifact@v3 + # if: failure() + # with: + # name: Test Data + # path: | + # fastlane/recordings + # fastlane/sinatra_log.txt + # fastlane/test_output/logs/*/Diagnostics/StreamChatSwiftUITestsAppUITests-*/*/*.txt - allure_testops_launch: - name: Launch Allure TestOps - runs-on: macos-13 - if: ${{ github.event_name != 'push' }} - outputs: - launch_id: ${{ steps.get_launch_id.outputs.launch_id }} - steps: - - uses: actions/checkout@v3.1.0 - - uses: ./.github/actions/ruby-cache - - name: Launch Allure TestOps - run: bundle exec fastlane allure_launch - env: - ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_EVENT: ${{ toJson(github.event) }} - - id: get_launch_id - run: echo "launch_id=${{env.LAUNCH_ID}}" >> $GITHUB_OUTPUT - if: env.LAUNCH_ID != '' + # allure_testops_launch: + # name: Launch Allure TestOps + # runs-on: macos-13 + # if: ${{ github.event_name != 'push' }} + # outputs: + # launch_id: ${{ steps.get_launch_id.outputs.launch_id }} + # steps: + # - uses: actions/checkout@v3.1.0 + # - uses: ./.github/actions/ruby-cache + # - name: Launch Allure TestOps + # run: bundle exec fastlane allure_launch + # env: + # ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # GITHUB_EVENT: ${{ toJson(github.event) }} + # - id: get_launch_id + # run: echo "launch_id=${{env.LAUNCH_ID}}" >> $GITHUB_OUTPUT + # if: env.LAUNCH_ID != '' - build-apps: - name: Build Demo App - runs-on: macos-13 - needs: build-test-app-and-frameworks - if: ${{ github.event_name != 'push' }} - steps: - - uses: actions/checkout@v3.1.0 - - uses: actions/download-artifact@v3 - with: - name: cache-derived-data - path: derived_data/Build/ - - uses: ./.github/actions/ruby-cache - - uses: ./.github/actions/xcode-cache - - name: Build Demo App - run: bundle exec fastlane build_demo + # build-apps: + # name: Build Demo App + # runs-on: macos-13 + # needs: build-test-app-and-frameworks + # if: ${{ github.event_name != 'push' }} + # steps: + # - uses: actions/checkout@v3.1.0 + # - uses: actions/download-artifact@v3 + # with: + # name: cache-derived-data + # path: derived_data/Build/ + # - uses: ./.github/actions/ruby-cache + # - uses: ./.github/actions/xcode-cache + # - name: Build Demo App + # run: bundle exec fastlane build_demo From 95c97a16d5e446c84da59afa227a7b199a652eab Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Thu, 26 Oct 2023 14:28:00 +0100 Subject: [PATCH 8/8] Uncomment jobs --- .github/workflows/smoke-checks.yml | 210 ++++++++++++++--------------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/.github/workflows/smoke-checks.yml b/.github/workflows/smoke-checks.yml index 57c5c858..45f65921 100644 --- a/.github/workflows/smoke-checks.yml +++ b/.github/workflows/smoke-checks.yml @@ -17,24 +17,24 @@ env: IOS_SIMULATOR_DEVICE: "iPhone 14 Pro" jobs: - # automated-code-review: - # name: Automated Code Review - # runs-on: macos-13 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # GITHUB_PR_NUM: ${{ github.event.number }} - # if: ${{ github.event_name != 'push' }} - # steps: - # - uses: actions/checkout@v3.1.0 - # - uses: ./.github/actions/bootstrap - # - name: Run Danger - # run: bundle exec danger - # - name: Run Fastlane Linting - # run: bundle exec fastlane rubocop - # - name: Run SwiftFormat Linting - # run: ./Scripts/run-linter.sh - # - name: Run Podspec Linting - # run: bundle exec fastlane pod_lint + automated-code-review: + name: Automated Code Review + runs-on: macos-13 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_PR_NUM: ${{ github.event.number }} + if: ${{ github.event_name != 'push' }} + steps: + - uses: actions/checkout@v3.1.0 + - uses: ./.github/actions/bootstrap + - name: Run Danger + run: bundle exec danger + - name: Run Fastlane Linting + run: bundle exec fastlane rubocop + - name: Run SwiftFormat Linting + run: ./Scripts/run-linter.sh + - name: Run Podspec Linting + run: bundle exec fastlane pod_lint build-test-app-and-frameworks: name: Build Test App and Frameworks @@ -107,92 +107,92 @@ jobs: path: | fastlane/test_output/snapshots - # test-e2e-debug: - # name: Test E2E UI (Debug) - # runs-on: macos-13 - # if: ${{ github.event_name != 'push' }} - # needs: - # - allure_testops_launch - # - build-test-app-and-frameworks - # env: - # LAUNCH_ID: ${{ needs.allure_testops_launch.outputs.launch_id }} - # strategy: - # matrix: - # batch: [0, 1] - # fail-fast: false - # steps: - # - uses: actions/checkout@v3.1.0 - # - uses: actions/download-artifact@v3 - # with: - # name: cache-derived-data - # path: derived_data/Build/ - # - uses: ./.github/actions/bootstrap - # env: - # INSTALL_ALLURE: true - # - name: Run UI Tests (Debug) - # run: bundle exec fastlane test_e2e_mock device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}' test_without_building:true - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # GITHUB_PR_NUM: ${{ github.event.number }} - # MATRIX_SIZE: ${{ strategy.job-total }} - # IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (16.4)" # TODO: delete this line as soon as Xcode 15 is stable on CI - # XCODE_VERSION: "14.3.1" # TODO: delete this line as soon as Xcode 15 is stable on CI - # - name: Allure TestOps Upload - # if: env.LAUNCH_ID != '' && (success() || failure()) - # run: bundle exec fastlane allure_upload launch_id:$LAUNCH_ID - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} - # - name: Allure TestOps Launch Removal - # if: env.LAUNCH_ID != '' && cancelled() - # run: bundle exec fastlane allure_launch_removal launch_id:$LAUNCH_ID - # env: - # ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} - # - name: Parse xcresult - # if: failure() - # run: | - # brew install chargepoint/xcparse/xcparse - # xcparse logs fastlane/test_output/StreamChatSwiftUITestsApp.xcresult fastlane/test_output/logs/ - # - uses: actions/upload-artifact@v3 - # if: failure() - # with: - # name: Test Data - # path: | - # fastlane/recordings - # fastlane/sinatra_log.txt - # fastlane/test_output/logs/*/Diagnostics/StreamChatSwiftUITestsAppUITests-*/*/*.txt + test-e2e-debug: + name: Test E2E UI (Debug) + runs-on: macos-13 + if: ${{ github.event_name != 'push' }} + needs: + - allure_testops_launch + - build-test-app-and-frameworks + env: + LAUNCH_ID: ${{ needs.allure_testops_launch.outputs.launch_id }} + strategy: + matrix: + batch: [0, 1] + fail-fast: false + steps: + - uses: actions/checkout@v3.1.0 + - uses: actions/download-artifact@v3 + with: + name: cache-derived-data + path: derived_data/Build/ + - uses: ./.github/actions/bootstrap + env: + INSTALL_ALLURE: true + - name: Run UI Tests (Debug) + run: bundle exec fastlane test_e2e_mock device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}' test_without_building:true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_PR_NUM: ${{ github.event.number }} + MATRIX_SIZE: ${{ strategy.job-total }} + IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (16.4)" # TODO: delete this line as soon as Xcode 15 is stable on CI + XCODE_VERSION: "14.3.1" # TODO: delete this line as soon as Xcode 15 is stable on CI + - name: Allure TestOps Upload + if: env.LAUNCH_ID != '' && (success() || failure()) + run: bundle exec fastlane allure_upload launch_id:$LAUNCH_ID + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} + - name: Allure TestOps Launch Removal + if: env.LAUNCH_ID != '' && cancelled() + run: bundle exec fastlane allure_launch_removal launch_id:$LAUNCH_ID + env: + ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} + - name: Parse xcresult + if: failure() + run: | + brew install chargepoint/xcparse/xcparse + xcparse logs fastlane/test_output/StreamChatSwiftUITestsApp.xcresult fastlane/test_output/logs/ + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: Test Data + path: | + fastlane/recordings + fastlane/sinatra_log.txt + fastlane/test_output/logs/*/Diagnostics/StreamChatSwiftUITestsAppUITests-*/*/*.txt - # allure_testops_launch: - # name: Launch Allure TestOps - # runs-on: macos-13 - # if: ${{ github.event_name != 'push' }} - # outputs: - # launch_id: ${{ steps.get_launch_id.outputs.launch_id }} - # steps: - # - uses: actions/checkout@v3.1.0 - # - uses: ./.github/actions/ruby-cache - # - name: Launch Allure TestOps - # run: bundle exec fastlane allure_launch - # env: - # ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # GITHUB_EVENT: ${{ toJson(github.event) }} - # - id: get_launch_id - # run: echo "launch_id=${{env.LAUNCH_ID}}" >> $GITHUB_OUTPUT - # if: env.LAUNCH_ID != '' + allure_testops_launch: + name: Launch Allure TestOps + runs-on: macos-13 + if: ${{ github.event_name != 'push' }} + outputs: + launch_id: ${{ steps.get_launch_id.outputs.launch_id }} + steps: + - uses: actions/checkout@v3.1.0 + - uses: ./.github/actions/ruby-cache + - name: Launch Allure TestOps + run: bundle exec fastlane allure_launch + env: + ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_EVENT: ${{ toJson(github.event) }} + - id: get_launch_id + run: echo "launch_id=${{env.LAUNCH_ID}}" >> $GITHUB_OUTPUT + if: env.LAUNCH_ID != '' - # build-apps: - # name: Build Demo App - # runs-on: macos-13 - # needs: build-test-app-and-frameworks - # if: ${{ github.event_name != 'push' }} - # steps: - # - uses: actions/checkout@v3.1.0 - # - uses: actions/download-artifact@v3 - # with: - # name: cache-derived-data - # path: derived_data/Build/ - # - uses: ./.github/actions/ruby-cache - # - uses: ./.github/actions/xcode-cache - # - name: Build Demo App - # run: bundle exec fastlane build_demo + build-apps: + name: Build Demo App + runs-on: macos-13 + needs: build-test-app-and-frameworks + if: ${{ github.event_name != 'push' }} + steps: + - uses: actions/checkout@v3.1.0 + - uses: actions/download-artifact@v3 + with: + name: cache-derived-data + path: derived_data/Build/ + - uses: ./.github/actions/ruby-cache + - uses: ./.github/actions/xcode-cache + - name: Build Demo App + run: bundle exec fastlane build_demo