Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Savely.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
F25F23C6EEAA47853BFA137D /* StoreScreenshotTourUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D0412010EDA0CEB30538B1 /* StoreScreenshotTourUITests.swift */; };
AA28B8C8B38F312A7623F2D2 /* AutoMoveSuggestionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AFC2151C01A7FBD2947EB51 /* AutoMoveSuggestionTests.swift */; };
DE826483AC71FF3EC2A603B7 /* AutoMoveSuggestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = F774124079B5BEC3DD37C743 /* AutoMoveSuggestion.swift */; };
A11A0002C0DE5AFE10000002 /* AmountParsing.swift in Sources */ = {isa = PBXBuildFile; fileRef = A11A0001C0DE5AFE10000001 /* AmountParsing.swift */; };
Expand Down Expand Up @@ -109,6 +110,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
46D0412010EDA0CEB30538B1 /* StoreScreenshotTourUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreScreenshotTourUITests.swift; sourceTree = "<group>"; };
9AFC2151C01A7FBD2947EB51 /* AutoMoveSuggestionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoMoveSuggestionTests.swift; sourceTree = "<group>"; };
F774124079B5BEC3DD37C743 /* AutoMoveSuggestion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoMoveSuggestion.swift; sourceTree = "<group>"; };
A11A0001C0DE5AFE10000001 /* AmountParsing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmountParsing.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -490,6 +492,7 @@
1DC258212CC07DCF0002DDE3 /* SavelyUITests */ = {
isa = PBXGroup;
children = (
46D0412010EDA0CEB30538B1 /* StoreScreenshotTourUITests.swift */,
1DC258222CC07DCF0002DDE3 /* SavelyUITests.swift */,
1DC258242CC07DCF0002DDE3 /* SavelyUITestsLaunchTests.swift */,
);
Expand Down Expand Up @@ -783,6 +786,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F25F23C6EEAA47853BFA137D /* StoreScreenshotTourUITests.swift in Sources */,
1DC258252CC07DCF0002DDE3 /* SavelyUITestsLaunchTests.swift in Sources */,
1DC258232CC07DCF0002DDE3 /* SavelyUITests.swift in Sources */,
);
Expand Down
67 changes: 67 additions & 0 deletions SavelyUITests/StoreScreenshotTourUITests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// StoreScreenshotTourUITests.swift
// SavelyUITests
//
// Not a test of behaviour — a screenshot tour. Walks the main tabs and the
// "+" sheet and attaches a full-resolution screenshot of each, so App
// Store artwork can be built from real screens:
// xcodebuild test -scheme Savely -only-testing:SavelyUITests/StoreScreenshotTourUITests \
// -destination 'platform=iOS Simulator,name=iPhone 17 Pro' -resultBundlePath build/Tour.xcresult
// xcrun xcresulttool export attachments --path build/Tour.xcresult --output-path build/tour
// Seed the Simulator with real-looking data first (goals, a few expenses/
// incomes) — an empty app makes empty screenshots. Skipped on CI like the
// rest of SavelyUITests.
//

import XCTest

final class StoreScreenshotTourUITests: XCTestCase {

@MainActor
func testTourAttachesEveryMainScreen() throws {
let app = XCUIApplication()
app.launchArguments += ["-isOnboardingComplete", "YES"]
app.launch()

let addButton = app.buttons["Add"]
XCTAssertTrue(addButton.waitForExistence(timeout: 20), "the main tab bar did not appear")
snap(app, "01-home")

for (tab, name) in [("Goals", "02-goals"), ("Money", "03-money"), ("Me", "04-me")] {
app.buttons[tab].firstMatch.tap()
_ = app.buttons[tab].firstMatch.waitForExistence(timeout: 2)
snap(app, name)
}

app.buttons["Home"].firstMatch.tap()
addButton.tap()
XCTAssertTrue(app.staticTexts["What's the move?"].waitForExistence(timeout: 5))
snap(app, "05-plus-sheet")

// Log expense keypad
let logExpense = app.buttons.matching(NSPredicate(format: "label BEGINSWITH 'Log expense'")).firstMatch
if logExpense.waitForExistence(timeout: 2) {
logExpense.tap()
_ = app.staticTexts["Log expense"].waitForExistence(timeout: 3)
for key in ["2", "4", "5"] { app.buttons[key].firstMatch.tap() }
snap(app, "06-log-expense")
app.buttons["Back"].firstMatch.tap()
}

// Scanner (Simulator: no camera → unavailable card, still shows the surface)
let scan = app.buttons.matching(NSPredicate(format: "label BEGINSWITH 'Scan a receipt'")).firstMatch
if scan.waitForExistence(timeout: 2) {
scan.tap()
_ = app.buttons["Choose from Photos"].waitForExistence(timeout: 5)
snap(app, "07-scan-camera")
app.buttons["Close"].firstMatch.tap()
}
}

private func snap(_ app: XCUIApplication, _ name: String) {
let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = name
attachment.lifetime = .keepAlways
add(attachment)
}
}
Loading
Loading