Skip to content

Commit

Permalink
IDEA-332876 UI tests: Add base for HeaderStateTest
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 32e34d1667332ff76f0f317fea616fa2181b8eef
  • Loading branch information
Aydar Mukhametzyanov authored and intellij-monorepo-bot committed Nov 24, 2023
1 parent c8a9bb3 commit 815b4bd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ catch (t: Throwable) {
fun String.withIndent(indent: String = " "): String = lineSequence().map { "$indent$it" }.joinToString(System.lineSeparator())

fun takeScreenshot(logsDir: Path) {
takeScreenshot(logsDir, "screenshot_beforeKill.jpg")
}

fun takeScreenshot(logsDir: Path, screenshotName: String) {
val toolsDir = GlobalPaths.instance.getCacheDirectoryFor("tools")
val toolName = "TakeScreenshot"
val screenshotTool = toolsDir / toolName / "$toolName.jar"
Expand All @@ -55,7 +59,7 @@ fun takeScreenshot(logsDir: Path) {
val screenshotJar = File(IDERunContext::class.java.classLoader.getResource("tools/$toolName.jar")!!.toURI())
screenshotJar.copyTo(screenshotTool.toFile(), true)
}
val screenshotFile = logsDir.resolve("screenshot_beforeKill.jpg")
val screenshotFile = logsDir.resolve(screenshotName)

val javaPath = ProcessHandle.current().info().command().orElseThrow().toString()
ProcessExecutor(
Expand Down

0 comments on commit 815b4bd

Please sign in to comment.