File tree Expand file tree Collapse file tree
src/frontend/tests/core/integrations Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( / r f _ _ n o d e - T a v i l y S e a r c h C o m p o n e n t - / ) ;
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" )
You can’t perform that action at this time.
0 commit comments