From 05dc8d1c05ba295f843c5e3fa393c9a0faf2c82b Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Fri, 25 Jun 2021 16:11:11 +0200 Subject: [PATCH] Run selenium tests in Firefox is specific System property (synced with project property) is present --- web/integration-core/build.gradle.kts | 8 ++++++++ .../integration/common/BaseIntegrationTests.kt | 15 ++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/web/integration-core/build.gradle.kts b/web/integration-core/build.gradle.kts index 4de56157ce..2ded32e07c 100644 --- a/web/integration-core/build.gradle.kts +++ b/web/integration-core/build.gradle.kts @@ -74,4 +74,12 @@ kotlin { tasks.named("jvmTest") { dependsOn(tasks.named("jsBrowserDevelopmentWebpack")) + + listOf( + "compose.web.tests.integration.withFirefox" + ).forEach { propName -> + if (project.hasProperty(propName)) { + systemProperty(propName, "true") + } + } } diff --git a/web/integration-core/src/jvmTest/kotlin/org/jetbrains/compose/web/tests/integration/common/BaseIntegrationTests.kt b/web/integration-core/src/jvmTest/kotlin/org/jetbrains/compose/web/tests/integration/common/BaseIntegrationTests.kt index 7fb441d7ec..2be11b0eb6 100644 --- a/web/integration-core/src/jvmTest/kotlin/org/jetbrains/compose/web/tests/integration/common/BaseIntegrationTests.kt +++ b/web/integration-core/src/jvmTest/kotlin/org/jetbrains/compose/web/tests/integration/common/BaseIntegrationTests.kt @@ -61,15 +61,20 @@ object Drivers { @MethodSource("resolveDrivers") annotation class ResolveDrivers + @DisplayNameGeneration(DisplayNameSimplifier::class) @ExtendWith(value = [StaticServerSetupExtension::class]) abstract class BaseIntegrationTests() { companion object { + @OptIn(ExperimentalStdlibApi::class) + private val drivers: Array> = buildList> { + add(arrayOf(Drivers.Chrome)) + if (System.getProperty("compose.web.tests.integration.withFirefox") == "true") { + add(arrayOf(Drivers.Firefox)) + } + }.toTypedArray() + @JvmStatic - fun resolveDrivers(): Array> { - return arrayOf( - arrayOf(Drivers.Chrome) - ) - } + fun resolveDrivers() = drivers } }