Usage
import gptd_swiftimport XCTest
import gptd_swift
@MainActor
final class DemoUITests: XCTestCase {
var app: XCUIApplication!
var gptDriver: GptDriver!
override func setUpWithError() throws {
continueAfterFailure = false
app = XCUIApplication()
app.launch()
// Init gpt driver by passing the XCUIApplication
gptDriver = GptDriver(
apiKey: "<api_key>",
nativeApp: app
)
}
override func tearDownWithError() throws {
app = nil
}
func testNavigationToSecondScreen() async throws {
try await gptDriver.execute("Tap on the Go to Second Screen button")
try await gptDriver.execute("Check if you can see a screen with a second screen headline")
}
}
Last updated