@debugg-ai/debugg-ai-mcp 1.0.15 → 1.0.16
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/README.md +121 -96
- package/dist/config/index.js +92 -0
- package/dist/e2e-agents/e2eRunner.js +32 -13
- package/dist/handlers/e2eSuiteHandlers.js +518 -0
- package/dist/handlers/index.js +6 -0
- package/dist/handlers/liveSessionHandlers.js +370 -0
- package/dist/handlers/testPageChangesHandler.js +123 -0
- package/dist/index.js +161 -173
- package/dist/services/browserSessions.js +196 -0
- package/dist/services/e2es.js +54 -0
- package/dist/services/index.js +33 -12
- package/dist/{tunnels → services}/ngrok/index.js +76 -37
- package/dist/services/ngrok/tunnelManager.js +306 -0
- package/dist/services/ngrok/types.js +2 -0
- package/dist/tools/e2eSuites.js +253 -0
- package/dist/tools/index.js +58 -0
- package/dist/tools/liveSession.js +212 -0
- package/dist/tools/testPageChanges.js +55 -0
- package/dist/types/index.js +123 -0
- package/dist/utils/axiosTransport.js +3 -0
- package/dist/utils/errors.js +116 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/logger.js +152 -0
- package/dist/utils/projectAnalyzer.js +499 -0
- package/dist/utils/urlParser.js +86 -0
- package/dist/utils/validation.js +87 -0
- package/package.json +20 -2
- package/dist/services/coverage.js +0 -127
- package/dist/services/issues.js +0 -132
- package/dist/services/repos.js +0 -23
- package/dist/tunnels/ngrok/types.js +0 -2
- /package/dist/{tunnels → services}/ngrok/error.js +0 -0
package/README.md
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
# 🧪 Official MCP Server for Debugg AI
|
|
2
2
|
|
|
3
|
-
**AI-
|
|
3
|
+
**AI-powered development and testing toolkit** implementing the [Model Context Protocol (MCP)](https://modelcontext.org), designed to give AI agents comprehensive testing, debugging, and code analysis capabilities.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Should you want to later rerun those tests or create a suite of them to run in your CI / CD pipeline, you can see all historical test results in your dashboard - [Debugg.AI App](https://app.debugg.ai)
|
|
5
|
+
Transform your development workflow with:
|
|
6
|
+
- **Zero-config E2E testing** - Run browser tests with natural language descriptions
|
|
7
|
+
- **Live session monitoring** - Real-time browser console, network, and screenshot monitoring
|
|
8
|
+
- **Test suite management** - Create and manage comprehensive test suites
|
|
9
|
+
- **Seamless CI/CD integration** - View all test results in your [Debugg.AI App](https://app.debugg.ai) dashboard
|
|
12
10
|
|
|
13
11
|
<a href="https://glama.ai/mcp/servers/@debugg-ai/debugg-ai-mcp">
|
|
14
12
|
<img width="380" height="200" src="https://glama.ai/mcp/servers/@debugg-ai/debugg-ai-mcp/badge" alt="Debugg AI MCP server" />
|
|
@@ -18,23 +16,13 @@ Should you want to later rerun those tests or create a suite of them to run in y
|
|
|
18
16
|
|
|
19
17
|
## 🚀 Features
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
Full MCP server implementation with CLI and tool registry support.
|
|
23
|
-
|
|
24
|
-
* 🧪 **End-to-End Test Automation**
|
|
25
|
-
Trigger UI tests based on user stories or natural language descriptions via the `debugg_ai_test_page_changes` tool.
|
|
26
|
-
|
|
27
|
-
* 🌐 **Localhost Web App Integration**
|
|
28
|
-
Test your running dev app on any `localhost` port with simulated user flows.
|
|
19
|
+
### **12 Focused Development Tools**
|
|
29
20
|
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* 🧱 **Stdio Server Compatible**
|
|
37
|
-
Plug into any MCP-compatible client (like Claude Desktop, LangChain agents, etc.) via stdin/stdout.
|
|
21
|
+
* 🧪 **E2E Testing Suite** - Run browser tests, create test suites, and generate commit-based tests
|
|
22
|
+
* 🖥️ **Live Session Monitoring** - Real-time browser console, network traffic, and screenshot monitoring
|
|
23
|
+
* 📊 **Test Management** - List, create, and track test suites and commit-based test suites
|
|
24
|
+
* 📱 **Real-time Progress** - Live updates with screenshots and step-by-step execution
|
|
25
|
+
* 🌐 **Universal Compatibility** - Works with any MCP-compatible client (Claude Desktop, LangChain, etc.)
|
|
38
26
|
|
|
39
27
|
---
|
|
40
28
|
|
|
@@ -61,145 +49,182 @@ Should you want to later rerun those tests or create a suite of them to run in y
|
|
|
61
49
|
|
|
62
50
|
|
|
63
51
|
|
|
64
|
-
## 🛠️
|
|
52
|
+
## 🛠️ Quick Setup
|
|
65
53
|
|
|
66
|
-
###
|
|
54
|
+
### 1. Get Your API Key
|
|
55
|
+
Create a free account at [debugg.ai](https://debugg.ai) and generate your API key.
|
|
67
56
|
|
|
68
|
-
###
|
|
57
|
+
### 2. Choose Your Installation Method
|
|
69
58
|
|
|
59
|
+
**Option A: NPX (Recommended)**
|
|
70
60
|
```bash
|
|
71
61
|
npx -y @debugg-ai/debugg-ai-mcp
|
|
72
62
|
```
|
|
73
63
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
### Option 2: Docker
|
|
77
|
-
|
|
64
|
+
**Option B: Docker**
|
|
78
65
|
```bash
|
|
79
66
|
docker run -i --rm --init \
|
|
80
67
|
-e DEBUGGAI_API_KEY=your_api_key \
|
|
81
|
-
-e TEST_USERNAME_EMAIL=your_test_email \
|
|
82
|
-
-e TEST_USER_PASSWORD=your_password \
|
|
83
|
-
-e DEBUGGAI_LOCAL_PORT=3000 \
|
|
84
|
-
-e DEBUGGAI_LOCAL_REPO_NAME=your-org/your-repo \
|
|
85
|
-
-e DEBUGGAI_LOCAL_BRANCH_NAME=main \
|
|
86
|
-
-e DEBUGGAI_LOCAL_REPO_PATH=/app \
|
|
87
|
-
-e DEBUGGAI_LOCAL_FILE_PATH=/app/index.ts \
|
|
88
68
|
quinnosha/debugg-ai-mcp
|
|
89
69
|
```
|
|
90
70
|
|
|
91
71
|
---
|
|
92
72
|
|
|
93
|
-
## 🧰
|
|
73
|
+
## 🧰 Available Tools
|
|
94
74
|
|
|
95
|
-
###
|
|
75
|
+
### **E2E Testing Tools**
|
|
76
|
+
- `debugg_ai_test_page_changes` - Run browser tests with natural language descriptions
|
|
77
|
+
- `debugg_ai_create_test_suite` - Create organized test suites for features
|
|
78
|
+
- `debugg_ai_create_commit_suite` - Generate tests based on git commits
|
|
79
|
+
- `debugg_ai_get_test_status` - Monitor test execution and results
|
|
96
80
|
|
|
97
|
-
|
|
98
|
-
|
|
81
|
+
### **Test Management Tools**
|
|
82
|
+
- `debugg_ai_list_tests` - List all E2E tests with filtering and pagination
|
|
83
|
+
- `debugg_ai_list_test_suites` - List all test suites with filtering options
|
|
84
|
+
- `debugg_ai_list_commit_suites` - List all commit-based test suites
|
|
99
85
|
|
|
100
|
-
###
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
| `repoName` | string | ❌ | GitHub repo name |
|
|
107
|
-
| `branchName` | string | ❌ | Current branch |
|
|
108
|
-
| `repoPath` | string | ❌ | Absolute path to the repo |
|
|
109
|
-
| `filePath` | string | ❌ | File to test |
|
|
86
|
+
### **Live Session Monitoring Tools**
|
|
87
|
+
- `debugg_ai_start_live_session` - Start a live browser session with real-time monitoring
|
|
88
|
+
- `debugg_ai_stop_live_session` - Stop an active live session
|
|
89
|
+
- `debugg_ai_get_live_session_status` - Get the current status of a live session
|
|
90
|
+
- `debugg_ai_get_live_session_logs` - Retrieve console and network logs from a live session
|
|
91
|
+
- `debugg_ai_get_live_session_screenshot` - Capture screenshots from an active live session
|
|
110
92
|
|
|
111
93
|
---
|
|
112
94
|
|
|
113
|
-
##
|
|
95
|
+
## ⚙️ Configuration
|
|
96
|
+
|
|
97
|
+
### **For Claude Desktop**
|
|
114
98
|
|
|
115
|
-
|
|
99
|
+
Add this to your MCP settings file:
|
|
100
|
+
|
|
101
|
+
```json
|
|
116
102
|
{
|
|
117
103
|
"mcpServers": {
|
|
118
104
|
"debugg-ai-mcp": {
|
|
119
105
|
"command": "npx",
|
|
120
106
|
"args": ["-y", "@debugg-ai/debugg-ai-mcp"],
|
|
121
107
|
"env": {
|
|
122
|
-
"DEBUGGAI_API_KEY": "
|
|
123
|
-
"TEST_USERNAME_EMAIL": "test@example.com",
|
|
124
|
-
"TEST_USER_PASSWORD": "supersecure",
|
|
125
|
-
"DEBUGGAI_LOCAL_PORT": 3000,
|
|
126
|
-
"DEBUGGAI_LOCAL_REPO_NAME": "org/project",
|
|
127
|
-
"DEBUGGAI_LOCAL_BRANCH_NAME": "main",
|
|
128
|
-
"DEBUGGAI_LOCAL_REPO_PATH": "/Users/you/project",
|
|
129
|
-
"DEBUGGAI_LOCAL_FILE_PATH": "/Users/you/project/index.ts"
|
|
108
|
+
"DEBUGGAI_API_KEY": "your_api_key_here"
|
|
130
109
|
}
|
|
131
110
|
}
|
|
132
111
|
}
|
|
133
112
|
}
|
|
134
113
|
```
|
|
135
114
|
|
|
136
|
-
|
|
115
|
+
### **Optional Environment Variables**
|
|
116
|
+
```bash
|
|
117
|
+
# Required
|
|
118
|
+
DEBUGGAI_API_KEY=your_api_key
|
|
119
|
+
|
|
120
|
+
# Optional (with sensible defaults)
|
|
121
|
+
DEBUGGAI_LOCAL_PORT=3000 # Your app's port
|
|
122
|
+
DEBUGGAI_LOCAL_REPO_NAME=your-org/repo # GitHub repo name
|
|
123
|
+
DEBUGGAI_LOCAL_REPO_PATH=/path/to/project # Project directory
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 💡 Usage Examples
|
|
137
127
|
|
|
138
|
-
|
|
128
|
+
### **Run a Quick E2E Test**
|
|
129
|
+
```
|
|
130
|
+
"Test the user login flow on my app running on port 3000"
|
|
131
|
+
```
|
|
139
132
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
| `TEST_USER_PASSWORD` | Password of test user account | ❌ |
|
|
145
|
-
| `DEBUGGAI_LOCAL_PORT` | Local port your app runs on | ✅ |
|
|
146
|
-
| `DEBUGGAI_LOCAL_REPO_NAME` | GitHub repo name | ❌ |
|
|
147
|
-
| `DEBUGGAI_LOCAL_BRANCH_NAME` | Branch name | ❌ |
|
|
148
|
-
| `DEBUGGAI_LOCAL_REPO_PATH` | Local path to repo root | ❌ |
|
|
149
|
-
| `DEBUGGAI_LOCAL_FILE_PATH` | File to test | ❌ |
|
|
133
|
+
### **Analyze Your Project**
|
|
134
|
+
```
|
|
135
|
+
"What frameworks and languages are used in my codebase?"
|
|
136
|
+
```
|
|
150
137
|
|
|
138
|
+
### **Get Issue Insights**
|
|
139
|
+
```
|
|
140
|
+
"Show me all high-priority issues in my project"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### **Generate Test Coverage**
|
|
144
|
+
```
|
|
145
|
+
"Generate test coverage for the authentication module"
|
|
146
|
+
```
|
|
151
147
|
|
|
152
148
|
---
|
|
153
149
|
|
|
154
150
|
## 🧑💻 Local Development
|
|
155
151
|
|
|
156
152
|
```bash
|
|
157
|
-
#
|
|
153
|
+
# Install dependencies
|
|
158
154
|
npm install
|
|
159
155
|
|
|
160
|
-
#
|
|
161
|
-
|
|
156
|
+
# Run tests
|
|
157
|
+
npm test
|
|
162
158
|
|
|
163
|
-
#
|
|
164
|
-
|
|
159
|
+
# Build project
|
|
160
|
+
npm run build
|
|
165
161
|
|
|
166
|
-
#
|
|
167
|
-
|
|
162
|
+
# Start server locally
|
|
163
|
+
node dist/index.js
|
|
168
164
|
```
|
|
169
165
|
|
|
170
166
|
---
|
|
171
167
|
|
|
172
|
-
## 📁
|
|
168
|
+
## 📁 Project Structure
|
|
173
169
|
|
|
174
170
|
```
|
|
175
|
-
|
|
176
|
-
├──
|
|
177
|
-
├──
|
|
178
|
-
├──
|
|
179
|
-
├──
|
|
180
|
-
├──
|
|
181
|
-
|
|
171
|
+
debugg-ai-mcp/
|
|
172
|
+
├── config/ # Configuration management
|
|
173
|
+
├── tools/ # 14 MCP tool definitions
|
|
174
|
+
├── handlers/ # Tool implementation logic
|
|
175
|
+
├── services/ # DebuggAI API integration
|
|
176
|
+
├── utils/ # Shared utilities & logging
|
|
177
|
+
├── types/ # TypeScript type definitions
|
|
178
|
+
├── __tests__/ # Comprehensive test suite
|
|
179
|
+
└── index.ts # Main server entry point
|
|
182
180
|
```
|
|
183
181
|
|
|
184
182
|
---
|
|
185
183
|
|
|
186
|
-
##
|
|
184
|
+
## 🚀 Publishing & Releases
|
|
187
185
|
|
|
188
|
-
|
|
186
|
+
This project uses automated publishing to NPM. Here's how it works:
|
|
187
|
+
|
|
188
|
+
### **Automatic Publishing**
|
|
189
|
+
- Every push to `main` triggers automatic NPM publishing
|
|
190
|
+
- Only publishes if the version doesn't already exist
|
|
191
|
+
- Includes full test suite validation and build verification
|
|
192
|
+
|
|
193
|
+
### **Version Management**
|
|
194
|
+
```bash
|
|
195
|
+
# Bump version locally
|
|
196
|
+
npm run version:patch # 1.0.15 → 1.0.16
|
|
197
|
+
npm run version:minor # 1.0.15 → 1.1.0
|
|
198
|
+
npm run version:major # 1.0.15 → 2.0.0
|
|
199
|
+
|
|
200
|
+
# Check package contents
|
|
201
|
+
npm run publish:check
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### **Manual Version Bump via GitHub**
|
|
205
|
+
1. Go to **Actions** → **Version Bump**
|
|
206
|
+
2. Click **"Run workflow"**
|
|
207
|
+
3. Select version type or enter custom version
|
|
208
|
+
4. Workflow will update version and trigger publish
|
|
209
|
+
|
|
210
|
+
### **Setup for Contributors**
|
|
211
|
+
See [`.github/PUBLISHING_SETUP.md`](.github/PUBLISHING_SETUP.md) for complete setup instructions.
|
|
189
212
|
|
|
190
213
|
---
|
|
191
214
|
|
|
192
|
-
## 💬
|
|
215
|
+
## 💬 Support & Links
|
|
193
216
|
|
|
194
|
-
|
|
217
|
+
- 📖 **Documentation**: [debugg.ai/docs](https://debugg.ai/docs)
|
|
218
|
+
- 🐛 **Issues**: [GitHub Issues](https://github.com/debugg-ai/debugg-ai-mcp/issues)
|
|
219
|
+
- 💬 **Discord**: [Join our community](https://debugg.ai/discord)
|
|
220
|
+
- 🌐 **Dashboard**: [app.debugg.ai](https://app.debugg.ai)
|
|
195
221
|
|
|
196
222
|
---
|
|
197
223
|
|
|
198
224
|
## 🔒 License
|
|
199
225
|
|
|
200
|
-
|
|
226
|
+
Apache-2.0 License © 2025 DebuggAI
|
|
201
227
|
|
|
202
228
|
---
|
|
203
229
|
|
|
204
|
-
|
|
205
|
-
<p style="padding-top: 20px; text-align: center;">Made with 🩸, 💦, and 😭 in San Francisco</p>
|
|
230
|
+
<p align="center">Made with ❤️ in San Francisco</p>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized configuration management for DebuggAI MCP Server
|
|
3
|
+
* Handles environment variable validation and default values
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* Configuration schema with validation
|
|
8
|
+
*/
|
|
9
|
+
const configSchema = z.object({
|
|
10
|
+
server: z.object({
|
|
11
|
+
name: z.string().default('DebuggAI MCP Server'),
|
|
12
|
+
version: z.string().default('0.1.1'),
|
|
13
|
+
}),
|
|
14
|
+
api: z.object({
|
|
15
|
+
key: z.string().min(1, 'DEBUGGAI_API_KEY is required'),
|
|
16
|
+
baseUrl: z.string().url().optional(),
|
|
17
|
+
}),
|
|
18
|
+
auth: z.object({
|
|
19
|
+
testUsername: z.string().optional(),
|
|
20
|
+
testPassword: z.string().optional(),
|
|
21
|
+
}),
|
|
22
|
+
defaults: z.object({
|
|
23
|
+
localPort: z.number().int().min(1).max(65535).optional(),
|
|
24
|
+
repoName: z.string().optional(),
|
|
25
|
+
branchName: z.string().optional(),
|
|
26
|
+
repoPath: z.string().optional(),
|
|
27
|
+
filePath: z.string().optional(),
|
|
28
|
+
}),
|
|
29
|
+
logging: z.object({
|
|
30
|
+
level: z.enum(['error', 'warn', 'info', 'debug']).default('info'),
|
|
31
|
+
format: z.enum(['json', 'simple']).default('simple'),
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Load and validate configuration from environment variables
|
|
36
|
+
*/
|
|
37
|
+
export function loadConfig() {
|
|
38
|
+
const rawConfig = {
|
|
39
|
+
server: {
|
|
40
|
+
name: 'DebuggAI MCP Server',
|
|
41
|
+
version: '0.1.1',
|
|
42
|
+
},
|
|
43
|
+
api: {
|
|
44
|
+
key: process.env.DEBUGGAI_API_KEY || '',
|
|
45
|
+
baseUrl: process.env.DEBUGGAI_API_BASE_URL,
|
|
46
|
+
},
|
|
47
|
+
auth: {
|
|
48
|
+
testUsername: process.env.TEST_USERNAME_EMAIL || '',
|
|
49
|
+
testPassword: process.env.TEST_USER_PASSWORD || '',
|
|
50
|
+
},
|
|
51
|
+
defaults: {
|
|
52
|
+
localPort: process.env.DEBUGGAI_LOCAL_PORT ? parseInt(process.env.DEBUGGAI_LOCAL_PORT, 10) : undefined,
|
|
53
|
+
repoName: process.env.DEBUGGAI_LOCAL_REPO_NAME || undefined,
|
|
54
|
+
branchName: process.env.DEBUGGAI_LOCAL_BRANCH_NAME || undefined,
|
|
55
|
+
repoPath: process.env.DEBUGGAI_LOCAL_REPO_PATH || undefined,
|
|
56
|
+
filePath: process.env.DEBUGGAI_LOCAL_FILE_PATH || undefined,
|
|
57
|
+
},
|
|
58
|
+
logging: {
|
|
59
|
+
level: process.env.LOG_LEVEL || 'info',
|
|
60
|
+
format: process.env.LOG_FORMAT || 'simple',
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
try {
|
|
64
|
+
return configSchema.parse(rawConfig);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
if (error instanceof z.ZodError) {
|
|
68
|
+
const missingFields = error.errors
|
|
69
|
+
.map(err => `${err.path.join('.')}: ${err.message}`)
|
|
70
|
+
.join(', ');
|
|
71
|
+
throw new Error(`Configuration validation failed: ${missingFields}`);
|
|
72
|
+
}
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Global configuration instance - loaded lazily to avoid import-time errors in tests
|
|
78
|
+
*/
|
|
79
|
+
let _config;
|
|
80
|
+
export const config = {
|
|
81
|
+
get server() { return getConfig().server; },
|
|
82
|
+
get api() { return getConfig().api; },
|
|
83
|
+
get auth() { return getConfig().auth; },
|
|
84
|
+
get defaults() { return getConfig().defaults; },
|
|
85
|
+
get logging() { return getConfig().logging; }
|
|
86
|
+
};
|
|
87
|
+
function getConfig() {
|
|
88
|
+
if (!_config) {
|
|
89
|
+
_config = loadConfig();
|
|
90
|
+
}
|
|
91
|
+
return _config;
|
|
92
|
+
}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { downloadBinary } from '../tunnels/ngrok/index.js';
|
|
2
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
-
import
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
// Use createRequire to avoid ES module resolution issues
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
let ngrokModule = null;
|
|
6
|
+
async function getNgrok() {
|
|
7
|
+
if (!ngrokModule) {
|
|
8
|
+
try {
|
|
9
|
+
ngrokModule = require('ngrok');
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
throw new Error(`Failed to load ngrok module: ${error}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return ngrokModule;
|
|
16
|
+
}
|
|
4
17
|
async function startTunnel(authToken, localPort, domain) {
|
|
5
18
|
try {
|
|
6
|
-
|
|
7
|
-
// addr: localPort,
|
|
8
|
-
// hostname: domain,
|
|
9
|
-
// });
|
|
19
|
+
const ngrok = await getNgrok();
|
|
10
20
|
if (process.env.DOCKER_CONTAINER === "true") {
|
|
11
21
|
const url = await ngrok.connect({ proto: 'http', addr: `host.docker.internal:${localPort}`, hostname: domain, authtoken: authToken });
|
|
12
22
|
return url;
|
|
@@ -18,14 +28,21 @@ async function startTunnel(authToken, localPort, domain) {
|
|
|
18
28
|
}
|
|
19
29
|
catch (err) {
|
|
20
30
|
console.error('Error starting ngrok tunnel:', err);
|
|
31
|
+
throw err;
|
|
21
32
|
}
|
|
22
33
|
}
|
|
23
34
|
async function stopTunnel(url) {
|
|
24
|
-
|
|
25
|
-
await
|
|
35
|
+
try {
|
|
36
|
+
const ngrok = await getNgrok();
|
|
37
|
+
if (url) {
|
|
38
|
+
await ngrok.disconnect(url);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
await ngrok.disconnect();
|
|
42
|
+
}
|
|
26
43
|
}
|
|
27
|
-
|
|
28
|
-
|
|
44
|
+
catch (err) {
|
|
45
|
+
console.error('Error stopping ngrok tunnel:', err);
|
|
29
46
|
}
|
|
30
47
|
}
|
|
31
48
|
export class E2eTestRunner {
|
|
@@ -37,7 +54,7 @@ export class E2eTestRunner {
|
|
|
37
54
|
await this.configureNgrok();
|
|
38
55
|
}
|
|
39
56
|
async configureNgrok() {
|
|
40
|
-
|
|
57
|
+
// ngrok binary is downloaded automatically by the ngrok package
|
|
41
58
|
}
|
|
42
59
|
async startTunnel(authToken, port, url) {
|
|
43
60
|
await startTunnel(authToken, port, url);
|
|
@@ -85,9 +102,11 @@ export class E2eTestRunner {
|
|
|
85
102
|
console.error(`Creating new E2E test with description: ${testDescription}`);
|
|
86
103
|
const key = uuidv4();
|
|
87
104
|
const e2eTest = await this.client.e2es?.createE2eTest(testDescription, { filePath: filePath ?? "", repoName: repoName, branchName: branchName, repoPath: repoPath, key: key });
|
|
105
|
+
console.error("E2E test creation response:", JSON.stringify(e2eTest, null, 2));
|
|
88
106
|
const authToken = e2eTest?.tunnelKey;
|
|
89
107
|
if (!authToken) {
|
|
90
|
-
console.error("Failed to get auth token.");
|
|
108
|
+
console.error("Failed to get auth token. E2E test response:", e2eTest);
|
|
109
|
+
console.error("Available keys in response:", e2eTest ? Object.keys(e2eTest) : 'null response');
|
|
91
110
|
return null;
|
|
92
111
|
}
|
|
93
112
|
await startTunnel(authToken, testPort, `${key}.ngrok.debugg.ai`);
|
|
@@ -157,7 +176,7 @@ export class E2eTestRunner {
|
|
|
157
176
|
// }
|
|
158
177
|
stopped = true;
|
|
159
178
|
}
|
|
160
|
-
},
|
|
179
|
+
}, 2000);
|
|
161
180
|
// Timeout safeguard
|
|
162
181
|
const timeout = setTimeout(async () => {
|
|
163
182
|
if (stopped)
|