Skip to content

Unable to add links to report in Cucumber from code #483

@elantsov

Description

@elantsov

I'm submitting a ...

  • bug report

What is the current behavior?

The links are not added to report if trying to add them from hooks or steps code as:
Allure.link("https://example.org")

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Can't provide the demo project but I did a little research.

When Allure tries to add a link it makes:
final Optional<String> root = threadContext.getRoot(); final String uuid = root.get(); final Optional<TestResult> found = storage.getTestResult(uuid);

The problem is that in threadContext there is only Cucumber step or fixture uuid (depending on the place feom which you run Allure.link) and there's no actual root uuid pointing to TestResult uuid. Therefore, found.isPresent == false and TestResult is not getting updated with the link.

Not sure, but I have a feeling that the root cause of this problem is threadContext.clear() that causes real root uuid to be lost.

It seems to have been working fine in Allure 2.9.0 and got broken in 2.10.0.

What is the expected behavior?

Allure.link should add links to the report if executed from Cucumber steps code and from Cucumber hooks code.

Please tell us about your environment:

Allure version 2.13.6
Test framework [email protected]
Cucumber [email protected]
Allure integration [email protected]
Generate report using [email protected]

Other information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions