-
Notifications
You must be signed in to change notification settings - Fork 1k
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Retry analyzer not calling BeforeMethod & AfterMethods if firstTimeOnly/lastTimeOnly are mentioned for the test #792
Comments
ping.. |
I guess this is working as designed. Looking at the code of I see
So the So your best bet would be not to use |
It does, however, look like the |
@rschmitt : Do you have a test? I can debug the code. P.S : @AfterMethod is outside the scope of this issue |
Says who? Look at his console output again:
It's an invariant violation for the |
@rschmitt : I totally agree what you're saying. All I'm saying is, this defect context doesn't reflect the actual bug in testng. There should be a new defect for "Retry analyzer not calling BeforeMethod & AfterMethods if it's specified in a Example : public class testBug {
@BeforeMethod()
public void StartDriver()
{
System.out.println("Start Driver");
}
@AfterMethod()
public void stopDriver()
{
System.out.println("Stop Driver");
}
@Test
public void TestRetry()
{
Assert.assertTrue(false,"TestRetry Failed");
} Now this won't call |
Consider the case below:
If I use TestNG's IRetryAnalyzer to rerun the above case, the StartDriver & stopDriver are called for the actual first run, while none of the two is called for the Second(retry) time.
I am using TestNG 6.9.4 & this works fine(i.e start & stop are called for both first time & for the retry execution) if firstTimeOnly & lastTimeOnly are not mentioned.
Any help would be deeply appreciated.
The text was updated successfully, but these errors were encountered: