Rayrun
← Back to Discord Forum

Is it possible to mock functions in playwright?

glorious_axolotl_24941posted in #help-playwright
Open in Discord
glorious_axolotl_24941

I want to mock child_process spawn in order to return specific values from stdout

This thread is trying to answer question "Is it possible to mock functions such as 'child_process spawn' in Playwright, and if so, which libraries can be used?"

2 replies

Playwright does not have built-in functionality to mock such things. You need to use 3rd party libraries for that.

glorious_axolotl_24941

which libraries?

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.