addressbook-level4
addressbook-level4 copied to clipboard
Expand the scope of system tests
The "system" tests in test/java/guitests/
currently act somewhat as a unit test for GUI and commands.
With PR #536, GUI unit tests are done in a seperate architecture and test cases. With PRs associated to #172, commands themselves already have their appropriate unit tests.
As such, the system tests should be more thorough. For example, after performing a valid delete, DeleteCommandTest
should also ensure that the StatusBar's time is updated, and that StorageManager has also saved the file.
Remaining tests:
- [ ] ExitCommand
- [x] HelpCommand
- [ ] HistoryCommand
- [ ] ListCommand
- [x] ~UndoCommand~ (doesn't make sense to be tested in isolation)
- [x] ~RedoCommand~ (doesn't make sense to be tested in isolation)
@damithc do we have to write system tests for:
-
ExitCommand
(I think we definitely can't write for this :P) -
HelpCommand
-
HistoryCommand
-
ListCommand
-
RedoCommand
-
UndoCommand
For UndoCommand
and RedoCommand
, we have integrated them with other system tests. For the remaining 4 commands, arguably we need a system test to ensure that upon execution of these commands, the system is updated / not updated accordingly.
-
ExitCommand
: we should, but probably can't, so it's ok. -
HelpCommand
: yes -
HistoryCommand
: yes -
ListCommand
: yes -
RedoCommand
/UndoCommand
: if they are thoroughly tested by other commands, can be omitted. But it is unlikely other tests will push the limits of these commands, so I guess yes, we can have a system test for these too, but can be a lower priority.
Noted. I will put the emphasis on porting the existing tests from guitests
to systemtests
, before implementing for the commands listed above. ^^
ExitCommand (I think we definitely can't write for this :P)
The test will type in the exit
keyword, and then test that the MainWindow
/MainApp
is closed.
The test will type in the exit keyword, and then test that the MainWindow/MainApp is closed.
After investigating this, @yamidark and I realized that it's not possible to test that the MainWindow / MainApp is closed because the JVM shuts down after the exit
command is executed; the test will end immediately. See here for the detailed discussion.