Browse Source

Run selenium tests in Firefox is specific System property (synced with project property) is present

pull/822/head
Shagen Ogandzhanian 3 years ago
parent
commit
05dc8d1c05
  1. 8
      web/integration-core/build.gradle.kts
  2. 15
      web/integration-core/src/jvmTest/kotlin/org/jetbrains/compose/web/tests/integration/common/BaseIntegrationTests.kt

8
web/integration-core/build.gradle.kts

@ -74,4 +74,12 @@ kotlin {
tasks.named<Test>("jvmTest") { tasks.named<Test>("jvmTest") {
dependsOn(tasks.named("jsBrowserDevelopmentWebpack")) dependsOn(tasks.named("jsBrowserDevelopmentWebpack"))
listOf(
"compose.web.tests.integration.withFirefox"
).forEach { propName ->
if (project.hasProperty(propName)) {
systemProperty(propName, "true")
}
}
} }

15
web/integration-core/src/jvmTest/kotlin/org/jetbrains/compose/web/tests/integration/common/BaseIntegrationTests.kt

@ -61,15 +61,20 @@ object Drivers {
@MethodSource("resolveDrivers") @MethodSource("resolveDrivers")
annotation class ResolveDrivers annotation class ResolveDrivers
@DisplayNameGeneration(DisplayNameSimplifier::class) @DisplayNameGeneration(DisplayNameSimplifier::class)
@ExtendWith(value = [StaticServerSetupExtension::class]) @ExtendWith(value = [StaticServerSetupExtension::class])
abstract class BaseIntegrationTests() { abstract class BaseIntegrationTests() {
companion object { companion object {
@JvmStatic @OptIn(ExperimentalStdlibApi::class)
fun resolveDrivers(): Array<Array<Any>> { private val drivers: Array<Array<WebDriver>> = buildList<Array<WebDriver>> {
return arrayOf( add(arrayOf(Drivers.Chrome))
arrayOf(Drivers.Chrome) if (System.getProperty("compose.web.tests.integration.withFirefox") == "true") {
) add(arrayOf(Drivers.Firefox))
} }
}.toTypedArray()
@JvmStatic
fun resolveDrivers() = drivers
} }
} }

Loading…
Cancel
Save