diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml
index 1c716b2d4066..3f1f8f1a9aed 100644
--- a/.azure/pipelines/ci.yml
+++ b/.azure/pipelines/ci.yml
@@ -697,7 +697,7 @@ stages:
# Just uploading artifacts/logs/ files can take 15 minutes. Doubling the cancel timeout for this job.
cancelTimeoutInMinutes: 30
buildArgs: -all -pack -test -binaryLog /p:SkipHelixReadyTests=true /p:SkipIISNewHandlerTests=true /p:SkipIISTests=true
- /p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false
+ /p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false /p:RunBlazorPlaywrightTemplateTests=true
$(_InternalRuntimeDownloadArgs)
beforeBuild:
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
diff --git a/eng/RequiresDelayedBuildProjects.props b/eng/RequiresDelayedBuildProjects.props
index 0951a943c555..75ab8a61e6db 100644
--- a/eng/RequiresDelayedBuildProjects.props
+++ b/eng/RequiresDelayedBuildProjects.props
@@ -16,5 +16,6 @@
+
diff --git a/eng/Versions.props b/eng/Versions.props
index d4176dab7a80..dbca08fa2260 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -280,7 +280,7 @@
13.0.113.0.41.1.6
- 1.17.3
+ 1.28.03.0.07.2.34.7.0
diff --git a/eng/tools/GenerateFiles/Directory.Build.props.in b/eng/tools/GenerateFiles/Directory.Build.props.in
index c3502bee4217..13205d2f4961 100644
--- a/eng/tools/GenerateFiles/Directory.Build.props.in
+++ b/eng/tools/GenerateFiles/Directory.Build.props.in
@@ -1,6 +1,7 @@
${DefaultNetCoreTargetFramework}
+ ${ArtifactsShippingPackagesDir}true${LibNetHostAppPackVersion}
diff --git a/eng/tools/GenerateFiles/GenerateFiles.csproj b/eng/tools/GenerateFiles/GenerateFiles.csproj
index 0b6322f44b1f..e23567530a1b 100644
--- a/eng/tools/GenerateFiles/GenerateFiles.csproj
+++ b/eng/tools/GenerateFiles/GenerateFiles.csproj
@@ -26,7 +26,8 @@
MicrosoftNETCoreAppRuntimeVersion=$(MicrosoftNETCoreAppRuntimeVersion);
MicrosoftPlaywrightCLIVersion=$(MicrosoftPlaywrightCLIVersion);
LibNetHostAppPackVersion=$(BundledNETCoreAppPackageVersion);
- SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers.Trim())
+ SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers.Trim());
+ ArtifactsShippingPackagesDir=$(ArtifactsShippingPackagesDir)
diff --git a/src/ProjectTemplates/README.md b/src/ProjectTemplates/README.md
index b5ea7e11b861..62fdb426a975 100644
--- a/src/ProjectTemplates/README.md
+++ b/src/ProjectTemplates/README.md
@@ -71,6 +71,18 @@ Then, use one of:
previous step, it is NOT advised that you install templates created on your local machine using just
`dotnet new -i [nupkgPath]`.
+#### Running Blazor Playwright Template Tests
+
+1. From the root of the repo, build the templates: `.\eng\build.cmd -all -pack`
+2. `cd .\src\ProjectTemplates\test\Templates.Blazor.Tests`
+3. `dotnet test .\Templates.Blazor.Tests.csproj` with optional `--filter` arg to run a specific test.
+
+The requisite browsers should be automatically installed. If you encounter browser errors, the browsers can be manually installed via the following script, replacing `[TFM]` with the current target TFM (ex. `net8.0`).
+
+```cmd
+.\bin\Debug\[TFM]\playwright.ps1 install
+```
+
#### Conditional tests & skipping test platforms
Individual test methods can be decorated with attributes to configure them to not run ("skip running") on certain platforms. The `[ConditionalFact]` and `[ConditionalTheory]` attributes must be used on tests using the skip attributes in order for them to actually be skipped:
diff --git a/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs b/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs
index 40325ebf134b..05ed84845f1a 100644
--- a/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs
+++ b/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs
@@ -99,6 +99,11 @@ private static async Task InstallTemplatePackages(ITestOutputHelper output)
.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase)))
.ToArray();
+ if (builtPackages.Length == 0)
+ {
+ throw new InvalidOperationException($"Failed to find required templates in {packagesDir}. Please ensure the *Templates*.nupkg have been built.");
+ }
+
Assert.Equal(4, builtPackages.Length);
await VerifyCannotFindTemplateAsync(output, "web");
diff --git a/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in b/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in
index a2f7a41bd7e0..88c7d6173021 100644
--- a/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in
+++ b/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in
@@ -7,4 +7,7 @@
+
+ $(RestoreAdditionalProjectSources);$(ArtifactsShippingPackagesDir)
+
diff --git a/src/ProjectTemplates/test/Templates.Blazor.Tests/BlazorServerTemplateTest.cs b/src/ProjectTemplates/test/Templates.Blazor.Tests/BlazorServerTemplateTest.cs
index 5681de730647..6e96fdd96c1d 100644
--- a/src/ProjectTemplates/test/Templates.Blazor.Tests/BlazorServerTemplateTest.cs
+++ b/src/ProjectTemplates/test/Templates.Blazor.Tests/BlazorServerTemplateTest.cs
@@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
+using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.BrowserTesting;
using Microsoft.AspNetCore.Testing;
@@ -25,7 +26,7 @@ public BlazorServerTemplateTest(ProjectFactoryFixture projectFactory)
public override string ProjectType { get; } = "blazorserver";
- [Theory(Skip = "https://github.com/dotnet/aspnetcore/issues/30761")]
+ [Theory]
[InlineData(BrowserKind.Chromium)]
public async Task BlazorServerTemplateWorks_NoAuth(BrowserKind browserKind)
{
@@ -77,11 +78,8 @@ await BrowserManager.GetBrowserInstance(browserKind, BrowserContextInfo) :
}
}
- public static IEnumerable