Add XCUITest authoring docs and templates
This commit is contained in:
48
XCUITestSuiteTemplate.swift
Normal file
48
XCUITestSuiteTemplate.swift
Normal file
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// __FeatureName__Tests.swift
|
||||
// SportsTimeUITests
|
||||
//
|
||||
// Copy this file into SportsTimeUITests/Tests and rename placeholders.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class __FeatureName__Tests: BaseUITestCase {
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
@MainActor
|
||||
private func openHome() -> HomeScreen {
|
||||
let home = HomeScreen(app: app)
|
||||
home.waitForLoad()
|
||||
return home
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private func openWizard() -> TripWizardScreen {
|
||||
let home = openHome()
|
||||
home.tapStartPlanning()
|
||||
|
||||
let wizard = TripWizardScreen(app: app)
|
||||
wizard.waitForLoad()
|
||||
return wizard
|
||||
}
|
||||
|
||||
// MARK: - Tests
|
||||
|
||||
/// Replace with test case ID and behavior, e.g. F-200.
|
||||
@MainActor
|
||||
func testF___BehaviorName() {
|
||||
let wizard = openWizard()
|
||||
wizard.selectDateRangeMode()
|
||||
|
||||
// Add scenario actions
|
||||
// wizard.selectSport("mlb")
|
||||
// wizard.selectRegion("central")
|
||||
|
||||
// Add assertions
|
||||
XCTAssertTrue(wizard.planTripButton.exists, "Plan button should be visible")
|
||||
|
||||
captureScreenshot(named: "F___-BehaviorName")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user