lib/third_party/imgui/imgui_test_engine/README.md
Automation system for Dear ImGui and applications/games/engines using Dear ImGui.
Because Dear ImGui tends to be wired in many low-level subsystems within your codebase, you can leverage that to automate actions interacting with them. It may be a very efficient solution to automate and tests many things (engine systems etc.).
Running Dear ImGui Test Suite, in Fast Mode, with full rendering enabled:
https://user-images.githubusercontent.com/8225057/182409619-cd3bf990-b383-4a6c-a6ba-c5afe7557d6c.mp4
Quick overview of what automation code may look like like:
ImGuiTest* test = IM_REGISTER_TEST(e, "demo_test", "test1");
test->TestFunc = [](ImGuiTestContext* ctx)
{
ctx->SetRef("My Window"); // Set a base path so we don't have to specify full path afterwards
ctx->ItemClick("My Button"); // Click "My Button" inside "My Window"
ctx->ItemCheck("Node/Checkbox"); // Open "Node", find "Checkbox", ensure it is checked if not checked already.
ctx->ItemInputValue("Slider", 123); // Find "Slider" and set the value to 123
IM_CHECK_EQ(app->SliderValue, 123); // Check value on app side
ctx->MenuCheck("//Dear ImGui Demo/Tools/About Dear ImGui"); // Show Dear ImGui About Window (assume Demo window is open)
};
MenuCheck("Edit/Options/Enable Grid") or run more programmatic queries ("list openable items in that section, then open them all"). So from your POV it could be used for simple smoke testing ("open all our tools") or for more elaborate testing ("interact with xxx and xxx, check result").See Wiki sections: