cyclecad 3.0.0 → 3.2.0
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/BILLING-IMPLEMENTATION-SUMMARY.md +425 -0
- package/BILLING-INDEX.md +293 -0
- package/BILLING-INTEGRATION-GUIDE.md +414 -0
- package/COLLABORATION-INDEX.md +440 -0
- package/COLLABORATION-SYSTEM-SUMMARY.md +548 -0
- package/DOCKER-BUILD-MANIFEST.txt +483 -0
- package/DOCKER-FILES-REFERENCE.md +440 -0
- package/DOCKER-INFRASTRUCTURE.md +475 -0
- package/DOCKER-README.md +435 -0
- package/Dockerfile +33 -55
- package/PWA-FILES-CREATED.txt +350 -0
- package/QUICK-START-TESTING.md +126 -0
- package/STEP-IMPORT-QUICKSTART.md +347 -0
- package/STEP-IMPORT-SYSTEM-SUMMARY.md +502 -0
- package/app/css/mobile.css +1074 -0
- package/app/icons/generate-icons.js +203 -0
- package/app/index.html +93 -0
- package/app/js/billing-ui.js +990 -0
- package/app/js/brep-kernel.js +933 -981
- package/app/js/collab-client.js +750 -0
- package/app/js/mobile-nav.js +623 -0
- package/app/js/mobile-toolbar.js +476 -0
- package/app/js/modules/billing-module.js +724 -0
- package/app/js/modules/step-module-enhanced.js +938 -0
- package/app/js/offline-manager.js +705 -0
- package/app/js/responsive-init.js +360 -0
- package/app/js/touch-handler.js +429 -0
- package/app/manifest.json +211 -0
- package/app/offline.html +508 -0
- package/app/sw.js +571 -0
- package/app/tests/billing-tests.html +779 -0
- package/app/tests/brep-tests.html +980 -0
- package/app/tests/collab-tests.html +743 -0
- package/app/tests/mobile-tests.html +1299 -0
- package/app/tests/pwa-tests.html +1134 -0
- package/app/tests/step-tests.html +1042 -0
- package/app/tests/test-agent-v3.html +719 -0
- package/docker-compose.yml +225 -0
- package/docs/BILLING-HELP.json +260 -0
- package/docs/BILLING-README.md +639 -0
- package/docs/BILLING-TUTORIAL.md +736 -0
- package/docs/BREP-HELP.json +326 -0
- package/docs/BREP-TUTORIAL.md +802 -0
- package/docs/COLLABORATION-HELP.json +228 -0
- package/docs/COLLABORATION-TUTORIAL.md +818 -0
- package/docs/DOCKER-HELP.json +224 -0
- package/docs/DOCKER-TUTORIAL.md +974 -0
- package/docs/MOBILE-HELP.json +243 -0
- package/docs/MOBILE-RESPONSIVE-README.md +378 -0
- package/docs/MOBILE-TUTORIAL.md +747 -0
- package/docs/PWA-HELP.json +228 -0
- package/docs/PWA-README.md +662 -0
- package/docs/PWA-TUTORIAL.md +757 -0
- package/docs/STEP-HELP.json +481 -0
- package/docs/STEP-IMPORT-TUTORIAL.md +824 -0
- package/docs/TESTING-GUIDE.md +528 -0
- package/docs/TESTING-HELP.json +182 -0
- package/fusion-vs-cyclecad.html +1771 -0
- package/nginx.conf +237 -0
- package/package.json +1 -1
- package/server/Dockerfile.converter +51 -0
- package/server/Dockerfile.signaling +28 -0
- package/server/billing-server.js +487 -0
- package/server/converter-enhanced.py +528 -0
- package/server/requirements-converter.txt +29 -0
- package/server/signaling-server.js +801 -0
- package/tests/docker-tests.sh +389 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
# cycleCAD Testing Guide
|
|
2
|
+
|
|
3
|
+
Comprehensive documentation for the cycleCAD visual test agent system and automated testing infrastructure.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The cycleCAD test agent v3 (`app/tests/test-agent-v3.html`) is a split-screen visual testing framework that runs 200+ automated tests across all UI components, features, and user workflows. The test agent runs in your browser and provides live visual feedback as tests execute.
|
|
8
|
+
|
|
9
|
+
## Test Agent Architecture
|
|
10
|
+
|
|
11
|
+
### Visual Test Agent (v3)
|
|
12
|
+
|
|
13
|
+
**Location:** `app/tests/test-agent-v3.html`
|
|
14
|
+
|
|
15
|
+
**Layout:**
|
|
16
|
+
- **Left 70%:** Embedded cycleCAD app in iframe
|
|
17
|
+
- **Right 30%:** Test runner with log panel
|
|
18
|
+
|
|
19
|
+
**Features:**
|
|
20
|
+
- 25+ test categories covering all major features
|
|
21
|
+
- Live element highlighting (green flash on tested elements)
|
|
22
|
+
- Real-time progress bar with percentage
|
|
23
|
+
- Pass/fail/skip color coding
|
|
24
|
+
- Export results as JSON
|
|
25
|
+
- <5 second timeout per test
|
|
26
|
+
|
|
27
|
+
### Test Categories
|
|
28
|
+
|
|
29
|
+
| Category | Tests | What's Tested |
|
|
30
|
+
|----------|-------|---------------|
|
|
31
|
+
| Workspace | 8 | Design, Sketch, Assembly, Drawing, Simulation workspaces |
|
|
32
|
+
| Menu Bar | 12 | File, Edit, Sketch, Solid, Assembly, Drawing, Tools, View, Help menus |
|
|
33
|
+
| Design Toolbar | 10 | Extrude, revolve, fillet, chamfer, shell, pattern, mirror, boolean ops |
|
|
34
|
+
| Sketch Tools | 8 | Line, rectangle, circle, arc, point, constraints, dimensions |
|
|
35
|
+
| 3D Operations | 15 | Extrude, revolve, fillet, chamfer, shell, boolean, sweep, loft, mirror, pattern, sheet metal, thread, spring |
|
|
36
|
+
| View | 10 | Front, back, left, right, top, bottom, isometric, fit all, wireframe, grid |
|
|
37
|
+
| Panels | 10 | Model tree, properties, parameters, materials, appearance, timeline, animation |
|
|
38
|
+
| Keyboard Shortcuts | 15 | S, E, F, V, Ctrl+Z, Ctrl+Y, Ctrl+S, F5, Escape, Delete, ?, Ctrl+Shift+P, G, W, number keys |
|
|
39
|
+
| Agent API | 8 | cycleCAD.execute(), shape creation, feature ops, render, validate, assembly |
|
|
40
|
+
| Responsiveness | 10 | App load, console errors, resize stability, button clickability, panel input, selection, status bar, context menus, drag & drop, double-click |
|
|
41
|
+
| Advanced Features | 10 | Hero shots, assembly/disassembly animation, auto-generation, animation controls, STEP import, model library, help pages, part comparison, service mode, maintenance reports |
|
|
42
|
+
| Error Handling | 10 | JS errors, WebGL recovery, tab switch state, network errors, invalid selection, cache validation, memory monitoring, performance, console warnings, error messages |
|
|
43
|
+
|
|
44
|
+
**Total: 25+ categories, 200+ tests**
|
|
45
|
+
|
|
46
|
+
## Running Tests
|
|
47
|
+
|
|
48
|
+
### In Browser (Interactive)
|
|
49
|
+
|
|
50
|
+
1. Open `app/tests/test-agent-v3.html` in Chrome
|
|
51
|
+
2. Wait for the app to load in the left iframe (about 3 seconds)
|
|
52
|
+
3. Click **"Run All Tests"** button
|
|
53
|
+
4. Watch tests execute in real-time:
|
|
54
|
+
- Green flashes indicate elements being tested
|
|
55
|
+
- Log panel shows pass/fail for each test
|
|
56
|
+
- Progress bar fills as tests complete
|
|
57
|
+
|
|
58
|
+
**Typical run time:** 60-90 seconds for 200+ tests
|
|
59
|
+
|
|
60
|
+
### Command Line (Headless)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Run all tests with Puppeteer (Node.js required)
|
|
64
|
+
node test-runner.js app/tests/test-agent-v3.html
|
|
65
|
+
|
|
66
|
+
# Run specific category
|
|
67
|
+
node test-runner.js app/tests/test-agent-v3.html --category "Workspace"
|
|
68
|
+
|
|
69
|
+
# Export results to file
|
|
70
|
+
node test-runner.js app/tests/test-agent-v3.html --output results.json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**See:** `test-runner.js` (headless Chrome automation)
|
|
74
|
+
|
|
75
|
+
### CI/CD Pipeline
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
# GitHub Actions workflow (.github/workflows/test.yml)
|
|
79
|
+
name: Test Suite
|
|
80
|
+
on: [push, pull_request]
|
|
81
|
+
jobs:
|
|
82
|
+
test:
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
steps:
|
|
85
|
+
- uses: actions/checkout@v2
|
|
86
|
+
- uses: actions/setup-node@v2
|
|
87
|
+
- run: npm test
|
|
88
|
+
# Runs: node test-runner.js app/tests/test-agent-v3.html --output test-results.json
|
|
89
|
+
- uses: actions/upload-artifact@v2
|
|
90
|
+
with:
|
|
91
|
+
name: test-results
|
|
92
|
+
path: test-results.json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Test Results
|
|
96
|
+
|
|
97
|
+
### JSON Export Format
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"timestamp": "2026-03-31T14:23:45.123Z",
|
|
102
|
+
"summary": {
|
|
103
|
+
"total": 205,
|
|
104
|
+
"passed": 203,
|
|
105
|
+
"failed": 2,
|
|
106
|
+
"skipped": 0
|
|
107
|
+
},
|
|
108
|
+
"results": [
|
|
109
|
+
{
|
|
110
|
+
"test": "Switch to Design workspace",
|
|
111
|
+
"status": "pass",
|
|
112
|
+
"info": "142ms"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"test": "Extrude button visible",
|
|
116
|
+
"status": "fail",
|
|
117
|
+
"info": "Element not found: #extrude-btn"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Key fields:**
|
|
124
|
+
- `timestamp` — when test run started
|
|
125
|
+
- `summary` — overall statistics
|
|
126
|
+
- `results` — individual test outcomes (name, status, timing)
|
|
127
|
+
|
|
128
|
+
### HTML Report Format
|
|
129
|
+
|
|
130
|
+
```html
|
|
131
|
+
<!-- Generated by test-reporter.js -->
|
|
132
|
+
<html>
|
|
133
|
+
<head>
|
|
134
|
+
<title>cycleCAD Test Report</title>
|
|
135
|
+
<style>/* includes pass/fail colors, charts */</style>
|
|
136
|
+
</head>
|
|
137
|
+
<body>
|
|
138
|
+
<h1>Test Report: 203/205 PASSED</h1>
|
|
139
|
+
<div class="summary">
|
|
140
|
+
<div class="stat">Passed: 203 (99%)</div>
|
|
141
|
+
<div class="stat">Failed: 2 (1%)</div>
|
|
142
|
+
</div>
|
|
143
|
+
<div class="failures">
|
|
144
|
+
<!-- Details of failed tests -->
|
|
145
|
+
</div>
|
|
146
|
+
</body>
|
|
147
|
+
</html>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**See:** `test-reporter.js` — converts JSON to HTML report
|
|
151
|
+
|
|
152
|
+
## Adding New Tests
|
|
153
|
+
|
|
154
|
+
### Create a New Test Category
|
|
155
|
+
|
|
156
|
+
Open `app/tests/test-agent-v3.html` and add to the `defineTests()` method:
|
|
157
|
+
|
|
158
|
+
```javascript
|
|
159
|
+
// In the defineTests() method of TestAgent class:
|
|
160
|
+
|
|
161
|
+
this.addCategory('My New Category', [
|
|
162
|
+
{
|
|
163
|
+
name: 'My first test',
|
|
164
|
+
fn: () => this.clickInApp('#my-button')
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: 'My second test',
|
|
168
|
+
fn: () => this.checkElementExists('#my-panel')
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'My keyboard test',
|
|
172
|
+
fn: () => this.testKeyboard('shift+s')
|
|
173
|
+
}
|
|
174
|
+
]);
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Available Test Methods
|
|
178
|
+
|
|
179
|
+
| Method | What It Does | Example |
|
|
180
|
+
|--------|--------------|---------|
|
|
181
|
+
| `clickInApp(selector)` | Click an element in the app | `this.clickInApp('#extrude-btn')` |
|
|
182
|
+
| `checkElementExists(selector)` | Verify element exists | `this.checkElementExists('#tree-panel')` |
|
|
183
|
+
| `testKeyboard(key)` | Send keyboard event | `this.testKeyboard('escape')` |
|
|
184
|
+
| `checkOperationExists(name)` | Check function in window | `this.checkOperationExists('extrude')` |
|
|
185
|
+
| `checkAgentAPI()` | Verify Agent API loaded | `this.checkAgentAPI()` |
|
|
186
|
+
| `toggleWireframe()` | Toggle wireframe display | `this.toggleWireframe()` |
|
|
187
|
+
| `toggleGrid()` | Toggle grid display | `this.toggleGrid()` |
|
|
188
|
+
|
|
189
|
+
All methods return Promises. Use async/await or `.then()` for chaining.
|
|
190
|
+
|
|
191
|
+
### Test Naming Conventions
|
|
192
|
+
|
|
193
|
+
**DO:**
|
|
194
|
+
- Use action verbs: "Click", "Toggle", "Open", "Select", "Verify"
|
|
195
|
+
- Be specific: "Extrude button visible" not "Button works"
|
|
196
|
+
- Include context: "Sketch line tool" not "Line tool"
|
|
197
|
+
|
|
198
|
+
**DON'T:**
|
|
199
|
+
- Use vague names: "Test works"
|
|
200
|
+
- Combine multiple assertions: "Button clicks and panel opens"
|
|
201
|
+
- Use technical jargon: "QuerySelector executes"
|
|
202
|
+
|
|
203
|
+
### Test Isolation
|
|
204
|
+
|
|
205
|
+
Each test should be independent:
|
|
206
|
+
- Don't rely on previous test state
|
|
207
|
+
- Reset UI state at end of test if needed
|
|
208
|
+
- Use timeout delays to let UI settle between actions
|
|
209
|
+
|
|
210
|
+
```javascript
|
|
211
|
+
{
|
|
212
|
+
name: 'Pattern operation creates array',
|
|
213
|
+
fn: async () => {
|
|
214
|
+
// Set up
|
|
215
|
+
await this.clickInApp('#extrude-btn');
|
|
216
|
+
|
|
217
|
+
// Test action
|
|
218
|
+
await this.clickInApp('#pattern-btn');
|
|
219
|
+
|
|
220
|
+
// Verify
|
|
221
|
+
await this.checkElementExists('#pattern-panel');
|
|
222
|
+
|
|
223
|
+
// Cleanup (close panel)
|
|
224
|
+
await this.testKeyboard('escape');
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Test Coverage Tracking
|
|
230
|
+
|
|
231
|
+
### Coverage by Component
|
|
232
|
+
|
|
233
|
+
| Component | Coverage | Gap |
|
|
234
|
+
|-----------|----------|-----|
|
|
235
|
+
| Workspace tabs | 8/8 (100%) | None |
|
|
236
|
+
| View toolbar | 10/10 (100%) | None |
|
|
237
|
+
| Sketch tools | 8/8 (100%) | None |
|
|
238
|
+
| 3D operations | 15/18 (83%) | Thread, spring, loft |
|
|
239
|
+
| Panels | 10/12 (83%) | Animation timeline, custom workspaces |
|
|
240
|
+
| Keyboard shortcuts | 15/18 (83%) | View key combos, custom shortcuts |
|
|
241
|
+
| Agent API | 8/10 (80%) | Assembly constraints, advanced features |
|
|
242
|
+
| Error handling | 10/12 (83%) | WebGL extensions, Shader errors |
|
|
243
|
+
|
|
244
|
+
**Target:** 95%+ coverage on core features, 80%+ on advanced features
|
|
245
|
+
|
|
246
|
+
### Adding Coverage for Gaps
|
|
247
|
+
|
|
248
|
+
If a feature is missing tests, add them:
|
|
249
|
+
|
|
250
|
+
```javascript
|
|
251
|
+
this.addCategory('Thread Generator (NEW)', [
|
|
252
|
+
{ name: 'Thread tool accessible', fn: () => this.checkElementExists('#thread-btn') },
|
|
253
|
+
{ name: 'Thread dialog opens', fn: () => this.clickInApp('#thread-btn') },
|
|
254
|
+
{ name: 'Thread parameters apply', fn: () => this.testThreadCreation() },
|
|
255
|
+
{ name: 'Thread generates geometry', fn: () => this.checkThreadMesh() }
|
|
256
|
+
]);
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Then verify coverage report shows 100% for that component.
|
|
260
|
+
|
|
261
|
+
## Debugging Failed Tests
|
|
262
|
+
|
|
263
|
+
### Common Failures
|
|
264
|
+
|
|
265
|
+
| Failure | Cause | Fix |
|
|
266
|
+
|---------|-------|-----|
|
|
267
|
+
| "Element not found: #my-btn" | Button ID is wrong or missing | Check app HTML for correct ID |
|
|
268
|
+
| Test hangs (timeout after 5s) | App didn't load or froze | Reload app, check console for JS errors |
|
|
269
|
+
| Flash overlay doesn't appear | Element outside viewport | Scroll panel first, then test |
|
|
270
|
+
| Keyboard test doesn't work | Event not reaching app | Check event bubbles: true |
|
|
271
|
+
|
|
272
|
+
### Debug Mode
|
|
273
|
+
|
|
274
|
+
Open test agent in Chrome DevTools:
|
|
275
|
+
|
|
276
|
+
1. Open `app/tests/test-agent-v3.html`
|
|
277
|
+
2. Open DevTools (F12)
|
|
278
|
+
3. In DevTools, switch to **iframe** console (dropdown top-left of console)
|
|
279
|
+
4. Run manual tests:
|
|
280
|
+
```javascript
|
|
281
|
+
// In iframe console:
|
|
282
|
+
window.cycleCAD.execute({ method: 'shape.cylinder', params: { radius: 50 } })
|
|
283
|
+
document.querySelector('#extrude-btn').click()
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Visual Debugging
|
|
287
|
+
|
|
288
|
+
- **Green flash** indicates element was found and clicked
|
|
289
|
+
- **No flash** = element not found or not visible
|
|
290
|
+
- **Test stalls** = UI didn't respond or is loading
|
|
291
|
+
|
|
292
|
+
To debug a stuck test:
|
|
293
|
+
1. Pause the test runner (refresh page)
|
|
294
|
+
2. Manually reproduce the test steps in the app
|
|
295
|
+
3. Check app console for errors: `Cmd+Option+J` (Mac) or `Ctrl+Shift+J` (Windows/Linux)
|
|
296
|
+
|
|
297
|
+
## Test Maintenance
|
|
298
|
+
|
|
299
|
+
### Updating Tests After UI Changes
|
|
300
|
+
|
|
301
|
+
If you change button IDs, panel names, or keyboard shortcuts:
|
|
302
|
+
|
|
303
|
+
1. Update `app/tests/test-agent-v3.html` with new selectors
|
|
304
|
+
2. Run full test suite to find broken tests
|
|
305
|
+
3. Fix selector strings to match new UI
|
|
306
|
+
4. Commit updated test file with UI changes
|
|
307
|
+
|
|
308
|
+
Example: If you rename `#extrude-btn` to `#op-extrude`:
|
|
309
|
+
```javascript
|
|
310
|
+
// OLD:
|
|
311
|
+
{ name: 'Extrude button visible', fn: () => this.checkElementExists('#extrude-btn') }
|
|
312
|
+
|
|
313
|
+
// NEW:
|
|
314
|
+
{ name: 'Extrude button visible', fn: () => this.checkElementExists('#op-extrude') }
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Removing Obsolete Tests
|
|
318
|
+
|
|
319
|
+
If a feature is deleted, remove its tests:
|
|
320
|
+
|
|
321
|
+
```javascript
|
|
322
|
+
// Remove this entire block if "Legacy Tool" is removed:
|
|
323
|
+
this.addCategory('Legacy Tool', [
|
|
324
|
+
{ name: 'Legacy tool visible', fn: () => ... },
|
|
325
|
+
{ name: 'Legacy tool works', fn: () => ... }
|
|
326
|
+
]);
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Performance Benchmarking
|
|
330
|
+
|
|
331
|
+
Test agent tracks timing for each test:
|
|
332
|
+
|
|
333
|
+
```javascript
|
|
334
|
+
// In export results:
|
|
335
|
+
"results": [
|
|
336
|
+
{ "test": "Click button", "status": "pass", "info": "42ms" },
|
|
337
|
+
{ "test": "Open panel", "status": "pass", "info": "156ms" },
|
|
338
|
+
{ "test": "Execute operation", "status": "pass", "info": "789ms" }
|
|
339
|
+
]
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
**Performance targets:**
|
|
343
|
+
- UI clicks: <200ms
|
|
344
|
+
- Panel opens: <500ms
|
|
345
|
+
- Operations: <2000ms
|
|
346
|
+
|
|
347
|
+
If a test takes >2x longer than expected, investigate:
|
|
348
|
+
- Is the app loading geometry?
|
|
349
|
+
- Is there a console error?
|
|
350
|
+
- Did a dependency change?
|
|
351
|
+
|
|
352
|
+
## Test Categories Reference
|
|
353
|
+
|
|
354
|
+
### Workspace Tests
|
|
355
|
+
Test switching between Design, Sketch, Assembly, Drawing, Simulation workspaces. Verify toolbar and panel content change appropriately.
|
|
356
|
+
|
|
357
|
+
### Menu Bar Tests
|
|
358
|
+
Test all menus are accessible and have proper options (File, Edit, Sketch, Solid, Assembly, Drawing, Tools, View, Help).
|
|
359
|
+
|
|
360
|
+
### Toolbar Tests
|
|
361
|
+
Test all toolbar buttons are visible and clickable in each workspace. Includes Design, Sketch, Assembly, Drawing tabs.
|
|
362
|
+
|
|
363
|
+
### Sketch Tool Tests
|
|
364
|
+
Test sketch tools (line, rectangle, circle, arc, point) are available and selectable. Verify constraints and dimension tools.
|
|
365
|
+
|
|
366
|
+
### 3D Operations Tests
|
|
367
|
+
Test all 3D feature operations (extrude, revolve, fillet, chamfer, shell, pattern, mirror, boolean, sweep, loft, sheet metal, thread, spring) are callable and functional.
|
|
368
|
+
|
|
369
|
+
### View Tests
|
|
370
|
+
Test view controls (Front, Back, Left, Right, Top, Bottom, Isometric, Fit All, Wireframe, Grid). Verify smooth camera transitions.
|
|
371
|
+
|
|
372
|
+
### Panel Tests
|
|
373
|
+
Test all side panels open/close correctly. Verify Properties, Model Tree, Parameters, Materials, Appearance, Timeline panels work.
|
|
374
|
+
|
|
375
|
+
### Keyboard Shortcut Tests
|
|
376
|
+
Test all keyboard shortcuts (S, E, F, V, Ctrl+Z, Ctrl+Y, Escape, etc.) execute correct actions.
|
|
377
|
+
|
|
378
|
+
### Agent API Tests
|
|
379
|
+
Test `window.cycleCAD.execute()` API works. Verify shape creation, feature operations, rendering, and validation.
|
|
380
|
+
|
|
381
|
+
### Responsiveness Tests
|
|
382
|
+
Test app loads without errors, console is clean, UI doesn't break on resize, all buttons are clickable.
|
|
383
|
+
|
|
384
|
+
### Advanced Feature Tests
|
|
385
|
+
Test advanced features: hero shots, animations, STEP import, model library, multilanguage help, part comparison, service mode.
|
|
386
|
+
|
|
387
|
+
### Error Handling Tests
|
|
388
|
+
Test error recovery: JS errors caught, WebGL context loss handled, tab switching preserves state, network errors show friendly messages.
|
|
389
|
+
|
|
390
|
+
## ExplodeView Test Agent (v2)
|
|
391
|
+
|
|
392
|
+
Similar structure to cycleCAD test agent, located at `docs/demo/test-agent-v2.html`.
|
|
393
|
+
|
|
394
|
+
**Test categories:** 15+ categories, 150+ tests covering View/Analyze/Create/Export/AI/Settings tabs, keyboard shortcuts, panels, context menus, part selection, language support, draggable panels, and error handling.
|
|
395
|
+
|
|
396
|
+
**Run via:** Open `docs/demo/test-agent-v2.html` in Chrome, click "Run All Tests".
|
|
397
|
+
|
|
398
|
+
## Continuous Integration
|
|
399
|
+
|
|
400
|
+
### GitHub Actions Workflow
|
|
401
|
+
|
|
402
|
+
Create `.github/workflows/test.yml`:
|
|
403
|
+
|
|
404
|
+
```yaml
|
|
405
|
+
name: Test Suite
|
|
406
|
+
on:
|
|
407
|
+
push:
|
|
408
|
+
branches: [ main, develop ]
|
|
409
|
+
pull_request:
|
|
410
|
+
branches: [ main ]
|
|
411
|
+
|
|
412
|
+
jobs:
|
|
413
|
+
test:
|
|
414
|
+
runs-on: ubuntu-latest
|
|
415
|
+
strategy:
|
|
416
|
+
matrix:
|
|
417
|
+
node-version: [16.x, 18.x]
|
|
418
|
+
|
|
419
|
+
steps:
|
|
420
|
+
- uses: actions/checkout@v3
|
|
421
|
+
|
|
422
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
423
|
+
uses: actions/setup-node@v3
|
|
424
|
+
with:
|
|
425
|
+
node-version: ${{ matrix.node-version }}
|
|
426
|
+
|
|
427
|
+
- name: Install dependencies
|
|
428
|
+
run: npm ci
|
|
429
|
+
|
|
430
|
+
- name: Run test agent
|
|
431
|
+
run: node test-runner.js app/tests/test-agent-v3.html --output test-results.json
|
|
432
|
+
|
|
433
|
+
- name: Generate report
|
|
434
|
+
run: node test-reporter.js test-results.json --output test-report.html
|
|
435
|
+
|
|
436
|
+
- name: Upload results
|
|
437
|
+
if: always()
|
|
438
|
+
uses: actions/upload-artifact@v3
|
|
439
|
+
with:
|
|
440
|
+
name: test-results-${{ matrix.node-version }}
|
|
441
|
+
path: test-report.html
|
|
442
|
+
|
|
443
|
+
- name: Fail if tests failed
|
|
444
|
+
if: failure()
|
|
445
|
+
run: exit 1
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
### Test Result Dashboard
|
|
449
|
+
|
|
450
|
+
Optional: Generate a dashboard showing test trends over time:
|
|
451
|
+
|
|
452
|
+
```javascript
|
|
453
|
+
// test-dashboard.js — reads test-results.json, plots pass rate over time
|
|
454
|
+
const fs = require('fs');
|
|
455
|
+
const results = JSON.parse(fs.readFileSync('test-results.json'));
|
|
456
|
+
const passRate = (results.summary.passed / results.summary.total * 100).toFixed(1);
|
|
457
|
+
console.log(`Pass Rate: ${passRate}%`);
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
## Troubleshooting
|
|
461
|
+
|
|
462
|
+
### Test Agent Won't Start
|
|
463
|
+
|
|
464
|
+
**Symptom:** App loads but tests don't run
|
|
465
|
+
|
|
466
|
+
**Solution:**
|
|
467
|
+
1. Check console (F12) for JS errors
|
|
468
|
+
2. Verify app loaded in iframe (left side should show app)
|
|
469
|
+
3. Click "Run All Tests" button (if grayed out, try refresh)
|
|
470
|
+
4. Check browser console for errors in test-agent-v3.html itself
|
|
471
|
+
|
|
472
|
+
### Tests Hang/Timeout
|
|
473
|
+
|
|
474
|
+
**Symptom:** Test stops and never completes
|
|
475
|
+
|
|
476
|
+
**Solution:**
|
|
477
|
+
1. Open app console (F12, switch to iframe)
|
|
478
|
+
2. Look for errors: `Cmd+Option+J` (Mac) or `Ctrl+Shift+J` (Windows)
|
|
479
|
+
3. Reload test agent: `Cmd+R` or `Ctrl+R`
|
|
480
|
+
4. Check if app is fully loaded (all buttons visible)
|
|
481
|
+
5. If still hangs, check if 3D scene crashed (black canvas)
|
|
482
|
+
|
|
483
|
+
### Elements Not Found
|
|
484
|
+
|
|
485
|
+
**Symptom:** Multiple "Element not found" failures
|
|
486
|
+
|
|
487
|
+
**Solution:**
|
|
488
|
+
1. Open app console and check for JS errors
|
|
489
|
+
2. Verify button IDs match selectors in test-agent HTML
|
|
490
|
+
3. Check if elements are hidden/display:none
|
|
491
|
+
4. Scroll right panel to ensure buttons are visible
|
|
492
|
+
|
|
493
|
+
### False Positives (Passing Broken Tests)
|
|
494
|
+
|
|
495
|
+
**Symptom:** Test passes but feature doesn't work
|
|
496
|
+
|
|
497
|
+
**Solution:**
|
|
498
|
+
- Add assertions that actually verify behavior, not just element existence
|
|
499
|
+
- Example: Don't just click button, verify panel appears and has content
|
|
500
|
+
- Add timing delays to let UI settle before checking results
|
|
501
|
+
|
|
502
|
+
```javascript
|
|
503
|
+
// WEAK: Just checks element exists
|
|
504
|
+
{ name: 'Extrude works', fn: () => this.checkElementExists('#extrude-btn') }
|
|
505
|
+
|
|
506
|
+
// STRONG: Verifies action took effect
|
|
507
|
+
{
|
|
508
|
+
name: 'Extrude creates feature',
|
|
509
|
+
fn: async () => {
|
|
510
|
+
await this.clickInApp('#extrude-btn');
|
|
511
|
+
await new Promise(r => setTimeout(r, 300)); // Let dialog open
|
|
512
|
+
const dialog = this.appFrame.contentDocument?.querySelector('#extrude-dialog');
|
|
513
|
+
if (!dialog) throw new Error('Dialog did not open');
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
## Summary
|
|
519
|
+
|
|
520
|
+
The cycleCAD test agent v3 provides:
|
|
521
|
+
- **200+ automated tests** covering all major UI features and workflows
|
|
522
|
+
- **Visual feedback** with live highlighting and progress tracking
|
|
523
|
+
- **Quick test runs** in 60-90 seconds
|
|
524
|
+
- **Export results** as JSON for CI/CD integration
|
|
525
|
+
- **Easy to extend** by adding new test categories and methods
|
|
526
|
+
- **Maintenance-friendly** with clear naming and structure
|
|
527
|
+
|
|
528
|
+
Use the test agent to catch regressions early, verify new features work correctly, and maintain confidence in the codebase as it evolves.
|