Running test suite teardown steps when specific testcases are run

Bug reports.
hsarmah2021
Posts: 10
Joined: Tue Oct 27, 2020 1:43 pm

Running test suite teardown steps when specific testcases are run

Post by hsarmah2021 » Wed Jan 27, 2021 9:56 am

Hello,
I have some teardown steps in the testsuite for sending email and generating reports, and I have noticed that the teardown steps do not run when I run specific test via command line from the test suite, they only work when the complete test suite is run. Does anyone know why is it so and how to resolve this?

User avatar
Stub
Posts: 425
Joined: Fri Jul 15, 2016 1:35 pm

Re: Running test suite teardown steps when specific testcases are run

Post by Stub » Wed Jan 27, 2021 12:53 pm

It doesn't run any of the surrounding parent Setup/Teardown steps because it starts and starts at the particular Test Case that you asked it to specifically run - so the test has to be self contained. But you can setup a Run Configuration which incorporates a subset of Test Cases to execute. If you then run that customised runconfig, it'll do all of the Setup/Teardown steps because it's running the whole Test Suite, but with just a defined subset of Test Case.