Add XCUITest authoring docs and reusable prompt template
This commit is contained in:
34
docs/templates/XCUITestSuiteTemplate.swift
vendored
Normal file
34
docs/templates/XCUITestSuiteTemplate.swift
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// <Feature>Tests.swift
|
||||
// Tests iOS
|
||||
//
|
||||
// Replace placeholders and move into Tests iOS/ when creating a real suite.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class <Feature>Tests: BaseUITestCase {
|
||||
// Choose fixture: "empty", "single_mood", "week_of_moods"
|
||||
override var seedFixture: String? { "empty" }
|
||||
|
||||
// Override launch behavior only when needed for this feature.
|
||||
// override var skipOnboarding: Bool { false }
|
||||
// override var bypassSubscription: Bool { false }
|
||||
// override var expireTrial: Bool { true }
|
||||
|
||||
func test<Behavior>() {
|
||||
let tabBar = TabBarScreen(app: app)
|
||||
|
||||
// Navigate using screen objects.
|
||||
let day = tabBar.tapDay()
|
||||
|
||||
// Interact using identifier-backed elements and helpers.
|
||||
day.assertMoodHeaderVisible()
|
||||
|
||||
// Add an attachment for triage/debugging.
|
||||
captureScreenshot(name: "<feature_behavior_state>")
|
||||
|
||||
// Assert outcome.
|
||||
XCTAssertTrue(day.moodHeader.exists, "Expected day mood header to exist")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user