Closed chuanding closed 5 years ago
-parameters
compiler option (https://docs.oracle.com/javase/tutorial/reflect/member/methodparameterreflection.html)Thanks baev! love you!
@baev is there a way to show param names in same order as given in the test method?
as of now it is sorted based on parameter name.
Is there a way to set -parameters
in the build.gradle
file.
I found the following way but it didn't work:
compileJava {
options.compilerArgs << '-parameters'
}
@baev is there a way to show param names in same order as given in the test method?
as of now it is sorted based on parameter name.
I have the same question here. Anyone got the answer?
@baev same question as these 2 bellow:
@baev is there a way to show param names in same order as given in the test method? as of now it is sorted based on parameter name.
I have the same question here. Anyone got the answer?
@baev is there a way to show param names in same order as given in the test method?
as of now it is sorted based on parameter name.
Test parameters seem to be sorted alphabetically, even if the LinkedHashMap is used to store params
This is my implementation:
public static void attachParametersToTest(Map<String, String> rowData) {
Allure.getLifecycle().updateTestCase(test ->
test.setParameters(test.getParameters()
.stream()
.filter(parameter -> parameter.getName().isEmpty())
.collect(Collectors.toList()))); //deletes the parameters set so far (the method is invoked at the end of execution)
rowData.forEach((key,value) -> {
Allure.getLifecycle().updateTestCase(test -> test.getParameters().add(new Parameter()
.setName(key)
.setValue(value)));
}); //adds the parameters from LinkedHashMap so the order should be preserved
}
even after this, the test parameters are sorted alphabetically based on the param name
[//]: # ( . Note: for support questions, please use Stackoverflow or Gitter. . This repository's issues are reserved for feature requests and bug reports. . . In case of any problems with Allure Jenkins plugin please use the following repository . to create an issue: https://github.com/jenkinsci/allure-plugin/issues . . Make sure you have a clear name for your issue. The name should start with a capital . letter and no dot is required in the end of the sentence. An example of good issue names: . . - The report is broken in IE11 . - Add an ability to disable default plugins . - Support emoji in test descriptions )
I'm submitting a ...
What is the current behavior?
I use testNG and allure, and I pass the parameters via @dataproveide supported by TestNG, and then generated the allure report. But I found that the parameters in the report show the name as arg0, arg1, this is unreadable for the human.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
What is the expected behavior?
Is there any way to show the real parameters name that I defined in the test function or an Object field names?
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Other information
[//]: # ( . e.g. detailed explanation, stacktraces, related issues, suggestions . how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc )