@timetotest/cli 0.1.11 → 0.2.1
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 +201 -190
- package/dist/bin/ttt.js +4 -2
- package/dist/bin/ttt.js.map +1 -1
- package/dist/package.json +13 -2
- package/dist/src/commands/ask/AskApp.js +121 -0
- package/dist/src/commands/ask/AskApp.js.map +1 -0
- package/dist/src/commands/ask/components/AssistantResponse.js +31 -0
- package/dist/src/commands/ask/components/AssistantResponse.js.map +1 -0
- package/dist/src/commands/ask/components/Banner.js +15 -0
- package/dist/src/commands/ask/components/Banner.js.map +1 -0
- package/dist/src/commands/ask/components/ChatInput.js +93 -0
- package/dist/src/commands/ask/components/ChatInput.js.map +1 -0
- package/dist/src/commands/ask/components/Divider.js +17 -0
- package/dist/src/commands/ask/components/Divider.js.map +1 -0
- package/dist/src/commands/ask/components/IntroTips.js +19 -0
- package/dist/src/commands/ask/components/IntroTips.js.map +1 -0
- package/dist/src/commands/ask/components/MessageBubble.js +47 -0
- package/dist/src/commands/ask/components/MessageBubble.js.map +1 -0
- package/dist/src/commands/ask/components/SessionInfo.js +20 -0
- package/dist/src/commands/ask/components/SessionInfo.js.map +1 -0
- package/dist/src/commands/ask/components/StatusIndicator.js +67 -0
- package/dist/src/commands/ask/components/StatusIndicator.js.map +1 -0
- package/dist/src/commands/ask-ink.js +380 -0
- package/dist/src/commands/ask-ink.js.map +1 -0
- package/dist/src/commands/ask.js +73 -60
- package/dist/src/commands/ask.js.map +1 -1
- package/dist/src/commands/chat/ChatApp.js +125 -0
- package/dist/src/commands/chat/ChatApp.js.map +1 -0
- package/dist/src/commands/chat-ink.js +436 -0
- package/dist/src/commands/chat-ink.js.map +1 -0
- package/dist/src/commands/chat.js +82 -0
- package/dist/src/commands/chat.js.map +1 -0
- package/dist/src/commands/login.js +6 -4
- package/dist/src/commands/login.js.map +1 -1
- package/dist/src/commands/start-test.js +62 -88
- package/dist/src/commands/start-test.js.map +1 -1
- package/dist/src/commands/stream.js +9 -9
- package/dist/src/commands/stream.js.map +1 -1
- package/dist/src/commands/test.js +58 -125
- package/dist/src/commands/test.js.map +1 -1
- package/dist/src/lib/agent-orchestrator.js +546 -0
- package/dist/src/lib/agent-orchestrator.js.map +1 -0
- package/dist/src/lib/cloudinary-service.js +65 -0
- package/dist/src/lib/cloudinary-service.js.map +1 -0
- package/dist/src/lib/events.js +73 -60
- package/dist/src/lib/events.js.map +1 -1
- package/dist/src/lib/http.js +34 -1
- package/dist/src/lib/http.js.map +1 -1
- package/dist/src/lib/legacy-chat-runner.js +37 -0
- package/dist/src/lib/legacy-chat-runner.js.map +1 -0
- package/dist/src/lib/local-tools/api/api-discovery.js +17 -0
- package/dist/src/lib/local-tools/api/api-discovery.js.map +1 -0
- package/dist/src/lib/local-tools/api/build-request.js +20 -0
- package/dist/src/lib/local-tools/api/build-request.js.map +1 -0
- package/dist/src/lib/local-tools/api/extract-response-fields.js +26 -0
- package/dist/src/lib/local-tools/api/extract-response-fields.js.map +1 -0
- package/dist/src/lib/local-tools/api/generate-api-test.js +20 -0
- package/dist/src/lib/local-tools/api/generate-api-test.js.map +1 -0
- package/dist/src/lib/local-tools/api/generate-curl.js +8 -0
- package/dist/src/lib/local-tools/api/generate-curl.js.map +1 -0
- package/dist/src/lib/local-tools/api/get-api-parameters.js +17 -0
- package/dist/src/lib/local-tools/api/get-api-parameters.js.map +1 -0
- package/dist/src/lib/local-tools/api/index.js +10 -0
- package/dist/src/lib/local-tools/api/index.js.map +1 -0
- package/dist/src/lib/local-tools/api/request.js +43 -0
- package/dist/src/lib/local-tools/api/request.js.map +1 -0
- package/dist/src/lib/local-tools/api/set-auth-header.js +8 -0
- package/dist/src/lib/local-tools/api/set-auth-header.js.map +1 -0
- package/dist/src/lib/local-tools/api/types.js +2 -0
- package/dist/src/lib/local-tools/api/types.js.map +1 -0
- package/dist/src/lib/local-tools/api/utils.js +33 -0
- package/dist/src/lib/local-tools/api/utils.js.map +1 -0
- package/dist/src/lib/local-tools/api/validate-response.js +41 -0
- package/dist/src/lib/local-tools/api/validate-response.js.map +1 -0
- package/dist/src/lib/local-tools/file-tools.js +45 -0
- package/dist/src/lib/local-tools/file-tools.js.map +1 -0
- package/dist/src/lib/local-tools/general/discover-local-services.js +95 -0
- package/dist/src/lib/local-tools/general/discover-local-services.js.map +1 -0
- package/dist/src/lib/local-tools/general/index.js +2 -0
- package/dist/src/lib/local-tools/general/index.js.map +1 -0
- package/dist/src/lib/local-tools/ui/click-element.js +105 -0
- package/dist/src/lib/local-tools/ui/click-element.js.map +1 -0
- package/dist/src/lib/local-tools/ui/dom-rag.js +201 -0
- package/dist/src/lib/local-tools/ui/dom-rag.js.map +1 -0
- package/dist/src/lib/local-tools/ui/find-element.js +31 -0
- package/dist/src/lib/local-tools/ui/find-element.js.map +1 -0
- package/dist/src/lib/local-tools/ui/hover-element.js +94 -0
- package/dist/src/lib/local-tools/ui/hover-element.js.map +1 -0
- package/dist/src/lib/local-tools/ui/index.js +3 -0
- package/dist/src/lib/local-tools/ui/index.js.map +1 -0
- package/dist/src/lib/local-tools/ui/manage-tab.js +65 -0
- package/dist/src/lib/local-tools/ui/manage-tab.js.map +1 -0
- package/dist/src/lib/local-tools/ui/navigate.js +35 -0
- package/dist/src/lib/local-tools/ui/navigate.js.map +1 -0
- package/dist/src/lib/local-tools/ui/page-discovery.js +32 -0
- package/dist/src/lib/local-tools/ui/page-discovery.js.map +1 -0
- package/dist/src/lib/local-tools/ui/playwright-mcp.js +217 -0
- package/dist/src/lib/local-tools/ui/playwright-mcp.js.map +1 -0
- package/dist/src/lib/local-tools/ui/screenshot.js +19 -0
- package/dist/src/lib/local-tools/ui/screenshot.js.map +1 -0
- package/dist/src/lib/local-tools/ui/search-interactive-elements.js +18 -0
- package/dist/src/lib/local-tools/ui/search-interactive-elements.js.map +1 -0
- package/dist/src/lib/local-tools/ui/selector-resolver.js +153 -0
- package/dist/src/lib/local-tools/ui/selector-resolver.js.map +1 -0
- package/dist/src/lib/local-tools/ui/snapshot-query.js +129 -0
- package/dist/src/lib/local-tools/ui/snapshot-query.js.map +1 -0
- package/dist/src/lib/local-tools/ui/type-text.js +40 -0
- package/dist/src/lib/local-tools/ui/type-text.js.map +1 -0
- package/dist/src/lib/local-tools/ui/types.js +2 -0
- package/dist/src/lib/local-tools/ui/types.js.map +1 -0
- package/dist/src/lib/local-tools/utility/finish-overall-test.js +12 -0
- package/dist/src/lib/local-tools/utility/finish-overall-test.js.map +1 -0
- package/dist/src/lib/local-tools/utility/index.js +2 -0
- package/dist/src/lib/local-tools/utility/index.js.map +1 -0
- package/dist/src/lib/prompts/builder.js +38 -0
- package/dist/src/lib/prompts/builder.js.map +1 -0
- package/dist/src/lib/prompts/index.js +7 -0
- package/dist/src/lib/prompts/index.js.map +1 -0
- package/dist/src/lib/prompts/templates.js +166 -0
- package/dist/src/lib/prompts/templates.js.map +1 -0
- package/dist/src/lib/session-manager.js +201 -0
- package/dist/src/lib/session-manager.js.map +1 -0
- package/dist/src/lib/socket.js +70 -9
- package/dist/src/lib/socket.js.map +1 -1
- package/dist/src/lib/testing-mode.js +33 -0
- package/dist/src/lib/testing-mode.js.map +1 -0
- package/dist/src/lib/tool-descriptions.js +59 -0
- package/dist/src/lib/tool-descriptions.js.map +1 -0
- package/dist/src/lib/tool-executor.js +537 -0
- package/dist/src/lib/tool-executor.js.map +1 -0
- package/dist/src/lib/tool-registry.js +803 -0
- package/dist/src/lib/tool-registry.js.map +1 -0
- package/dist/src/lib/tool-result-pruner.js +384 -0
- package/dist/src/lib/tool-result-pruner.js.map +1 -0
- package/dist/src/lib/tui/components/AskIntro.js +6 -0
- package/dist/src/lib/tui/components/AskIntro.js.map +1 -0
- package/dist/src/lib/tui/components/Banner.js +15 -0
- package/dist/src/lib/tui/components/Banner.js.map +1 -0
- package/dist/src/lib/tui/components/Divider.js +17 -0
- package/dist/src/lib/tui/components/Divider.js.map +1 -0
- package/dist/src/lib/tui/components/EventLine.js +110 -0
- package/dist/src/lib/tui/components/EventLine.js.map +1 -0
- package/dist/src/lib/tui/components/Header.js +15 -0
- package/dist/src/lib/tui/components/Header.js.map +1 -0
- package/dist/src/lib/tui/components/InputBox.js +9 -0
- package/dist/src/lib/tui/components/InputBox.js.map +1 -0
- package/dist/src/lib/tui/components/Mapping.js +8 -0
- package/dist/src/lib/tui/components/Mapping.js.map +1 -0
- package/dist/src/lib/tui/components/ProjectList.js +6 -0
- package/dist/src/lib/tui/components/ProjectList.js.map +1 -0
- package/dist/src/lib/tui/components/Spinner.js +20 -0
- package/dist/src/lib/tui/components/Spinner.js.map +1 -0
- package/dist/src/lib/tui/components/StatusBanner.js +12 -0
- package/dist/src/lib/tui/components/StatusBanner.js.map +1 -0
- package/dist/src/lib/tui/components/StatusBar.js +11 -0
- package/dist/src/lib/tui/components/StatusBar.js.map +1 -0
- package/dist/src/lib/tui/components/UserBubble.js +6 -0
- package/dist/src/lib/tui/components/UserBubble.js.map +1 -0
- package/dist/src/lib/tui/components/index.js +16 -0
- package/dist/src/lib/tui/components/index.js.map +1 -0
- package/dist/src/lib/tui/events.js +716 -76
- package/dist/src/lib/tui/events.js.map +1 -1
- package/dist/src/lib/tui/icons.js +14 -0
- package/dist/src/lib/tui/icons.js.map +1 -1
- package/dist/src/lib/tui/ink-print.js +41 -0
- package/dist/src/lib/tui/ink-print.js.map +1 -0
- package/dist/src/lib/tui/interactive-chat.js +345 -0
- package/dist/src/lib/tui/interactive-chat.js.map +1 -0
- package/dist/src/lib/tui/print.js +31 -26
- package/dist/src/lib/tui/print.js.map +1 -1
- package/dist/src/lib/tui/prompt.js +21 -18
- package/dist/src/lib/tui/prompt.js.map +1 -1
- package/dist/src/test-agent-flow.js +148 -0
- package/dist/src/test-agent-flow.js.map +1 -0
- package/dist/src/test-browser-session.js +152 -0
- package/dist/src/test-browser-session.js.map +1 -0
- package/dist/src/test-browser-snapshot.js +187 -0
- package/dist/src/test-browser-snapshot.js.map +1 -0
- package/dist/src/test-snapshot-detailed.js +219 -0
- package/dist/src/test-snapshot-detailed.js.map +1 -0
- package/dist/src/test-snapshot-simple.js +85 -0
- package/dist/src/test-snapshot-simple.js.map +1 -0
- package/dist/src/test-snapshot-tabs.js +110 -0
- package/dist/src/test-snapshot-tabs.js.map +1 -0
- package/package.json +13 -2
package/README.md
CHANGED
|
@@ -1,293 +1,304 @@
|
|
|
1
|
-
|
|
1
|
+
# Time to Test CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Transform your testing workflow with an Agent that actually understands your application.**
|
|
4
4
|
|
|
5
|
-
AI,
|
|
6
|
-
TimetoTest is an autonomous agent that plans, uses tools, and adapts to test your Web apps and APIs.
|
|
5
|
+
The Time to Test CLI is your intelligent testing companion that combines the power of AI reasoning with local execution capabilities. Instead of writing complex test scripts, simply chat with an AI agent that can see your application, interact with it, and generate comprehensive test reports.
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
- Captures screenshots and context
|
|
10
|
-
- Generates high-quality test cases
|
|
11
|
-
- Optionally executes and iterates
|
|
12
|
-
- Produces shareable PDF reports
|
|
7
|
+
## Why Time to Test CLI?
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
### **Test Without Writing Code**
|
|
15
10
|
|
|
16
|
-
|
|
11
|
+
- Describe what you want to test in plain English
|
|
12
|
+
- The AI agent understands your application and creates tests automatically
|
|
13
|
+
- No more spending hours writing boilerplate test code
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
npm i -g @timetotest/cli
|
|
20
|
-
ttt --version
|
|
21
|
-
```
|
|
15
|
+
### **Local-First Testing**
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
- Test your localhost applications directly (no tunneling required)
|
|
18
|
+
- AI agent runs browser automation and API calls on your machine
|
|
19
|
+
- Complete control over your testing environment
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
npx @timetotest/cli --help
|
|
27
|
-
```
|
|
21
|
+
### **Intelligent Test Discovery**
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
- Automatically discovers pages, endpoints, and user flows
|
|
24
|
+
- Understands your application's structure and behavior
|
|
25
|
+
- Generates comprehensive test coverage without manual exploration
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
### **Rich Reporting**
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
- Beautiful PDF reports with screenshots and test results
|
|
30
|
+
- Shareable links for team collaboration
|
|
31
|
+
- Detailed analysis of what was tested and what failed
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
## Quick Start
|
|
38
34
|
|
|
39
|
-
|
|
35
|
+
### 1. Install the CLI
|
|
40
36
|
|
|
41
37
|
```bash
|
|
42
|
-
|
|
38
|
+
npm install -g @timetotest/cli
|
|
43
39
|
```
|
|
44
40
|
|
|
45
|
-
|
|
41
|
+
### 2. Start Testing (Local Mode - Default)
|
|
46
42
|
|
|
47
43
|
```bash
|
|
48
|
-
|
|
44
|
+
# Launch interactive chat with AI agent
|
|
45
|
+
ttt
|
|
46
|
+
|
|
47
|
+
# Or test a specific URL with a prompt
|
|
48
|
+
ttt test --url http://localhost:3000 --prompt "Test the user login flow"
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
3.
|
|
51
|
+
### 3. Cloud Mode (Optional)
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
|
|
54
|
+
# Use remote AI agent (no localhost access)
|
|
55
|
+
ttt --cloud
|
|
55
56
|
```
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
## How It Works
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
- Use `--share` to enable a public share link
|
|
61
|
-
- Use `ttt stream <test-id>` to reattach to progress later
|
|
60
|
+
### Local Mode (Default)
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
- **Website**: [Time to Test](https://timetotest.tech)
|
|
62
|
+
When you run `ttt`, you get an AI agent that:
|
|
65
63
|
|
|
66
|
-
|
|
64
|
+
- **Runs locally** on your machine using Playwright and HTTP clients
|
|
65
|
+
- **Sees your application** through browser automation
|
|
66
|
+
- **Understands your APIs** through intelligent discovery
|
|
67
|
+
- **Learns from interactions** to improve test coverage
|
|
68
|
+
- **Generates reports** with screenshots and detailed analysis
|
|
67
69
|
|
|
68
|
-
|
|
70
|
+
### Cloud Mode
|
|
69
71
|
|
|
70
|
-
|
|
71
|
-
npm i -g @timetotest/cli
|
|
72
|
-
```
|
|
72
|
+
When you run `ttt --cloud`, you get:
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
- **Remote AI agent** with no access to your localhost
|
|
75
|
+
- **Same conversation interface** but with cloud-based execution
|
|
76
|
+
- **Secure testing** for production environments
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
npx @timetotest/cli --help
|
|
78
|
-
```
|
|
78
|
+
## Key Features
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
### **UI Testing**
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
- **Smart Navigation**: AI understands your app's structure and navigates intelligently
|
|
83
|
+
- **Element Interaction**: Click, type, hover with natural language descriptions
|
|
84
|
+
- **Visual Validation**: Automatic screenshot capture and comparison
|
|
85
|
+
- **User Flow Testing**: Complete user journeys from login to checkout
|
|
83
86
|
|
|
84
|
-
|
|
85
|
-
ttt login
|
|
86
|
-
# Opens a browser to authenticate. As a fallback, you may be prompted to paste a short-lived token.
|
|
87
|
-
```
|
|
87
|
+
### **API Testing**
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
- **Automatic Discovery**: Finds and catalogs all your API endpoints
|
|
90
|
+
- **Request Building**: Generates proper requests with headers and payloads
|
|
91
|
+
- **Response Validation**: Checks status codes, schemas, and data integrity
|
|
92
|
+
- **Authentication Handling**: Manages tokens and session state
|
|
90
93
|
|
|
91
|
-
|
|
92
|
-
ttt test \
|
|
93
|
-
--url http://localhost:3000 \
|
|
94
|
-
--type ui \
|
|
95
|
-
--execute \
|
|
96
|
-
--mode priority \
|
|
97
|
-
--project-id 123 \
|
|
98
|
-
--team-id 456 \
|
|
99
|
-
--report ./report.pdf \
|
|
100
|
-
--wait
|
|
101
|
-
```
|
|
94
|
+
### **Advanced Capabilities**
|
|
102
95
|
|
|
103
|
-
|
|
96
|
+
- **Session Management**: Resume conversations and test sessions
|
|
97
|
+
- **Artifact Storage**: Screenshots, logs, and reports saved locally
|
|
98
|
+
- **Mode Switching**: Seamlessly switch between UI and API testing
|
|
99
|
+
- **Legacy Command Support**: Existing commands still work with chat integration
|
|
104
100
|
|
|
105
|
-
##
|
|
101
|
+
## Usage Examples
|
|
106
102
|
|
|
107
|
-
|
|
108
|
-
- **Headless/CI**: Use Firebase Email/Password (service user):
|
|
103
|
+
### Interactive Chat Mode
|
|
109
104
|
|
|
110
105
|
```bash
|
|
111
|
-
|
|
106
|
+
# Start a conversation with the AI agent
|
|
107
|
+
ttt
|
|
108
|
+
|
|
109
|
+
# The agent will help you:
|
|
110
|
+
# - Discover your application
|
|
111
|
+
# - Plan test scenarios
|
|
112
|
+
# - Execute tests locally
|
|
113
|
+
# - Generate reports
|
|
112
114
|
```
|
|
113
115
|
|
|
114
|
-
|
|
115
|
-
- **Env override**: Set `TTT_TOKEN` to inject the token for one-off runs.
|
|
116
|
-
|
|
117
|
-
## Commands
|
|
118
|
-
|
|
119
|
-
- **ttt login**
|
|
120
|
-
|
|
121
|
-
- Options:
|
|
122
|
-
- `--device` (reserved)
|
|
123
|
-
- `--email <email> --password <password> --api-key <firebase-web-api-key>`
|
|
124
|
-
- `--token <FIREBASE_ID_TOKEN>`
|
|
125
|
-
|
|
126
|
-
- **ttt test**
|
|
116
|
+
### Direct Testing
|
|
127
117
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
- `--type <ui|api|mixed>`: defaults to `ui`
|
|
132
|
-
- `--execute`: execute generated test cases
|
|
133
|
-
- `--mode <all|priority|failed_only>`: defaults to `priority`
|
|
134
|
-
- `--project-id <id>` / `--team-id <id>`
|
|
135
|
-
- `--docs-url <openapi-url>`: API docs (OpenAPI/Swagger)
|
|
136
|
-
- `--no-tunnel`: disable auto ngrok tunnel for local URLs
|
|
137
|
-
- `--report [path]`: download PDF on completion (default `./report-<id>.pdf`)
|
|
138
|
-
- `--share`: enable public sharing after completion
|
|
139
|
-
- `--wait`: block until completion and set exit code based on result
|
|
140
|
-
|
|
141
|
-
- **ttt start-test <prompt>**
|
|
142
|
-
|
|
143
|
-
- Start a test from a natural language prompt. The backend derives the URL from your selected/last project, so you don't need to pass `--url`.
|
|
144
|
-
- Examples:
|
|
145
|
-
```bash
|
|
146
|
-
ttt start-test "Smoke test the main user journey and generate a PDF report" --execute --wait
|
|
147
|
-
ttt start-test "API regression for orders endpoints" --type api --docs-url https://api.example.com/openapi.json --execute
|
|
148
|
-
```
|
|
149
|
-
- Options:
|
|
150
|
-
- `--type <ui|api|mixed>`: defaults to `ui`
|
|
151
|
-
- `--execute`: execute generated test cases
|
|
152
|
-
- `--mode <all|priority|failed_only>`: defaults to `priority`
|
|
153
|
-
- `--project-id <id>` / `--team-id <id>`
|
|
154
|
-
- `--docs-url <openapi-url>`: API docs (OpenAPI/Swagger)
|
|
155
|
-
- `--report [path]`: download PDF on completion (default `./report-<id>.pdf`)
|
|
156
|
-
- `--share`: enable public sharing after completion
|
|
157
|
-
- `--wait`: block until completion and set exit code based on result
|
|
158
|
-
|
|
159
|
-
- **ttt stream <test-id>**
|
|
160
|
-
|
|
161
|
-
- Attach to an existing test and print textual progress only.
|
|
162
|
-
|
|
163
|
-
- **ttt status <test-id>**
|
|
118
|
+
```bash
|
|
119
|
+
# Test a web application
|
|
120
|
+
ttt test --url http://localhost:3000 --prompt "Test the shopping cart functionality"
|
|
164
121
|
|
|
165
|
-
|
|
122
|
+
# Test an API
|
|
123
|
+
ttt test --url https://api.myapp.com --type api --prompt "Validate all user endpoints"
|
|
166
124
|
|
|
167
|
-
|
|
125
|
+
# Generate a comprehensive report
|
|
126
|
+
ttt test --url http://localhost:3000 --prompt "Full regression test" --report ./test-report.pdf
|
|
127
|
+
```
|
|
168
128
|
|
|
169
|
-
|
|
129
|
+
### Session Management
|
|
170
130
|
|
|
171
|
-
|
|
131
|
+
```bash
|
|
132
|
+
# List your test sessions
|
|
133
|
+
ttt list-sessions
|
|
172
134
|
|
|
173
|
-
|
|
135
|
+
# Resume a previous session
|
|
136
|
+
ttt resume session-123
|
|
174
137
|
|
|
175
|
-
|
|
176
|
-
|
|
138
|
+
# Clear old sessions
|
|
139
|
+
ttt clear-session session-123
|
|
140
|
+
```
|
|
177
141
|
|
|
178
|
-
##
|
|
142
|
+
## Configuration
|
|
179
143
|
|
|
180
|
-
|
|
144
|
+
### Environment Variables
|
|
181
145
|
|
|
182
|
-
|
|
146
|
+
```bash
|
|
147
|
+
# Default to local mode (no need to set)
|
|
148
|
+
export TTT_MODE=local
|
|
183
149
|
|
|
184
|
-
|
|
150
|
+
# Force cloud mode
|
|
151
|
+
export TTT_MODE=remote
|
|
185
152
|
|
|
186
|
-
|
|
153
|
+
# Backend API configuration
|
|
154
|
+
export TTT_API_URL=https://api.timetotest.tech
|
|
155
|
+
export TTT_TOKEN=your-firebase-token
|
|
187
156
|
|
|
188
|
-
|
|
189
|
-
export
|
|
157
|
+
# Allow network access in local mode (optional)
|
|
158
|
+
export TTT_ALLOW_NET=true
|
|
190
159
|
```
|
|
191
160
|
|
|
192
|
-
|
|
161
|
+
### Authentication
|
|
193
162
|
|
|
194
|
-
|
|
195
|
-
|
|
163
|
+
```bash
|
|
164
|
+
# Interactive login
|
|
165
|
+
ttt login
|
|
196
166
|
|
|
197
|
-
|
|
167
|
+
# Headless login (for CI/CD)
|
|
168
|
+
ttt login --email user@example.com --password password --api-key firebase-key
|
|
198
169
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
"apiUrl": "https://api.timetotest.tech",
|
|
202
|
-
"socketUrl": "https://api.timetotest.tech",
|
|
203
|
-
"auth": {"firebaseIdToken": "...", "expiresAt": 0},
|
|
204
|
-
"defaultProjectId": null,
|
|
205
|
-
"defaultTeamId": null,
|
|
206
|
-
"ngrok": {"authtoken": null}
|
|
207
|
-
}
|
|
170
|
+
# Direct token
|
|
171
|
+
ttt login --token your-firebase-token
|
|
208
172
|
```
|
|
209
173
|
|
|
210
|
-
##
|
|
211
|
-
|
|
212
|
-
- `TTT_API_URL` – override API base URL
|
|
213
|
-
- `TTT_SOCKET_URL` – override Socket.IO base URL
|
|
214
|
-
- `TTT_TOKEN` – Firebase ID token (overrides stored token)
|
|
215
|
-
- `TTT_NGROK_AUTHTOKEN` – ngrok account token
|
|
174
|
+
## Integration Examples
|
|
216
175
|
|
|
217
|
-
|
|
176
|
+
### GitHub Actions
|
|
218
177
|
|
|
219
178
|
```yaml
|
|
220
|
-
name:
|
|
221
|
-
on:
|
|
222
|
-
push:
|
|
223
|
-
branches: [main]
|
|
179
|
+
name: AI-Powered Testing
|
|
180
|
+
on: [push, pull_request]
|
|
224
181
|
|
|
225
182
|
jobs:
|
|
226
|
-
|
|
183
|
+
test:
|
|
227
184
|
runs-on: ubuntu-latest
|
|
228
185
|
steps:
|
|
229
186
|
- uses: actions/checkout@v4
|
|
230
|
-
|
|
187
|
+
|
|
188
|
+
- name: Setup Node.js
|
|
189
|
+
uses: actions/setup-node@v4
|
|
231
190
|
with:
|
|
232
191
|
node-version: "20"
|
|
233
192
|
|
|
234
193
|
- name: Install CLI
|
|
235
|
-
run: npm
|
|
194
|
+
run: npm install -g @timetotest/cli
|
|
236
195
|
|
|
237
|
-
- name: Start
|
|
196
|
+
- name: Start Application
|
|
238
197
|
run: |
|
|
239
198
|
npm ci
|
|
240
|
-
npm run build
|
|
199
|
+
npm run build
|
|
241
200
|
npm start &
|
|
242
|
-
|
|
243
|
-
npx wait-on http://localhost:3000
|
|
201
|
+
sleep 10
|
|
244
202
|
|
|
245
|
-
- name:
|
|
203
|
+
- name: Login to Time to Test
|
|
246
204
|
env:
|
|
247
205
|
TTT_EMAIL: ${{ secrets.TTT_EMAIL }}
|
|
248
206
|
TTT_PASSWORD: ${{ secrets.TTT_PASSWORD }}
|
|
249
207
|
TTT_FIREBASE_API_KEY: ${{ secrets.TTT_FIREBASE_API_KEY }}
|
|
250
208
|
run: ttt login --email "$TTT_EMAIL" --password "$TTT_PASSWORD" --api-key "$TTT_FIREBASE_API_KEY"
|
|
251
209
|
|
|
252
|
-
- name: Run
|
|
253
|
-
env:
|
|
254
|
-
TTT_API_URL: https://apis.timetotest.afloattech.com
|
|
255
|
-
TTT_SOCKET_URL: https://apis.timetotest.afloattech.com
|
|
256
|
-
TTT_NGROK_AUTHTOKEN: ${{ secrets.NGROK_AUTHTOKEN }}
|
|
210
|
+
- name: Run AI Tests
|
|
257
211
|
run: |
|
|
258
212
|
ttt test \
|
|
259
213
|
--url http://localhost:3000 \
|
|
260
|
-
--
|
|
261
|
-
--
|
|
262
|
-
--mode priority \
|
|
263
|
-
--project-id 123 \
|
|
264
|
-
--team-id 456 \
|
|
265
|
-
--report ./report.pdf \
|
|
214
|
+
--prompt "Comprehensive regression test for main user flows" \
|
|
215
|
+
--report ./test-report.pdf \
|
|
266
216
|
--wait
|
|
267
217
|
|
|
268
|
-
- name: Upload Report
|
|
218
|
+
- name: Upload Test Report
|
|
269
219
|
uses: actions/upload-artifact@v4
|
|
270
220
|
with:
|
|
271
|
-
name:
|
|
272
|
-
path: ./report.pdf
|
|
221
|
+
name: test-report
|
|
222
|
+
path: ./test-report.pdf
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Local Development Workflow
|
|
273
226
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
227
|
+
```bash
|
|
228
|
+
# Start your app
|
|
229
|
+
npm start
|
|
230
|
+
|
|
231
|
+
# In another terminal, test it
|
|
232
|
+
ttt test --url http://localhost:3000 --prompt "Test the new feature I just built"
|
|
233
|
+
|
|
234
|
+
# Get a detailed report
|
|
235
|
+
ttt test --url http://localhost:3000 --prompt "Full test suite" --report ./reports/latest.pdf
|
|
277
236
|
```
|
|
278
237
|
|
|
279
|
-
##
|
|
238
|
+
## Commands Reference
|
|
239
|
+
|
|
240
|
+
### Core Commands
|
|
280
241
|
|
|
281
|
-
-
|
|
282
|
-
-
|
|
283
|
-
-
|
|
284
|
-
-
|
|
242
|
+
- `ttt` - Start interactive chat (local mode)
|
|
243
|
+
- `ttt --cloud` - Start interactive chat (cloud mode)
|
|
244
|
+
- `ttt test` - Run a specific test with options
|
|
245
|
+
- `ttt login` - Authenticate with Time to Test
|
|
246
|
+
|
|
247
|
+
### Session Management
|
|
248
|
+
|
|
249
|
+
- `ttt list-sessions` - Show all test sessions
|
|
250
|
+
- `ttt resume <session-id>` - Continue a previous session
|
|
251
|
+
- `ttt clear-session <session-id>` - Delete a session
|
|
252
|
+
|
|
253
|
+
### Legacy Commands (Still Supported)
|
|
254
|
+
|
|
255
|
+
- `ttt start-test <prompt>` - Start test from prompt
|
|
256
|
+
- `ttt stream <test-id>` - Monitor test progress
|
|
257
|
+
- `ttt status <test-id>` - Check test status
|
|
258
|
+
- `ttt report <test-id>` - Generate report
|
|
259
|
+
- `ttt share <test-id>` - Create shareable link
|
|
260
|
+
|
|
261
|
+
## What Makes This Different?
|
|
262
|
+
|
|
263
|
+
### Traditional Testing Tools
|
|
264
|
+
|
|
265
|
+
- Require writing test code
|
|
266
|
+
- Need manual test case creation
|
|
267
|
+
- Limited to predefined scenarios
|
|
268
|
+
- Complex setup and maintenance
|
|
269
|
+
|
|
270
|
+
### Time to Test CLI
|
|
271
|
+
|
|
272
|
+
- Natural language test descriptions
|
|
273
|
+
- AI discovers test scenarios automatically
|
|
274
|
+
- Adapts to your application's behavior
|
|
275
|
+
- Zero configuration for local testing
|
|
285
276
|
|
|
286
277
|
## Privacy & Security
|
|
287
278
|
|
|
288
|
-
-
|
|
289
|
-
-
|
|
279
|
+
- **Local Mode**: All testing happens on your machine
|
|
280
|
+
- **No Data Collection**: Your application data stays private
|
|
281
|
+
- **Secure Authentication**: Firebase-based auth with token management
|
|
282
|
+
- **Configurable Access**: Control what the agent can access
|
|
283
|
+
|
|
284
|
+
## Getting Help
|
|
285
|
+
|
|
286
|
+
- **Documentation**: [timetotest.tech](https://timetotest.tech)
|
|
287
|
+
- **Support**: Visit our website for help and updates
|
|
288
|
+
- **Issues**: Report bugs and feature requests through our support channels
|
|
289
|
+
|
|
290
|
+
## Requirements
|
|
290
291
|
|
|
291
|
-
|
|
292
|
+
- **Node.js**: 18 or higher
|
|
293
|
+
- **Operating System**: macOS, Linux, or Windows
|
|
294
|
+
- **Browser**: Chrome/Chromium (for UI testing)
|
|
295
|
+
- **Network**: Internet connection for AI reasoning (local execution)
|
|
292
296
|
|
|
293
|
-
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
**Ready to revolutionize your testing workflow?** Install the CLI and start chatting with your AI testing agent today!
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
npm install -g @timetotest/cli
|
|
303
|
+
ttt
|
|
304
|
+
```
|
package/dist/bin/ttt.js
CHANGED
|
@@ -8,10 +8,11 @@ import { restart } from "../src/commands/restart.js";
|
|
|
8
8
|
import { stream } from "../src/commands/stream.js";
|
|
9
9
|
import { report } from "../src/commands/report.js";
|
|
10
10
|
import { share } from "../src/commands/share.js";
|
|
11
|
-
import { ask } from "../src/commands/ask.js";
|
|
11
|
+
import { askInk as ask } from "../src/commands/ask-ink.js";
|
|
12
12
|
import { startTest } from "../src/commands/start-test.js";
|
|
13
13
|
import { applyStyledHelpRecursively } from "../src/lib/help.js";
|
|
14
14
|
import { promptForUpdateIfAvailable } from "../src/lib/update.js";
|
|
15
|
+
import { chatInk as chat } from "../src/commands/chat-ink.js";
|
|
15
16
|
const program = new Command();
|
|
16
17
|
const cliVersion = String(packageJson.version || "0.0.0");
|
|
17
18
|
program.name("ttt").description("Time to Test CLI").version(cliVersion);
|
|
@@ -24,11 +25,12 @@ program.addCommand(report);
|
|
|
24
25
|
program.addCommand(share);
|
|
25
26
|
program.addCommand(ask);
|
|
26
27
|
program.addCommand(startTest);
|
|
28
|
+
program.addCommand(chat);
|
|
27
29
|
applyStyledHelpRecursively(program, "ttt");
|
|
28
30
|
await promptForUpdateIfAvailable();
|
|
29
31
|
// Default to `ask` when no subcommand is provided
|
|
30
32
|
if (process.argv.length <= 2) {
|
|
31
|
-
process.argv.push("
|
|
33
|
+
process.argv.push("chat");
|
|
32
34
|
}
|
|
33
35
|
await program.parseAsync(process.argv);
|
|
34
36
|
//# sourceMappingURL=ttt.js.map
|
package/dist/bin/ttt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ttt.js","sourceRoot":"","sources":["../../bin/ttt.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAC9D,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAC,IAAI,EAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAC,GAAG,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"ttt.js","sourceRoot":"","sources":["../../bin/ttt.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAC9D,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAC,IAAI,EAAC,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAC,MAAM,IAAI,GAAG,EAAC,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAC,0BAA0B,EAAC,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAC,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,6BAA6B,CAAC;AAE5D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAC9B,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC;AAC1D,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAExE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAC1B,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACzB,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAC5B,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAC1B,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACxB,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAC9B,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAEzB,0BAA0B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAE3C,MAAM,0BAA0B,EAAE,CAAC;AACnC,kDAAkD;AAClD,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AACD,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timetotest/cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Time to Test CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,25 +29,36 @@
|
|
|
29
29
|
"node": ">=18"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.20.1",
|
|
32
33
|
"@ngrok/ngrok": "^1.3.0",
|
|
34
|
+
"@playwright/mcp": "^0.0.43",
|
|
33
35
|
"axios": "^1.7.7",
|
|
34
36
|
"chalk": "^5.3.0",
|
|
37
|
+
"cloudinary": "^2.8.0",
|
|
35
38
|
"commander": "^12.1.0",
|
|
36
39
|
"dotenv": "^16.4.5",
|
|
37
40
|
"figlet": "^1.6.0",
|
|
38
41
|
"fs-extra": "^11.2.0",
|
|
42
|
+
"fuse.js": "^7.1.0",
|
|
43
|
+
"ink": "^6.3.1",
|
|
44
|
+
"ink-spinner": "^5.0.0",
|
|
45
|
+
"ink-text-input": "^6.0.0",
|
|
39
46
|
"inquirer": "^9.2.12",
|
|
40
47
|
"keytar": "^7.9.0",
|
|
41
48
|
"open": "^9.1.0",
|
|
42
49
|
"ora": "^8.1.0",
|
|
50
|
+
"playwright": "^1.56.1",
|
|
51
|
+
"react": "^19.2.0",
|
|
43
52
|
"readline": "^1.3.0",
|
|
44
|
-
"socket.io-client": "^4.7.5"
|
|
53
|
+
"socket.io-client": "^4.7.5",
|
|
54
|
+
"yaml": "^2.8.1"
|
|
45
55
|
},
|
|
46
56
|
"devDependencies": {
|
|
47
57
|
"@types/figlet": "^1.5.8",
|
|
48
58
|
"@types/fs-extra": "^11.0.4",
|
|
49
59
|
"@types/inquirer": "^9.0.9",
|
|
50
60
|
"@types/node": "^20.11.19",
|
|
61
|
+
"@types/react": "^19.2.2",
|
|
51
62
|
"typescript": "^5.5.4"
|
|
52
63
|
}
|
|
53
64
|
}
|