Opened 12 years ago
Closed 8 years ago
#278 closed task (discarded)
implement unit tests + framework
Reported by: | epruesse | Owned by: | devel |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | global | Version: | gtkport |
Keywords: | Cc: |
Description
The GUI needs unit tests.
- The dummy classes from SL/TREEDISP should probably go to WINDOW.
- All non-gui dependent classes need raw tests.
Testing the GUI itself is more difficult. Still, it might be doable. GTK has some test-frame work functions. If they can disable all theming so that the rendering looks the same on all platforms, we might get by with taking/comparing screenshots for test-dialogs. I.e. take screenshots, compare bitwise, if different, ask to confirm, save new accepted test-result.
Change History (4)
comment:1 Changed 11 years ago by epruesse
- Priority changed from normal to minor
comment:2 Changed 11 years ago by epruesse
- Component changed from !NoIdea to global
- Priority changed from minor to normal
comment:3 in reply to: ↑ description Changed 11 years ago by westram
Replying to epruesse:
The GUI needs unit tests.
I dont think the GUI needs many test, tests for canvas contents (like disabled TreeDisplay test) would suffice for me.
But i think the UI needs tests! The UI is used by the , so we need tests simulating a -interaction, e.g. something like
start_arb("demo.arb"); TEST_EXPECT_AWAR_CONTAINS(AWAR_MARKED_SPECIES_COUNTER, "28 marked"); click_button("speciesinfo"); // e.g. use action name TEST_EXPECT_WINDOW_OPENED("Species Information"); // or internal window name click_button("search"); TEST_EXPECT_WINDOW_OPENED("SEARCH and QUERY"); change_awar("expression1", "*bac*); click_button("Search"); TEST_EXPECT_SELECTION_LIST_SIZE("hitlist", 15); TEST_EXPECT_SELECTION_LIST_CONTAINS("hitlist", "BacMegat"); TEST_EXPECT_AWAR_CONTAINS(AWAR_MARKED_SPECIES_COUNTER, "28 marked"); click_button("Mark Listed Unmark Rest"); TEST_EXPECT_AWAR_CONTAINS(AWAR_MARKED_SPECIES_COUNTER, "15 marked"); click_button("Unmark Listed Mark Rest"); TEST_EXPECT_AWAR_CONTAINS(AWAR_MARKED_SPECIES_COUNTER, "85 marked"); // etc..
Such tests should run with invisible GUI.
comment:4 Changed 8 years ago by westram
- Resolution set to discarded
- Status changed from new to closed
gtk-port is dead
The unit test in TreeDisplay? was disabled again by r10850.
The problem is that the display varies by target platform, if only slightly. That is quite normal and typically addressed by having reference images for each target platform and mechanisms allowing testers to approve new test results manually.
We need extra support for this in both UNIT_TEST and ideally Jenkins to make result approval simpler.