Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

test(workflows): wait for the library card before selecting it (#10212)

Lincoln Stein34610109684c
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDialog.browser.test.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDialog.browser.test.tsx
index b486375586..e0f915aa5d 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDialog.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDialog.browser.test.tsx
@@ -1861,7 +1861,11 @@ describe('WorkflowLibraryDialog — This project', () => {
});
};
const clickText = (text: string) => click(buttonWithText(text));
- const selectCard = (workflowId: string) => click(card(workflowId));
+ // The grid can render its cards a frame after the dialog settles on a loaded CI worker.
+ const selectCard = async (workflowId: string) => {
+ await vi.waitFor(() => expect(card(workflowId)).not.toBeNull());
+ await click(card(workflowId));
+ };
const menuItem = (value: string) => document.querySelector<HTMLElement>(`[data-menu-item="${value}"]`);
const railMenuTrigger = () => rail()?.querySelector<HTMLElement>('[aria-label="More actions"]');