stebi
13 years agoOccasional Contributor
Enable/Disable Test Items via Code
Hi,
I don't want all tests of my project to be run all the time. I have structured the tests like that (in the "Test Items" panel):
EnableTests
[-] SmokeTests
* Test 1
* ...
* Test N
[-] DetailedTests
* Test 1
* ...
* Test N
The first Test "EnableTests" should enable the SmokeTest-Group and only if nightly testing "DetailedTests".
I'm able to scan through all test items and see if they are "enabled", but trying to set the property results in an error.
E.g. (Delphi Script):
Project.TestItems[1].Enabled := True;
Results in:
---------------------------
Wrong number of parameters or invalid property assignment.
Enabled
---------------------------
How do I enable/disable a specific test item via code? Is there a better location for enabling tests than using a test itself for that?
If there isn't any possibility to do it like that, maybe I can prevent a test from starting via "Test Engine Events"->OnStartTest?
Thanks in advance for any help.
I don't want all tests of my project to be run all the time. I have structured the tests like that (in the "Test Items" panel):
[-] SmokeTests
*
*
*
[-] DetailedTests
*
*
*
The first Test "EnableTests" should enable the SmokeTest-Group and only if nightly testing "DetailedTests".
I'm able to scan through all test items and see if they are "enabled", but trying to set the property results in an error.
E.g. (Delphi Script):
Project.TestItems[1].Enabled := True;
Results in:
---------------------------
Wrong number of parameters or invalid property assignment.
Enabled
---------------------------
How do I enable/disable a specific test item via code? Is there a better location for enabling tests than using a test itself for that?
If there isn't any possibility to do it like that, maybe I can prevent a test from starting via "Test Engine Events"->OnStartTest?
Thanks in advance for any help.