Hi, does any one has code examples for testing Tor...
# tornadofx
a
Hi, does any one has code examples for testing TornadoFx components using TestFx?
a
Thank you! It's very comprehensive
c
You're welcome!
I made the decision to use real Model and Controller instances while testing the View, but I used mocks for the service layer and below. In my experience, using mock or fake instances for the Models and Controllers in View tests requires a lot of extra setup. It's sort of a pragmatic compromise to consider the MVC triad as the unit rather than the View alone as the unit.
It also uses two Page Object Model instances for the same page. The Real one simulates real user interaction (mouse movement, clicks, typing), whereas the Fast one interacts with Node and other instances directly in order to transform state as quickly as possible. The tests call the Fast instances when setting up the initial state, but then call the Real instance when performing the execution and verification parts of the test.