parent
b033883728
commit
1f7b5855f7
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
|
@ -32,7 +32,6 @@ namespace Microsoft.AspNetCore.SpaServices.Extensions.Proxy
|
|||
{
|
||||
AllowAutoRedirect = false,
|
||||
UseCookies = false,
|
||||
|
||||
};
|
||||
|
||||
return new HttpClient(handler)
|
||||
|
|
@ -229,7 +228,7 @@ namespace Microsoft.AspNetCore.SpaServices.Extensions.Proxy
|
|||
// on Windows, by which time the logic in SockJS has already timed out and made
|
||||
// it fall back on some other transport (xhr_streaming, usually). It's fine
|
||||
// on Linux though, completing almost instantly.
|
||||
//
|
||||
//
|
||||
// The slowness on Windows does not cause a problem though, because the transport
|
||||
// fallback logic works correctly and doesn't surface any errors, but it would be
|
||||
// better if ConnectAsync was fast enough and the initial Websocket transport
|
||||
|
|
|
|||
|
|
@ -179,6 +179,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.ApiAut
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Components.Prerendering", "..\Mvc\Mvc.Components.Prerendering\src\Microsoft.AspNetCore.Mvc.Components.Prerendering.csproj", "{706DBAF7-0BB4-4B4F-9B44-E7C3372ECDF2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices.Extensions", "..\Middleware\SpaServices.Extensions\src\Microsoft.AspNetCore.SpaServices.Extensions.csproj", "{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -1233,6 +1235,18 @@ Global
|
|||
{706DBAF7-0BB4-4B4F-9B44-E7C3372ECDF2}.Release|x64.Build.0 = Release|Any CPU
|
||||
{706DBAF7-0BB4-4B4F-9B44-E7C3372ECDF2}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{706DBAF7-0BB4-4B4F-9B44-E7C3372ECDF2}.Release|x86.Build.0 = Release|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|x64.Build.0 = Release|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -1320,6 +1334,7 @@ Global
|
|||
{81B96508-D920-45F6-9534-0D348B11DFAB} = {D64F966A-B33B-4554-BA8C-A1AF91265996}
|
||||
{6012D544-32B4-4F5C-B335-A224AA4F661D} = {D64F966A-B33B-4554-BA8C-A1AF91265996}
|
||||
{706DBAF7-0BB4-4B4F-9B44-E7C3372ECDF2} = {D64F966A-B33B-4554-BA8C-A1AF91265996}
|
||||
{06D0D7B2-EDA3-45A2-A060-AB791ED1DB80} = {D64F966A-B33B-4554-BA8C-A1AF91265996}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D2F122BA-928C-4179-B503-6744DB64BA13}
|
||||
|
|
|
|||
|
|
@ -9,4 +9,4 @@ $ErrorActionPreference = 'Stop'
|
|||
|
||||
. $PSScriptRoot\Test-Template.ps1
|
||||
|
||||
Test-Template "angular" "angular" "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0.0-preview4-t000.nupkg" $true
|
||||
Test-Template "angular" "angular" "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0.0-preview5-t000.nupkg" $true
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ function Test-Template($templateName, $templateArgs, $templateNupkg, $isSPA) {
|
|||
<DisablePackageReferenceRestrictions>true</DisablePackageReferenceRestrictions>
|
||||
</PropertyGroup>")
|
||||
$projContent | Set-Content $proj
|
||||
dotnet ef migrations add mvc
|
||||
dotnet publish --configuration Release
|
||||
dotnet bin\Release\netcoreapp3.0\publish\$templateName.dll
|
||||
dotnet.exe ef migrations add mvc
|
||||
dotnet.exe publish --configuration Release
|
||||
dotnet.exe bin\Release\netcoreapp3.0\publish\$templateName.dll
|
||||
}
|
||||
finally {
|
||||
Pop-Location
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ namespace Templates.Test.SpaTemplateTest
|
|||
{
|
||||
var (browser, logs) = await BrowserFixture.GetOrCreateBrowserAsync(Output, $"{Project.ProjectName}.build");
|
||||
aspNetProcess.VisitInBrowser(browser);
|
||||
TestBasicNavigation(visitFetchData: shouldVisitFetchData, usesAuth, browser);
|
||||
TestBasicNavigation(visitFetchData: shouldVisitFetchData, usesAuth, browser, logs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ namespace Templates.Test.SpaTemplateTest
|
|||
{
|
||||
var (browser, logs) = await BrowserFixture.GetOrCreateBrowserAsync(Output, $"{Project.ProjectName}.publish");
|
||||
aspNetProcess.VisitInBrowser(browser);
|
||||
TestBasicNavigation(visitFetchData: shouldVisitFetchData, usesAuth, browser);
|
||||
TestBasicNavigation(visitFetchData: shouldVisitFetchData, usesAuth, browser, logs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -179,7 +179,7 @@ namespace Templates.Test.SpaTemplateTest
|
|||
File.WriteAllText(Path.Combine(Project.TemplatePublishDir, "appsettings.json"), testAppSettings);
|
||||
}
|
||||
|
||||
private void TestBasicNavigation(bool visitFetchData, bool usesAuth, IWebDriver browser)
|
||||
private void TestBasicNavigation(bool visitFetchData, bool usesAuth, IWebDriver browser, ILogs logs)
|
||||
{
|
||||
browser.Exists(By.TagName("ul"));
|
||||
// <title> element gets project ID injected into it during template execution
|
||||
|
|
@ -226,6 +226,16 @@ namespace Templates.Test.SpaTemplateTest
|
|||
browser.Exists(By.CssSelector("table>tbody>tr"));
|
||||
browser.Equal(5, () => browser.FindElements(By.CssSelector("p+table>tbody>tr")).Count);
|
||||
}
|
||||
|
||||
foreach (var logKind in logs.AvailableLogTypes)
|
||||
{
|
||||
var entries = logs.GetLog(logKind);
|
||||
var badEntries = entries.Where(e => new LogLevel[] { LogLevel.Warning, LogLevel.Severe }.Contains(e.Level));
|
||||
|
||||
badEntries = badEntries.Where(e => !e.Message.EndsWith("failed: WebSocket is closed before the connection is established."));
|
||||
|
||||
Assert.True(badEntries.Count() == 0, "There were Warnings or Errors from the browser." + Environment.NewLine + string.Join(Environment.NewLine, badEntries));
|
||||
}
|
||||
}
|
||||
|
||||
private void AssertFileExists(string basePath, string path, bool shouldExist)
|
||||
|
|
|
|||
Loading…
Reference in New Issue