Skip to content

Commit d182d56

Browse files
[CI] Fix flaky tests (#654)
1 parent 929b434 commit d182d56

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

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)