I am not a tester, but have to write tests for our WPF desktop software. We are using Ranorex.
I am planning to have hundreds of test cases in single test suite. Probably grouped by using smart folders. Please criticize my plan if it's wrong.
How to properly organize test cases to be able to edit/delete them, add new, etc. without affecting existing test cases?
Tests are running one after another. If certain test is deleted or new one is inserted then following up test has to be adjusted. To me it's a problem, especially in team environment, where different people write tests and I am thinking how to make test less dependend on other tests.
I can think of following possibilities:
1. Restore complete environment
Default state: no software is running. Each test case should start the software and exit software after test is completed.
Software test - Test suite
- Main window test 1 - Test case
- Setup
... start software ...
Test body - Recording
- Teardown
... exit software ...
+ Main window test 2 - Test case // same structure as test 1
+ Main window test 3 - Test case // same structure as test 1
This is very easy abstract approach, but is also very inefficient time wise. While generally we don't care about duration of nightly tests my concern is development time: when testing test cases (debugging) I'd be forced to wait (software start up takes long time).
2. Nested structure
Test cases can be organized by nested smart folders, where inner folder will have more local function. E.g. outer will start software, inner will switch to window, more inner - switch tab, etc. Tests then are grouped by control location.
Software test - Test suite
- Setup
... start software ...
- Main window - Smart folder
- Setup
... switch to main window ...
+ Main window test 1 - Test case
+ Main window test 2 - Test case
+ Main window test 3 - Test case
- Teardown
... switch back to ???? ...
- Teardown
... exit software ...
When debugging I can disable all tests, then enable just one and click "Run to here". That will go through all parent folders setups. Now I can run my single test multiple times without having to restart software, wait, etc.
Problem with this approach is to what switch back??? I have to define "default" state for each of such nested folder containing test cases and each test inside should restore exactly this state at the end. This seems quite tedious, e.g. a test which fills the form to only check what button "Ok" is enabled will have to clear everything afterwards.
3. Are there more options?
This is my question. Is there another option? Am I overthinking all this without knowing a simple thing (which one)?