microsoft / playwright-dotnet

.NET version of the Playwright testing and automation library.
https://playwright.dev/dotnet/
MIT License
2.47k stars 235 forks source link

[Bug]: Run and Debug MSTest Playwright Test Project/NUnit Playwright Test Project failed #2900

Closed qiyue8702 closed 6 months ago

qiyue8702 commented 6 months ago

Version

Don't know

Steps to reproduce

1.Create a MSTest Playwright Test Project and add a NUnit Playwright Test Project to the solution. 2.Build the solution. 3.In the Activity bar, Run Test or Debug Test.

Expected behavior

Run and Debug normally.

Actual behavior

Run and Debug MSTest Playwright Test Project/NUnit Playwright Test Project failed.

Details in "Output -> C# Dev Kit - Test Explorer" pane: Created Test Controller Using vstest from dotnet sdk in [C:\Program Files\dotnet\sdk\8.0.203]. Initialized Test Explorer Server [9660] Test Store Folder: c:\Users\v-arabellaqi\AppData\Roaming\Code - Insiders\User\workspaceStorage\112c82b1835acdda23a9dd3507e051ef\ms-dotnettools.csdevkit Test data store opened in 0.019 sec. Initialized project system provider. 1 projects added, 0 changed, 0 removed. Scheduling discovery: C:\Users\v-arabellaqi\source\repos\1\TestProject1\bin\Debug\net8.0\TestProject1.dll [0] Tests are available, running test discovery: C:\Users\v-arabellaqi\source\repos\1\TestProject1\bin\Debug\net8.0\TestProject1.dll Scheduling discovery: C:\Users\v-arabellaqi\source\repos\1\TestProject1\bin\Debug\net8.0\TestProject1.dll [1712103303569] ========== Starting test discovery ========== Tests changed, running test discovery: C:\Users\v-arabellaqi\source\repos\1\TestProject1\bin\Debug\net8.0\TestProject1.dll Skipping discovery, already scheduled: C:\Users\v-arabellaqi\source\repos\1\TestProject1\bin\Debug\net8.0\TestProject1.dll [1712103303569] ========== Test discovery finished: 1 Tests found in 2.1 sec ========== 1 tests discovered from C:\Users\v-arabellaqi\source\repos\1\TestProject1\bin\Debug\net8.0\TestProject1.dll in 2113.2267 ms ========== Starting test run ========== ========== Test run finished: 1 Tests (0 Passed, 1 Failed, 0 Skipped) run in 5.9 sec ==========

Additional context

Issue image: 1 Issue record screen: issue .NET SDKs Version: 2

Environment

Test Environment: 
Platform: Windows, Mac ARM64, Linux
VSCode: VSCode Stable, VSCode Insider
Extensions:
.NET Install Tool Extension v2.0.3 
C# Dev Kit Extension: v1.5.10 
C# Extension: v2.24.17 
Intellicode Extension: v0.1.56 
.NET SDKs: 8.0.203
nohwnd commented 6 months ago

I see this error expanded, which is the standard "install driver" error. Step 3. and 4. here https://playwright.dev/dotnet/docs/intro#introduction

image

Running the suggested command (in my case .\TestProject1\bin\Debug\net9.0\playwright.ps1 install) does install the driver and fixes the problem.

if you feel this is not ergonomic enough please upvote this issue: https://github.com/microsoft/playwright-dotnet/issues/2286

mxschmitt commented 6 months ago

Closing as per above.