[Feature] More intuitive setup and installation of Playwright
See original GitHub issueI’m a fan of PowerShell, but I think having to add Microsoft.Playwright.NUnit
or a similar package, then build your project, then execute a PowerShell script that you can find in the bin/something...something/playwright.ps1
is not the ideal experience or the experience .NET developers expect. It works great tho!
I was hoping the Playwright setup experience could be more in line with what we expect as .NET developers. I’m not an expert on MSBuild and still new to Playwright, so call me out if I’m off base!
When installing any Playwright NuGet package, I’d expect the installation to modify the MSBuild project file, and the MSBuild project file would setup all of Playwright the first time. I’m not sure if Playwright updates its dependencies automatically over time, but if it did, I’d expect that to be checked for and updated during build. This could also be a standalone MSBuild target.
Alternatively, I think Playwright may also be a good fit for a global tool, or a local tool like the ef core tool.
Then inside the project, you may be able to run dotnet playwright init
or dotnet playwright update
.
Based on the NuGet package and MSBuild target described above, I’d expect there to be additional .NET templates for NUnit, MsTest, and xUnit. These templates would be the most intuitive ways to get started with Playwright and also to be reused for .NET IDEs like Visual Studio, VS Code, and Rider.
Issue Analytics
- State:
- Created a year ago
- Reactions:26
- Comments:19 (8 by maintainers)
For Visual Studio the user experience should be:
This experience currently fails because browsers aren’t installed. By default it should check to see if the browser specified has been installed and if not install it or alternatively use the Users Default Browser if it is supported.
I just found this myself as well last time I tried it I was using the CLI tool which was bizarre for me as well. A global CLI tool that requires a project build to work… that’s now that I would expect, specially when the node.js experience is quite smooth (
npx playwright install
like a .NET global tool)I expected the global CLI tool to at minimum (and sometimes even at most) to just install the browsers because my builds and F# scripts failed just because playwright browsers were not installed nothing else, once I ran
npx playwright install
things just worked and I could live with thatNow I come back and find that I need to run powershell scripts? which are generated after build?
That’s simply too bizarre for me to be honest I’d prefer to have a global CLI tool that’s just a wrapper over
npx playwright install
if that would let me do the followingI don’t think this is a cosmetic issue, while I know every project is different I find it hard to justify that I need to modify my .NET workflow just because a library seems to have weird requirements
Now I’m not sure how my wording is for this feedback but I certainly have no intention to annoy anyone it is just my raw experience with this tool from a few minutes ago after a couple of months away from it. The install experience hasn’t been there from the get go, once we’re past that things just work very nicely and smooth, it is a very sweet library to work with
Extra: It would be nice to pin this issue to make it more visible