Skip to content

Commit 32e3fd2

Browse files
committed
[CI] Fix flaky tests
1 parent 929b434 commit 32e3fd2

File tree

5 files changed

+72
-78
lines changed

5 files changed

+72
-78
lines changed

.github/workflows/cron-checks.yml

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -112,70 +112,70 @@ jobs:
112112
fastlane/test_output/logs/*/Diagnostics/**/*.txt
113113
fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/*
114114
115-
build-apps:
116-
name: Build Demo App
117-
strategy:
118-
matrix:
119-
include:
120-
- xcode: 15.4
121-
os: macos-14
122-
- xcode: 15.0.1
123-
os: macos-14
124-
fail-fast: false
125-
runs-on: ${{ matrix.os }}
126-
steps:
127-
- uses: actions/[email protected]
128-
- uses: ./.github/actions/ruby-cache
129-
- uses: ./.github/actions/xcode-cache
130-
- name: Build Demo App
131-
run: bundle exec fastlane build_demo
132-
env:
133-
XCODE_VERSION: ${{ matrix.xcode }}
134-
- uses: 8398a7/action-slack@v3
135-
with:
136-
status: ${{ job.status }}
137-
text: "You shall not pass!"
138-
job_name: "${{ github.workflow }}: ${{ github.job }}"
139-
fields: message,commit,author,action,workflow,job,took
140-
env:
141-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
142-
MATRIX_CONTEXT: ${{ toJson(matrix) }}
143-
if: failure() && github.event_name == 'schedule'
115+
# build-apps:
116+
# name: Build Demo App
117+
# strategy:
118+
# matrix:
119+
# include:
120+
# - xcode: 15.4
121+
# os: macos-14
122+
# - xcode: 15.0.1
123+
# os: macos-14
124+
# fail-fast: false
125+
# runs-on: ${{ matrix.os }}
126+
# steps:
127+
# - uses: actions/[email protected]
128+
# - uses: ./.github/actions/ruby-cache
129+
# - uses: ./.github/actions/xcode-cache
130+
# - name: Build Demo App
131+
# run: bundle exec fastlane build_demo
132+
# env:
133+
# XCODE_VERSION: ${{ matrix.xcode }}
134+
# - uses: 8398a7/action-slack@v3
135+
# with:
136+
# status: ${{ job.status }}
137+
# text: "You shall not pass!"
138+
# job_name: "${{ github.workflow }}: ${{ github.job }}"
139+
# fields: message,commit,author,action,workflow,job,took
140+
# env:
141+
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
142+
# MATRIX_CONTEXT: ${{ toJson(matrix) }}
143+
# if: failure() && github.event_name == 'schedule'
144144

145-
build-xcode15:
146-
name: Build SDKs (Xcode 15.0)
147-
runs-on: macos-13
148-
if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }}
149-
env:
150-
XCODE_VERSION: "15.0.1"
151-
steps:
152-
- name: Connect Bot
153-
uses: webfactory/[email protected]
154-
with:
155-
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
156-
- uses: actions/[email protected]
157-
- uses: ./.github/actions/ruby-cache
158-
- name: List Xcode versions
159-
run: mdfind "kMDItemCFBundleIdentifier = 'com.apple.dt.Xcode'"
160-
timeout-minutes: 25
161-
- name: Build SwiftUI
162-
run: bundle exec fastlane test_ui device:"iPhone 15" build_for_testing:true
163-
timeout-minutes: 25
164-
- name: Build XCFrameworks
165-
run: bundle exec fastlane build_xcframeworks
166-
timeout-minutes: 25
167-
env:
168-
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
169-
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
145+
# build-xcode15:
146+
# name: Build SDKs (Xcode 15.0)
147+
# runs-on: macos-13
148+
# if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }}
149+
# env:
150+
# XCODE_VERSION: "15.0.1"
151+
# steps:
152+
# - name: Connect Bot
153+
# uses: webfactory/[email protected]
154+
# with:
155+
# ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
156+
# - uses: actions/[email protected]
157+
# - uses: ./.github/actions/ruby-cache
158+
# - name: List Xcode versions
159+
# run: mdfind "kMDItemCFBundleIdentifier = 'com.apple.dt.Xcode'"
160+
# timeout-minutes: 25
161+
# - name: Build SwiftUI
162+
# run: bundle exec fastlane test_ui device:"iPhone 15" build_for_testing:true
163+
# timeout-minutes: 25
164+
# - name: Build XCFrameworks
165+
# run: bundle exec fastlane build_xcframeworks
166+
# timeout-minutes: 25
167+
# env:
168+
# MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
169+
# APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
170170

171-
automated-code-review:
172-
name: Automated Code Review
173-
runs-on: macos-13
174-
env:
175-
XCODE_VERSION: "15.0.1"
176-
steps:
177-
- uses: actions/[email protected]
178-
- uses: ./.github/actions/bootstrap
179-
- run: bundle exec fastlane rubocop
180-
- run: ./Scripts/run-linter.sh
181-
- run: bundle exec fastlane pod_lint
171+
# automated-code-review:
172+
# name: Automated Code Review
173+
# runs-on: macos-13
174+
# env:
175+
# XCODE_VERSION: "15.0.1"
176+
# steps:
177+
# - uses: actions/[email protected]
178+
# - uses: ./.github/actions/bootstrap
179+
# - run: bundle exec fastlane rubocop
180+
# - run: ./Scripts/run-linter.sh
181+
# - run: bundle exec fastlane pod_lint

StreamChatSwiftUITestsAppTests/Pages/MessageListPage.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ class MessageListPage {
188188
static func giphyCancelButton(in messageCell: XCUIElement) -> XCUIElement {
189189
attachmentActionButton(in: messageCell, label: "Cancel")
190190
}
191+
192+
static func giphyImage(in messageCell: XCUIElement) -> XCUIElement {
193+
messageCell.otherElements["GiphyAttachmentView"].images.firstMatch
194+
}
191195

192196
static func giphyLabel(in messageCell: XCUIElement) -> XCUIElement {
193197
messageCell.staticTexts["GiphyAttachmentView"]

StreamChatSwiftUITestsAppTests/Robots/UserRobot+Asserts.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ extension UserRobot {
866866
) -> Self {
867867
let cell = messageCell(withIndex: messageCellIndex, file: file, line: line).wait()
868868
XCTAssertTrue(attributes.giphyLabel(in: cell).wait().exists, "Giphy label does not exist")
869-
XCTAssertEqual(0, attributes.giphyButtons(in: cell).count)
869+
XCTAssertTrue(attributes.giphyImage(in: cell).exists, "Giphy image does not exist")
870870
return self
871871
}
872872

StreamChatSwiftUITestsAppTests/Robots/UserRobot.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ extension UserRobot {
362362
typeText("/giphy")
363363
sendMessage(text, waitForAppearance: false)
364364
}
365-
if send { tapOnSendGiphyButton() }
366365
MessageListPage.Attributes.actionButtons().firstMatch.wait()
366+
if send { tapOnSendGiphyButton() }
367367
return self
368368
}
369369

StreamChatSwiftUITestsAppTests/Tests/Ephemeral_Messages_Tests.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,14 @@ final class Ephemeral_Messages_Tests: StreamTestCase {
1313

1414
func test_userObservesAnimatedGiphy_whenUserAddsGiphyMessage() throws {
1515
linkToScenario(withId: 435)
16-
17-
try XCTSkipIf(
18-
ProcessInfo().operatingSystemVersion.majorVersion > 16,
19-
"The test cannot tap on a `Send` button on iOS 17"
20-
)
2116

2217
GIVEN("user opens a channel") {
2318
userRobot
2419
.login()
2520
.openChannel()
2621
}
2722
WHEN("user sends a giphy using giphy command") {
28-
userRobot.sendGiphy()
23+
userRobot.sendGiphy(useComposerCommand: true)
2924
}
3025
THEN("user observes the animated gif") {
3126
userRobot.assertGiphyImage()
@@ -141,11 +136,6 @@ final class Ephemeral_Messages_Tests: StreamTestCase {
141136

142137
func test_userObservesAnimatedGiphy_afterAddingGiphyThroughComposerMenu() throws {
143138
linkToScenario(withId: 441)
144-
145-
try XCTSkipIf(
146-
ProcessInfo().operatingSystemVersion.majorVersion > 16,
147-
"The test cannot tap on a `Send` button on iOS 17"
148-
)
149139

150140
GIVEN("user opens a channel") {
151141
userRobot

0 commit comments

Comments
 (0)