From a1507bd64bac09206adf993c5dd2811fc583e63e Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 20 Apr 2021 13:29:35 -0700 Subject: [PATCH 01/17] New E2E Migration (PW) test project --- src/Components/Components.slnf | 6 +- src/Components/ComponentsNoDeps.slnf | 1 + .../Infrastructure/PlaywrightTestBase.cs | 84 ++++++++++++++ .../ServerFixtures/AspNetEnvironment.cs | 11 ++ .../ServerFixtures/AspNetSiteServerFixture.cs | 47 ++++++++ .../BasicTestAppServerSiteFixture.cs | 13 +++ .../ServerFixtures/DevHostServerFixture.cs | 40 +++++++ .../ServerFixtures/ServerFixture.cs | 86 +++++++++++++++ .../ServerFixtures/StaticSiteServerFixture.cs | 49 +++++++++ .../ToggleExecutionModeServerFixture.cs | 73 ++++++++++++ .../ServerFixtures/WebHostServerFixture.cs | 36 ++++++ .../Infrastructure/TestOutputLogger.cs | 29 +++++ ...tCore.Components.Migration.E2ETests.csproj | 104 ++++++++++++++++++ .../TestJsonSerializerOptionsProvider.cs | 16 +++ .../Tests/BinaryHttpClientTest.cs | 93 ++++++++++++++++ .../test/E2ETestMigration/package.json | 23 ++++ .../playwrightSettings.ci.json | 15 +++ .../playwrightSettings.ci.linux.json | 8 ++ .../playwrightSettings.ci.osx.json | 7 ++ .../playwrightSettings.ci.win.json | 2 + .../playwrightSettings.debug.json | 7 ++ .../E2ETestMigration/playwrightSettings.json | 38 +++++++ .../playwrightSettings.linux.json | 2 + .../playwrightSettings.osx.json | 2 + .../playwrightSettings.win.json | 2 + .../test/E2ETestMigration/xunit.runner.json | 7 ++ 26 files changed, 798 insertions(+), 3 deletions(-) create mode 100644 src/Components/test/E2ETestMigration/Infrastructure/PlaywrightTestBase.cs create mode 100644 src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/AspNetEnvironment.cs create mode 100644 src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/AspNetSiteServerFixture.cs create mode 100644 src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/BasicTestAppServerSiteFixture.cs create mode 100644 src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/DevHostServerFixture.cs create mode 100644 src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ServerFixture.cs create mode 100644 src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/StaticSiteServerFixture.cs create mode 100644 src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ToggleExecutionModeServerFixture.cs create mode 100644 src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/WebHostServerFixture.cs create mode 100644 src/Components/test/E2ETestMigration/Infrastructure/TestOutputLogger.cs create mode 100644 src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj create mode 100644 src/Components/test/E2ETestMigration/TestJsonSerializerOptionsProvider.cs create mode 100644 src/Components/test/E2ETestMigration/Tests/BinaryHttpClientTest.cs create mode 100644 src/Components/test/E2ETestMigration/package.json create mode 100644 src/Components/test/E2ETestMigration/playwrightSettings.ci.json create mode 100644 src/Components/test/E2ETestMigration/playwrightSettings.ci.linux.json create mode 100644 src/Components/test/E2ETestMigration/playwrightSettings.ci.osx.json create mode 100644 src/Components/test/E2ETestMigration/playwrightSettings.ci.win.json create mode 100644 src/Components/test/E2ETestMigration/playwrightSettings.debug.json create mode 100644 src/Components/test/E2ETestMigration/playwrightSettings.json create mode 100644 src/Components/test/E2ETestMigration/playwrightSettings.linux.json create mode 100644 src/Components/test/E2ETestMigration/playwrightSettings.osx.json create mode 100644 src/Components/test/E2ETestMigration/playwrightSettings.win.json create mode 100644 src/Components/test/E2ETestMigration/xunit.runner.json diff --git a/src/Components/Components.slnf b/src/Components/Components.slnf index 8d592d0fd705..350be8d23b2a 100644 --- a/src/Components/Components.slnf +++ b/src/Components/Components.slnf @@ -32,13 +32,14 @@ "src\\Components\\WebAssembly\\testassets\\HostedInAspNet.Server\\HostedInAspNet.Server.csproj", "src\\Components\\WebAssembly\\testassets\\StandaloneApp\\StandaloneApp.csproj", "src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Client\\Wasm.Authentication.Client.csproj", - "src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Shared\\Wasm.Authentication.Shared.csproj", "src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Server\\Wasm.Authentication.Server.csproj", + "src\\Components\\WebAssembly\\testassets\\Wasm.Authentication.Shared\\Wasm.Authentication.Shared.csproj", "src\\Components\\WebAssembly\\testassets\\WasmLinkerTest\\WasmLinkerTest.csproj", "src\\Components\\Web\\src\\Microsoft.AspNetCore.Components.Web.csproj", "src\\Components\\Web\\test\\Microsoft.AspNetCore.Components.Web.Tests.csproj", "src\\Components\\benchmarkapps\\Wasm.Performance\\Driver\\Wasm.Performance.Driver.csproj", "src\\Components\\benchmarkapps\\Wasm.Performance\\TestApp\\Wasm.Performance.TestApp.csproj", + "src\\Components\\test\\E2ETestMigration\\Microsoft.AspNetCore.Components.Migration.E2ETests.csproj", "src\\Components\\test\\E2ETest\\Microsoft.AspNetCore.Components.E2ETests.csproj", "src\\Components\\test\\testassets\\BasicTestApp\\BasicTestApp.csproj", "src\\Components\\test\\testassets\\ComponentsApp.Server\\ComponentsApp.Server.csproj", @@ -74,7 +75,6 @@ "src\\Middleware\\Localization\\src\\Microsoft.AspNetCore.Localization.csproj", "src\\Middleware\\ResponseCaching.Abstractions\\src\\Microsoft.AspNetCore.ResponseCaching.Abstractions.csproj", "src\\Middleware\\ResponseCompression\\src\\Microsoft.AspNetCore.ResponseCompression.csproj", - "src\\Middleware\\SpaServices.Extensions\\src\\Microsoft.AspNetCore.SpaServices.Extensions.csproj", "src\\Middleware\\StaticFiles\\src\\Microsoft.AspNetCore.StaticFiles.csproj", "src\\Middleware\\WebSockets\\src\\Microsoft.AspNetCore.WebSockets.csproj", "src\\Mvc\\Mvc.Abstractions\\src\\Microsoft.AspNetCore.Mvc.Abstractions.csproj", @@ -114,4 +114,4 @@ "src\\Testing\\src\\Microsoft.AspNetCore.Testing.csproj" ] } -} +} \ No newline at end of file diff --git a/src/Components/ComponentsNoDeps.slnf b/src/Components/ComponentsNoDeps.slnf index a0f1f200b623..d2aa2f466730 100644 --- a/src/Components/ComponentsNoDeps.slnf +++ b/src/Components/ComponentsNoDeps.slnf @@ -53,6 +53,7 @@ "src\\Components\\benchmarkapps\\Wasm.Performance\\Driver\\Wasm.Performance.Driver.csproj", "src\\Components\\benchmarkapps\\Wasm.Performance\\TestApp\\Wasm.Performance.TestApp.csproj", "src\\Components\\test\\E2ETest\\Microsoft.AspNetCore.Components.E2ETests.csproj", + "src\\Components\\test\\E2ETestMigration\\Microsoft.AspNetCore.Components.Migration.E2ETests.csproj", "src\\Components\\test\\testassets\\BasicTestApp\\BasicTestApp.csproj", "src\\Components\\test\\testassets\\ComponentsApp.Server\\ComponentsApp.Server.csproj", "src\\Components\\test\\testassets\\GlobalizationWasmApp\\GlobalizationWasmApp.csproj", diff --git a/src/Components/test/E2ETestMigration/Infrastructure/PlaywrightTestBase.cs b/src/Components/test/E2ETestMigration/Infrastructure/PlaywrightTestBase.cs new file mode 100644 index 000000000000..967c720f4485 --- /dev/null +++ b/src/Components/test/E2ETestMigration/Infrastructure/PlaywrightTestBase.cs @@ -0,0 +1,84 @@ +// 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 System; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Microsoft.AspNetCore.BrowserTesting; +using Microsoft.AspNetCore.Testing; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Testing; +using Xunit; +using Xunit.Abstractions; +using Xunit.Sdk; + +namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure +{ + public class PlaywrightTestBase : LoggedTest, IAsyncLifetime + { + private static readonly bool _isCIEnvironment = + !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("ContinuousIntegrationBuild")); + + public PlaywrightTestBase(ITestOutputHelper output) : base(output) { } + + protected async override Task InitializeCoreAsync(TestContext context) + { + BrowserManager = await BrowserManager.CreateAsync(CreateConfiguration(), LoggerFactory); + BrowserContextInfo = new ContextInformation(LoggerFactory); + _output = new TestOutputLogger(Logger); + } + + public Task InitializeAsync() => Task.CompletedTask; + + private static IConfiguration CreateConfiguration() + { + var basePath = Path.GetDirectoryName(typeof(PlaywrightTestBase).Assembly.Location); + var os = Environment.OSVersion.Platform switch + { + PlatformID.Win32NT => "win", + PlatformID.Unix => "linux", + PlatformID.MacOSX => "osx", + _ => null + }; + + var builder = new ConfigurationBuilder() + .AddJsonFile(Path.Combine(basePath, "playwrightSettings.json")) + .AddJsonFile(Path.Combine(basePath, $"playwrightSettings.{os}.json"), optional: true); + + if (_isCIEnvironment) + { + builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.ci.json"), optional: true) + .AddJsonFile(Path.Combine(basePath, $"playwrightSettings.ci.{os}.json"), optional: true); + } + + if (Debugger.IsAttached) + { + builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.debug.json"), optional: true); + } + + return builder.Build(); + } + + public Task DisposeAsync() => BrowserManager.DisposeAsync(); + + private ITestOutputHelper _output; + public ITestOutputHelper Output + { + get + { + if (_output == null) + { + _output = new TestOutputLogger(Logger); + } + return _output; + } + } + + public ContextInformation BrowserContextInfo { get; protected set; } + public BrowserManager BrowserManager { get; private set; } + } +} diff --git a/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/AspNetEnvironment.cs b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/AspNetEnvironment.cs new file mode 100644 index 000000000000..54a76e303d2a --- /dev/null +++ b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/AspNetEnvironment.cs @@ -0,0 +1,11 @@ +// 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. + +namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures +{ + public enum AspNetEnvironment + { + Development, + Production + } +} diff --git a/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/AspNetSiteServerFixture.cs b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/AspNetSiteServerFixture.cs new file mode 100644 index 000000000000..a4e476aa6cf7 --- /dev/null +++ b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/AspNetSiteServerFixture.cs @@ -0,0 +1,47 @@ +// 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 System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures +{ + public class AspNetSiteServerFixture : WebHostServerFixture + { + public delegate IHost BuildWebHost(string[] args); + + public Assembly ApplicationAssembly { get; set; } + + public BuildWebHost BuildWebHostMethod { get; set; } + + public AspNetEnvironment Environment { get; set; } = AspNetEnvironment.Production; + + public List AdditionalArguments { get; set; } = new List { "--test-execution-mode", "server" }; + + protected override IHost CreateWebHost() + { + if (BuildWebHostMethod == null) + { + throw new InvalidOperationException( + $"No value was provided for {nameof(BuildWebHostMethod)}"); + } + + var assembly = ApplicationAssembly ?? BuildWebHostMethod.Method.DeclaringType.Assembly; + var sampleSitePath = FindSampleOrTestSitePath(assembly.FullName); + + var host = "127.0.0.1"; + + return BuildWebHostMethod(new[] + { + "--urls", $"http://{host}:0", + "--contentroot", sampleSitePath, + "--environment", Environment.ToString(), + }.Concat(AdditionalArguments).ToArray()); + } + } +} diff --git a/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/BasicTestAppServerSiteFixture.cs b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/BasicTestAppServerSiteFixture.cs new file mode 100644 index 000000000000..c0b1c6d51a3e --- /dev/null +++ b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/BasicTestAppServerSiteFixture.cs @@ -0,0 +1,13 @@ +// 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. + +namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures +{ + public class BasicTestAppServerSiteFixture : AspNetSiteServerFixture where TStartup : class + { + public BasicTestAppServerSiteFixture() + { + BuildWebHostMethod = TestServer.Program.BuildWebHost; + } + } +} diff --git a/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/DevHostServerFixture.cs b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/DevHostServerFixture.cs new file mode 100644 index 000000000000..a08fad650e2b --- /dev/null +++ b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/DevHostServerFixture.cs @@ -0,0 +1,40 @@ +// 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.Extensions.Hosting; +using System.Collections.Generic; +using DevHostServerProgram = Microsoft.AspNetCore.Components.WebAssembly.DevServer.Server.Program; + +namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures +{ + public class DevHostServerFixture : WebHostServerFixture + { + public string Environment { get; set; } + public string PathBase { get; set; } + public string ContentRoot { get; private set; } + + protected override IHost CreateWebHost() + { + ContentRoot = FindSampleOrTestSitePath( + typeof(TProgram).Assembly.FullName); + + var host = "127.0.0.1"; + + var args = new List + { + "--urls", $"http://{host}:0", + "--contentroot", ContentRoot, + "--pathbase", PathBase, + "--applicationpath", typeof(TProgram).Assembly.Location, + }; + + if (!string.IsNullOrEmpty(Environment)) + { + args.Add("--environment"); + args.Add(Environment); + } + + return DevHostServerProgram.BuildWebHost(args.ToArray()); + } + } +} diff --git a/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ServerFixture.cs b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ServerFixture.cs new file mode 100644 index 000000000000..2ee6a2d69306 --- /dev/null +++ b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ServerFixture.cs @@ -0,0 +1,86 @@ +// 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 System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.ExceptionServices; +using System.Threading; + +namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures +{ + public abstract class ServerFixture : IDisposable + { + private static readonly Lazy> _projects = new Lazy>(FindProjects); + + public Uri RootUri => _rootUriInitializer.Value; + + private readonly Lazy _rootUriInitializer; + + public ServerFixture() + { + _rootUriInitializer = new Lazy(() => + { + var uri = new Uri(StartAndGetRootUri()); + + return uri; + }); + } + + public abstract void Dispose(); + + protected abstract string StartAndGetRootUri(); + + private static Dictionary FindProjects() + { + return typeof(ServerFixture).Assembly.GetCustomAttributes() + .Where(m => m.Key.StartsWith("TestAssemblyApplication[", StringComparison.Ordinal)) + .ToDictionary(m => + m.Key.Replace("TestAssemblyApplication", "").TrimStart('[').TrimEnd(']'), + m => m.Value); + } + + public static string FindSampleOrTestSitePath(string projectName) + { + var projects = _projects.Value; + if (projects.TryGetValue(projectName, out var dir)) + { + return dir; + } + + throw new ArgumentException($"Cannot find a sample or test site with name '{projectName}'."); + } + + protected static void RunInBackgroundThread(Action action) + { + var isDone = new ManualResetEvent(false); + + ExceptionDispatchInfo edi = null; + new Thread(() => + { + try + { + action(); + } + catch (Exception ex) + { + edi = ExceptionDispatchInfo.Capture(ex); + } + + isDone.Set(); + }).Start(); + + if (!isDone.WaitOne(TimeSpan.FromSeconds(10))) + { + throw new TimeoutException("Timed out waiting for: " + action); + } + + if (edi != null) + { + throw edi.SourceException; + } + } + } +} diff --git a/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/StaticSiteServerFixture.cs b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/StaticSiteServerFixture.cs new file mode 100644 index 000000000000..c01d5c826434 --- /dev/null +++ b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/StaticSiteServerFixture.cs @@ -0,0 +1,49 @@ +// 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 System; +using System.IO; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures +{ + // Although this is not used for anything meaningful related to Blazor yet, it + // will be used later when there's a mechanism for publishing standalone Blazor + // apps as a set of purely static files and we need E2E testing on the result. + + public class StaticSiteServerFixture : WebHostServerFixture + { + public string SampleSiteName { get; set; } + + protected override IHost CreateWebHost() + { + if (string.IsNullOrEmpty(SampleSiteName)) + { + throw new InvalidOperationException($"No value was provided for {nameof(SampleSiteName)}"); + } + + var sampleSitePath = FindSampleOrTestSitePath(SampleSiteName); + + var host = "127.0.0.1"; + + return new HostBuilder() + .ConfigureWebHost(webHostBuilder => webHostBuilder + .UseKestrel() + .UseContentRoot(sampleSitePath) + .UseWebRoot(string.Empty) + .UseStartup() + .UseUrls($"http://{host}:0")) + .Build(); + } + + private class StaticSiteStartup + { + public void Configure(IApplicationBuilder app) + { + app.UseFileServer(); + } + } + } +} diff --git a/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ToggleExecutionModeServerFixture.cs b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ToggleExecutionModeServerFixture.cs new file mode 100644 index 000000000000..2088ddf53821 --- /dev/null +++ b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ToggleExecutionModeServerFixture.cs @@ -0,0 +1,73 @@ +// 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 System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures +{ + public class ToggleExecutionModeServerFixture + : ServerFixture + { + public string PathBase { get; set; } + + public IHost Host { get; set; } + + public ExecutionMode ExecutionMode { get; set; } = ExecutionMode.Client; + + private AspNetSiteServerFixture.BuildWebHost _buildWebHostMethod; + private IDisposable _serverToDispose; + + public List AspNetFixtureAdditionalArguments { get; set; } = new List(); + + public void UseAspNetHost(AspNetSiteServerFixture.BuildWebHost buildWebHostMethod) + { + _buildWebHostMethod = buildWebHostMethod + ?? throw new ArgumentNullException(nameof(buildWebHostMethod)); + } + + protected override string StartAndGetRootUri() + { + if (_buildWebHostMethod == null) + { + // Use Blazor's dev host server + var underlying = new DevHostServerFixture(); + underlying.PathBase = "/subdir"; + _serverToDispose = underlying; + var uri = underlying.RootUri.AbsoluteUri; // As a side-effect, this starts the server + + Host = underlying.Host; + + return uri; + } + else + { + // Use specified ASP.NET host server + var underlying = new AspNetSiteServerFixture(); + underlying.AdditionalArguments.AddRange(AspNetFixtureAdditionalArguments); + underlying.BuildWebHostMethod = _buildWebHostMethod; + _serverToDispose = underlying; + var uri = underlying.RootUri.AbsoluteUri; // As a side-effect, this starts the server + + Host = underlying.Host; + + return uri; + } + } + + public override void Dispose() + { + _serverToDispose?.Dispose(); + } + + internal ToggleExecutionModeServerFixture WithAdditionalArguments(string [] additionalArguments) + { + AspNetFixtureAdditionalArguments.AddRange(additionalArguments); + return this; + } + } + + public enum ExecutionMode { Client, Server } +} diff --git a/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/WebHostServerFixture.cs b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/WebHostServerFixture.cs new file mode 100644 index 000000000000..a29f47315284 --- /dev/null +++ b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/WebHostServerFixture.cs @@ -0,0 +1,36 @@ +// 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.Hosting; +using Microsoft.AspNetCore.Hosting.Server.Features; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System.Linq; +using Microsoft.AspNetCore.Hosting.Server; + +namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures +{ + public abstract class WebHostServerFixture : ServerFixture + { + protected override string StartAndGetRootUri() + { + Host = CreateWebHost(); + RunInBackgroundThread(Host.Start); + return Host.Services.GetRequiredService().Features + .Get() + .Addresses.Single(); + } + + public IHost Host { get; set; } + + public override void Dispose() + { + // This can be null if creating the webhost throws, we don't want to throw here and hide + // the original exception. + Host?.Dispose(); + Host?.StopAsync(); + } + + protected abstract IHost CreateWebHost(); + } +} diff --git a/src/Components/test/E2ETestMigration/Infrastructure/TestOutputLogger.cs b/src/Components/test/E2ETestMigration/Infrastructure/TestOutputLogger.cs new file mode 100644 index 000000000000..a4d67a231d20 --- /dev/null +++ b/src/Components/test/E2ETestMigration/Infrastructure/TestOutputLogger.cs @@ -0,0 +1,29 @@ +// 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 System.Globalization; +using Microsoft.Extensions.Logging; +using Xunit.Abstractions; + +namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure +{ + internal class TestOutputLogger : ITestOutputHelper + { + private readonly ILogger _logger; + + public TestOutputLogger(ILogger logger) + { + _logger = logger; + } + + public void WriteLine(string message) + { + _logger.LogInformation(message); + } + + public void WriteLine(string format, params object[] args) + { + _logger.LogInformation(string.Format(CultureInfo.InvariantCulture, format, args)); + } + } +} diff --git a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj new file mode 100644 index 000000000000..006cd30ddedf --- /dev/null +++ b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj @@ -0,0 +1,104 @@ + + + + $(DefaultNetCoreTargetFramework) + Components.EToETests + <_DefaultProjectFilter>$(MSBuildProjectDirectory)\..\..\.. + + + + + + + + false + + + + ;1701;1702;1705;;NU5105;RS0041;CA1416;CS0649 + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + playwrightSettings.json + + + PreserveNewest + + + + + + + + + + + + + + + + + + <_DefaultProjectRoot>$([System.IO.Path]::GetFullPath($(_DefaultProjectFilter))) + + + <_ContentRootProjectReferences + Include="@(ReferencePath)" + Condition="'%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' AND $([System.String]::Copy(%(ReferencePath.MSBuildSourceProjectFile)).StartsWith('$(_DefaultProjectRoot)'))" /> + + + + + + <_ContentRootMetadata + Condition="'%(_ContentRootProjectReferences.Identity)' != ''" + Include="%(_ContentRootProjectReferences.Identity)" + AssemblyName="%(_ContentRootProjectReferences.FusionName)" + ContentRootPath="$([System.IO.Path]::GetDirectoryName(%(_ContentRootProjectReferences.MSBuildSourceProjectFile)))" + ContentRootTest="$([System.IO.Path]::GetFileName(%(_ContentRootProjectReferences.MSBuildSourceProjectFile)))" + Priority="0" /> + + + + + <_Parameter1>TestAssemblyApplication[%(_ContentRootMetadata.AssemblyName)] + <_Parameter2>%(_ContentRootMetadata.ContentRootPath) + + + + + + + PreserveNewest + + + + diff --git a/src/Components/test/E2ETestMigration/TestJsonSerializerOptionsProvider.cs b/src/Components/test/E2ETestMigration/TestJsonSerializerOptionsProvider.cs new file mode 100644 index 000000000000..2f893e85ea1a --- /dev/null +++ b/src/Components/test/E2ETestMigration/TestJsonSerializerOptionsProvider.cs @@ -0,0 +1,16 @@ +// 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 System.Text.Json; + +namespace Microsoft.AspNetCore.Components.E2ETest +{ + internal static class TestJsonSerializerOptionsProvider + { + public static JsonSerializerOptions Options { get; } = new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + PropertyNameCaseInsensitive = true, + }; + } +} diff --git a/src/Components/test/E2ETestMigration/Tests/BinaryHttpClientTest.cs b/src/Components/test/E2ETestMigration/Tests/BinaryHttpClientTest.cs new file mode 100644 index 000000000000..ecb1435c8bc6 --- /dev/null +++ b/src/Components/test/E2ETestMigration/Tests/BinaryHttpClientTest.cs @@ -0,0 +1,93 @@ +// 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 System; +using System.Linq; +using System.Threading.Tasks; +using BasicTestApp.HttpClientTest; +using Microsoft.AspNetCore.BrowserTesting; +using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; +using Microsoft.AspNetCore.Testing; +using PlaywrightSharp; +using TestServer; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.AspNetCore.Components.E2ETest.Tests +{ + public class BinaryHttpClientTest : PlaywrightTestBase, + IClassFixture>, + IClassFixture> + { + private readonly DevHostServerFixture _devHostServerFixture; + readonly ServerFixture _apiServerFixture; + //IWebElement _appElement; + //IWebElement _responseStatus; + //IWebElement _responseStatusText; + //IWebElement _testOutcome; + + public BinaryHttpClientTest( + DevHostServerFixture devHostServerFixture, + BasicTestAppServerSiteFixture apiServerFixture, + ITestOutputHelper output) + : base(output) + { + _devHostServerFixture = devHostServerFixture; + _devHostServerFixture.PathBase = "/subdir"; + _apiServerFixture = apiServerFixture; + } + + //protected override void InitializeAsyncCore() + //{ + // //Browser.Navigate(_devHostServerFixture.RootUri, "/subdir", noReload: true); + // //_appElement = Browser.MountTestComponent(); + //} + + [Fact] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/23366")] + public async Task CanSendAndReceiveBytes() + { + if (BrowserManager.IsAvailable(BrowserKind.Chromium)) + { + await using var browser = await BrowserManager.GetBrowserInstance(BrowserKind.Chromium, BrowserContextInfo); + var page = await browser.NewPageAsync(); + await page.GoToAsync(_devHostServerFixture.RootUri + "/subdir/api/data"); + +/* var socket = BrowserContextInfo.Pages[page].WebSockets.SingleOrDefault() ?? + (await page.WaitForEventAsync(PageEvent.WebSocket)).WebSocket; + + // Receive render batch + await socket.WaitForEventAsync(WebSocketEvent.FrameReceived); + await socket.WaitForEventAsync(WebSocketEvent.FrameSent); + + // JS interop call to intercept navigation + await socket.WaitForEventAsync(WebSocketEvent.FrameReceived); + await socket.WaitForEventAsync(WebSocketEvent.FrameSent); + + await page.WaitForSelectorAsync("ul");*/ + + await page.CloseAsync(); + } + + + //IssueRequest("/subdir/api/data"); + //Assert.Equal("OK", _responseStatus.Text); + //Assert.Equal("OK", _responseStatusText.Text); + //Assert.Equal("", _testOutcome.Text); + } + + private void IssueRequest() + { + //var targetUri = new Uri(_apiServerFixture.RootUri, relativeUri); + //SetValue("request-uri", targetUri.AbsoluteUri); + + //_appElement.FindElement(By.Id("send-request")).Click(); + + //_responseStatus = Browser.Exists(By.Id("response-status")); + //_responseStatusText = _appElement.FindElement(By.Id("response-status-text")); + //_testOutcome = _appElement.FindElement(By.Id("test-outcome")); + + } + } +} diff --git a/src/Components/test/E2ETestMigration/package.json b/src/Components/test/E2ETestMigration/package.json new file mode 100644 index 000000000000..607937be210d --- /dev/null +++ b/src/Components/test/E2ETestMigration/package.json @@ -0,0 +1,23 @@ +{ + "name": "microsoft.aspnetcore.components.e2etest", + "version": "0.0.1", + "description": "Not a real package. This file exists only to declare dependencies.", + "main": "index.js", + "private": true, + "scripts": { + "selenium-standalone": "selenium-standalone", + "prepare": "selenium-standalone install --config ../../../Shared/E2ETesting/selenium-config.json", + "sauce": "ts-node ./scripts/sauce.ts" + }, + "author": "", + "license": "Apache-2.0", + "dependencies": { + "sauce-connect-launcher": "^1.3.1", + "selenium-standalone": "^6.17.0" + }, + "devDependencies": { + "@types/node": "^13.1.7", + "ts-node": "^8.6.2", + "typescript": "^3.7.5" + } +} diff --git a/src/Components/test/E2ETestMigration/playwrightSettings.ci.json b/src/Components/test/E2ETestMigration/playwrightSettings.ci.json new file mode 100644 index 000000000000..146abcf62692 --- /dev/null +++ b/src/Components/test/E2ETestMigration/playwrightSettings.ci.json @@ -0,0 +1,15 @@ +{ + "TimeoutInMilliseconds": 120000, + "TimeoutAfterFirstFailureInMilliseconds": 20000, + "GlobalBrowserOptions": { + "Headless": true + }, + "BrowserOptions": { + "Firefox": { + "IsEnabled": false + }, + "Webkit": { + "IsEnabled": false + } + } +} diff --git a/src/Components/test/E2ETestMigration/playwrightSettings.ci.linux.json b/src/Components/test/E2ETestMigration/playwrightSettings.ci.linux.json new file mode 100644 index 000000000000..e416652ffe39 --- /dev/null +++ b/src/Components/test/E2ETestMigration/playwrightSettings.ci.linux.json @@ -0,0 +1,8 @@ +{ + "IsDisabled": true, + "BrowserOptions": { + "Chromium": { + "IsEnabled": false + } + } +} diff --git a/src/Components/test/E2ETestMigration/playwrightSettings.ci.osx.json b/src/Components/test/E2ETestMigration/playwrightSettings.ci.osx.json new file mode 100644 index 000000000000..137e7e958118 --- /dev/null +++ b/src/Components/test/E2ETestMigration/playwrightSettings.ci.osx.json @@ -0,0 +1,7 @@ +{ + "BrowserOptions": { + "Chromium": { + "IsEnabled": false + } + } +} diff --git a/src/Components/test/E2ETestMigration/playwrightSettings.ci.win.json b/src/Components/test/E2ETestMigration/playwrightSettings.ci.win.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/src/Components/test/E2ETestMigration/playwrightSettings.ci.win.json @@ -0,0 +1,2 @@ +{ +} diff --git a/src/Components/test/E2ETestMigration/playwrightSettings.debug.json b/src/Components/test/E2ETestMigration/playwrightSettings.debug.json new file mode 100644 index 000000000000..6899a11ae8f8 --- /dev/null +++ b/src/Components/test/E2ETestMigration/playwrightSettings.debug.json @@ -0,0 +1,7 @@ +{ + "TimeoutInMilliseconds": 120000000, + "TimeoutAfterFirstFailureInMilliseconds": 20000000, + "GlobalBrowserOptions": { + "Headless": false + } +} diff --git a/src/Components/test/E2ETestMigration/playwrightSettings.json b/src/Components/test/E2ETestMigration/playwrightSettings.json new file mode 100644 index 000000000000..d5e34b4795f4 --- /dev/null +++ b/src/Components/test/E2ETestMigration/playwrightSettings.json @@ -0,0 +1,38 @@ +{ + "TimeoutInMilliseconds": 30000, + "TimeoutAfterFirstFailureInMilliseconds": 10000, + "BaseArtifactsFolder": ".", + "GlobalBrowserOptions": { + "ChromiumSandbox": true, + "DumpIO": true, + "IgnoreHTTPSErrors": true, + "Headless": true, + "Timeout": 30000 + }, + "GlobalContextOptions": { + "RecordVideo": { + "Dir": "videos" + }, + "RecordHar": { + "Path": "har" + }, + "IgnoreHTTPSErrors": true + }, + "BrowserOptions": { + "Chromium": { + "BrowserKind": "Chromium", + "IsEnabled": true, + "Args": { + "--ignore-certificate-errors": true + } + }, + "Firefox": { + "BrowserKind": "Firefox", + "IsEnabled": true + }, + "Webkit": { + "BrowserKind": "Webkit", + "IsEnabled": true + } + } +} diff --git a/src/Components/test/E2ETestMigration/playwrightSettings.linux.json b/src/Components/test/E2ETestMigration/playwrightSettings.linux.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/src/Components/test/E2ETestMigration/playwrightSettings.linux.json @@ -0,0 +1,2 @@ +{ +} diff --git a/src/Components/test/E2ETestMigration/playwrightSettings.osx.json b/src/Components/test/E2ETestMigration/playwrightSettings.osx.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/src/Components/test/E2ETestMigration/playwrightSettings.osx.json @@ -0,0 +1,2 @@ +{ +} diff --git a/src/Components/test/E2ETestMigration/playwrightSettings.win.json b/src/Components/test/E2ETestMigration/playwrightSettings.win.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/src/Components/test/E2ETestMigration/playwrightSettings.win.json @@ -0,0 +1,2 @@ +{ +} diff --git a/src/Components/test/E2ETestMigration/xunit.runner.json b/src/Components/test/E2ETestMigration/xunit.runner.json new file mode 100644 index 000000000000..baa05fb93d2a --- /dev/null +++ b/src/Components/test/E2ETestMigration/xunit.runner.json @@ -0,0 +1,7 @@ +{ + // This is set to -1 to allow the usage of an + // unlimited ammount of threads. + "maxParallelThreads": -1, + "diagnosticMessages": true, + "longRunningTestSeconds": 30 +} From c48a6ca976539133dd4beb27ef0a79250702c31b Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 20 Apr 2021 15:11:33 -0700 Subject: [PATCH 02/17] Update BinaryHttpClientTest.cs --- .../test/E2ETestMigration/Tests/BinaryHttpClientTest.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Components/test/E2ETestMigration/Tests/BinaryHttpClientTest.cs b/src/Components/test/E2ETestMigration/Tests/BinaryHttpClientTest.cs index ecb1435c8bc6..8a4a683b1f73 100644 --- a/src/Components/test/E2ETestMigration/Tests/BinaryHttpClientTest.cs +++ b/src/Components/test/E2ETestMigration/Tests/BinaryHttpClientTest.cs @@ -45,7 +45,6 @@ public BinaryHttpClientTest( //} [Fact] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/23366")] public async Task CanSendAndReceiveBytes() { if (BrowserManager.IsAvailable(BrowserKind.Chromium)) From c8e99db11ce455ec5476d276e67ad1fba9d3eb76 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 20 Apr 2021 15:11:46 -0700 Subject: [PATCH 03/17] Delete package.json --- .../test/E2ETestMigration/package.json | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/Components/test/E2ETestMigration/package.json diff --git a/src/Components/test/E2ETestMigration/package.json b/src/Components/test/E2ETestMigration/package.json deleted file mode 100644 index 607937be210d..000000000000 --- a/src/Components/test/E2ETestMigration/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "microsoft.aspnetcore.components.e2etest", - "version": "0.0.1", - "description": "Not a real package. This file exists only to declare dependencies.", - "main": "index.js", - "private": true, - "scripts": { - "selenium-standalone": "selenium-standalone", - "prepare": "selenium-standalone install --config ../../../Shared/E2ETesting/selenium-config.json", - "sauce": "ts-node ./scripts/sauce.ts" - }, - "author": "", - "license": "Apache-2.0", - "dependencies": { - "sauce-connect-launcher": "^1.3.1", - "selenium-standalone": "^6.17.0" - }, - "devDependencies": { - "@types/node": "^13.1.7", - "ts-node": "^8.6.2", - "typescript": "^3.7.5" - } -} From 5975e332200473f705880e322e04fad5aaa6dd37 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 21 Apr 2021 01:28:29 -0700 Subject: [PATCH 04/17] Update Microsoft.AspNetCore.Components.Migration.E2ETests.csproj --- .../Microsoft.AspNetCore.Components.Migration.E2ETests.csproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj index 006cd30ddedf..0663b8b5e06c 100644 --- a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj +++ b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj @@ -10,8 +10,7 @@ - - false + true From f72d949fbdb9dcee347a4596de5ea4d2d38eb4f8 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 21 Apr 2021 01:31:17 -0700 Subject: [PATCH 05/17] Update Microsoft.AspNetCore.Components.Migration.E2ETests.csproj --- .../Microsoft.AspNetCore.Components.Migration.E2ETests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj index 0663b8b5e06c..3abc6b83e9d7 100644 --- a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj +++ b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj @@ -48,6 +48,7 @@ PreserveNewest + From 20a70acc71d61ead56e3c2351f1b750ae9f9d139 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 23 Apr 2021 16:32:44 -0700 Subject: [PATCH 06/17] Update Microsoft.AspNetCore.Components.Migration.E2ETests.csproj --- ...tCore.Components.Migration.E2ETests.csproj | 31 ++----------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj index 3abc6b83e9d7..02c809879caa 100644 --- a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj +++ b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj @@ -2,8 +2,7 @@ $(DefaultNetCoreTargetFramework) - Components.EToETests - <_DefaultProjectFilter>$(MSBuildProjectDirectory)\..\..\.. + Components.Migration.E2ETests @@ -11,10 +10,9 @@ true - - - ;1701;1702;1705;;NU5105;RS0041;CA1416;CS0649 + true + true @@ -30,14 +28,12 @@ - - @@ -74,27 +70,6 @@ - - - <_ContentRootMetadata - Condition="'%(_ContentRootProjectReferences.Identity)' != ''" - Include="%(_ContentRootProjectReferences.Identity)" - AssemblyName="%(_ContentRootProjectReferences.FusionName)" - ContentRootPath="$([System.IO.Path]::GetDirectoryName(%(_ContentRootProjectReferences.MSBuildSourceProjectFile)))" - ContentRootTest="$([System.IO.Path]::GetFileName(%(_ContentRootProjectReferences.MSBuildSourceProjectFile)))" - Priority="0" /> - - - - - <_Parameter1>TestAssemblyApplication[%(_ContentRootMetadata.AssemblyName)] - <_Parameter2>%(_ContentRootMetadata.ContentRootPath) - - - - PreserveNewest From 0e7c9b8cc107de5caf28940d75a3eafc6b699634 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 23 Apr 2021 18:49:12 -0700 Subject: [PATCH 07/17] Add playwright dependencies --- ...osoft.AspNetCore.Components.Migration.E2ETests.csproj | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj index 02c809879caa..dc799e651660 100644 --- a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj +++ b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj @@ -24,6 +24,8 @@ + + @@ -76,4 +78,11 @@ + + + <_PublishFiles Include="$(OutputPath).playwright\**\*.*" /> + + + + From 2fc7ea04dc431a357a1a09be71786b91ecce069e Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 24 Apr 2021 00:55:39 -0700 Subject: [PATCH 08/17] Update ServerFixture.cs --- .../ServerFixtures/ServerFixture.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ServerFixture.cs b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ServerFixture.cs index 2ee6a2d69306..b42cc6a7ea09 100644 --- a/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ServerFixture.cs +++ b/src/Components/test/E2ETestMigration/Infrastructure/ServerFixtures/ServerFixture.cs @@ -44,6 +44,25 @@ private static Dictionary FindProjects() public static string FindSampleOrTestSitePath(string projectName) { + if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) + { + var comma = projectName.IndexOf(",", StringComparison.Ordinal); + if (comma != -1) + { + projectName = projectName.Substring(0, comma); + } + if (string.Equals(projectName, "Components.TestServer", StringComparison.Ordinal)) + { + projectName = "TestServer"; // This testasset doesn't match the folder name for some reason + } + var path = Path.Combine(AppContext.BaseDirectory, "testassets", projectName); + if (!Directory.Exists(path)) + { + throw new ArgumentException($"Cannot find a sample or test site directory: '{path}'."); + } + return path; + } + var projects = _projects.Value; if (projects.TryGetValue(projectName, out var dir)) { From 183b7e838164be3c5a02c4af3292edf5f0356115 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 24 Apr 2021 00:55:54 -0700 Subject: [PATCH 09/17] Update Microsoft.AspNetCore.Components.Migration.E2ETests.csproj --- ...Microsoft.AspNetCore.Components.Migration.E2ETests.csproj | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj index dc799e651660..ee045e3e8f16 100644 --- a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj +++ b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj @@ -4,11 +4,6 @@ $(DefaultNetCoreTargetFramework) Components.Migration.E2ETests - - - - - true true From 2f0f003cbbfcda1957a452a5df13bb4b43240e87 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 24 Apr 2021 00:56:37 -0700 Subject: [PATCH 10/17] Update Microsoft.AspNetCore.Components.Migration.E2ETests.csproj --- .../Microsoft.AspNetCore.Components.Migration.E2ETests.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj index ee045e3e8f16..3c37d8097f20 100644 --- a/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj +++ b/src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj @@ -41,7 +41,8 @@ PreserveNewest - + + From 2e425d628b8865cbb2e6a70571d025c9a5ff007c Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Sat, 24 Apr 2021 00:57:38 -0700 Subject: [PATCH 11/17] Update Components.TestServer.csproj --- .../test/testassets/TestServer/Components.TestServer.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Components/test/testassets/TestServer/Components.TestServer.csproj b/src/Components/test/testassets/TestServer/Components.TestServer.csproj index 40fb11d8c400..4cd9dfd849a3 100644 --- a/src/Components/test/testassets/TestServer/Components.TestServer.csproj +++ b/src/Components/test/testassets/TestServer/Components.TestServer.csproj @@ -34,7 +34,8 @@ <_Parameter1>Microsoft.AspNetCore.Testing.BasicTestApp.ContentRoot - <_Parameter2>$([MSBuild]::NormalizeDirectory('$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\BasicTestApp'))')) + <_Parameter2 Condition="$(IsHelixJob) != 'true'">$([MSBuild]::NormalizeDirectory('$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\BasicTestApp'))')) + <_Parameter2 Condition="$(IsHelixJob) == 'true'">..\BasicTestApp'))')) From 7d62f3f32220042d747dd0fecc9c43fbab796875 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 26 Apr 2021 09:08:21 -0700 Subject: [PATCH 12/17] Disable firefox and webkit (overrides not working?) --- src/Components/test/E2ETestMigration/playwrightSettings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/test/E2ETestMigration/playwrightSettings.json b/src/Components/test/E2ETestMigration/playwrightSettings.json index d5e34b4795f4..887196bda4d3 100644 --- a/src/Components/test/E2ETestMigration/playwrightSettings.json +++ b/src/Components/test/E2ETestMigration/playwrightSettings.json @@ -28,11 +28,11 @@ }, "Firefox": { "BrowserKind": "Firefox", - "IsEnabled": true + "IsEnabled": false }, "Webkit": { "BrowserKind": "Webkit", - "IsEnabled": true + "IsEnabled": false } } } From bb45c2a2aaf47a47dedbc8ca95474a61780fd071 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 26 Apr 2021 13:31:57 -0700 Subject: [PATCH 13/17] Update helix-matrix.yml --- .azure/pipelines/helix-matrix.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.azure/pipelines/helix-matrix.yml b/.azure/pipelines/helix-matrix.yml index de615d9e345c..97ce99e0a3d0 100644 --- a/.azure/pipelines/helix-matrix.yml +++ b/.azure/pipelines/helix-matrix.yml @@ -1,5 +1,9 @@ # We only want to run full helix matrix on main -pr: none +pr: + autoCancel: true + branches: + include: + - '*' trigger: none schedules: # Cron timezone is UTC. From 6bbb9b6a8497341033ecd922fb0da3ba10d6228d Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 26 Apr 2021 21:21:34 -0700 Subject: [PATCH 14/17] Skip helix arm queues for playwright --- eng/targets/Helix.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 502f334ff7a1..b1b431ecb2ce 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -10,6 +10,7 @@ Windows.7.Amd64.Open;Windows.81.Amd64.Open;Redhat.7.Amd64.Open;Redhat.7.Amd64;Debian.9.Amd64.Open;Debian.9.Amd64.Open;Ubuntu.2004.Amd64.Open;Ubuntu.2004.Amd64;Ubuntu.1604.Amd64.Open;Ubuntu.1604.Amd64;Alpine.312.Amd64.Open;(Alpine.312.Amd64.Open)Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.12-helix-20200908125345-56c6673;(Fedora.33.Amd64.Open)Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-33-helix-20210120000908-a9df267 + true From c054bb11a2951041e94e71d637f35d7b2e91114c Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 26 Apr 2021 21:22:09 -0700 Subject: [PATCH 15/17] Skipped in helix target --- .../BlazorTemplates.Tests/BlazorTemplates.Tests.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj index 88018c32be2e..28d4ed1ea25d 100644 --- a/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj +++ b/src/ProjectTemplates/BlazorTemplates.Tests/BlazorTemplates.Tests.csproj @@ -7,7 +7,6 @@ true true - true From 963373ca42bd6fd1626c04c81b56e422f1cb2bec Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 27 Apr 2021 14:34:56 -0700 Subject: [PATCH 16/17] Update helix-matrix.yml --- .azure/pipelines/helix-matrix.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.azure/pipelines/helix-matrix.yml b/.azure/pipelines/helix-matrix.yml index 97ce99e0a3d0..de615d9e345c 100644 --- a/.azure/pipelines/helix-matrix.yml +++ b/.azure/pipelines/helix-matrix.yml @@ -1,9 +1,5 @@ # We only want to run full helix matrix on main -pr: - autoCancel: true - branches: - include: - - '*' +pr: none trigger: none schedules: # Cron timezone is UTC. From 9d8e901f69e2f827a991a3f5ed165a74bc2dd53b Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 30 Apr 2021 14:10:21 -0700 Subject: [PATCH 17/17] Update Components.TestServer.csproj --- .../test/testassets/TestServer/Components.TestServer.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/test/testassets/TestServer/Components.TestServer.csproj b/src/Components/test/testassets/TestServer/Components.TestServer.csproj index 4cd9dfd849a3..aed21c75f3e2 100644 --- a/src/Components/test/testassets/TestServer/Components.TestServer.csproj +++ b/src/Components/test/testassets/TestServer/Components.TestServer.csproj @@ -35,7 +35,7 @@ <_Parameter1>Microsoft.AspNetCore.Testing.BasicTestApp.ContentRoot <_Parameter2 Condition="$(IsHelixJob) != 'true'">$([MSBuild]::NormalizeDirectory('$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\BasicTestApp'))')) - <_Parameter2 Condition="$(IsHelixJob) == 'true'">..\BasicTestApp'))')) + <_Parameter2 Condition="$(IsHelixJob) == 'true'">..\BasicTestApp