Skip to content

configfailurepolicy=continue only works for BeforeTest when using TestNG XML file #2731

Open
@Mei-self

Description

@Mei-self

TestNG Version

7.5

Expected behavior

if configfailurepolicy=continue and any BeforeXXX method fails, the remaining test method should execute not skip

Actual behavior

only BeforeTest fails, the remaining test method would execute

Is the issue reproducible on runner?

  • Shell
  • Maven
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans

Test case sample

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="TestSuite" configfailurepolicy="continue">
    <test name="Test">
        <classes>
            <class name="TestConfigFail"/>
        </classes>
    </test>
</suite>
public class TestConfigFail {

    @BeforeSuite
    public void beforeSuite() {
        Assert.fail("This before suite is fail");
    }

    @BeforeTest
    public void beforeTest() {
        Assert.fail("This before test is fail");
    }

    @BeforeClass
    public void beforeClass(){
        Assert.fail("This before class is fail");
    }

    @BeforeMethod
    public void beforeMethod(){
        Assert.fail("This before method is fail");
    }

    @Test
    public void test() {
        System.out.println("This is test method");
    }
}

Contribution guidelines

Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions