dotnet / test-templates

MIT License
45 stars 71 forks source link

Playwright template does not build #412

Closed jjonescz closed 3 months ago

jjonescz commented 4 months ago
dotnet new globaljson --sdk-version 9.0.100-preview.5.24307.3
dotnet new mstest-playwright
dotnet build

Fails with:

\obj\Debug\net9.0\PlaywrightTests.GlobalUsings.g.cs(2,32): error CS0234: The type or namespace name 'Playwright' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
\UnitTest1.cs(4,26): error CS0246: The type or namespace name 'PageTest' could not be found (are you missing a using directive or an assembly reference?)

I first thought this is related to https://github.com/dotnet/test-templates/pull/408 but the usings removed in that PR are present in my generated csproj. Note that the template works in .NET 8. cc @Evangelink

Evangelink commented 4 months ago

Hi @jjonescz,

Would it be possible for you to let me know the version of MSTest linked to that SDK template?

jjonescz commented 4 months ago

I got MSTest.Sdk/3.3.1 from the SDK template. When manually updated to 3.4.1, the build first failed (probably unrelated issue) with

C:\Program Files\dotnet\sdk\9.0.100-preview.5.24307.3\NuGet.targets(170,5): error : Cannot create a file when that file already exists

then on re-run it succeeded.

jjonescz commented 4 months ago

Note that this was discovered in arcade update in Roslyn which bumps .NET SDK to 9 Preview 5 (https://github.com/dotnet/roslyn/pull/73656) - there is a test which tries every template with dotnet new and then building it. The Playwright template started failing there.

Evangelink commented 4 months ago

I will try to understand what's the process for backporting fixes in previous previews of .NET 9

jjonescz commented 4 months ago

I mean, I don't need this backported, I can just disable the test for now. If it will work in some future .NET version, that's fine.

Evangelink commented 3 months ago

I have just tested with 9.0.100-preview.7.24323.5 and I confirm the issue is fixed.