frameworkium-core icon indicating copy to clipboard operation
frameworkium-core copied to clipboard

Should the UITestRunner have alwaysRun set on afterMethod?

Open davecpayne opened this issue 5 years ago • 4 comments

Describe the Issue I've found that if an exception is thrown in the setUpClass or setTestName methods (annotated with @BeforeClass and @BeforeMethod respectively) of UITestRunner, then the subsequent test(s) are skipped, and so the afterMethod method doesn't execute. This meant that the Chrome session didn't get killed.

Adding alwaysRun=true to the @AfterMethod annotation seems to have resolved this issue.

Is there any downside to that which I might be missing? If not, I'm happy to submit a PR with that change in.

To Reproduce Steps to reproduce the behavior:

  1. Set up a BDD test project using Chrome as the browser.
  2. Cause an exception to be thrown during one of the @Before... methods in UITestRunner.
  3. Execute the UITestRunner.

Expected Behaviour The test(s) should be skipped, and the Chrome session should be closed gracefully.

Versions (please complete the following information):

  • Frameworkium-core version: [e.g. 3.0.0]
  • OS: CentOS 7.6.1810
  • Browser: Chromium
  • Version: 71

Additional Context Add any other context about the problem here. I originally raised this in the Frameworkium BDD project's issues, but just realised that maybe they don't get much attention. Happy to delete either that one or this one

davecpayne avatar Mar 09 '20 17:03 davecpayne

Hi davecpayne,

This is definitely a bug. Please go ahead with a pull request and we will merge it in

Mjl33 avatar Mar 10 '20 13:03 Mjl33

Done with PR here: https://github.com/Frameworkium/frameworkium-bdd/pull/15

davecpayne avatar Mar 11 '20 08:03 davecpayne

The build on the above PR seems to be failing for unrelated reasons - possibly to do with the browser version?

davecpayne avatar Mar 19 '20 22:03 davecpayne

I've migrated to from TravisCI to github Actions. The CI workflow is a lot more stable. If you would rebase this onto the current master, it should pass the build (barring any real test failures).

Optionally I can take over and do that for you.

Mjl33 avatar Jan 05 '21 13:01 Mjl33