Closed the browser after ten minutes and got "Codegen closed without writing a spec"
Asked 3,410 views2 answers
12votes
Recorded for about ten minutes, closed the window, and:
text
✖ RUN_FAILED: Codegen closed without writing a spec (nothing was recorded).
Nothing under projects/demo-shop/recorded/. Ten minutes gone. What did I do wrong, and is there anywhere the actions are buffered that I can recover from?
Nothing to recover, sorry — SDODS has nothing to recover from.
Read the message literally. Codegen exited normally, and afterwards there was no file at projects/demo-shop/recorded/checkout.spec.ts. That existence check is the whole test. SDODS does not watch what you did in the browser, it looks for the output file at the end, and when it is not there it refuses to report a recording that did not happen.
Note this is a different failure from the neighbouring one. playwright codegen exited with code 1 and produced no spec is codegen never starting, almost always no display. Yours is codegen running to completion and leaving nothing behind.
Which usually means the session ended before anything was written — the window closed in a way that took the recorder with it, or the terminal running the command went away. It is also worth checking that anything was actually recorded: codegen writes down actions, so a session spent scrolling and reading produces an empty result honestly.
Habit worth picking up: pass --name rather than taking the rec-<timestamp> default, so you know exactly which file to go looking for afterwards.
bash
sdods record -p demo-shop -e staging --name checkout --user standard
Adding the case that catches people who did nothing wrong at all: running the CLI inside the Docker image. There you do not get this error — the image has no display, so you get the exit-1 one with the hint about recording on your workstation instead.
Recording is the single thing in SDODS that does not containerise, because a person has to be sitting in front of it. Everything else in the image behaves.