2025-01-26 12:00:55 +08:00
import {
AgentOverChromeBridge ,
getBridgePageInCliSide ,
} from '@/bridge-mode/agent-cli-side' ;
2025-01-26 20:34:56 +08:00
import { sleep } from '@midscene/core/utils' ;
2025-01-26 12:00:55 +08:00
import { describe , expect , it , vi } from 'vitest' ;
vi . setConfig ( {
2025-02-13 15:53:53 +08:00
testTimeout : 300 * 1000 ,
2025-01-26 12:00:55 +08:00
} ) ;
2025-02-14 21:54:47 +08:00
const describeIf = process . env . BRIDGE_MODE ? describe : describe.skip ;
describeIf ( 'drag event' , ( ) = > {
2025-01-26 12:00:55 +08:00
it ( 'agent in cli side, current tab' , async ( ) = > {
2025-02-08 13:05:17 +08:00
const agent = new AgentOverChromeBridge ( {
2025-02-14 21:54:47 +08:00
cacheId : 'finish-form-and-submit' ,
2025-02-08 13:05:17 +08:00
} ) ;
2025-02-13 15:53:53 +08:00
await agent . connectCurrentTab ( ) ;
2025-02-08 13:05:17 +08:00
2025-02-13 15:53:53 +08:00
await sleep ( 2000 ) ;
2025-01-26 20:34:56 +08:00
2025-02-14 21:54:47 +08:00
await agent . aiAction (
'Use the test data to complete the form,Comply with the following restrictions: 1. The Captcha code is not required 2. No need to click the register button' ,
) ;
2025-01-26 12:00:55 +08:00
await agent . destroy ( ) ;
} ) ;
} ) ;