From 7c5a644ca370b67a7edad0e4a2a54f8ce405e6a9 Mon Sep 17 00:00:00 2001 From: Alfonso Presa Date: Thu, 5 Dec 2019 19:38:03 +0100 Subject: [PATCH] feature(): enable folderNames in name template --- .../de/zalando/ep/zalenium/dashboard/TestInformation.java | 2 +- .../zalando/ep/zalenium/proxy/DockerSeleniumRemoteProxy.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/zalando/ep/zalenium/dashboard/TestInformation.java b/src/main/java/de/zalando/ep/zalenium/dashboard/TestInformation.java index 40209e25e3..d0da1a1294 100644 --- a/src/main/java/de/zalando/ep/zalenium/dashboard/TestInformation.java +++ b/src/main/java/de/zalando/ep/zalenium/dashboard/TestInformation.java @@ -219,7 +219,7 @@ public void buildVideoFileName() { .replace("{platform}", this.platform) .replace("{timestamp}", commonProxyUtilities.getDateAndTimeFormatted(this.timestamp)) .replace("{testStatus}", getTestStatus().toString()) - .replaceAll("[^a-zA-Z0-9]", "_"); + .replaceAll("[^a-zA-Z0-9/\\-]", "_"); this.fileName = FILE_NAME_TEMPLATE.replace("{fileName}", testNameNoExtension) .replace("{fileExtension}", fileExtension); diff --git a/src/main/java/de/zalando/ep/zalenium/proxy/DockerSeleniumRemoteProxy.java b/src/main/java/de/zalando/ep/zalenium/proxy/DockerSeleniumRemoteProxy.java index 7e780b47e7..3fed5c98b0 100644 --- a/src/main/java/de/zalando/ep/zalenium/proxy/DockerSeleniumRemoteProxy.java +++ b/src/main/java/de/zalando/ep/zalenium/proxy/DockerSeleniumRemoteProxy.java @@ -638,8 +638,8 @@ void copyVideos(final String containerId) { testInformation.setFileExtension(fileExtension); Path videoFile = Paths.get(String.format("%s/%s", testInformation.getVideoFolderPath(), testInformation.getFileName())); - if (!Files.exists(Paths.get(testInformation.getVideoFolderPath()))) { - Files.createDirectories(Paths.get(testInformation.getVideoFolderPath())); + if (!Files.exists(videoFile.getParent())) { + Files.createDirectories(videoFile.getParent()); } Files.copy(tarStream, videoFile); CommonProxyUtilities.setFilePermissions(videoFile);