-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Improved unit/regression test support #3926
Comments
What current test strategies exist for egui applications? I'm looking to feature/system test an app using egui and am lookong at where to start. I'm coming from web where interfaces are pretty easy to test since assertion against DOM state is trivial/well supported. |
Not sure if is counts as a test strategy, but in Surfer we use egui_skia https://github.com/lucasmerlin/egui_skia (but a local version that supports egui 0.25, we still need to add support for 0.26) and generate images that we compare. See https://gitlab.com/surfer-project/surfer/-/blob/main/src/tests/snapshot.rs?ref_type=heads Limitations are (among others):
Still, it gives us some code coverage and tests have helped us from breaking stuff unintentionally so we think it is worth it. |
Is your feature request related to a problem? Please describe.
To improve regression testing, it would be nice if there is was a mechanism to "inject" mouse and keyboard presses from code. (I guess there may be, just that it is not that simple to figure out how.)
Describe the solution you'd like
Ideally a testing framework to make it easier to test egui applications. However, a clear described mechanism to force certain events would be a first step.
Describe alternatives you've considered
Additional context
This is somewhat related to #1129 (we are using egui-skia to generate test images, but can only test features triggered by messages, not "pressing" keys/mouse buttons in suitable areas).
The text was updated successfully, but these errors were encountered: