Skip to content

[Bug]: Codegen's Clear button doesn't work if not recording #33802

Closed

Description

Version

1.49.0

Steps to reproduce

  • Launch npx playwright codegen
  • Record a few steps
  • Stop recording
  • Click Clear button

Expected behavior

Should clear recorded actions

Actual behavior

Doesn't clean recorded actions. Besides, if recording is enabled again, it keeps the same actions but cleans them as soon as we record a new one.

Additional context

RecorderCollection.restart() clears its internal actions but only fires a change event if enabled, and when recorder is not recording, it is disabled, and that causes Recorder not to be notified of those changes. Those events are only sent when another action is recorded.

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 13th Gen Intel(R) Core(TM) i5-1335U
    Memory: 6.99 GB / 31.66 GB
  Binaries:
    Node: 22.11.0 - ~\scoop\apps\nvm\current\nodejs\nodejs\node.EXE
    Yarn: 1.22.22 - ~\scoop\apps\yarn\current\bin\yarn.CMD
    npm: 10.9.0 - ~\scoop\apps\nvm\current\nodejs\nodejs\npm.CMD
    pnpm: 9.14.2 - ~\scoop\shims\pnpm.EXE
  IDEs:
    VSCode: 1.95.3 - C:\Users\rui.figueira\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 5.2.37 - C:\Users\rui.figueira\scoop\shims\bash.EXE
  npmPackages:
    @playwright/test: ^1.49.0 => 1.49.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions