Add 4 passing UI tests (batch 8): sharing template rendering

- TC-111: Year share Gradient template renders in SharingStylePickerView
- TC-112: Year share Color Block template renders after swipe
- TC-116: Month share Clean Calendar template renders
- TC-117: Month share Stacked Bars template renders after swipe

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-20 10:52:53 -06:00
parent c701bf9d3b
commit f495ae90fa
4 changed files with 181 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
//
// MonthShareTemplateTests.swift
// Tests iOS
//
// TC-116: This Month - Clean Calendar sharing template renders.
// TC-117: This Month - Stacked Bars sharing template renders.
//
import XCTest
final class MonthShareTemplateTests: BaseUITestCase {
override var seedFixture: String? { "week_of_moods" }
override var bypassSubscription: Bool { true }
/// TC-116: Tap Month share button verify Clean Calendar design renders.
func testMonthShare_CleanCalendarTemplate_Renders() {
let tabBar = TabBarScreen(app: app)
tabBar.tapMonth()
// Wait for month view to load
_ = app.waitForExistence(timeout: 3)
// Find the month share button
let shareButton = app.element(UITestID.Month.shareButton)
XCTAssertTrue(
shareButton.waitForExistence(timeout: 8),
"Month share button should exist"
)
shareButton.tapWhenReady()
// Verify the SharingStylePickerView sheet appears
let exitButton = app.buttons["Exit"].firstMatch
XCTAssertTrue(
exitButton.waitForExistence(timeout: 5),
"Sharing picker Exit button should appear"
)
// First design should be "Clean Calendar"
let cleanCalendarLabel = app.staticTexts["Clean Calendar"].firstMatch
XCTAssertTrue(
cleanCalendarLabel.waitForExistence(timeout: 5),
"Clean Calendar design label should be visible"
)
captureScreenshot(name: "month_share_clean_calendar")
// Close the picker
exitButton.tap()
}
/// TC-117: Swipe to second design verify Stacked Bars design renders.
func testMonthShare_StackedBarsTemplate_Renders() {
let tabBar = TabBarScreen(app: app)
tabBar.tapMonth()
_ = app.waitForExistence(timeout: 3)
let shareButton = app.element(UITestID.Month.shareButton)
XCTAssertTrue(
shareButton.waitForExistence(timeout: 8),
"Month share button should exist"
)
shareButton.tapWhenReady()
let exitButton = app.buttons["Exit"].firstMatch
XCTAssertTrue(
exitButton.waitForExistence(timeout: 5),
"Sharing picker Exit button should appear"
)
// Swipe left to get to the "Stacked Bars" design
app.swipeLeft()
_ = app.waitForExistence(timeout: 1)
let stackedBarsLabel = app.staticTexts["Stacked Bars"].firstMatch
XCTAssertTrue(
stackedBarsLabel.waitForExistence(timeout: 5),
"Stacked Bars design label should be visible after swiping"
)
captureScreenshot(name: "month_share_stacked_bars")
// Close the picker
exitButton.tap()
}
}

View File

@@ -0,0 +1,85 @@
//
// YearShareTemplateTests.swift
// Tests iOS
//
// TC-111: All Time Moods - Gradient sharing template renders.
// TC-112: All Time Moods - Color Block sharing template renders.
//
import XCTest
final class YearShareTemplateTests: BaseUITestCase {
override var seedFixture: String? { "week_of_moods" }
override var bypassSubscription: Bool { true }
/// TC-111: Tap Year share button verify Gradient design renders in SharingStylePickerView.
func testYearShare_GradientTemplate_Renders() {
let tabBar = TabBarScreen(app: app)
tabBar.tapYear()
// Wait for year view to load and find the share button
let shareButton = app.element(UITestID.Year.shareButton)
XCTAssertTrue(
shareButton.waitForExistence(timeout: 8),
"Year share button should exist"
)
shareButton.tapWhenReady()
// Verify the SharingStylePickerView sheet appears
let exitButton = app.buttons["Exit"].firstMatch
XCTAssertTrue(
exitButton.waitForExistence(timeout: 5),
"Sharing picker Exit button should appear"
)
// Verify the title "All Time Moods" appears (YearView sends "All Time Moods")
// Note: YearView creates SharePickerData with title based on year number,
// but the first design is "Gradient"
let gradientLabel = app.staticTexts["Gradient"].firstMatch
XCTAssertTrue(
gradientLabel.waitForExistence(timeout: 5),
"Gradient design label should be visible"
)
captureScreenshot(name: "year_share_gradient")
// Close the picker
exitButton.tap()
}
/// TC-112: Swipe to second design verify Color Block design renders.
func testYearShare_ColorBlockTemplate_Renders() {
let tabBar = TabBarScreen(app: app)
tabBar.tapYear()
let shareButton = app.element(UITestID.Year.shareButton)
XCTAssertTrue(
shareButton.waitForExistence(timeout: 8),
"Year share button should exist"
)
shareButton.tapWhenReady()
let exitButton = app.buttons["Exit"].firstMatch
XCTAssertTrue(
exitButton.waitForExistence(timeout: 5),
"Sharing picker Exit button should appear"
)
// Swipe left to get to the "Color Block" design (second page in TabView pager)
app.swipeLeft()
_ = app.waitForExistence(timeout: 1)
let colorBlockLabel = app.staticTexts["Color Block"].firstMatch
XCTAssertTrue(
colorBlockLabel.waitForExistence(timeout: 5),
"Color Block design label should be visible after swiping"
)
captureScreenshot(name: "year_share_color_block")
// Close the picker
exitButton.tap()
}
}