Create the GPT Driver instance and start the session
val sdkInstance = GptDriver(
"<api_key>",
Platform.Android,
"http://10.0.2.2:4723/wd/hub"
)
Use execute method to perform AI-driven steps:
sdkInstance.execute("Tap on the home button and verify it leads to the main screen")
Simple test example:
class TestWithGptDriver {
@get:Rule
val activityRule = ActivityScenarioRule(MainActivity::class.java)
private lateinit var sdkInstance: GptDriver
@Before
fun setUp() {
sdkInstance = GptDriver(
"<api_key>",
Platform.Android,
"http://10.0.2.2:4723/wd/hub"
)
}
@Test
fun basicLoginTest() {
sdkInstance.execute("Log into the app with credentials: username=test, password=test")
sdkInstance.assertCondition("You are on the home screen")
sdkInstance.setSessionStatus("success")
}
}