You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val trimmed = maybeTooLongPath.absolutePath.take(maxPath)
60
-
log.error { "Directory path length cannot exceed $maxPath characters and has been trimmed from $maybeTooLongPath to $trimmed and can create a conflict. "+
61
-
"This happened because the combination of file path, pool name and device serial is too long." }
54
+
log.error {
55
+
"Directory path length cannot exceed $maxPath characters and has been trimmed from $maybeTooLongPath to $trimmed and can create a conflict. "+
56
+
"This happened because the combination of file path, pool name and device serial is too long."
57
+
}
62
58
File(trimmed)
63
59
} else {
64
60
maybeTooLongPath
@@ -98,17 +94,22 @@ class FileManager(private val maxPath: Int, private val maxFilename: Int, privat
98
94
val maybeTooLongPath =File(directory.toFile(), trimmedFilename)
Copy file name to clipboardexpand all lines: vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/executor/listeners/screenshot/AdamScreenCaptureTestRunListener.kt
@@ -27,14 +29,30 @@ class AdamScreenCaptureTestRunListener(
27
29
val screenshots = testMetrics.filterKeys { it =="com.malinskiy.adam.junit4.android.screencapture.AdamScreenCaptureProcessor.v1" }
28
30
screenshots.values.forEach { path ->
29
31
val extension = path.substringAfterLast('.')
30
-
val attachmentType =when (extension) {
31
-
"jpeg", "jpg"->AttachmentType.SCREENSHOT_JPEG
32
-
"png"->AttachmentType.SCREENSHOT_PNG
33
-
"webp"->AttachmentType.SCREENSHOT_WEBP
34
-
else->null
32
+
var attachmentType:AttachmentType?=null
33
+
var fileType:FileType?=null
34
+
when (extension) {
35
+
"jpeg", "jpg"-> {
36
+
attachmentType =AttachmentType.SCREENSHOT_JPEG
37
+
fileType =FileType.SCREENSHOT_JPG
38
+
}
39
+
"png"-> {
40
+
attachmentType =AttachmentType.SCREENSHOT_PNG
41
+
fileType =FileType.SCREENSHOT_PNG
42
+
}
43
+
"webp"-> {
44
+
attachmentType =AttachmentType.SCREENSHOT_WEBP
45
+
fileType =FileType.SCREENSHOT_WEBP
46
+
}
47
+
"gif"-> {
48
+
attachmentType =AttachmentType.SCREENSHOT_GIF
49
+
fileType =FileType.SCREENSHOT_GIF
50
+
}
51
+
else->Unit
35
52
}
36
-
if (attachmentType !=null) {
37
-
val localFile = fileManager.createScreenshotFile(extension, pool, device.toDeviceInfo(), test.toTest(), testBatchId)
53
+
54
+
if (attachmentType !=null&& fileType !=null) {
55
+
val localFile = fileManager.createFile(fileType, pool, device.toDeviceInfo(), test.toTest(), testBatchId = testBatchId, id =UUID.randomUUID().toString())
0 commit comments