Open ndagnhat opened 1 year ago
Hello @ndagnhat - I was able to reproduce something similar to you when I changed it to "files", have you tried changing it to "resources" instead, this populated the example table for me.
@CsvFileSource(resources = "/testlist.csv", numLinesToSkip = 1)
Hello @ndagnhat - I was able to reproduce something similar to you when I changed it to "files", have you tried changing it to "resources" instead, this populated the example table for me.
@CsvFileSource(resources = "/testlist.csv", numLinesToSkip = 1)
hi @zzoubian i have tried both ("files" or "resources") but data test doesn't show in Report, and when tried changing files to resources instead, this error(https://github.com/serenity-bdd/serenity-core/issues/2956) appear in console
Thanks for reply
I'll give it a try on Windows, and see if I get the same error.
Hello @ndagnhat - I was able to reproduce something similar to you when I changed it to "files", have you tried changing it to "resources" instead, this populated the example table for me. @CsvFileSource(resources = "/testlist.csv", numLinesToSkip = 1)
hi @zzoubian i have tried both ("files" or "resources") but data test doesn't show in Report, and when tried changing files to resources instead, this error(#2956) appear in console
Thanks for reply
You are correct, I see the same exception from #2956 and there is no data in the examples table when using resources on Windows. Even though, it runs through all the tests fine.
Can you dig into the code and see if you can propose a PR with a fix? The JUnit 5 integration is still a bit experimental in parts.
@wakaleo - appears to be a simple fix, adding .getClassLoader() to lines 99 (getDataFileFor) and 109 (isAClassPathResource) in JUnit5CSVTestDataSource.java, fixes the issue for me.
Can you propose a PR?
I'll need to do a little bit more digging, after the change, it broke on macos :) if i get it working for both OS, i'll create a PR.
My code
CSV file
Serenity Report