Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞: Could not update test case: test case with uuid" when using it in second or futher steps of cucumber scenario/background #1008

Closed
1 task done
bigkingkosta opened this issue Feb 21, 2024 · 1 comment · Fixed by #1011
Labels
type:bug Something isn't working

Comments

@bigkingkosta
Copy link

What happened?

Using methods Allure.descriptionHtml ,Allure.link or Allure.label in first step of a scenario or first step of the background in feature file works.
But using it in second and further steps the following error occurs;
[main] ERROR io.qameta.allure.AllureLifecycle - Could not update test case: test case with uuid
Logging the current testcase uuid (findUuidInString(Allure.getLifecycle().getCurrentTestCase().get()) shows that the uuid change from "Options[uuid]", to featureNameOptions[uuid]scenarioStepName.
Using workaround for ongoing that works:

a) Instead of using e.g. Allure.descriptionHtml I use:
code snipped(adapted from the Allure.descriptionHtml method):

if (Allure.getLifecycle().getCurrentTestCase().isPresent()) {
            String currentUuid=findUuidInString(Allure.getLifecycle().getCurrentTestCase().get());
            logger.debug("currentUuid :{}",currentUuid);
                getLifecycle().updateTestCase(currentUuid, (execute) ->
                        execute.setDescriptionHtml(("\<p\>test\</p\>")));
        }

b) via regular expression I extracted the uuid
public static String findUuidInString(String findString){

    Matcher matcher = Pattern.compile( "[0-9a-f\\-]{8}-[0-9a-f\\-]{4}-[0-9a-f\\-]{4}-[0-9a-f\\-]{4}-[0-9a-f\\-]{12}" ).matcher( findString );
    String match="";
    while ( matcher.find() ) {
        logger.debug("searchString : {} an Position [{},{}]",
                matcher.group(),
                matcher.start(), matcher.end());
        match=matcher.group();
    }
    return match;
}

What Allure Integration are you using?

allure-cucumber7-jvm

What version of Allure Integration you are using?

2.25.0

What version of Allure Report you are using?

2.25.0

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bigkingkosta bigkingkosta added triage type:bug Something isn't working labels Feb 21, 2024
@baev
Copy link
Member

baev commented Feb 28, 2024

The problem is that hook steps after finish clears the thread context. The fix #1011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants