Skip to content

Commit 16c748b

Browse files
committed
fix market research input found
1 parent e13d33e commit 16c748b

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

src/frontend/tests/core/integrations/Market Research.spec.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,27 @@ withEventDeliveryModes(
3535
});
3636

3737
await initialGPTsetup(page);
38-
await page
39-
.getByTestId("popover-anchor-input-api_key")
40-
.nth(0)
41-
.fill(process.env.TAVILY_API_KEY ?? "");
38+
39+
// Find the Tavily node and fill the API key with retry
40+
const tavilyNode = page.getByTestId(/rf__node-TavilySearchComponent-/);
41+
const tavilyApiKeyInput = tavilyNode.getByTestId("popover-anchor-input-api_key");
42+
43+
const maxRetries = 5;
44+
for (let attempt = 0; attempt < maxRetries; attempt++) {
45+
await tavilyApiKeyInput.waitFor({ state: "visible", timeout: 10000 });
46+
await tavilyApiKeyInput.click();
47+
await tavilyApiKeyInput.clear();
48+
await tavilyApiKeyInput.fill(process.env.TAVILY_API_KEY ?? "");
49+
await tavilyApiKeyInput.press("Tab"); // Trigger blur to save value
50+
51+
// Verify the value was filled
52+
const value = await tavilyApiKeyInput.inputValue();
53+
if (value === process.env.TAVILY_API_KEY) {
54+
break;
55+
}
56+
57+
await page.waitForTimeout(500);
58+
}
4259

4360
await page
4461
.getByTestId("handle-parsercomponent-shownode-data or dataframe-left")

0 commit comments

Comments
 (0)