Skip to content

Commit 387c9d6

Browse files
committed
Changes in version 1.8.4
------------------------ * reportng 1.6.5
1 parent 4af7efe commit 387c9d6

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

CHANGELOG.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Changes in version 1.8.4
2+
------------------------
3+
* reportng 1.6.5
4+
5+
16
Changes in version 1.8.3
27
------------------------
38
* reportng 1.6.2

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99

1010

1111
group = "it.testee"
12-
version = "1.8.3"
12+
version = "1.8.4"
1313

1414

1515
repositories {
@@ -27,7 +27,7 @@ dependencies {
2727
// testng
2828
implementation("org.testng", "testng", "7.7.1")
2929
// reportng
30-
implementation("com.github.hibissscus:reportng:1.6.2")
30+
implementation("com.github.hibissscus:reportng:1.6.5")
3131
}
3232

3333
tasks {

src/main/kotlin/testee/it/e2e/core/test/TestBase.kt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ import org.openqa.selenium.remote.RemoteWebDriver
77
import org.testng.ITestContext
88
import org.testng.ITestResult
99
import org.testng.SkipException
10-
import org.testng.annotations.AfterClass
11-
import org.testng.annotations.AfterMethod
12-
import org.testng.annotations.BeforeClass
13-
import org.testng.annotations.BeforeMethod
14-
import org.testng.annotations.Listeners
10+
import org.testng.annotations.*
1511
import org.testng.annotations.Optional
16-
import org.testng.annotations.Parameters
1712
import org.testng.util.Strings
1813
import testee.it.e2e.core.browser.Browser
1914
import testee.it.e2e.core.browser.WebDriverFactory.manageBrowser
@@ -23,7 +18,6 @@ import java.io.File
2318
import java.lang.System.currentTimeMillis
2419
import java.lang.reflect.Method
2520
import java.util.*
26-
import kotlin.collections.HashSet
2721
import kotlin.concurrent.timerTask
2822

2923

@@ -123,7 +117,7 @@ abstract class TestBase(
123117
@BeforeClass
124118
fun beforeClass(context: ITestContext) {
125119
itc = context
126-
outputDirectory = context.outputDirectory
120+
outputDirectory = context.outputDirectory.replace("Default Suite", "e2e")
127121
className = this.javaClass.name
128122
itc.allTestMethods.first().retryAnalyzerClass = RetryAnalyzer::class.java
129123
}
@@ -170,9 +164,9 @@ abstract class TestBase(
170164
}
171165
}
172166

173-
fun takeScreenShot() {
167+
fun takeScreenShot(name: String = "") {
174168
val screenshotFile = (driver as TakesScreenshot).getScreenshotAs(OutputType.FILE)
175-
val outputFolder = "${outputDirectory}/images/$className/$testName/" + "_" + this.counter++ + ".png"
169+
val outputFolder = "${outputDirectory}/images/$className/$testName/$name" + "_" + this.counter++ + ".png"
176170
screenshotFile.copyTo(File(outputFolder))
177171
}
178172

src/test/kotlin/testee/it/tests/example/piano/PianoTest.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ class PianoTest : TestBase(url = "https://virtualpiano.net", browser = Browser.C
1616
fun `01 piano play`() {
1717
PianoPage(driver)
1818
.open("https://virtualpiano.net")
19+
.also { takeScreenShot("open") }
1920
.loaded()
21+
.also { takeScreenShot("loaded") }
2022
.hideCookies()
23+
.also { takeScreenShot("hideCookies") }
2124
.freePlay(Note.SYM40, 50)
25+
.also { takeScreenShot("freePlay") }
2226
.waitForSeconds(10)
27+
.also { takeScreenShot("waitForSeconds") }
2328
}
2429

2530
@Test

0 commit comments

Comments
 (0)