4

I use Allure with jUnit. In parametrized test I see parameter in the title enter image description here

When I want to provide custom title via @Title annotation, these parameters is not shown. I tried to specify parameter as @Title("Test {0}") but it didn't work as well.

Is there a way to have custom title and parameter in the test case?

just-boris
  • 9,468
  • 5
  • 48
  • 84

2 Answers2

2

How about setting name to @Parameterized annotation?

@Parameterized.Parameters(name = "My cool test {1} {2} {3}")

UPD: Allure gets @Title annotation value as is and does not support neither {method} nor {i} notation because it's being processed without aspects. Java on its turn does not allow dynamic expressions in annotations.

Community
  • 1
  • 1
vania-pooh
  • 2,933
  • 4
  • 24
  • 42
  • I tried and got `Calculation test [My cool test 1]`. But I expected to replace entire title, not brackets content – just-boris Sep 18 '15 at 13:49
0

I would recommend usage of Allure object to update test name at runtime in Allure lifecycle.

Allure.getLifecycle().updateTestCase(testResult -> testResult.setName("updated_test_name"));