Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue199 UI test #224

Merged
merged 13 commits into from
Oct 25, 2023
37 changes: 25 additions & 12 deletions Basic-Car-Maintenance-UITests/BasicCarMaintenanceUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,32 @@
import XCTest

final class BasicCarMaintenanceUITests: XCTestCase {

override func setUpWithError() throws {

let app = XCUIApplication()

override func setUp() {
continueAfterFailure = false
}

override func tearDownWithError() throws {
}

func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()

// Use XCTAssert and related functions to verify your tests produce the correct results.
}

func testAddVehicle() {
// Navigate to the AddVehicleView
app.buttons["Settings"].tap()
app.collectionViews.buttons["Add Vehicle"].tap()

let nameTextField = app.textFields["Vehicle Name"]
nameTextField.tap()
nameTextField.typeText("My Car")

let makeTextField = app.textFields["Vehicle Make"]
makeTextField.tap()
makeTextField.typeText("Toyota")

let modelTextField = app.textFields["Vehicle Model"]
modelTextField.tap()
modelTextField.typeText("Camry")

app.buttons["Add"].tap()
}

}
Loading