Skip to content

Commit c1711ff

Browse files
authored
v7 (#522)
* linux is back * base64 encode * add credentialless to see if we can get this to load * bump v * it works * acceptance-linux * remove testmo * gather * update api key for local * updots * fix catch err * sdk prototype * migrate for new dashcam 1.0 * sdk to test.mjs * vitest * correctly editing * Update acceptance-sdk-tests.yml * disable aws * update workflow * use vitest * run self-hosted less often * increase hook timeout for non-hot vm * fix client / healingclient syntax error * debugable test results * eslint * test * seems ot be working * add global dashcam track functionality * add sdk back * silent log forwarding * fix setup * checkout globalsetup to revert * update for stack track * refactor to use internal methods * sdk refactor * remove recovery functions * v7 * making a mess * passing prompt test * tests working, error reporting looking good * update td api root to prod * fix eslint and prettier * client -> testdriver * ensure type runs sequential * prompt caching, windows fixes * workflow runs on windows and linux * fix for rendersandbox * fix for rendersandbox * find recordings * fix eslint * prettier * fix for finding dashcam recording * dont forward all messages * fix eslint * run prettier * fix for logfile not existing on track * prettier * pretty good checkpoint * it worked * it worked * stop for today * linux passing * fix prettier * this at least starts it * absolute path progress * all the way to upload * video actually working * 1.4.10 * duration updates * Phase 1 Complete: Core Foundation - Created Dashcam class as composable module (src/core/Dashcam.js) - Extracted from lifecycle helpers - Platform-agnostic (Windows/Linux/Mac) - Methods: auth(), addFileLog(), addApplicationLog(), start(), stop(), isRecording() - State tracking with this.recording - Created core module exports (src/core/index.js) - Exports TestDriver and Dashcam classes - Updated package.json with modular exports - . (main SDK) - ./core (TestDriver + Dashcam) - ./vitest (plugin) - Converted lifecycle helpers to thin wrappers - Uses WeakMap to cache Dashcam instances per client - Maintains state across helper calls - Backward compatible - Added unit tests (test/dashcam.test.js) - 5 passing tests - Tests creation, options, errors, URL extraction, state - All acceptance tests passing ✅ * Phase 2 Task 2.1: Vitest Hooks API - Created useTestDriver() hook for managed TestDriver instances - Accepts Vitest context parameter - Auto-cleanup via context.onTestFinished() - Returns configured TestDriver client - Created useDashcam() hook for managed Dashcam instances - Requires TestDriver client from useTestDriver() - Optional auto-auth, auto-start, auto-stop - Automatic URL registration with plugin - Created useTestDriverWithDashcam() combined hook - Single-line setup for both TestDriver + Dashcam - Full auto-lifecycle management - Simplest API for 90% of use cases - Added ./vitest/hooks export to package.json - Created example test demonstrating hooks usage Progressive disclosure: users can choose their level of control - useTestDriverWithDashcam() - fully automatic - useTestDriver() + useDashcam() - custom lifecycle - Direct class usage - full manual control * Phase 3: Presets System - Created chromePreset for automated Chrome setup - Auto-launches Chrome with configurable options - Supports maximized, guest mode, custom URL - Dashcam auto-enabled by default - Created vscodePreset for automated VS Code setup - Opens workspace/folder automatically - Installs extensions on demand - Dashcam integration included - Created electronPreset for Electron apps - Launches with configurable app path and args - Platform-aware shell execution - Created webAppPreset as generic wrapper - Currently delegates to chromePreset - Extensible for Firefox, Edge, etc. - Created createPreset() builder API - Enables users to create custom presets - Automatic client + dashcam setup - Simple setup() function pattern - Updated useTestDriver hook - Fixed TestDriver initialization (apiKey as first param) - Added autoConnect option (default: true) - Auto-auth and auto-connect to sandbox - Returns __connectionPromise for presets to await - Added ./presets export to package.json - Created comprehensive PRESETS.md documentation - Usage examples for all presets - Custom preset creation guide - Progressive disclosure explanation - Created presets-example.test.mjs with examples - Demonstrates all preset usage patterns - Shows custom preset creation Progressive disclosure hierarchy: - Beginner: chromePreset(context, { url }) - instant setup - Intermediate: useTestDriver + useDashcam - custom lifecycle - Advanced: new TestDriver() - full manual control * Phase 4: DX Polish - TypeScript Definitions and Migration Guide TypeScript Definitions: - Created src/core/index.d.ts - Full type definitions for TestDriver and Dashcam classes - DashcamOptions, LogConfig, TestDriverOptions interfaces - Comprehensive JSDoc comments - Created src/vitest/hooks.d.ts - Type definitions for all hooks - VitestContext, UseTestDriverOptions, UseDashcamOptions interfaces - Full autocomplete support for hook options - Created src/presets/index.d.ts - Type definitions for all presets - ChromePresetOptions, VSCodePresetOptions, ElectronPresetOptions - PresetSetupFunction and PresetConfig types - Full type safety for preset creation Migration Guide (docs/MIGRATION.md): - Complete v6 → v7 migration guide - Side-by-side before/after examples - Three migration strategies: 1. Gradual - Keep old code, use new for new tests 2. Convert to Hooks - Replace helpers with hooks 3. Adopt Presets - Use presets for common scenarios - Common pattern conversions with LOC reductions - TypeScript examples - Zero breaking changes - 100% backward compatible - Deprecation timeline explained Updated README.md: - Added v7 Progressive Disclosure section - Three levels clearly explained with examples: 🟢 Beginner: Presets (chromePreset) 🟡 Intermediate: Hooks (useTestDriver/useDashcam) 🔴 Advanced: Core Classes (TestDriver/Dashcam) - Links to documentation Benefits: ✅ Full TypeScript IntelliSense ✅ Type-safe preset options ✅ Clear migration path ✅ No breaking changes ✅ Progressive learning curve ✅ Professional documentation * 📋 SDK v7 Implementation Complete Summary Created comprehensive summary document covering: - All 4 phases completion status - Detailed task breakdowns - Architecture overview - Code metrics and LOC counts - Timeline and git history - Future work suggestions Status: ✅ READY FOR RELEASE * major refactor, logs, browser tarcking in dashcam * decent sdk stopping * interactions * timeline updates * update track interactions * fix many bug * updates * friday * double asser test in same file * fix for log tracking * run 2 tests in parallel one file * name dashcam recordings * clean up directories a bit * major cleanup * remove tset * update workflow * testdriver is a reporter, not a plugin * small test for cicd test running * update to get reporter working in ci * try for reporter in ci * test workflow in github * v7 js beta * remove docs publish sript * bump v
1 parent d7604be commit c1711ff

File tree

438 files changed

+58807
-20116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

438 files changed

+58807
-20116
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
TD_API_KEY=
2+
TD_API_ROOT=

.github/dependabot.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/acceptance-tests.yml

Lines changed: 0 additions & 130 deletions
This file was deleted.

.github/workflows/acceptance-v6.yml

Lines changed: 0 additions & 169 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/linux-tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Linux Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Run Linux tests
26+
run: npx vitest run test/testdriver/assert.test.mjs
27+
env:
28+
TD_API_KEY: ${{ secrets.TD_API_KEY }}

0 commit comments

Comments
 (0)