-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Programmatically activating widget? #3949
Comments
There is such an automation system see #435 but it hasn’t been made public. |
…ling, using nav queries. (ocornut#4449) Not using counter/modulo anymore and special provisions to handle tab wrapping with ImGuiListClipper. Wrapping may be done better as a next-frame forwarded request. Also one extra step toward ocornut#3949 ocornut#3985
@ocornut is there any update on the automation framework? Any ETA for when it will be made public? |
This is still being tested/iterated with selected partners and sponsors. We’re working on a license and expect to release it publicly between Q2 and Q3. |
Most likely done via #435 🥳 |
Yes as per your specific need Test Engine should ideally be the answer. |
Background
I am looking to write some unit tests for an imgui based application.
Say I have a window with some text inputs, and a "create" button. It all works, but I want to write a unit that verifies when the button is pressed that the desired action occurs.
The immediate mode methodology makes it trivially easy to pre-fill the form with my test input strings, but I'm not sure how I'd go about setting the "button id
##example
has been pressed" state.I could add additional variables to allow triggering the button being pressed, e.g
as discussed in #966 but I would rather not, as it clutters up the code just for testing (which adds more potential for errors)
Main question
At the end of the discussion #966 (comment) there was a comment saying
I am wondering if this has come to existence yet? I had a search around and couldn't find any further mention of it (but it's a slightly hard thing to know the search terms for!)
Followup ideas
I'm imagining something very vaguely along the lines of this
I'm using the imgui-rs bindings, not sure how exactly that'd translate to the original C++, but should give a rough idea as pseudo code - basically on next query I want the element with that ID to be as if the user clicked on it
My other thought was I could determine the button location and simulate a mouse click (by moving the cursor position to there and setting the mouse button as down) - this might actually be a better way to go since it exactly what I'm wanting to test, just the implementation is slightly more complex
The text was updated successfully, but these errors were encountered: