This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| android { | |
| ... | |
| composeOptions { | |
| kotlinCompilerExtensionVersion "0.1.0-dev04" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies { | |
| ... | |
| implementation 'androidx.compose:compose-compiler:0.1.0-dev04' | |
| implementation 'androidx.compose:compose-runtime:0.1.0-dev04' | |
| implementation 'androidx.ui:ui-layout:0.1.0-dev04' | |
| implementation 'androidx.ui:ui-framework:0.1.0-dev04' | |
| implementation 'androidx.ui:ui-layout:0.1.0-dev04' | |
| implementation 'androidx.ui:ui-foundation:0.1.0-dev04' | |
| implementation 'androidx.ui:ui-animation:0.1.0-dev04' | |
| implementation 'androidx.ui:ui-tooling:0.1.0-dev04' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @LargeTest | |
| @RunWith(AndroidJUnit4::class) | |
| class SignInActivityTest123 { | |
| @Rule | |
| @JvmField | |
| var mActivityTestRule = ActivityTestRule(SignInActivity::class.java) | |
| @Test | |
| fun signInActivityTest123() { | |
| val appCompatEditText = onView( | |
| allOf(withId(R.id.email), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Criteria | Appium | Espresso | UiAutomator | |
|---|---|---|---|---|
| Execution Time | Slow (test case: 12.154 sec) | Fast (test case: 0.967 sec) | Medium (test case: 8.743 sec) | |
| Supported languages | Java, Kotlin, C#, JavaScript, Python, Ruby | Java, Kotlin | Java, Kotlin | |
| Test Type | Black Box | Gray Box | Black Box | |
| Setup | Hard (separate module, capabilities (device, app, etc.)) | Easy (part of the project) | Easy (part of the project) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AppiumSignInTest { | |
| private lateinit var appiumDriver: AppiumDriver<AndroidElement> | |
| @Before | |
| fun setup() { | |
| val capabilities = DesiredCapabilities() | |
| capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android") | |
| capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "emulator-5554") | |
| capabilities.setCapability("appPackage", "com.alex.mapnotes") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @RunWith(AndroidJUnit4::class) | |
| class UiAutomatorSignInTest { | |
| companion object { | |
| const val LAUNCH_TIMEOUT = 2_000L | |
| const val APP_PACKAGE = "com.alex.mapnotes" | |
| } | |
| private val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @RunWith(AndroidJUnit4::class) | |
| class EspressoSignInTest { | |
| @Rule @JvmField | |
| val activityRule = ActivityTestRule<SignInActivity>(SignInActivity::class.java) | |
| @Test | |
| fun shouldDisplaySinInErrorWhenEmailIsIncorrect() { | |
| val incorrectEmail = "test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Analytics { | |
| private var startSessionTimestamp: Long = -1 | |
| private val reporters = mutableListOf<AnalyticsReporter>() | |
| fun addReporter(reporter: AnalyticsReporter) { | |
| reporters.add(reporter) | |
| } | |
| fun startSession() { | |
| startSessionTimestamp = Date().time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies { | |
| ... | |
| // Robolectric | |
| testImplementation "org.robolectric:robolectric:$robolectric_version" // 4.1 | |
| // Android test runner and rules | |
| androidTestImplementation "androidx.test:runner:$test_runner_version" // 1.1.0 | |
| androidTestImplementation "androidx.test:core:$test_core_version" // 1.1.0 | |
| androidTestImplementation "androidx.test.ext:junit:$test_junit_version" // 1.1.0 | |
| androidTestImplementation "androidx.test:rules:$test_rules_version" // 1.1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object TestDataFactory { | |
| fun randomString(): String { | |
| return UUID.randomUUID().toString() | |
| } | |
| fun randomDouble(): Double { | |
| return Math.random() | |
| } |