Closed hellosagar closed 1 year ago
Currently Im using a enum to avoid this situation
like below or do we have a better solution as well?
enum class Description(value: String){
SHORT("You unlocked 10% off your next X bookings. Your discount will be automatically " +
"applied at checkout."),
LONG("Get 10% off your next booking.")
}
For @TestParameters
, there are indeed multiple solutions for this, but for @TestParamter
, I think the enum option is the best way to customize the test name.
TestParameterInjector
will pick the test name from the parameter values usingtoString()
.For my test case
So, for above test case, test name generating is to way too long i.e
screenshots_SampleScreenshotTest_test1[NEXUS_5_DAY,You’re off to see the world!,You unlocked 10% off your next X bookings. Your discount will be automatically applied at checkout.,Use by Dec 31, 2022,null,Learn more,false]
.Im writing a snapshot tests using paparazzi and it uses the test name to generate the file name, due to long file name which is taken from the test name Im getting this error
File name too long
, and in order to solve this Ive to shorten the test name.So, here if I want to generate a custom name for
@TestParameter
annotation how can I do that? In doc I found custom name is available for@TestParameters
but not forTestParameter
Please suggestion some solution Thanks