diff --git a/gradle.properties b/gradle.properties index d876d4b9..58baa81e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,4 +14,4 @@ kotlin.mpp.enableCInteropCommonization=true GROUP=com.atiurin POM_ARTIFACT_ID=ultron -VERSION_NAME=2.5.0-alpha09 +VERSION_NAME=2.5.0-alpha10 diff --git a/sample-app/src/androidTest/java/com/atiurin/sampleapp/tests/BaseTest.kt b/sample-app/src/androidTest/java/com/atiurin/sampleapp/tests/BaseTest.kt index b46471c4..ea19df99 100644 --- a/sample-app/src/androidTest/java/com/atiurin/sampleapp/tests/BaseTest.kt +++ b/sample-app/src/androidTest/java/com/atiurin/sampleapp/tests/BaseTest.kt @@ -31,8 +31,8 @@ abstract class BaseTest { @JvmStatic fun config() { UltronConfig.applyRecommended() - UltronAllureConfig.applyRecommended() UltronComposeConfig.applyRecommended() + UltronAllureConfig.applyRecommended() UltronAllureConfig.setAllureResultsDirectory(Environment.DIRECTORY_DOWNLOADS) } } diff --git a/ultron-android/src/main/kotlin/com/atiurin/ultron/core/config/UltronConfig.kt b/ultron-android/src/main/kotlin/com/atiurin/ultron/core/config/UltronConfig.kt index 8f190095..ad268e4f 100644 --- a/ultron-android/src/main/kotlin/com/atiurin/ultron/core/config/UltronConfig.kt +++ b/ultron-android/src/main/kotlin/com/atiurin/ultron/core/config/UltronConfig.kt @@ -73,6 +73,7 @@ object UltronConfig { private fun modify() { Espresso.ACTION_TIMEOUT = params.operationTimeoutMs Espresso.ASSERTION_TIMEOUT = params.operationTimeoutMs + UiAutomator.OPERATION_TIMEOUT = params.operationTimeoutMs UltronCommonConfig.addListener(LogLifecycleListener()) if (params.logToFile) { UltronLog.addLogger(UltronLog.fileLogger) diff --git a/ultron-compose/src/commonMain/kotlin/com/atiurin/ultron/core/compose/config/UltronComposeConfig.kt b/ultron-compose/src/commonMain/kotlin/com/atiurin/ultron/core/compose/config/UltronComposeConfig.kt index fc6b727d..13e13d9a 100644 --- a/ultron-compose/src/commonMain/kotlin/com/atiurin/ultron/core/compose/config/UltronComposeConfig.kt +++ b/ultron-compose/src/commonMain/kotlin/com/atiurin/ultron/core/compose/config/UltronComposeConfig.kt @@ -79,10 +79,21 @@ object UltronComposeConfig { fun applyRecommended() { params = UltronComposeConfigParams() + modify() } fun apply(block: UltronComposeConfigParams.() -> Unit) { params.block() + modify() + } + + private fun modify(){ + UltronCommonConfig.addListener(LogLifecycleListener()) + if (UltronCommonConfig.logToFile) { + UltronLog.addLogger(UltronLog.fileLogger) + } else { + UltronLog.removeLogger(UltronLog.fileLogger.id) + } UltronLog.info("UltronComposeConfig applied with params $params}") } }