secant-android-wallet/ui-screenshot-test/build.gradle.kts

98 lines
2.7 KiB
Plaintext
Raw Normal View History

plugins {
id("com.android.test")
kotlin("android")
id("secant.android-build-conventions")
id("wtf.emulator.gradle")
id("secant.emulator-wtf-conventions")
}
// Force orchestrator to be used for this module, because we need cleared state to generate screenshots
val isOrchestratorEnabled = true
android {
namespace = "co.electroniccoin.zcash.ui.screenshot"
// Target needs to be set to com.android.application type module
targetProjectPath = ":${projects.app.name}"
// Run tests in this module
experimentalProperties["android.experimental.self-instrumenting"] = true
defaultConfig {
if (isOrchestratorEnabled) {
testInstrumentationRunnerArguments["clearPackageData"] = "true"
}
testInstrumentationRunner = "co.electriccoin.zcash.test.ZcashUiTestRunner"
}
// Define the same flavors as in app module
flavorDimensions.add("network")
productFlavors {
create("zcashtestnet") {
dimension = "network"
}
create("zcashmainnet") {
dimension = "network"
}
}
[#599] Macrobenchmark test module * Temporary enable FTL test * Enable emulator.wft tests for ui-integration-test module on CI * Rebase onto main * Test Fladle configuration for ui-integration-test module * Fix Fladle for ui-integration-test module * Rename ui-integration-test module flade configuration * Disable again FTL action from PRs * Clear support for FTL from ui-integration-test module * Refactor the emulator.wtf support across our modules. * [#599] Macrobenchmark test module - Created new dedicated macrobenchmark test module - Updated related Architecture and Setup documentation - Connected to app module - New benchmark build type - Related run configuration above custom Gradle task - Basic startup benchmark test included * Benchmark build variant simplification * Run benchmarking simplification * Documentation update. * New property IS_SIGN_RELEASE_BUILD_WITH_DEBUG_KEY - It enables signing the release build with debug key configuration. Default value is false. - First, we check if we can sign it with release configs, otherwise with debug. - Documentation updated. * Benchmarking documentation update * Adds support for Android SDK 32 and 33 - Bumped benchmark library to the latest alpha version - Which results in a need of adding profile-installer library in target module (app) - Now we're able to run benchmarking on Android SDK level 29 and higher (i.e. latest levels included) - Updated related documentation * Enables benchmarking for emulators - I've decided to support emulator devices with our benchmark test module at the end. Documentation and code comments explain to a user that the results may not be the same as on a real physical device. But until we have it set up in CI, we can benefit from having it set up like this.
2022-10-27 03:51:24 -07:00
buildTypes {
create("release") {
// To provide compatibility with other modules
[#599] Macrobenchmark test module * Temporary enable FTL test * Enable emulator.wft tests for ui-integration-test module on CI * Rebase onto main * Test Fladle configuration for ui-integration-test module * Fix Fladle for ui-integration-test module * Rename ui-integration-test module flade configuration * Disable again FTL action from PRs * Clear support for FTL from ui-integration-test module * Refactor the emulator.wtf support across our modules. * [#599] Macrobenchmark test module - Created new dedicated macrobenchmark test module - Updated related Architecture and Setup documentation - Connected to app module - New benchmark build type - Related run configuration above custom Gradle task - Basic startup benchmark test included * Benchmark build variant simplification * Run benchmarking simplification * Documentation update. * New property IS_SIGN_RELEASE_BUILD_WITH_DEBUG_KEY - It enables signing the release build with debug key configuration. Default value is false. - First, we check if we can sign it with release configs, otherwise with debug. - Documentation updated. * Benchmarking documentation update * Adds support for Android SDK 32 and 33 - Bumped benchmark library to the latest alpha version - Which results in a need of adding profile-installer library in target module (app) - Now we're able to run benchmarking on Android SDK level 29 and higher (i.e. latest levels included) - Updated related documentation * Enables benchmarking for emulators - I've decided to support emulator devices with our benchmark test module at the end. Documentation and code comments explain to a user that the results may not be the same as on a real physical device. But until we have it set up in CI, we can benefit from having it set up like this.
2022-10-27 03:51:24 -07:00
}
}
if (isOrchestratorEnabled) {
testOptions {
execution = "ANDROIDX_TEST_ORCHESTRATOR"
}
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.androidx.compose.compiler.get().versionConstraint.displayName
}
}
dependencies {
2023-02-20 10:46:23 -08:00
implementation(projects.configurationApiLib)
implementation(projects.configurationImplAndroidLib)
implementation(projects.sdkExtLib)
2023-02-20 10:46:23 -08:00
implementation(projects.spackleAndroidLib)
implementation(projects.testLib)
implementation(projects.uiLib)
implementation(libs.bundles.androidx.test)
implementation(libs.bundles.androidx.compose.core)
implementation(libs.bundles.play.update)
implementation(libs.androidx.compose.test.junit)
implementation(libs.androidx.navigation.compose)
[#653] Refactor Backup flow screens * [#653] Move copy to buffer action - Trigger this action after seed phrase panel click and confirm via dialog window - Added basic ui tests - Added also dialog integration test - Added related strings * Revert "[#653] Move copy to buffer action" This reverts commit 813eab00b747a779be5ef652745002f65c04572c. * [#150] Refactoring the Backup flow to use Compose Scaffold * Fix Backup flow screenshot test - Removed scroll actions above nodes, which are no longer part of scroll behaviour - bottom navigation buttons are now part of Compose Scaffold component. * Added scroll actions in screenshot test of Profile screen - After tested the whole app with screenshot test on smaller screen device 4WVGA Nexus S * Remove unnecessary screenshot test click action - This click action on the Profile screen title seems to be unnecessary for the test and creates confusion * ScreenshotTest module auto components init - Changed the way we auto-initialize components in ScreenshotTest module - Now we use androidx-startup library for it - And we disabled the default way * Add system back button navigation support * Enable scrolling for Backup Test screen * Fix Screenshot test on small screen in landscape - Tested and fixed cases in which our screenshot test wasn't successful - Tested on 4 WVGA Nexus S in landscpae mode * Code clean * Address review comments + stages refactoring - Flattened BackupStage sealed class. Test and Failure are now regular stages. - Introduced CheckSeed stage, instead of reusing Seed phrase for re-viewing. - Simplified BackupView and custom Saver implementations. - List of possible screen state stages is now lazy loaded value, instead of method. - Some of the stages now override stage moving methods to enhance Backup screen state machine, as it's not linear. - Existing tests updated to align with the new implementation of stages. * Remove `run` block * Rename CheckSeed -> ReviewSeed Check might imply to another reader of the code that there is some going back to the test. I went with the word Review which seems to better convey how that screen is passive for the user. * Simplify list construction This should have better performance. * Crash instead of allowing back navigation * Add documentation * Fix initialization error * Add non-localized string tag Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-11-22 23:17:06 -08:00
implementation(libs.androidx.startup)
implementation(libs.androidx.uiAutomator)
androidTestUtil(libs.androidx.test.services) {
artifact {
type = "apk"
}
}
if (isOrchestratorEnabled) {
androidTestUtil(libs.androidx.test.orchestrator) {
artifact {
type = "apk"
}
}
}
}
emulatorwtf {
directoriesToPull.set(listOf("/sdcard/googletest/test_outputfiles"))
// Because screenshot tests can be flaky, allow this module to always re-run
// which is helpful on GitHub Actions. Once the tests are fully stabilized, this can be
// removed.
sideEffects.set(true)
}