Skip to content

Attributes annotations don't work with cucumber-java8 syntax #26

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

Closed
endless-qa opened this issue Nov 12, 2021 · 1 comment
Closed

Attributes annotations don't work with cucumber-java8 syntax #26

endless-qa opened this issue Nov 12, 2021 · 1 comment

Comments

@endless-qa
Copy link

Client: 5.5.0
Agent: 5.0.2 (agent-java-cucumber6)

Description:
We use cucumber-java8 syntax in defining steps. Hence, the only way to placed the Report Portal's @Attributes annotation was like this:

@Attributes(multiValueAttributes = { @MultiValueAttribute(key = "myKey", values = { "valueOne", "valueTwo" }) }) Given("^user logs in", this::logInPlease);

I was expecting the assigned attributes to appear on Report Portal but they didn't. I tried to place the @Attributes annotation on the logInPlease() method that is called in the step but that didn't change anything.

I tried both, ScenarioReporter and StepReporter. Am I missing something of cucumber-java8 syntax is not supported by this agent?

@HardNorth
Copy link
Member

HardNorth commented Nov 12, 2021

cucumber-java8 Given, When, Then steps are static methods, their calls are inlined in code. And it's not possible in java to get annotations from method calls. Also Cucumber does not provide methods from which these steps are called. And it's also conceptual question how to handle multiple steps defined in one method/constructor. So no, it's not a bug or issue. Right now we don't have any plans to support such functionality.

Apart from that cucumber-java8 is a subject for deprecation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants