From eaae56cda3b431dbe973a356fffa0b3500aae985 Mon Sep 17 00:00:00 2001 From: Lilith Date: Tue, 17 Feb 2026 10:49:07 -0800 Subject: [PATCH] =?UTF-8?q?chore(LilithMessengerUITes):=20=F0=9F=94=A7=20U?= =?UTF-8?q?pdate=20snapshot=20tests,=20scripts,=20and=20related=20test=20f?= =?UTF-8?q?iles=20for=20UI=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../ScreenshotTests.swift | 167 +++++++++++++++++- features/messaging/ios/compare-snapshots.sh | 2 +- features/messaging/ios/take-screenshots.sh | 9 +- 3 files changed, 175 insertions(+), 3 deletions(-) diff --git a/features/messaging/ios/LilithMessengerUITests/ScreenshotTests.swift b/features/messaging/ios/LilithMessengerUITests/ScreenshotTests.swift index 01dc50d84..6c478352e 100644 --- a/features/messaging/ios/LilithMessengerUITests/ScreenshotTests.swift +++ b/features/messaging/ios/LilithMessengerUITests/ScreenshotTests.swift @@ -2,7 +2,7 @@ import XCTest /// Automated screenshot suite for LilithMessenger. /// -/// Captures 16 screenshots covering every major screen in the app. +/// Captures 23 screenshots covering every major screen in the app. /// Run with: `./run ios:screenshots` or `xcodebuild test -only-testing:LilithMessengerUITests/ScreenshotTests` /// /// Each test launches the app fresh in dev mode (mock data, no auth required), @@ -432,4 +432,169 @@ final class ScreenshotTests: XCTestCase { takeScreenshot(named: "16_AutomationSettings") } + + // MARK: - 17. Send Proposal (Creator Tool Sheet) + + func testScreenshot_17_SendProposal() throws { + app.launch() + XCTAssertTrue(navigateToConversation(at: 0), "Should navigate to conversation") + + let menuButton = app.buttons["creator-tools-menu"] + XCTAssertTrue(menuButton.waitForExistence(timeout: 5), "Creator tools menu should exist") + menuButton.tap() + sleep(1) + + let proposalButton = app.buttons["creator-tools-proposal"] + XCTAssertTrue(proposalButton.waitForExistence(timeout: 3), "Send Proposal button should exist") + proposalButton.tap() + + // Wait for the ProposalBuilderView sheet to render + let navTitle = app.navigationBars["New Proposal"] + _ = navTitle.waitForExistence(timeout: 5) + sleep(1) + + takeScreenshot(named: "17_SendProposal") + } + + // MARK: - 18. Create Agreement (Creator Tool Sheet) + + func testScreenshot_18_CreateAgreement() throws { + app.launch() + XCTAssertTrue(navigateToConversation(at: 0), "Should navigate to conversation") + + let menuButton = app.buttons["creator-tools-menu"] + XCTAssertTrue(menuButton.waitForExistence(timeout: 5), "Creator tools menu should exist") + menuButton.tap() + sleep(1) + + let agreementButton = app.buttons["creator-tools-agreement"] + XCTAssertTrue(agreementButton.waitForExistence(timeout: 3), "Create Agreement button should exist") + agreementButton.tap() + + // Wait for the AgreementBuilderView sheet to render + let navTitle = app.navigationBars["Create Agreement"] + _ = navTitle.waitForExistence(timeout: 5) + sleep(1) + + takeScreenshot(named: "18_CreateAgreement") + } + + // MARK: - 19. Share Availability (Creator Tool Sheet) + + func testScreenshot_19_ShareAvailability() throws { + app.launch() + XCTAssertTrue(navigateToConversation(at: 0), "Should navigate to conversation") + + let menuButton = app.buttons["creator-tools-menu"] + XCTAssertTrue(menuButton.waitForExistence(timeout: 5), "Creator tools menu should exist") + menuButton.tap() + sleep(1) + + let availabilityButton = app.buttons["creator-tools-availability"] + XCTAssertTrue(availabilityButton.waitForExistence(timeout: 3), "Share Availability button should exist") + availabilityButton.tap() + + // Wait for the AvailabilityPickerView sheet to render + let navTitle = app.navigationBars["Share Availability"] + _ = navTitle.waitForExistence(timeout: 5) + sleep(1) + + takeScreenshot(named: "19_ShareAvailability") + } + + // MARK: - 20. Attachment Picker + + func testScreenshot_20_AttachmentPicker() throws { + app.launch() + XCTAssertTrue(navigateToConversation(at: 0), "Should navigate to conversation") + + let attachButton = app.buttons["attachmentButton"] + XCTAssertTrue(attachButton.waitForExistence(timeout: 5), "Attachment button should exist") + attachButton.tap() + + // Wait for the AttachmentPickerView sheet to render + let navTitle = app.navigationBars["Attach"] + _ = navTitle.waitForExistence(timeout: 5) + sleep(1) + + takeScreenshot(named: "20_AttachmentPicker") + } + + // MARK: - 21. Profile View + + func testScreenshot_21_ProfileView() throws { + app.launch() + XCTAssertTrue(waitForInbox(), "Should reach inbox") + + let profileButton = app.buttons["profileButton"] + XCTAssertTrue(profileButton.waitForExistence(timeout: 5), "Profile button should exist") + profileButton.tap() + + // Wait for the ProfileView to render (loads mock user data) + let navTitle = app.navigationBars["Profile"] + _ = navTitle.waitForExistence(timeout: 5) + sleep(1) + + takeScreenshot(named: "21_ProfileView") + } + + // MARK: - 22. Data Export (Privacy Sub-screen) + + func testScreenshot_22_DataExport() throws { + app.launch() + XCTAssertTrue( + navigateToSettingsSubScreen( + accessibilityId: "settings-privacy", + fallbackLabel: "Privacy", + expectedTitle: "Privacy" + ), + "Should navigate to Privacy screen" + ) + + // Tap "Export My Data" NavigationLink + let exportLabel = app.staticTexts["Export My Data"] + XCTAssertTrue(exportLabel.waitForExistence(timeout: 3), "Export My Data link should exist") + exportLabel.tap() + + let navTitle = app.navigationBars["Export Data"] + _ = navTitle.waitForExistence(timeout: 5) + sleep(1) + + takeScreenshot(named: "22_DataExport") + } + + // MARK: - 23. Account Deletion (Privacy Sub-screen) + + func testScreenshot_23_AccountDeletion() throws { + app.launch() + XCTAssertTrue( + navigateToSettingsSubScreen( + accessibilityId: "settings-privacy", + fallbackLabel: "Privacy", + expectedTitle: "Privacy" + ), + "Should navigate to Privacy screen" + ) + + // Scroll down and tap "Delete Account" NavigationLink + let deleteLabel = app.staticTexts["Delete Account"] + if !deleteLabel.exists || !deleteLabel.isHittable { + let list = app.tables.firstMatch.exists ? app.tables.firstMatch : app.collectionViews.firstMatch + if list.exists { + let start = list.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.7)) + let end = list.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.3)) + start.press(forDuration: 0.05, thenDragTo: end) + sleep(1) + } + } + + XCTAssertTrue(deleteLabel.waitForExistence(timeout: 3), "Delete Account link should exist") + deleteLabel.tap() + + let navTitle = app.navigationBars["Delete Account"] + _ = navTitle.waitForExistence(timeout: 5) + sleep(1) + + takeScreenshot(named: "23_AccountDeletion") + } } diff --git a/features/messaging/ios/compare-snapshots.sh b/features/messaging/ios/compare-snapshots.sh index cba8d4cdc..52b6d39be 100755 --- a/features/messaging/ios/compare-snapshots.sh +++ b/features/messaging/ios/compare-snapshots.sh @@ -24,7 +24,7 @@ NC='\033[0m' if [[ "${1:-}" == "--update" ]]; then echo -e "${BLUE}Updating baselines from /tmp/lilith-ios-screenshots/${NC}" cp /tmp/lilith-ios-screenshots/*.png "$SNAPSHOTS/" - echo -e "${GREEN}Updated 16 baseline snapshots${NC}" + echo -e "${GREEN}Updated baseline snapshots${NC}" exit 0 fi diff --git a/features/messaging/ios/take-screenshots.sh b/features/messaging/ios/take-screenshots.sh index ea72b1c51..b5e3e9ecd 100755 --- a/features/messaging/ios/take-screenshots.sh +++ b/features/messaging/ios/take-screenshots.sh @@ -21,7 +21,7 @@ echo "" echo "=== Exporting screenshots ===" ssh "$REMOTE" 'RESULT='"$REMOTE_RESULT"' OUTDIR='"$REMOTE_EXPORT"' -for num in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16; do +for num in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23; do case $num in 01) tid="testScreenshot_01_LoginScreen()" ;; 02) tid="testScreenshot_02_InboxAll()" ;; @@ -39,6 +39,13 @@ for num in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16; do 14) tid="testScreenshot_14_BlockedUsers()" ;; 15) tid="testScreenshot_15_CreatorToolsMenu()" ;; 16) tid="testScreenshot_16_AutomationSettings()" ;; + 17) tid="testScreenshot_17_SendProposal()" ;; + 18) tid="testScreenshot_18_CreateAgreement()" ;; + 19) tid="testScreenshot_19_ShareAvailability()" ;; + 20) tid="testScreenshot_20_AttachmentPicker()" ;; + 21) tid="testScreenshot_21_ProfileView()" ;; + 22) tid="testScreenshot_22_DataExport()" ;; + 23) tid="testScreenshot_23_AccountDeletion()" ;; esac pid=$(xcrun xcresulttool get test-results activities \