diff --git a/.github/workflows/smoke-checks.yml b/.github/workflows/smoke-checks.yml index 45f65921..b4cf9c53 100644 --- a/.github/workflows/smoke-checks.yml +++ b/.github/workflows/smoke-checks.yml @@ -7,6 +7,12 @@ on: # - '!main' TODO: commented until `develop` branch is in place workflow_dispatch: + inputs: + snapshots: + description: 'Should Snapshots be recorded on CI?' + type: boolean + required: false + default: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -23,7 +29,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_PR_NUM: ${{ github.event.number }} - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} steps: - uses: actions/checkout@v3.1.0 - uses: ./.github/actions/bootstrap @@ -69,15 +75,16 @@ jobs: - uses: ./.github/actions/bootstrap - uses: ./.github/actions/python-cache - name: Run UI Tests (Debug) - run: bundle exec fastlane test_ui device:"${{ env.IOS_SIMULATOR_DEVICE }}" skip_build:true - timeout-minutes: 40 + run: bundle exec fastlane test_ui device:"${{ env.IOS_SIMULATOR_DEVICE }}" skip_build:true record:${{ github.event.inputs.snapshots }} + timeout-minutes: 60 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_BOT_GITHUB_TOKEN }} # to open a PR GITHUB_PR_NUM: ${{ github.event.number }} - name: Get branch name id: get_branch_name run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT - name: Run Sonar analysis + if: ${{ github.event.inputs.snapshots != 'true' }} run: bundle exec fastlane sonar_upload env: BRANCH_NAME: ${{ steps.get_branch_name.outputs.branch }} @@ -110,7 +117,7 @@ jobs: test-e2e-debug: name: Test E2E UI (Debug) runs-on: macos-13 - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} needs: - allure_testops_launch - build-test-app-and-frameworks @@ -165,7 +172,7 @@ jobs: allure_testops_launch: name: Launch Allure TestOps runs-on: macos-13 - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} outputs: launch_id: ${{ steps.get_launch_id.outputs.launch_id }} steps: @@ -185,7 +192,7 @@ jobs: name: Build Demo App runs-on: macos-13 needs: build-test-app-and-frameworks - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }} steps: - uses: actions/checkout@v3.1.0 - uses: actions/download-artifact@v3 diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_addUsersShownSnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_addUsersShownSnapshot.1.png index 14bb1da7..09a62b54 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_addUsersShownSnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_addUsersShownSnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelMutedSnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelMutedSnapshot.1.png index 97a128b0..166c9e5b 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelMutedSnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelMutedSnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelOfflineSnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelOfflineSnapshot.1.png index 9d18379e..4f2c6eef 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelOfflineSnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelOfflineSnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelOnlineSnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelOnlineSnapshot.1.png index f8a5396b..921f0e4e 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelOnlineSnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_directChannelOnlineSnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_groupCollapsedSnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_groupCollapsedSnapshot.1.png index fd9d4a23..086a6aee 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_groupCollapsedSnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_groupCollapsedSnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_groupExpandedSnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_groupExpandedSnapshot.1.png index 8630ac1e..4f790cc1 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_groupExpandedSnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_groupExpandedSnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_navBarSnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_navBarSnapshot.1.png index f104b13c..a3e6670e 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_navBarSnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_navBarSnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_smallGroupSnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_smallGroupSnapshot.1.png index 601b57e0..17ed941b 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_smallGroupSnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/ChatChannelInfoView_Tests/test_chatChannelInfoView_smallGroupSnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/FileAttachmentsView_Tests/test_fileAttachmentsView_emptySnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/FileAttachmentsView_Tests/test_fileAttachmentsView_emptySnapshot.1.png index d0284a10..d4dd8053 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/FileAttachmentsView_Tests/test_fileAttachmentsView_emptySnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/FileAttachmentsView_Tests/test_fileAttachmentsView_emptySnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MediaAttachmentsView_Tests/test_mediaAttachmentsView_emptySnapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MediaAttachmentsView_Tests/test_mediaAttachmentsView_emptySnapshot.1.png index 67110d68..cbc77d6d 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MediaAttachmentsView_Tests/test_mediaAttachmentsView_emptySnapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo/__Snapshots__/MediaAttachmentsView_Tests/test_mediaAttachmentsView_emptySnapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerMaxSize_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerMaxSize_snapshot.1.png index 457d357e..29609edc 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerMaxSize_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerMaxSize_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerViewEmpty_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerViewEmpty_snapshot.1.png index 963ee205..39fc0df2 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerViewEmpty_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerViewEmpty_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerView_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerView_snapshot.1.png index da42acc3..d639f854 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerView_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/Suggestions/__Snapshots__/InstantCommandsView_Tests/test_instantCommandsContainerView_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_buttonNewRow.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_buttonNewRow.1.png index 63a84991..ab81d19b 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_buttonNewRow.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_buttonNewRow.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_currentUserReaction.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_currentUserReaction.1.png index 683fa848..52b4cbf1 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_currentUserReaction.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_currentUserReaction.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_twoPerRow.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_twoPerRow.1.png index c99f3fd3..755b7cc7 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_twoPerRow.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_multipleRows_twoPerRow.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_currentUser.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_currentUser.1.png index 049d6234..0b98258e 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_currentUser.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_currentUser.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_currentUserReaction.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_currentUserReaction.1.png index 21823f7d..ae4e0f34 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_currentUserReaction.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_currentUserReaction.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_otherUser.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_otherUser.1.png index 27a33ca5..aec4df37 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_otherUser.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/BottomReactionsView_Tests/test_bottomReactions_singleRow_otherUser.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelHeader_Tests/test_chatChannelHeaderModifier_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelHeader_Tests/test_chatChannelHeaderModifier_snapshot.1.png index 39659c56..339b1134 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelHeader_Tests/test_chatChannelHeaderModifier_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelHeader_Tests/test_chatChannelHeaderModifier_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelHeader_Tests/test_chatChannelHeader_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelHeader_Tests/test_chatChannelHeader_snapshot.1.png index 764c0eb2..ddacc92f 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelHeader_Tests/test_chatChannelHeader_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelHeader_Tests/test_chatChannelHeader_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelViewDateOverlay_Tests/test_chatChannelView_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelViewDateOverlay_Tests/test_chatChannelView_snapshot.1.png index fdd12002..65b31e53 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelViewDateOverlay_Tests/test_chatChannelView_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelViewDateOverlay_Tests/test_chatChannelView_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_chatChannelView_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_chatChannelView_snapshot.1.png index bc206a58..5ad35a65 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_chatChannelView_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_chatChannelView_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_chatChannelView_snapshotEmpty.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_chatChannelView_snapshotEmpty.1.png index 1987ea8c..96649779 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_chatChannelView_snapshotEmpty.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_chatChannelView_snapshotEmpty.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_defaultChannelHeader_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_defaultChannelHeader_snapshot.1.png index 499f4066..3dde388e 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_defaultChannelHeader_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_defaultChannelHeader_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/GalleryView_Tests/test_galleryHeader_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/GalleryView_Tests/test_galleryHeader_snapshot.1.png index 4fb69b6c..1c48b27f 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/GalleryView_Tests/test_galleryHeader_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/GalleryView_Tests/test_galleryHeader_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/GalleryView_Tests/test_galleryView_snapshotLoading.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/GalleryView_Tests/test_galleryView_snapshotLoading.1.png index 4dfd6c72..686f773d 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/GalleryView_Tests/test_galleryView_snapshotLoading.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/GalleryView_Tests/test_galleryView_snapshotLoading.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageComposerView_Tests/test_videoIndicatorView_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageComposerView_Tests/test_videoIndicatorView_snapshot.1.png index c49b5878..862a3b19 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageComposerView_Tests/test_videoIndicatorView_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageComposerView_Tests/test_videoIndicatorView_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListViewLastGroupHeader_Tests/test_messageListView_headerOnTop.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListViewLastGroupHeader_Tests/test_messageListView_headerOnTop.1.png index 57e7056e..d1b45aeb 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListViewLastGroupHeader_Tests/test_messageListView_headerOnTop.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListViewLastGroupHeader_Tests/test_messageListView_headerOnTop.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_snapshot.1.png deleted file mode 100644 index d29f3631..00000000 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_snapshot.1.png and /dev/null differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_typingIndicator.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_typingIndicator.1.png index b14b34ce..9653e9be 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_typingIndicator.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_typingIndicator.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_withReactions.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_withReactions.1.png index d29f3631..157eb220 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_withReactions.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_withReactions.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotEmptyCount.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotEmptyCount.1.png index ed7d1092..7e0b62b0 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotEmptyCount.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotEmptyCount.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotUnreadCount.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotUnreadCount.1.png index 9c2f68d1..3165acab 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotUnreadCount.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotUnreadCount.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageReadIndicatorView_Tests/test_messageReadIndicatorView_snapshotPendingSend.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageReadIndicatorView_Tests/test_messageReadIndicatorView_snapshotPendingSend.1.png index 567c1164..63a034e6 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageReadIndicatorView_Tests/test_messageReadIndicatorView_snapshotPendingSend.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageReadIndicatorView_Tests/test_messageReadIndicatorView_snapshotPendingSend.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageViewMultiRowReactions_Tests/test_messageViewMultiRowReactions_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageViewMultiRowReactions_Tests/test_messageViewMultiRowReactions_snapshot.1.png index a16e1aba..2b97fad8 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageViewMultiRowReactions_Tests/test_messageViewMultiRowReactions_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageViewMultiRowReactions_Tests/test_messageViewMultiRowReactions_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ReactionsOverlayView_Tests/test_reactionAnimatableView_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ReactionsOverlayView_Tests/test_reactionAnimatableView_snapshot.1.png index 03998d27..84799238 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ReactionsOverlayView_Tests/test_reactionAnimatableView_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ReactionsOverlayView_Tests/test_reactionAnimatableView_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannelList/__Snapshots__/MoreChannelActionsFullScreenWrappingView_Tests/test_moreChannelActionsFullScreenWrappingView_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannelList/__Snapshots__/MoreChannelActionsFullScreenWrappingView_Tests/test_moreChannelActionsFullScreenWrappingView_snapshot.1.png index 797674cd..c7e8569e 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannelList/__Snapshots__/MoreChannelActionsFullScreenWrappingView_Tests/test_moreChannelActionsFullScreenWrappingView_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannelList/__Snapshots__/MoreChannelActionsFullScreenWrappingView_Tests/test_moreChannelActionsFullScreenWrappingView_snapshot.1.png differ diff --git a/StreamChatSwiftUITests/Tests/ChatChannelList/__Snapshots__/MoreChannelActionsView_Tests/test_moreChannelActionsView_snapshot.1.png b/StreamChatSwiftUITests/Tests/ChatChannelList/__Snapshots__/MoreChannelActionsView_Tests/test_moreChannelActionsView_snapshot.1.png index 3037e8e6..e0669fb0 100644 Binary files a/StreamChatSwiftUITests/Tests/ChatChannelList/__Snapshots__/MoreChannelActionsView_Tests/test_moreChannelActionsView_snapshot.1.png and b/StreamChatSwiftUITests/Tests/ChatChannelList/__Snapshots__/MoreChannelActionsView_Tests/test_moreChannelActionsView_snapshot.1.png differ diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 969f6fb3..fe872cd0 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -124,7 +124,7 @@ desc 'Runs tests in Debug config' lane :test_ui do |options| next unless is_check_required(sources: sources_matrix[:ui], force_check: @force_check) - remove_snapshots if options[:record] + remove_snapshots unless options[:record].to_s.empty? update_testplan_on_ci(path: 'StreamChatSwiftUITests/Tests/StreamChatSwiftUI.xctestplan') @@ -140,9 +140,31 @@ lane :test_ui do |options| devices: options[:device], build_for_testing: options[:build_for_testing], skip_build: options[:skip_build], - number_of_retries: 1, - xcargs: buildcache_xcargs + number_of_retries: options[:record].to_s.empty? ? 1 : nil, + xcargs: buildcache_xcargs, + fail_build: options[:record].to_s.empty? ) + + if options[:record] && is_ci + png_files = git_status(ext: '.png').map { |_, png| png }.flatten + next if png_files.empty? + + title = "[CI] Snapshots" + base = current_branch + head = "#{base}-snapshots" + sh("git checkout -b #{head}") + png_files.each { |png| sh("git add #{png}") || true } + sh("git commit -m '#{title}'") + push_to_git_remote(tags: false) + create_pull_request( + api_token: ENV.fetch('GITHUB_TOKEN', nil), + repo: github_repo, + title: title, + head: head, + base: base, + body: 'This PR was created automatically by CI.' + ) + end end lane :build_test_app_and_frameworks do @@ -336,9 +358,16 @@ lane :install_sim do |options| end end -desc 'Remove UI snapshots' -private_lane :remove_snapshots do - Dir.glob('../StreamChatSwiftUITests/**/__Snapshots__/**/*.png').select { |file| File.delete(file) } +desc 'Remove UI Snapshots' +lane :remove_snapshots do |options| + snapshots_path = "../StreamChatSwiftUITests/**/__Snapshots__/**/*.png" + if options[:only_unchanged] + pnf_files = git_status(ext: '.png') + changed_snapshots = (pnf_files[:a] + pnf_files[:m]).map { |f| File.expand_path(f) } + Dir.glob(snapshots_path).select { |f| File.delete(f) unless changed_snapshots.include?(File.expand_path(f)) } + else + Dir.glob(snapshots_path).select { |f| File.delete(f) } + end end lane :sources_matrix do @@ -353,3 +382,32 @@ end private_lane :current_branch do ENV['BRANCH_NAME'] || git_branch end + +private_lane :git_status do |options| + UI.user_error!('Extension should be provided') unless options[:ext] + + untracked_files = sh('git status -s', log: false).split("\n").map(&:strip) + UI.important("Git Status: #{untracked_files}") + + deleted_files = select_files_from(files: untracked_files, with_extension: options[:ext], that_start_with: 'D') + added_files = select_files_from(files: untracked_files, with_extension: options[:ext], that_start_with: ['A', '??']) + renamed_files = select_files_from(files: untracked_files, with_extension: options[:ext], that_start_with: 'R') + modified_files = select_files_from(files: untracked_files, with_extension: options[:ext], that_start_with: 'M') + + renamed_files.each do |renamed_file| + content = renamed_file.split.drop(1).join.split('->').map(&:strip) + deleted_files << content.first + added_files << content.last + end + { a: added_files, d: deleted_files, m: modified_files } +end + +def select_files_from(files:, with_extension:, that_start_with:) + files.select do |f| + f.start_with?(*that_start_with) + end.map do |f| + f.split.drop(1).join(' ') + end.select do |f| + f.gsub(/['"]/, '').end_with?(with_extension) + end +end