Skip to content
    Back to all Bounties

    Earn 45,000 ($450.00)

    Time Remainingdue 2 years ago
    Completed

    Playwright codegen from user actions without UI

    orph
    orph
    Posted 2 years ago
    This Bounty has been completed!

    Bounty Description

    Playwright has a codegen command that opens a window with a text editor, and injects some javascript into the playwright browser page to capture user events.

    That injected js communicates user events like click, typing, option select, etc to the playwright process via a binding. The playwright process then translates the user actions into simple browser automation code displayed in the popup window.

    I need this output without any UI window. Instructions:

    1. fork the playwright injected js, and rewrite to only include the parts related to robust user event capture, without highlighting or polling for recording start/stop state (always record): https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/injected/recorder.ts#L69-L78
    2. Use Playwright exposeBinding in nodejs to receive the user events sent via the forked injected js, and inject the forked js using addInitScriptor addScriptTag
    3. Fork the playwright code that generates js & python code from these user events and fork it to output code in either js or python: https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/recorder/codeGenerator.ts#L78

    Results should be in a new nodejs repl, with minimal dependencies beyond playwright. Playwright itself should not be forked, instead extract the relevant pieces and use standard playwright nodejs API.