File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,9 +34,9 @@ selenium-video-*.webm
3434nightwatch-video- * .webm
3535packages /nightwatch-devtools /nightwatch-video- * .webm
3636
37- # trace.zip output (mode: 'trace')
37+ # trace output (mode: 'trace')
3838trace- * .zip
39- trace- * /
39+ examples / ** / trace- * /
4040
4141# vitest --coverage output
4242coverage /
Original file line number Diff line number Diff line change 3838 },
3939 "types" : " ./src/index.ts" ,
4040 "scripts" : {
41- "lint" : " eslint ."
41+ "lint" : " eslint . --fix "
4242 },
4343 "license" : " MIT" ,
4444 "devDependencies" : {
Original file line number Diff line number Diff line change @@ -165,15 +165,12 @@ function buildActionEvents(
165165 const endMs = Math . max ( startMs + 1 , rawEndMs )
166166 const rawArgs = cmd . args as unknown [ ]
167167 let params : Record < string , unknown >
168- if (
169- action . class === 'Element' &&
170- action . method === 'fill' &&
171- rawArgs . length >= 2
172- ) {
168+ const isValueMethod = FILL_METHODS . has ( action . method )
169+ if ( action . class === 'Element' && isValueMethod && rawArgs . length >= 2 ) {
173170 params = { selector : rawArgs [ 0 ] , value : rawArgs [ 1 ] }
174171 } else if (
175172 action . class === 'Element' &&
176- action . method === 'fill' &&
173+ isValueMethod &&
177174 rawArgs . length === 1
178175 ) {
179176 params = { value : rawArgs [ 0 ] }
Original file line number Diff line number Diff line change 3131 "scripts" : {
3232 "dev" : " vite build --watch" ,
3333 "build" : " tsc && vite build" ,
34- "lint" : " eslint ." ,
34+ "lint" : " eslint . --fix " ,
3535 "prepublishOnly" : " pnpm build"
3636 },
3737 "dependencies" : {
Original file line number Diff line number Diff line change @@ -219,20 +219,23 @@ export default class DevToolsHookService implements Services.ServiceInstance {
219219 if ( this . #options. mode !== 'trace' || ! this . #browser) {
220220 return
221221 }
222+ const stamp = this . #lastActionTimestamp( )
223+ const snap = await captureActionSnapshot ( this . #browser, '__final__' )
224+ if ( snap ) {
225+ snap . timestamp = stamp
226+ this . #actionSnapshots. push ( snap )
227+ }
228+ }
229+
230+ #lastActionTimestamp( ) : number {
222231 const commands = this . #sessionCapturer. commandsLog
223- let stamp = Date . now ( )
224232 for ( let i = commands . length - 1 ; i >= 0 ; i -- ) {
225233 const cmd = commands [ i ] !
226234 if ( mapCommandToAction ( cmd . command ) ) {
227- stamp = cmd . timestamp
228- break
235+ return cmd . timestamp
229236 }
230237 }
231- const snap = await captureActionSnapshot ( this . #browser, '__final__' )
232- if ( snap ) {
233- snap . timestamp = stamp
234- this . #actionSnapshots. push ( snap )
235- }
238+ return Date . now ( )
236239 }
237240
238241 private resetStack ( ) {
@@ -320,16 +323,7 @@ export default class DevToolsHookService implements Services.ServiceInstance {
320323 ) {
321324 const snap = await captureActionSnapshot ( this . #browser, command )
322325 if ( snap ) {
323- const commands = this . #sessionCapturer. commandsLog
324- let stamp = 0
325- for ( let i = commands . length - 1 ; i >= 0 ; i -- ) {
326- const cmd = commands [ i ] !
327- if ( mapCommandToAction ( cmd . command ) ) {
328- stamp = cmd . timestamp
329- break
330- }
331- }
332- snap . timestamp = stamp
326+ snap . timestamp = this . #lastActionTimestamp( )
333327 this . #actionSnapshots. push ( snap )
334328 }
335329 }
Original file line number Diff line number Diff line change @@ -110,12 +110,8 @@ export class DevToolsAppLauncher {
110110 }
111111
112112 async onPrepare ( _ : never , caps : ExtendedCapabilities [ ] ) {
113- if ( this . #options. mode === 'trace' || this . #options. disableDebugger ) {
114- log . info (
115- this . #options. mode === 'trace'
116- ? 'Trace mode — skipping backend and Chrome window'
117- : 'Debugger disabled — skipping backend and Chrome window'
118- )
113+ if ( this . #options. mode === 'trace' ) {
114+ log . info ( 'Trace mode — skipping backend and Chrome window' )
119115 return
120116 }
121117 try {
Original file line number Diff line number Diff line change @@ -69,12 +69,6 @@ export interface ServiceOptions {
6969 screencast ?: ScreencastOptions
7070 /** `live` (default) launches the DevTools UI; `trace` skips it. */
7171 mode ?: DevToolsMode
72- /**
73- * Skip launching the devtools dashboard backend and Chrome UI window
74- * (default: false). Use when only trace recording is needed — no
75- * debug dashboard, no extra Chrome window, no backend server.
76- */
77- disableDebugger ?: boolean
7872 /** Trace output layout — `zip` (default) writes a single archive,
7973 * `ndjson-directory` unpacks into `trace-<id>/`. Only applies in trace mode. */
8074 traceFormat ?: TraceFormat
You can’t perform that action at this time.
0 commit comments