diff --git a/StreamChatSwiftUITestsAppTests/Pages/MessageListPage.swift b/StreamChatSwiftUITestsAppTests/Pages/MessageListPage.swift index c2a93582..a0b06971 100644 --- a/StreamChatSwiftUITestsAppTests/Pages/MessageListPage.swift +++ b/StreamChatSwiftUITestsAppTests/Pages/MessageListPage.swift @@ -188,6 +188,10 @@ class MessageListPage { static func giphyCancelButton(in messageCell: XCUIElement) -> XCUIElement { attachmentActionButton(in: messageCell, label: "Cancel") } + + static func giphyImage(in messageCell: XCUIElement) -> XCUIElement { + messageCell.otherElements["GiphyAttachmentView"].images.firstMatch + } static func giphyLabel(in messageCell: XCUIElement) -> XCUIElement { messageCell.staticTexts["GiphyAttachmentView"] diff --git a/StreamChatSwiftUITestsAppTests/Robots/UserRobot+Asserts.swift b/StreamChatSwiftUITestsAppTests/Robots/UserRobot+Asserts.swift index 455506a4..dbd33f6d 100644 --- a/StreamChatSwiftUITestsAppTests/Robots/UserRobot+Asserts.swift +++ b/StreamChatSwiftUITestsAppTests/Robots/UserRobot+Asserts.swift @@ -866,7 +866,7 @@ extension UserRobot { ) -> Self { let cell = messageCell(withIndex: messageCellIndex, file: file, line: line).wait() XCTAssertTrue(attributes.giphyLabel(in: cell).wait().exists, "Giphy label does not exist") - XCTAssertEqual(0, attributes.giphyButtons(in: cell).count) + XCTAssertTrue(attributes.giphyImage(in: cell).exists, "Giphy image does not exist") return self } diff --git a/StreamChatSwiftUITestsAppTests/Robots/UserRobot.swift b/StreamChatSwiftUITestsAppTests/Robots/UserRobot.swift index 739a3911..14e4c913 100644 --- a/StreamChatSwiftUITestsAppTests/Robots/UserRobot.swift +++ b/StreamChatSwiftUITestsAppTests/Robots/UserRobot.swift @@ -362,8 +362,8 @@ extension UserRobot { typeText("/giphy") sendMessage(text, waitForAppearance: false) } - if send { tapOnSendGiphyButton() } MessageListPage.Attributes.actionButtons().firstMatch.wait() + if send { tapOnSendGiphyButton() } return self } diff --git a/StreamChatSwiftUITestsAppTests/Tests/Ephemeral_Messages_Tests.swift b/StreamChatSwiftUITestsAppTests/Tests/Ephemeral_Messages_Tests.swift index 161b61e5..0c87ecc8 100644 --- a/StreamChatSwiftUITestsAppTests/Tests/Ephemeral_Messages_Tests.swift +++ b/StreamChatSwiftUITestsAppTests/Tests/Ephemeral_Messages_Tests.swift @@ -13,11 +13,6 @@ final class Ephemeral_Messages_Tests: StreamTestCase { func test_userObservesAnimatedGiphy_whenUserAddsGiphyMessage() throws { linkToScenario(withId: 435) - - try XCTSkipIf( - ProcessInfo().operatingSystemVersion.majorVersion > 16, - "The test cannot tap on a `Send` button on iOS 17" - ) GIVEN("user opens a channel") { userRobot @@ -25,7 +20,7 @@ final class Ephemeral_Messages_Tests: StreamTestCase { .openChannel() } WHEN("user sends a giphy using giphy command") { - userRobot.sendGiphy() + userRobot.sendGiphy(useComposerCommand: true) } THEN("user observes the animated gif") { userRobot.assertGiphyImage() @@ -141,11 +136,6 @@ final class Ephemeral_Messages_Tests: StreamTestCase { func test_userObservesAnimatedGiphy_afterAddingGiphyThroughComposerMenu() throws { linkToScenario(withId: 441) - - try XCTSkipIf( - ProcessInfo().operatingSystemVersion.majorVersion > 16, - "The test cannot tap on a `Send` button on iOS 17" - ) GIVEN("user opens a channel") { userRobot