Hi!
I am automating tests on an app using ImGui for its UI, and I am running into trouble with exploring childs, and more importantly tables.
As the title states: GatherItems doesn't seem to be able to find items inside childs (BeginChild/EndChild) or tables BeginTable/EndTable), while it will find items inside things like tree nodes.
Here is a minimalist-ish test case.
auto test = IM_REGISTER_TEST(engine, "tests", "gather childs");
test->GuiFunc = [](ImGuiTestContext*) {
if(ImGui::Begin("Window")) {
if(ImGui::BeginChild("Child")) {
ImGui::Button("Button1");
ImGui::Button("Button2");
ImGui::Button("Button3");
ImGui::Button("Button4");
}
ImGui::EndChild();
ImGui::End();
}
};
test->TestFunc = [](ImGuiTestContext* ctx) {
IM_CHECK_NE(ctx->ItemInfoOpenFullPath("//Window")->ID, 0); // Ok
IM_CHECK_NE(ctx->ItemInfoOpenFullPath("//Window/**/Button2")->ID, 0); // Ok
ImGuiTestItemList items;
ctx->GatherItems(&items, "//Window");
std::printf("%llu items\n", items.size()); // Only 2 items found, not sure what they are, but they do not match any of the expected items
for(const ImGuiTestItemInfo& info : items) {
std::printf(" %x: '%s'\n", info.ID, info.DebugLabel);
}
IM_CHECK_GT(items.size(), 2); // Fails: items.size() is 2
};
Hi! I am automating tests on an app using ImGui for its UI, and I am running into trouble with exploring childs, and more importantly tables. As the title states:
GatherItems
doesn't seem to be able to find items inside childs (BeginChild
/EndChild
) or tablesBeginTable
/EndTable
), while it will find items inside things like tree nodes.Here is a minimalist-ish test case.