@elizaos/client 1.5.5-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +350 -0
- package/dist/assets/empty-module-CLMscLYw.js +1 -0
- package/dist/assets/main-BBZ_3lkn.css +5999 -0
- package/dist/assets/main-C5zNUkXH.js +7 -0
- package/dist/assets/main-Dz64ENQg.js +614 -0
- package/dist/assets/react-vendor-DM5m98rr.js +545 -0
- package/dist/assets/ui-vendor-BQCqNqg0.js +1 -0
- package/dist/elizaos-avatar.png +0 -0
- package/dist/elizaos-icon.png +0 -0
- package/dist/elizaos-logo-light.png +0 -0
- package/dist/elizaos.webp +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/images/agents/agent1.png +0 -0
- package/dist/images/agents/agent2.png +0 -0
- package/dist/images/agents/agent3.png +0 -0
- package/dist/images/agents/agent4.png +0 -0
- package/dist/images/agents/agent5.png +0 -0
- package/dist/index.html +14 -0
- package/index.html +24 -0
- package/package.json +159 -0
- package/postcss.config.js +3 -0
- package/public/elizaos-avatar.png +0 -0
- package/public/elizaos-icon.png +0 -0
- package/public/elizaos-logo-light.png +0 -0
- package/public/elizaos.webp +0 -0
- package/public/favicon.ico +0 -0
- package/public/images/agents/agent1.png +0 -0
- package/public/images/agents/agent2.png +0 -0
- package/public/images/agents/agent3.png +0 -0
- package/public/images/agents/agent4.png +0 -0
- package/public/images/agents/agent5.png +0 -0
- package/src/App.tsx +222 -0
- package/src/components/AgentDetailsPanel.tsx +147 -0
- package/src/components/ChatInputArea.tsx +196 -0
- package/src/components/ChatMessageListComponent.tsx +139 -0
- package/src/components/actionTool.tsx +186 -0
- package/src/components/add-agent-card.tsx +77 -0
- package/src/components/agent-action-viewer.tsx +816 -0
- package/src/components/agent-avatar-stack.tsx +121 -0
- package/src/components/agent-card.cy.tsx +259 -0
- package/src/components/agent-card.tsx +177 -0
- package/src/components/agent-creator.tsx +142 -0
- package/src/components/agent-log-viewer.tsx +645 -0
- package/src/components/agent-memory-edit-overlay.tsx +461 -0
- package/src/components/agent-memory-viewer.tsx +504 -0
- package/src/components/agent-settings.tsx +270 -0
- package/src/components/agent-sidebar.tsx +178 -0
- package/src/components/api-key-dialog.tsx +113 -0
- package/src/components/app-sidebar.tsx +685 -0
- package/src/components/array-input.tsx +116 -0
- package/src/components/audio-recorder.tsx +292 -0
- package/src/components/avatar-panel.tsx +141 -0
- package/src/components/character-form.tsx +1138 -0
- package/src/components/chat.tsx +1813 -0
- package/src/components/combobox.tsx +187 -0
- package/src/components/confirmation-dialog.tsx +59 -0
- package/src/components/connection-error-banner.tsx +101 -0
- package/src/components/connection-status.cy.tsx +73 -0
- package/src/components/connection-status.tsx +155 -0
- package/src/components/copy-button.tsx +35 -0
- package/src/components/delete-button.tsx +24 -0
- package/src/components/env-settings.tsx +261 -0
- package/src/components/group-card.tsx +160 -0
- package/src/components/group-panel.tsx +543 -0
- package/src/components/input-copy.tsx +21 -0
- package/src/components/logs-page.tsx +41 -0
- package/src/components/media-content.tsx +385 -0
- package/src/components/memory-graph.tsx +170 -0
- package/src/components/missing-secrets-dialog.tsx +72 -0
- package/src/components/onboarding-tour.tsx +247 -0
- package/src/components/page-title.tsx +8 -0
- package/src/components/plugins-panel.tsx +383 -0
- package/src/components/profile-card.tsx +66 -0
- package/src/components/profile-overlay.tsx +283 -0
- package/src/components/retry-button.tsx +28 -0
- package/src/components/secret-panel.tsx +1505 -0
- package/src/components/server-management.tsx +264 -0
- package/src/components/split-button.tsx +148 -0
- package/src/components/stop-agent-button.tsx +99 -0
- package/src/components/ui/alert-dialog.cy.tsx +333 -0
- package/src/components/ui/alert-dialog.tsx +115 -0
- package/src/components/ui/alert.tsx +49 -0
- package/src/components/ui/avatar.cy.tsx +180 -0
- package/src/components/ui/avatar.tsx +57 -0
- package/src/components/ui/badge.cy.tsx +146 -0
- package/src/components/ui/badge.tsx +43 -0
- package/src/components/ui/button.cy.tsx +177 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/card.cy.tsx +160 -0
- package/src/components/ui/card.tsx +73 -0
- package/src/components/ui/chat/animated-markdown.tsx +59 -0
- package/src/components/ui/chat/chat-bubble.tsx +178 -0
- package/src/components/ui/chat/chat-container.tsx +51 -0
- package/src/components/ui/chat/chat-input.cy.tsx +169 -0
- package/src/components/ui/chat/chat-input.tsx +47 -0
- package/src/components/ui/chat/chat-message-list.tsx +61 -0
- package/src/components/ui/chat/chat-tts-button.tsx +199 -0
- package/src/components/ui/chat/code-block.tsx +79 -0
- package/src/components/ui/chat/expandable-chat.tsx +131 -0
- package/src/components/ui/chat/hooks/useAutoScroll.ts +86 -0
- package/src/components/ui/chat/markdown.tsx +209 -0
- package/src/components/ui/chat/message-loading.tsx +48 -0
- package/src/components/ui/checkbox.cy.tsx +170 -0
- package/src/components/ui/checkbox.tsx +30 -0
- package/src/components/ui/collapsible.cy.tsx +283 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/command.cy.tsx +313 -0
- package/src/components/ui/command.tsx +143 -0
- package/src/components/ui/dialog.cy.tsx +279 -0
- package/src/components/ui/dialog.tsx +104 -0
- package/src/components/ui/dropdown-menu.cy.tsx +273 -0
- package/src/components/ui/dropdown-menu.tsx +281 -0
- package/src/components/ui/input.cy.tsx +82 -0
- package/src/components/ui/input.tsx +27 -0
- package/src/components/ui/label.cy.tsx +157 -0
- package/src/components/ui/label.tsx +19 -0
- package/src/components/ui/resizable.tsx +42 -0
- package/src/components/ui/scroll-area.cy.tsx +242 -0
- package/src/components/ui/scroll-area.tsx +46 -0
- package/src/components/ui/select.cy.tsx +277 -0
- package/src/components/ui/select.tsx +155 -0
- package/src/components/ui/separator.cy.tsx +145 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/sheet.cy.tsx +324 -0
- package/src/components/ui/sheet.tsx +119 -0
- package/src/components/ui/sidebar.tsx +734 -0
- package/src/components/ui/skeleton.cy.tsx +149 -0
- package/src/components/ui/skeleton.tsx +17 -0
- package/src/components/ui/split-button.cy.tsx +274 -0
- package/src/components/ui/split-button.tsx +112 -0
- package/src/components/ui/switch.tsx +28 -0
- package/src/components/ui/tabs.cy.tsx +271 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/textarea.cy.tsx +136 -0
- package/src/components/ui/textarea.tsx +26 -0
- package/src/components/ui/toast.cy.tsx +209 -0
- package/src/components/ui/toast.tsx +126 -0
- package/src/components/ui/toaster.tsx +29 -0
- package/src/components/ui/tooltip.cy.tsx +244 -0
- package/src/components/ui/tooltip.tsx +30 -0
- package/src/config/agent-templates.ts +349 -0
- package/src/config/voice-models.ts +181 -0
- package/src/constants.ts +23 -0
- package/src/context/AuthContext.tsx +44 -0
- package/src/context/ConnectionContext.tsx +194 -0
- package/src/entry.tsx +9 -0
- package/src/hooks/__tests__/use-agent-tab-state.test.ts +137 -0
- package/src/hooks/__tests__/use-agent-update.test.tsx +250 -0
- package/src/hooks/__tests__/use-character-convert.test.ts +102 -0
- package/src/hooks/__tests__/use-panel-width-state.test.ts +243 -0
- package/src/hooks/__tests__/use-sidebar-state.test.ts +117 -0
- package/src/hooks/use-agent-management.ts +130 -0
- package/src/hooks/use-agent-tab-state.ts +74 -0
- package/src/hooks/use-agent-update.ts +469 -0
- package/src/hooks/use-character-convert.ts +138 -0
- package/src/hooks/use-confirmation.ts +55 -0
- package/src/hooks/use-delete-agent.ts +123 -0
- package/src/hooks/use-dm-channels.ts +198 -0
- package/src/hooks/use-elevenlabs-voices.ts +83 -0
- package/src/hooks/use-file-upload.ts +224 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/hooks/use-onboarding.tsx +49 -0
- package/src/hooks/use-panel-width-state.ts +147 -0
- package/src/hooks/use-partial-update.ts +288 -0
- package/src/hooks/use-plugin-details.ts +462 -0
- package/src/hooks/use-plugins.ts +119 -0
- package/src/hooks/use-query-hooks.ts +1263 -0
- package/src/hooks/use-server-agents.ts +62 -0
- package/src/hooks/use-server-version.tsx +47 -0
- package/src/hooks/use-sidebar-state.ts +50 -0
- package/src/hooks/use-socket-chat.ts +264 -0
- package/src/hooks/use-toast.ts +260 -0
- package/src/hooks/use-version.tsx +64 -0
- package/src/index.css +146 -0
- package/src/lib/api-client-config.ts +53 -0
- package/src/lib/api-type-mappers.ts +196 -0
- package/src/lib/export-utils.ts +123 -0
- package/src/lib/logger.ts +19 -0
- package/src/lib/media-utils.ts +170 -0
- package/src/lib/pca.test.ts +17 -0
- package/src/lib/pca.ts +52 -0
- package/src/lib/socketio-manager.ts +664 -0
- package/src/lib/utils.ts +168 -0
- package/src/main.tsx +16 -0
- package/src/mocks/empty-module.ts +12 -0
- package/src/mocks/node-module.ts +57 -0
- package/src/polyfills.ts +37 -0
- package/src/routes/agent-detail.tsx +30 -0
- package/src/routes/agent-list.tsx +27 -0
- package/src/routes/agent-settings.tsx +48 -0
- package/src/routes/character-detail.tsx +52 -0
- package/src/routes/character-form.tsx +79 -0
- package/src/routes/character-list.tsx +38 -0
- package/src/routes/chat.tsx +128 -0
- package/src/routes/createAgent.tsx +13 -0
- package/src/routes/group-new.tsx +50 -0
- package/src/routes/group.tsx +29 -0
- package/src/routes/home.tsx +218 -0
- package/src/routes/not-found.tsx +71 -0
- package/src/test/setup.ts +154 -0
- package/src/types/crypto-browserify.d.ts +4 -0
- package/src/types/index.ts +13 -0
- package/src/types/rooms.ts +8 -0
- package/src/types.ts +84 -0
- package/src/vite-env.d.ts +40 -0
- package/tailwind.config.ts +90 -0
- package/tsconfig.json +10 -0
- package/vite.config.ts +102 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shaw Walters and elizaOS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
# @elizaos/client
|
|
2
|
+
|
|
3
|
+
The official web client for ElizaOS agents, providing a modern React-based interface for interacting with ElizaOS agents.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🤖 Real-time agent communication via Socket.IO
|
|
8
|
+
- 💬 Chat interface with message history
|
|
9
|
+
- 🧠 Agent memory and action viewer
|
|
10
|
+
- 🔌 Plugin management interface
|
|
11
|
+
- 📊 Agent monitoring and logs
|
|
12
|
+
- 🎨 Modern, responsive UI with Tailwind CSS
|
|
13
|
+
- 🔐 Secure API key management
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bun add @elizaos/client
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### Development
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Install dependencies
|
|
27
|
+
bun install
|
|
28
|
+
|
|
29
|
+
# Run development server
|
|
30
|
+
bun run dev
|
|
31
|
+
|
|
32
|
+
# Build for production
|
|
33
|
+
bun run build
|
|
34
|
+
|
|
35
|
+
# Run tests
|
|
36
|
+
bun test
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Configuration
|
|
40
|
+
|
|
41
|
+
Configure via environment variables:
|
|
42
|
+
|
|
43
|
+
- `VITE_API_URL` - Backend API URL (default: http://localhost:3000)
|
|
44
|
+
- `VITE_SOCKET_URL` - Socket.IO server URL (default: http://localhost:3000)
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
MIT
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## ESLint Configuration (for contributors)
|
|
53
|
+
|
|
54
|
+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
55
|
+
|
|
56
|
+
- Configure the top-level `parserOptions` property like this:
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
export default tseslint.config({
|
|
60
|
+
languageOptions: {
|
|
61
|
+
// other options...
|
|
62
|
+
parserOptions: {
|
|
63
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
64
|
+
tsconfigRootDir: import.meta.dirname,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
|
|
71
|
+
- Optionally add `...tseslint.configs.stylisticTypeChecked`
|
|
72
|
+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
// eslint.config.js
|
|
76
|
+
import react from 'eslint-plugin-react';
|
|
77
|
+
|
|
78
|
+
export default tseslint.config({
|
|
79
|
+
// Set the react version
|
|
80
|
+
settings: { react: { version: '18.3' } },
|
|
81
|
+
plugins: {
|
|
82
|
+
// Add the react plugin
|
|
83
|
+
react,
|
|
84
|
+
},
|
|
85
|
+
rules: {
|
|
86
|
+
// other rules...
|
|
87
|
+
// Enable its recommended rules
|
|
88
|
+
...react.configs.recommended.rules,
|
|
89
|
+
...react.configs['jsx-runtime'].rules,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Running Tests
|
|
95
|
+
|
|
96
|
+
### Quick Start
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Run all tests with the ElizaOS UI automatically started
|
|
100
|
+
bun test
|
|
101
|
+
|
|
102
|
+
# Run tests with browser visible
|
|
103
|
+
bun run test:headed
|
|
104
|
+
|
|
105
|
+
# Run tests with Playwright UI mode for easier debugging
|
|
106
|
+
bun run test:ui
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Advanced Options
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Run a specific test file
|
|
113
|
+
bunx playwright test tests/05-modify-character-settings.spec.ts
|
|
114
|
+
|
|
115
|
+
# Run tests in a specific browser
|
|
116
|
+
bunx playwright test --project=chromium
|
|
117
|
+
|
|
118
|
+
# Run tests with verbose logging
|
|
119
|
+
bunx playwright test --debug
|
|
120
|
+
|
|
121
|
+
# Run tests and keep the browser open after tests finish
|
|
122
|
+
bunx playwright test --headed --timeout 0
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Test Architecture
|
|
126
|
+
|
|
127
|
+
### File Structure
|
|
128
|
+
|
|
129
|
+
- `playwright.config.ts`: Configuration for Playwright, including browser settings
|
|
130
|
+
- `tests/*.spec.ts`: Individual test files, numbered in dependency order
|
|
131
|
+
- `tests/utils.ts`: Shared utility functions for common operations
|
|
132
|
+
- `package.json`: Dependencies and scripts for running tests
|
|
133
|
+
|
|
134
|
+
### Test Files
|
|
135
|
+
|
|
136
|
+
Each test file is structured to be standalone but follows this naming convention:
|
|
137
|
+
|
|
138
|
+
1. `01-web-interface-access.spec.ts` - Basic access and initialization
|
|
139
|
+
2. `02-basic-conversation.spec.ts` - Message sending/receiving functionality
|
|
140
|
+
3. `03-character-configuration.spec.ts` - Character settings panel access
|
|
141
|
+
4. `04-view-character-info.spec.ts` - Character info panel functionality
|
|
142
|
+
5. `05-modify-character-settings.spec.ts` - Updating and saving character settings
|
|
143
|
+
|
|
144
|
+
## Test Details
|
|
145
|
+
|
|
146
|
+
### 01 - Web Interface Access
|
|
147
|
+
|
|
148
|
+
- Verifies that the ElizaOS web interface loads
|
|
149
|
+
- Confirms basic UI elements are present
|
|
150
|
+
- Validates initialization completes successfully
|
|
151
|
+
|
|
152
|
+
### 02 - Basic Conversation
|
|
153
|
+
|
|
154
|
+
- Accesses the agent chat interface
|
|
155
|
+
- Sends test messages to an agent
|
|
156
|
+
- Verifies responses are received
|
|
157
|
+
- Checks message formatting and display
|
|
158
|
+
|
|
159
|
+
### 03 - Character Configuration
|
|
160
|
+
|
|
161
|
+
- Opens the character configuration panel
|
|
162
|
+
- Verifies configuration fields are present
|
|
163
|
+
- Validates configuration panel UI elements
|
|
164
|
+
- Tests navigation between configuration tabs
|
|
165
|
+
|
|
166
|
+
### 04 - View Character Info
|
|
167
|
+
|
|
168
|
+
- Opens the character info panel
|
|
169
|
+
- Verifies character details are displayed
|
|
170
|
+
- Validates presence of key information sections
|
|
171
|
+
- Ensures images and formatted content displays correctly
|
|
172
|
+
|
|
173
|
+
### 05 - Modify Character Settings
|
|
174
|
+
|
|
175
|
+
- Opens the character settings panel
|
|
176
|
+
- Modifies the character username field
|
|
177
|
+
- Saves the changes using the save button
|
|
178
|
+
- Verifies the success notification appears
|
|
179
|
+
- Confirms changes are persisted
|
|
180
|
+
|
|
181
|
+
## Implementation Details
|
|
182
|
+
|
|
183
|
+
### Selector Strategy
|
|
184
|
+
|
|
185
|
+
Tests use a multi-layered approach to element selection:
|
|
186
|
+
|
|
187
|
+
1. Exact selectors when elements have stable identifiers
|
|
188
|
+
2. Attribute-based selectors for consistent UI components
|
|
189
|
+
3. Text-based selectors for readable elements
|
|
190
|
+
4. Position-based identification for graphical elements
|
|
191
|
+
5. Fallback mechanisms when standard selectors fail
|
|
192
|
+
|
|
193
|
+
### Resilience Features
|
|
194
|
+
|
|
195
|
+
- **Progressive Enhancement**: Tests adapt to different UI variations
|
|
196
|
+
- **Error Diagnostics**: Screenshots captured only during error conditions for efficient troubleshooting
|
|
197
|
+
- **Diagnostic Logging**: Detailed console output via standardized logger
|
|
198
|
+
- **Multiple Selector Approaches**: Alternative selection methods when primary selectors fail
|
|
199
|
+
- **Timeout Management**: Configurable timeouts for different operations
|
|
200
|
+
|
|
201
|
+
## Recent Improvements
|
|
202
|
+
|
|
203
|
+
### Enhanced Test Stability
|
|
204
|
+
|
|
205
|
+
- Implemented spatial analysis for locating elements based on position
|
|
206
|
+
- Added content change detection to verify UI state transitions
|
|
207
|
+
- Improved error handling with detailed diagnostics and recovery strategies
|
|
208
|
+
- Enhanced timing adjustments to accommodate varying response times
|
|
209
|
+
- Reduced screenshot capture to error scenarios only for improved performance
|
|
210
|
+
|
|
211
|
+
### Selector Upgrades
|
|
212
|
+
|
|
213
|
+
- Added support for general CSS selectors to reduce brittleness
|
|
214
|
+
- Implemented fallback mechanisms for dynamic component styling
|
|
215
|
+
- Enhanced element detection with combined attribute and content matching
|
|
216
|
+
- Added context-sensitive navigation based on UI state
|
|
217
|
+
|
|
218
|
+
### Error Recovery
|
|
219
|
+
|
|
220
|
+
- Added diagnostic screenshots at failure points
|
|
221
|
+
- Implemented contextual error messages with detailed state information
|
|
222
|
+
- Added graceful fallbacks for unexpected UI states
|
|
223
|
+
- Enhanced retry mechanisms for flaky operations
|
|
224
|
+
|
|
225
|
+
## Running Tests with UI Server
|
|
226
|
+
|
|
227
|
+
The default configuration starts the ElizaOS UI automatically as part of the test run. This is handled by the `webServer` configuration in `playwright.config.ts`:
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
webServer: {
|
|
231
|
+
command: 'cd ../../.. && bun start',
|
|
232
|
+
url: 'http://localhost:3000',
|
|
233
|
+
reuseExistingServer: !process.env.CI,
|
|
234
|
+
timeout: 60000, // ElizaOS might take some time to start
|
|
235
|
+
},
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
If you prefer to run the UI server separately:
|
|
239
|
+
|
|
240
|
+
1. Start the UI server in one terminal:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
cd eliza
|
|
244
|
+
bun start
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
2. Run tests in another terminal:
|
|
248
|
+
```bash
|
|
249
|
+
cd eliza/packages/client/ui-tests
|
|
250
|
+
PLAYWRIGHT_TEST_BASE_URL=http://localhost:3000 bun test
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Troubleshooting
|
|
254
|
+
|
|
255
|
+
### Common Issues
|
|
256
|
+
|
|
257
|
+
1. **Tests fail to find elements**
|
|
258
|
+
|
|
259
|
+
- Check if UI structure has changed
|
|
260
|
+
- Review screenshots in the `screenshots` directory
|
|
261
|
+
- Use `--headed` mode to observe the test in real-time
|
|
262
|
+
|
|
263
|
+
2. **Timeout errors**
|
|
264
|
+
|
|
265
|
+
- Increase timeout settings in the test or config
|
|
266
|
+
- Check if the UI server started correctly
|
|
267
|
+
- Verify network connectivity to the UI server
|
|
268
|
+
|
|
269
|
+
3. **Inconsistent results**
|
|
270
|
+
|
|
271
|
+
- Run with `--debug` flag for more detailed logs
|
|
272
|
+
- Check for race conditions in UI interactions
|
|
273
|
+
- Verify test isolation (tests affecting each other)
|
|
274
|
+
|
|
275
|
+
4. **Browser compatibility issues**
|
|
276
|
+
|
|
277
|
+
- Try running on a different browser project
|
|
278
|
+
- Check browser-specific CSS or JavaScript issues
|
|
279
|
+
- Update Playwright to the latest version
|
|
280
|
+
|
|
281
|
+
5. **Browser launch failures**
|
|
282
|
+
- Ensure browsers are installed with `bun run install:browsers`
|
|
283
|
+
- Check for missing dependencies on Linux systems (run `bunx playwright install-deps`)
|
|
284
|
+
- On headless systems, install xvfb: `apt-get install xvfb` and run with `xvfb-run bunx playwright test`
|
|
285
|
+
- For permission issues, try running with sudo: `sudo bunx playwright install`
|
|
286
|
+
|
|
287
|
+
### Debugging Strategies
|
|
288
|
+
|
|
289
|
+
1. **Interactive debugging**:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
bunx playwright test --debug
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
2. **UI Mode for test inspection**:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
bunx playwright test --ui
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
3. **Error screenshots**:
|
|
302
|
+
|
|
303
|
+
- Review error screenshots in the `screenshots` directory
|
|
304
|
+
- Screenshots are now only captured on test failures for better performance
|
|
305
|
+
|
|
306
|
+
4. **Trace viewing**:
|
|
307
|
+
```bash
|
|
308
|
+
bunx playwright show-trace test-results/trace.zip
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Extending the Test Suite
|
|
312
|
+
|
|
313
|
+
### Creating New Tests
|
|
314
|
+
|
|
315
|
+
1. Create a new numbered test file in the `tests` directory
|
|
316
|
+
2. Import the necessary utilities from `utils.ts`
|
|
317
|
+
3. Structure your test following the existing patterns
|
|
318
|
+
4. Add meaningful assertions and screenshots
|
|
319
|
+
|
|
320
|
+
### Best Practices
|
|
321
|
+
|
|
322
|
+
1. **Keep tests independent**: Each test should run independently
|
|
323
|
+
2. **Use utility functions**: Leverage the helper functions in `utils.ts`
|
|
324
|
+
3. **Take screenshots**: Capture UI state at key points for debugging
|
|
325
|
+
4. **Implement fallbacks**: Always have alternative strategies for element selection
|
|
326
|
+
5. **Add detailed logging**: Include console logs to help troubleshooting
|
|
327
|
+
6. **Test edge cases**: Cover not just happy paths but error conditions
|
|
328
|
+
7. **Validate state changes**: Verify that actions result in expected UI updates
|
|
329
|
+
|
|
330
|
+
## Continuous Integration
|
|
331
|
+
|
|
332
|
+
Tests can be run in CI environments with:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
# CI-friendly command
|
|
336
|
+
bun run test:ci
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
The CI configuration:
|
|
340
|
+
|
|
341
|
+
- Runs tests on headless browsers
|
|
342
|
+
- Generates reports and artifacts for review
|
|
343
|
+
- Includes retries for flaky tests
|
|
344
|
+
- Captures screenshots and videos on failure
|
|
345
|
+
|
|
346
|
+
## References
|
|
347
|
+
|
|
348
|
+
- [Playwright Documentation](https://playwright.dev/docs/intro)
|
|
349
|
+
- [ElizaOS API Documentation](https://docs.elizaos.com)
|
|
350
|
+
- [UI Component Library](https://ui.elizaos.com)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(t){}function u(t){}async function e(t){return!0}const o={init:n,captureException:u,flush:e};export{u as captureException,o as default,e as flush,n as init};
|