I would like to have a list of tests that I want to skip, but the list will be created at runtime. Due to this, excluding groups will not meet my needs, since those needs to be set before runtime.
Basically, I want to do something like this:
If TestA fails for a SPECIFIC reason, then skip TestB. If TestA fails for some other reason, run TestB.
Is there a way in onStart, that I could cause a test to be skipped?
Here is kind of what I was thinking….
public class TestListener extends TestListenerAdapter {
public void onTestStart(ITestResult arg0) {
super.onTestStart(arg0);
if (skipTests.contains(arg0.getMethod().getDescription())) {
// skip the test, not sure how?
}
}
}
With this, when a test starts, I read the description attribute. If that matches an element in skipTests, then the test is skipped.
Is this possible? Any advice?
Thanks,
David Genrich
> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To post to this group, send email to testng...@googlegroups.com.
> To unsubscribe from this group, send email to
> testng-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/testng-users?hl=en.
>
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Ah damn...never mind. I'm probaply too tired...
The IAnnotationTransformer runs only once on startup. So it wouldn't
be possible to change something at runtime with that.
Some Time ago I had the same idea as you do now, but I had to give up
on it. It just seems to be not possible.
The things I tried were: having an TestListener who has some methods
for failing / skipped... tests, then I wanted to change the @Test
annotation via reflections.
Sadly they dont seem to have any setter methods.
It could maybe work if you wrapped the TestNG Annotation and used
this, not shure, as I said, I had to give up.
Thanks,
David Genrich
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
I created issue http://jira.opensymphony.com/browse/TESTNG-470 to
track this.
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.