allure-java icon indicating copy to clipboard operation
allure-java copied to clipboard

AllureLifecycle method getCurrentTestCase() returns UUID of step

Open Sletov opened this issue 6 years ago • 4 comments

I'm submitting

  • [x] bug report

Current behavior:

Allure.getLifecycle().getCurrentTestCase() returns UUID of current running test step

Steps to reproduce:

Calling Allure.getLifecycle().getCurrentTestCase() in any Cucumber step (or hook) returns UUID of the step.

Expected behavior:

Allure.getLifecycle().getCurrentTestCase() returns UUID of current running test case

Motivation / use case for changing the behavior:

It's impossible to update current test case (write steps or add attachment) with method AllureLifecycle public updateTestCase(String, Consumer<TestResult>). Method AllureLifecycle public updateTestCase(Consumer<TestResult>) (for current running test case) doesn't work too.

Environment:

| Allure version | 2.12.1 | | Test framework | [email protected] | | Allure integration | [email protected] | | Generate report using | [email protected] |

Other information

I think problem is at io.qameta.allure.AllureLifecycle.java:223 (threadContext.clear() when starting fixture (hook))

Sletov avatar Jun 20 '19 08:06 Sletov

Аналогичное поведение на page-factory-2 14.0.1

AllureLifecycle lifecycle = Allure.getLifecycle();
System.out.println(lifecycle.getCurrentTestCase().get());

Вывод: TestCase56df8488-6468-4b16-be9f-1d320f0e84d7create new session6

То есть имя степа

Далее lifecycle.updateTestCase(..) Падает [ERROR] io.qameta.allure.AllureLifecycle - Could not update test case: test case with uuid TestCase56df8488-6468-4b16-be9f-1d320f0e84d7create new session6 not found

io.qameta.allure:allure-cucumber2-jvm:2.10.0 io.cucumber:cucumber-java:2.4.0

vmyasnik avatar Jul 24 '19 14:07 vmyasnik

This issue is still reproducible with io.qameta.allure:allure-testng:2.22.2. Is there an ETA when it will be fixed? Or at least please provide a workaround.

Novikevicius avatar Jun 20 '23 14:06 Novikevicius

Do we have any workaround to use for time being until the fix is available ?

mov2day avatar Dec 14 '23 13:12 mov2day

Due to this issue, not able to add Runtime Parameters, or Change Testcase name in report. We wanted to update testcase name to include browser for Cross Browser testing, but it is not working.

arshwarsi avatar Jan 23 '24 16:01 arshwarsi

fixed via https://github.com/allure-framework/allure-java/pull/1011

released as 2.26.0

baev avatar Mar 18 '24 14:03 baev