Multiple testNG tests run by @Factory are marked as "retries" instead of being separate
See original GitHub issueI’m submitting a …
- bug report
- feature request
- support request => Please do not submit support request here, see note at the top of this template.
What is the current behavior?
When running tests with TestNG @Factory annotation, multiple runs are considered as “retries” instead of appearing as separate test runs.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal
Run the following class:
import io.qameta.allure.Step;
import org.testng.Assert;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;
public class TestPoc {
int i = 1;
public TestPoc() {
}
public TestPoc(int i) {
this.i = i;
}
@Test
public void stepFailDemo() {
try {
failStep();
} catch (AssertionError e) {/*do nothing*/
}
}
@Step("Failing step")
private void failStep() {
Assert.fail("Failing an inner step " + i);
}
@Factory
public Object[] myFactory() {
return new Object[]{new TestPoc(5), new TestPoc(6),new TestPoc(7)};
}
}
What is the expected behavior?
Expected behaviour - Tests should show as separate entities.
What is the motivation / use case for changing the behavior?
Current behaviour is a bug - This is running a data driven test for 3 separate test cases (different parameters for test method)
Please tell us about your environment:
Allure version | 2.2.0 |
---|---|
Test framework | testng@6.11 |
Allure integration | allure-testng@2.0-BETA16 |
Generate report using | allure-maven@2.8 |
Report version | 2.3.3 |
Other information
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (4 by maintainers)
Top Results From Across the Web
Multiple testNG tests run by @Factory are marked as "retries ...
Multiple testNG tests run by @Factory are marked as "retries" instead of being separate.
Read more >Documentation - TestNG
If set to true, tests generated using this data provider are run in parallel. Default value is false. @Factory, Marks a method as...
Read more >Retry Failed Test in TestNG with IRetryAnalyzer
In this article, we will learn how to retry failed test in TestNG with IRetryAnalyzer and also how to rerun all tests from...
Read more >TestNG retry test in multithreaded environment - Stack Overflow
When I run only one test then retry mechanism works well (1 pass and 2 skipped). But when I run 5 tests as...
Read more >Parameterization in TestNG using testng.xml - Selenium Easy
TestNG allows the user to pass values to test methods as arguments by using parameter annotations through testng.xml file. Some times it may...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Kindly provide workaround for the same to show tests instead of retries in allure report.
I just added brand new
TestInstanceParameter
annotation that can be used to add parameters from test instance: