import XCTest
final class UITestingSwiftUIUITests: XCTestCase {
var app: XCUIApplication!
override func setUpWithError() throws {
continueAfterFailure = false
app = XCUIApplication()
app.launch()
}
func testAddTask() throws {
let addTaskTab = app.tabBars.buttons["Add Task"]
addTaskTab.tap()
let textField = app.textFields["Enter task"]
textField.tap()
textField.typeText("New Task")
// Dismiss the keyboard
app.buttons["Return"].tap()
let addTaskButton = app.buttons["AddTaskButton"]
addTaskButton.tap()
app.tabBars.buttons["Tasks"].tap()
XCTAssertTrue(app.staticTexts["New Task"].exists)
}
}
-
Notifications
You must be signed in to change notification settings - Fork 0
UI testing SwiftUI views using XCTest Framework
YamamotoDesu/UITestingSwiftUI
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
UI testing SwiftUI views using XCTest Framework
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published