File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
typescript-sdk/apps/dojo/e2e2/tests Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ import { test , expect } from '@playwright/test' ;
2+
3+ test ( 'renders initial message' , async ( { page } ) => {
4+ await page . goto ( 'http://localhost:9999/langgraph-fastapi/feature/agentic_chat' ) ;
5+
6+ await expect ( page . getByText ( 'Hi, I\'m an agent. Want to chat?' ) ) . toBeVisible ( ) ;
7+ } ) ;
8+
9+ test ( 'responds to user message' , async ( { page } ) => {
10+ await page . goto ( 'http://localhost:9999/langgraph-fastapi/feature/agentic_chat' ) ;
11+
12+ const textarea = page . getByPlaceholder ( 'Type a message...' ) ;
13+ textarea . fill ( 'How many sides are in a square? Please answer in one word. Do not use any punctuation, just the number in word form.' ) ;
14+ await page . keyboard . press ( 'Enter' ) ;
15+
16+ page . locator ( '.copilotKitInputControls button.copilotKitInputControlButton' ) . click ( ) ;
17+
18+ await expect ( page . locator ( '.copilotKitMessage' ) ) . toHaveCount ( 3 ) ;
19+ await expect ( page . locator ( '.copilotKitMessage.copilotKitAssistantMessage' ) ) . toHaveCount ( 2 ) ;
20+ await expect ( page . locator ( '.copilotKitMessage.copilotKitUserMessage' ) ) . toHaveCount ( 1 ) ;
21+ await expect ( page . locator ( '.copilotKitMessage.copilotKitAssistantMessage' ) . last ( ) ) . toHaveText ( 'four' , { ignoreCase : true } ) ;
22+ } ) ;
Original file line number Diff line number Diff line change 1+ import { test , expect } from '@playwright/test' ;
2+
3+ test ( 'renders initial message' , async ( { page } ) => {
4+ await page . goto ( 'http://localhost:9999/langgraph-typescript/feature/agentic_chat' ) ;
5+
6+ await expect ( page . getByText ( 'Hi, I\'m an agent. Want to chat?' ) ) . toBeVisible ( ) ;
7+ } ) ;
8+
9+ test ( 'responds to user message' , async ( { page } ) => {
10+ await page . goto ( 'http://localhost:9999/langgraph-typescript/feature/agentic_chat' ) ;
11+
12+ const textarea = page . getByPlaceholder ( 'Type a message...' ) ;
13+ textarea . fill ( 'How many sides are in a square? Please answer in one word. Do not use any punctuation, just the number in word form.' ) ;
14+ await page . keyboard . press ( 'Enter' ) ;
15+
16+ page . locator ( '.copilotKitInputControls button.copilotKitInputControlButton' ) . click ( ) ;
17+
18+ await expect ( page . locator ( '.copilotKitMessage' ) ) . toHaveCount ( 3 ) ;
19+ await expect ( page . locator ( '.copilotKitMessage.copilotKitAssistantMessage' ) ) . toHaveCount ( 2 ) ;
20+ await expect ( page . locator ( '.copilotKitMessage.copilotKitUserMessage' ) ) . toHaveCount ( 1 ) ;
21+ await expect ( page . locator ( '.copilotKitMessage.copilotKitAssistantMessage' ) . last ( ) ) . toHaveText ( 'four' , { ignoreCase : true } ) ;
22+ } ) ;
You can’t perform that action at this time.
0 commit comments