pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.31k stars 634 forks source link

Consider how best to support Playwright for tests #16291

Open sureshjoshi opened 2 years ago

sureshjoshi commented 2 years ago

Re: Slack thread https://pantsbuild.slack.com/archives/C0D7TNJHL/p1658767584514849

This isn't a feature request or bug fix per se, but more of an open question as to whether Playwright is inherently supported out-of-the-box with Pants or if we would need some sort of plugin or extension to allow its usage (this idea could arguably extend to Puppeteer or similar down the road).

After a pip install, playwright requires a one-off playwright install to download and install the browser engines.

I don't quite remember off-hand if the first test run will try to auto-install them, or whether we can just pass a command line arg to make it do that.

Playwright isn't a python-specific tool, so Node/Java/etc backends could benefit if this is handled correctly (i.e. could it become a subsystem?).

Eric-Arellano commented 2 years ago

You can use our plugin API hook PytestPluginSetup and PytestPluginSetupRequest. It lets you return back a Digest. We can expand its API to do more things if necessary.

I agree it could be interesting to generalize this to users.