Conditional skipping of TestNG tests

后端 未结 5 1182
猫巷女王i
猫巷女王i 2021-02-09 07:21

I don\'t have much experience with TestNG annotations, however I am trying to build a test suite using TestNG framework and POM design pattern for a retail website. I am plannin

5条回答
  •  滥情空心
    2021-02-09 08:08

    Since 6.13 throw new SkipException("Skipping the test case"); won't work. I have to set status before throwing exception, otherwise test status will be failure instead of skipped:

    iTestResult.setStatus(TestResult.SKIP); throw new SkipException("Skipping the test case");

    Probably it will be fixed/changed in next releases, please see https://github.com/cbeust/testng/issues/1632 for details.

提交回复
热议问题