https://kotlinlang.org logo
#kotest
Title
# kotest
r

Rob Elliot

06/06/2022, 5:44 PM
I'm writing a selenium test in kotest - I'm implementing a
TestListener
so that if
TestResult.isErrorOrFailure
I can use
RemoteWebDriver.getScreenshotAs
to capture the output. However, I need to save the file somewhere... is there a way to work out an output directory for kotest? I guess it would be very dependent on how kotest was bring run (gradle, maven, stadalone, whatever), so probably not, but thought I'd ask if anyone had any bright ideas.
j

Jim

06/06/2022, 8:56 PM
Kotest can create temporary directories, but I don't think that's what you want 🤔
When you set
writeSpecFailureFile
to true, it makes a directory named
.kotest
- so you could piggyback on that and set up your .gitignore appropriately
r

Rob Elliot

06/06/2022, 8:59 PM
I was hoping to put them in the same place the build tool puts test result files, but I'd guess kotest has no way of knowing where that is.
j

Jim

06/07/2022, 6:00 AM
Right, it might now if it was invoked by Gradle, but not by some generic runner 🤔
s

sam

06/07/2022, 8:42 PM
We should expose this. This is a good feature request.
👍 1
12 Views