Skip to content

Feature request: allow import() inside playwright-cli run-code #338

@PavelGlebovAndritz

Description

@PavelGlebovAndritz

We have a very stable playwright library to handle with custom UI elements in our applications, like Date Picker, Custom File Uploader, login form etc.
Instead of putting hundred lines of code into .md file like running-code.md, it would be great to just import required function from the module and call it. Just 2 lines instead of hundred.

According to https://nodejs.org/api/vm.html#support-of-dynamic-import-in-compilation-apis
it would be enough to add importModuleDynamically - option to the \playwright\packages\playwright-core\src\tools\backend\runCode.ts

Metadata

Metadata

Assignees

No one assigned

    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