UI Tests¶
AutoMobile will be able to record and playback sessions via IDE integrations.
Recording a Test¶
See the design docs for Android & iOS. For the moment this is still WIP.
Example Test¶
steps:
- tool: launchApp
appId: com.example.app
- tool: tapOn
action: tap
text: "Login"
- tool: inputText
text: "user@example.com"
@RunWith(AutoMobileRunner::class)
class ClockAppTest {
@Test
fun `Given we have a Clock app we should be able to set an alarm`() {
val result = AutoMobilePlan("test-plans/clock-set-alarm.yaml").execute()
assertTrue(result.success)
}
}
import XCTest
@testable import XCTestRunner
final class RemindersTests: AutoMobileTestCase {
func testLaunchRemindersPlan() throws {
let result = try executePlan("launch-reminders-app.yaml")
}
}
Running a Test¶
AutoMobile supports Android with JUnitRunner and iOS with XCTestRunner. We avoid conventional UI test harnesses like Android’s connectedAndroidTest and iOS’s XCUITest in favor of proxying all device setup and interaction via AutoMobile. Therefore you can think of AutoMobile’s tests as closer to UI snapshot tests that can run as JVM or XCTest unit tests.
This approach allows AutoMobile to manage device pooling, support multi-client tests, and automatically optimize test selection based on timing data.
Related¶
- JUnitRunner - Test framework details
- IDE Plugin - Recording and debugging