From a8bc26dc93c57e526d5c56bc0adb116415e8f26a Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 30 Sep 2026 10:43:28 +0300 Subject: [PATCH] Fix various UI test snapshot issues. --- UITests/Sources/BugReportTests.swift | 6 +++--- UITests/Sources/PollFormScreenTests.swift | 7 +------ .../Application/bugReport.testReportText-iPad-en-GB.png | 3 --- .../Application/bugReport.testReportText-iPhone-en-GB.png | 3 --- .../pollFormScreen.testFilledPoll-iPad-en-GB.png | 3 --- .../pollFormScreen.testFilledPoll-iPhone-en-GB.png | 3 --- .../Application/startChat.testFlow-iPhone-en-GB-8.png | 4 ++-- 7 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 UITests/Sources/__Snapshots__/Application/bugReport.testReportText-iPad-en-GB.png delete mode 100644 UITests/Sources/__Snapshots__/Application/bugReport.testReportText-iPhone-en-GB.png delete mode 100644 UITests/Sources/__Snapshots__/Application/pollFormScreen.testFilledPoll-iPad-en-GB.png delete mode 100644 UITests/Sources/__Snapshots__/Application/pollFormScreen.testFilledPoll-iPhone-en-GB.png diff --git a/UITests/Sources/BugReportTests.swift b/UITests/Sources/BugReportTests.swift index f79419965..9b021b994 100644 --- a/UITests/Sources/BugReportTests.swift +++ b/UITests/Sources/BugReportTests.swift @@ -17,20 +17,20 @@ class BugReportTests: XCTestCase { try await app.assertScreenshot() } - func testReportText() async throws { + func testReportText() { let app = Application.launch(.bugReport) // Type 4 characters and the send button should be disabled. app.textFields[A11yIdentifiers.bugReportScreen.report].clearAndTypeText("Text", app: app) XCTAssert(app.switches[A11yIdentifiers.bugReportScreen.sendLogs].isOn) XCTAssert(!app.switches[A11yIdentifiers.bugReportScreen.canContact].isOn) - try await app.assertScreenshot() + XCTAssertFalse(app.buttons["Send"].isEnabled) // Type more than 4 characters and send the button should become enabled. app.textFields[A11yIdentifiers.bugReportScreen.report].clearAndTypeText("Longer text", app: app) XCTAssert(app.switches[A11yIdentifiers.bugReportScreen.sendLogs].isOn) XCTAssert(!app.switches[A11yIdentifiers.bugReportScreen.canContact].isOn) - try await app.assertScreenshot() + XCTAssertTrue(app.buttons["Send"].isEnabled) } } diff --git a/UITests/Sources/PollFormScreenTests.swift b/UITests/Sources/PollFormScreenTests.swift index 579d2d7af..294f292ef 100644 --- a/UITests/Sources/PollFormScreenTests.swift +++ b/UITests/Sources/PollFormScreenTests.swift @@ -15,7 +15,7 @@ class PollFormScreenUITests: XCTestCase { try await app.assertScreenshot() } - func testFilledPoll() async throws { + func testFilledPoll() { let app = Application.launch(.createPoll) let questionTextField = app.textFields[A11yIdentifiers.pollFormScreen.question] questionTextField.tap(.center) @@ -29,13 +29,8 @@ class PollFormScreenUITests: XCTestCase { option2TextField.tap(.center) option2TextField.typeText("No") - // Dismiss the keyboard - app.swipeDown() - let createButton = app.buttons[A11yIdentifiers.pollFormScreen.submit] XCTAssertTrue(createButton.isEnabled) - - try await app.assertScreenshot() } func testMaxOptions() async throws { diff --git a/UITests/Sources/__Snapshots__/Application/bugReport.testReportText-iPad-en-GB.png b/UITests/Sources/__Snapshots__/Application/bugReport.testReportText-iPad-en-GB.png deleted file mode 100644 index 6f084c0b4..000000000 --- a/UITests/Sources/__Snapshots__/Application/bugReport.testReportText-iPad-en-GB.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:89a6fb1d60c964006efd0e9d3fa02257abe386e1cea5165b0c52d17583d8955f -size 146867 diff --git a/UITests/Sources/__Snapshots__/Application/bugReport.testReportText-iPhone-en-GB.png b/UITests/Sources/__Snapshots__/Application/bugReport.testReportText-iPhone-en-GB.png deleted file mode 100644 index 79899851b..000000000 --- a/UITests/Sources/__Snapshots__/Application/bugReport.testReportText-iPhone-en-GB.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:56e2ad288aaa0bcb52d2f0902f08a918b13e5a798a7bcc4e643ac0380212c225 -size 185887 diff --git a/UITests/Sources/__Snapshots__/Application/pollFormScreen.testFilledPoll-iPad-en-GB.png b/UITests/Sources/__Snapshots__/Application/pollFormScreen.testFilledPoll-iPad-en-GB.png deleted file mode 100644 index afed96576..000000000 --- a/UITests/Sources/__Snapshots__/Application/pollFormScreen.testFilledPoll-iPad-en-GB.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:740080b21171a941fc98e68bee3e84b0bfef9a37e161222d80efb0a9eb0fc579 -size 186398 diff --git a/UITests/Sources/__Snapshots__/Application/pollFormScreen.testFilledPoll-iPhone-en-GB.png b/UITests/Sources/__Snapshots__/Application/pollFormScreen.testFilledPoll-iPhone-en-GB.png deleted file mode 100644 index 38e316a5d..000000000 --- a/UITests/Sources/__Snapshots__/Application/pollFormScreen.testFilledPoll-iPhone-en-GB.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba5c5a3d23dc84febc6b7a92548ab74a4030c547e96bc64443fb5d9eb46c3050 -size 208498 diff --git a/UITests/Sources/__Snapshots__/Application/startChat.testFlow-iPhone-en-GB-8.png b/UITests/Sources/__Snapshots__/Application/startChat.testFlow-iPhone-en-GB-8.png index 794de95b8..c5a1a3f55 100644 --- a/UITests/Sources/__Snapshots__/Application/startChat.testFlow-iPhone-en-GB-8.png +++ b/UITests/Sources/__Snapshots__/Application/startChat.testFlow-iPhone-en-GB-8.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1ea6ee065d0d9fbaace3e79207788c8559d6e82a56f6f78cd6b704dcd52c14b2 -size 126699 +oid sha256:898fb951cf9d784f8beae45dc1719bc482e1b631a0173b2bbb4ee99b65c8d80a +size 126784