Skip to content

Commit

Permalink
Add browser test
Browse files Browse the repository at this point in the history
  • Loading branch information
Romanow committed Sep 7, 2024
1 parent acdc967 commit 5afa6fa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id "idea"
id "jacoco"
id "maven-publish"
id "org.jetbrains.kotlin.jvm" version "1.9.22"
id "org.jlleitschuh.gradle.ktlint" version "12.1.0"
Expand Down Expand Up @@ -51,6 +52,17 @@ test {
}
}

jacocoTestReport {
executionData tasks.withType(Test)
classDirectories.from = files(sourceSets.main.output.classesDirs)
sourceDirectories.from = files(sourceSets.main.java.srcDirs)

reports {
xml.required = true
xml.destination file("${layout.buildDirectory}/reports/jacoco/report.xml")
}
}

publishing {
publications {
maven(MavenPublication) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ internal class PropertiesHelperTest {

@Test
fun test() {
assertThat(PropertiesHelper.get("base-url", String::class)).isEqualTo("http://localhost:8080")
assertThat(PropertiesHelper.get("headless-mode", Boolean::class)).isFalse
assertThat(PropertiesHelper.get("slow-mode", Boolean::class)).isTrue
assertThat(PropertiesHelper.get("test.base-url", String::class)).isEqualTo("http://localhost:8080")
assertThat(PropertiesHelper.get("test.stop-on-error", Boolean::class)).isTrue
}
}
8 changes: 6 additions & 2 deletions src/test/resources/config.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
base-url=${BASE_HOST:http://localhost}:${BASE_PORT:8080}
headless-mode=${HEADLESS_MODE:false}
slow-mode=true
headless-mode=${HEADLESS_MODE:true}
slow-mode=${SLOW_MODE:true}

# for test only
test.base-url=${TEST_BASE_HOST:http://localhost}:${TEST_BASE_PORT:8080}
test.stop-on-error=true

0 comments on commit 5afa6fa

Please sign in to comment.