testup-2
testup-2 copied to clipboard
How to testing async program?
The following content is translated by machine from DeepL, please forgive if the language is not correct
There are many asynchronous methods in SketchUp, such as UI::start_timer, HtmlDialog#add_action_callback, we sometimes encapsulate these asynchronous methods (the result of encapsulation is naturally asynchronous), how do we unit test these? Thanks!
Hm... I'm not sure. I've not setup any tests for HtmlDialog callbacks or timers. TestUp is just a wrapper on top of Minitest, and I don't think Minitest (or any other typical unit test framework) is well suited for this kind of testing.
This sounds like you are testing UI interaction. In which case you might want to look at other tools that specialize on testing UI (simulating mouse events and keyboard events.)
Indeed, I searched quite a few keywords and couldn't find a way to test asynchronously. I'll look for another way. Thanks for the reply!
I asked around internally, we use Squish for UI test automation.
The following content is translated by machine from DeepL, please forgive if the language is not correct
Great, I'll look into it, thanks a lot~