testng: @AfterMethod(alwaysRun = true) is not getting called if we have exception in @BeforeMethod
TestNG Version
6.11
Expected behavior
@afterMethod is not called if test is throwing exception in @beforeMethod.
Actual behavior
@afterMethod should be called if test is throwing exception in @beforeMethod.
Is the issue reproductible on runner?
- Shell
- Maven
- Gradle
- Ant
- Eclipse
- IntelliJ
- NetBeans
Test case sample
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (9 by maintainers)
Commits related to this issue
- fixes #1426 @afterMethod should be called if @beforeMethod throws exeption with configfailurepolicy as continue. — committed to dipak-pawar/testng by dipak-pawar 7 years ago
- fixes #1426 @afterMethod should be called if @beforeMethod throws exeption with configfailurepolicy as continue. — committed to dipak-pawar/testng by dipak-pawar 7 years ago
- fixes #1426 if @BeforeMethod throws exception * @AfterMethod should be called with configfailurepolicy as continue. * @AfterMethod(alwaysRun = true) should be called with configfailurepolicy as defaul... — committed to dipak-pawar/testng by dipak-pawar 7 years ago
- Adds tests for @AfterMethod(alwaysRun = true) if @BeforeMethod is failing #1426 — committed to dipak-pawar/testng by dipak-pawar 7 years ago
- Adds tests for @AfterMethod(alwaysRun = true) if @BeforeMethod is failing #1426 — committed to dipak-pawar/testng by dipak-pawar 7 years ago
- * Added fix for #1426 * More tests around it — committed to dipak-pawar/testng by dipak-pawar 7 years ago
- * Added fix for #1426 * More tests around it — committed to dipak-pawar/testng by dipak-pawar 7 years ago
Cédric has some issues with maven central and you can follow #1506