Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to testing async program? #197

Open
linying1991 opened this issue Nov 10, 2021 · 4 comments
Open

How to testing async program? #197

linying1991 opened this issue Nov 10, 2021 · 4 comments
Labels

Comments

@linying1991
Copy link

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!

@linying1991 linying1991 changed the title how to testing async program? How to testing async program? Nov 10, 2021
@thomthom
Copy link
Member

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.)

@linying1991
Copy link
Author

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!

@thomthom
Copy link
Member

I asked around internally, we use Squish for UI test automation.

@linying1991
Copy link
Author

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~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants