From d7a960604083c98a6cbb38332680bd4487c28ed7 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Mon, 11 Mar 2019 18:40:18 +0100 Subject: [PATCH] [Templating][Components] Unify and improve E2E testing infrastructure (#8188) * Unify the Templating and Components testing infrastructure. * Enable test project discovery in the components E2E tests. * Enable selectively disabling Selenium tests through build properties. --- .azure/pipelines/jobs/default-build.yml | 4 + eng/scripts/InstallGoogleChrome.ps1 | 4 + .../Infrastructure/BasicTestAppTestBase.cs | 1 + .../E2ETest/Infrastructure/BrowserFixture.cs | 60 -- .../CaptureSeleniumLogsAttribute.cs | 49 -- .../ServerFixtures/AspNetSiteServerFixture.cs | 4 +- .../ServerFixtures/DevHostServerFixture.cs | 4 +- .../ServerFixtures/ServerFixture.cs | 46 +- .../E2ETest/Infrastructure/ServerTestBase.cs | 1 + ...soft.AspNetCore.Components.E2ETests.csproj | 22 +- .../ServerComponentRenderingTest.cs | 2 +- .../ServerExecutionTests/ServerSideAppTest.cs | 1 + .../ServerExecutionTests/TestSubclasses.cs | 1 + .../E2ETest/Tests/BinaryHttpClientTest.cs | 1 + src/Components/test/E2ETest/Tests/BindTest.cs | 1 + .../test/E2ETest/Tests/CascadingValueTest.cs | 1 + .../E2ETest/Tests/ComponentRenderingTest.cs | 1 + .../test/E2ETest/Tests/EventBubblingTest.cs | 1 + .../test/E2ETest/Tests/EventCallbackTest.cs | 1 + .../test/E2ETest/Tests/EventTest.cs | 1 + .../test/E2ETest/Tests/FormsTest.cs | 1 + .../test/E2ETest/Tests/HostedInAspNetTest.cs | 3 +- .../test/E2ETest/Tests/HttpClientTest.cs | 1 + .../test/E2ETest/Tests/InteropTest.cs | 1 + .../test/E2ETest/Tests/MonoSanityTest.cs | 1 + .../test/E2ETest/Tests/PerformanceTest.cs | 1 + .../test/E2ETest/Tests/RoutingTest.cs | 1 + .../test/E2ETest/Tests/StandaloneAppTest.cs | 1 + src/Components/test/E2ETest/package-lock.json | 627 ------------------ src/Components/test/E2ETest/yarn.lock | 575 ++++++++++++++++ src/ProjectTemplates/ProjectTemplates.sln | 101 +++ .../test/AssemblyInfo.AssemblyFixtures.cs | 4 + src/ProjectTemplates/test/BaselineTest.cs | 18 +- .../test/EmptyWebTemplateTest.cs | 16 +- ...teTestBase.cs => ProjectFactoryFixture.cs} | 87 ++- .../test/Helpers/WebDriverFactory.cs | 26 +- .../AssemblyFixtureAttribute.cs | 14 - .../test/Infrastructure/BrowserFixture.cs | 67 -- .../test/Infrastructure/BrowserTestBase.cs | 27 - .../Infrastructure/SeleniumServerFixture.cs | 103 --- src/ProjectTemplates/test/MvcTemplateTest.cs | 41 +- .../test/ProjectTemplates.Tests.csproj | 20 +- .../test/RazorComponentsTemplateTest.cs | 24 +- .../test/RazorPagesTemplateTest.cs | 30 +- .../SpaTemplateTest/AngularTemplateTest.cs | 12 +- .../SpaTemplateTest/ReactReduxTemplateTest.cs | 7 +- .../test/SpaTemplateTest/ReactTemplateTest.cs | 7 +- .../SpaTemplateTest/SpaTemplateTestBase.cs | 23 +- .../test/WebApiTemplateTest.cs | 14 +- src/ProjectTemplates/test/package.json | 16 + src/ProjectTemplates/test/yarn.lock | 575 ++++++++++++++++ src/Shared/E2ETesting/BrowserFixture.cs | 88 +++ .../E2ETesting}/BrowserTestBase.cs | 2 +- .../CaptureSeleniumLogsAttribute.cs | 9 +- src/Shared/E2ETesting/E2ETesting.props | 26 + src/Shared/E2ETesting/E2ETesting.targets | 105 +++ .../E2ETesting}/SeleniumStandaloneServer.cs | 2 +- .../E2ETesting}/WaitAssert.cs | 2 +- .../AssemblyFixtureAttribute.cs | 17 + ...TestCollectionRunnerWIthAssemblyFixture.cs | 6 +- ...itTestAssemblyRunnerWithAssemblyFixture.cs | 6 +- ...estFrameworkExecutorWithAssemblyFixture.cs | 6 +- .../XunitTestFrameworkWithAssemblyFixture.cs | 6 +- 63 files changed, 1759 insertions(+), 1166 deletions(-) create mode 100644 eng/scripts/InstallGoogleChrome.ps1 delete mode 100644 src/Components/test/E2ETest/Infrastructure/BrowserFixture.cs delete mode 100644 src/Components/test/E2ETest/Infrastructure/CaptureSeleniumLogsAttribute.cs delete mode 100644 src/Components/test/E2ETest/package-lock.json create mode 100644 src/Components/test/E2ETest/yarn.lock create mode 100644 src/ProjectTemplates/ProjectTemplates.sln create mode 100644 src/ProjectTemplates/test/AssemblyInfo.AssemblyFixtures.cs rename src/ProjectTemplates/test/Helpers/{TemplateTestBase.cs => ProjectFactoryFixture.cs} (72%) delete mode 100644 src/ProjectTemplates/test/Infrastructure/AssemblyFixtureAttribute.cs delete mode 100644 src/ProjectTemplates/test/Infrastructure/BrowserFixture.cs delete mode 100644 src/ProjectTemplates/test/Infrastructure/BrowserTestBase.cs delete mode 100644 src/ProjectTemplates/test/Infrastructure/SeleniumServerFixture.cs create mode 100644 src/ProjectTemplates/test/package.json create mode 100644 src/ProjectTemplates/test/yarn.lock create mode 100644 src/Shared/E2ETesting/BrowserFixture.cs rename src/{Components/test/E2ETest/Infrastructure => Shared/E2ETesting}/BrowserTestBase.cs (94%) rename src/{ProjectTemplates/test/Infrastructure => Shared/E2ETesting}/CaptureSeleniumLogsAttribute.cs (85%) create mode 100644 src/Shared/E2ETesting/E2ETesting.props create mode 100644 src/Shared/E2ETesting/E2ETesting.targets rename src/{Components/test/E2ETest/Infrastructure => Shared/E2ETesting}/SeleniumStandaloneServer.cs (98%) rename src/{Components/test/E2ETest/Infrastructure => Shared/E2ETesting}/WaitAssert.cs (97%) create mode 100644 src/Shared/E2ETesting/XUnitExtensions/AssemblyFixtureAttribute.cs rename src/{ProjectTemplates/test/Infrastructure => Shared/E2ETesting}/XUnitExtensions/XUnitTestCollectionRunnerWIthAssemblyFixture.cs (95%) rename src/{ProjectTemplates/test/Infrastructure => Shared/E2ETesting}/XUnitExtensions/XunitTestAssemblyRunnerWithAssemblyFixture.cs (96%) rename src/{ProjectTemplates/test/Infrastructure => Shared/E2ETesting}/XUnitExtensions/XunitTestFrameworkExecutorWithAssemblyFixture.cs (90%) rename src/{ProjectTemplates/test/Infrastructure => Shared/E2ETesting}/XUnitExtensions/XunitTestFrameworkWithAssemblyFixture.cs (85%) diff --git a/.azure/pipelines/jobs/default-build.yml b/.azure/pipelines/jobs/default-build.yml index 1e920bdd88..c503d5c5aa 100644 --- a/.azure/pipelines/jobs/default-build.yml +++ b/.azure/pipelines/jobs/default-build.yml @@ -123,6 +123,10 @@ jobs: - ${{ if and(eq(parameters.installJdk, 'true'), eq(parameters.agentOs, 'Windows')) }}: - powershell: ./eng/scripts/InstallJdk.ps1 '11.0.1' displayName: Install JDK 11 + - powershell: Write-Host "##vso[task.prependpath]$env:JAVA_HOME\bin" + displayName: Prepend JAVA bin folder to the PATH. + - powershell: ./eng/scripts/InstallGoogleChrome.ps1 + displayName: Install chrome - ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.agentOs, 'Windows'), eq(parameters.codeSign, 'true')) }}: - task: MicroBuildSigningPlugin@1 displayName: Install MicroBuild Signing plugin diff --git a/eng/scripts/InstallGoogleChrome.ps1 b/eng/scripts/InstallGoogleChrome.ps1 new file mode 100644 index 0000000000..8546095e46 --- /dev/null +++ b/eng/scripts/InstallGoogleChrome.ps1 @@ -0,0 +1,4 @@ +$InstallerPath = "$env:Temp\chrome_installer.exe"; +Invoke-WebRequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile $InstallerPath; +Start-Process -FilePath $InstallerPath -Args "/silent /install" -Verb RunAs -Wait; +Remove-Item $InstallerPath diff --git a/src/Components/test/E2ETest/Infrastructure/BasicTestAppTestBase.cs b/src/Components/test/E2ETest/Infrastructure/BasicTestAppTestBase.cs index 10b7b417dd..b8ecfe1b62 100644 --- a/src/Components/test/E2ETest/Infrastructure/BasicTestAppTestBase.cs +++ b/src/Components/test/E2ETest/Infrastructure/BasicTestAppTestBase.cs @@ -4,6 +4,7 @@ using BasicTestApp; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using System; diff --git a/src/Components/test/E2ETest/Infrastructure/BrowserFixture.cs b/src/Components/test/E2ETest/Infrastructure/BrowserFixture.cs deleted file mode 100644 index ea0d11061e..0000000000 --- a/src/Components/test/E2ETest/Infrastructure/BrowserFixture.cs +++ /dev/null @@ -1,60 +0,0 @@ -// 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 OpenQA.Selenium; -using OpenQA.Selenium.Chrome; -using OpenQA.Selenium.Remote; -using System; -using Xunit.Abstractions; - -namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure -{ - public class BrowserFixture : IDisposable - { - public IWebDriver Browser { get; } - - public ILogs Logs { get; } - - public ITestOutputHelper Output { get; set; } - - public BrowserFixture() - { - var opts = new ChromeOptions(); - - // Comment this out if you want to watch or interact with the browser (e.g., for debugging) - opts.AddArgument("--headless"); - - // Log errors - opts.SetLoggingPreference(LogType.Browser, LogLevel.All); - - // On Windows/Linux, we don't need to set opts.BinaryLocation - // But for Travis Mac builds we do - var binaryLocation = Environment.GetEnvironmentVariable("TEST_CHROME_BINARY"); - if (!string.IsNullOrEmpty(binaryLocation)) - { - opts.BinaryLocation = binaryLocation; - Console.WriteLine($"Set {nameof(ChromeOptions)}.{nameof(opts.BinaryLocation)} to {binaryLocation}"); - } - - try - { - var driver = new RemoteWebDriver(SeleniumStandaloneServer.Instance.Uri, opts); - driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1); - Browser = driver; - Logs = new RemoteLogs(driver); - } - catch (WebDriverException ex) - { - var message = - "Failed to connect to the web driver. Please see the readme and follow the instructions to install selenium." + - "Remember to start the web driver with `selenium-standalone start` before running the end-to-end tests."; - throw new InvalidOperationException(message, ex); - } - } - - public void Dispose() - { - Browser.Dispose(); - } - } -} diff --git a/src/Components/test/E2ETest/Infrastructure/CaptureSeleniumLogsAttribute.cs b/src/Components/test/E2ETest/Infrastructure/CaptureSeleniumLogsAttribute.cs deleted file mode 100644 index 00a868ab50..0000000000 --- a/src/Components/test/E2ETest/Infrastructure/CaptureSeleniumLogsAttribute.cs +++ /dev/null @@ -1,49 +0,0 @@ -// 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.Reflection; -using OpenQA.Selenium; -using Xunit.Sdk; - -namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure -{ - // This has to use BeforeAfterTestAttribute because running the log capture - // in the BrowserFixture.Dispose method is too late, and we can't add logging - // to the test. - public class CaptureSeleniumLogsAttribute : BeforeAfterTestAttribute - { - public override void Before(MethodInfo methodUnderTest) - { - if (!typeof(BrowserTestBase).IsAssignableFrom(methodUnderTest.DeclaringType)) - { - throw new InvalidOperationException("This should only be used with BrowserTestBase"); - } - } - - public override void After(MethodInfo methodUnderTest) - { - var browser = BrowserTestBase.Browser; - var logs = BrowserTestBase.Logs; - var output = BrowserTestBase.Output; - - // Put browser logs first, the test UI will truncate output after a certain length - // and the browser logs will include exceptions thrown by js in the browser. - foreach (var kind in logs.AvailableLogTypes.OrderBy(k => k == LogType.Browser ? 0 : 1)) - { - output.WriteLine($"{kind} Logs from Selenium:"); - - var entries = logs.GetLog(kind); - foreach (LogEntry entry in entries) - { - output.WriteLine($"[{entry.Timestamp}] - {entry.Level} - {entry.Message}"); - } - - output.WriteLine(""); - output.WriteLine(""); - } - } - } -} diff --git a/src/Components/test/E2ETest/Infrastructure/ServerFixtures/AspNetSiteServerFixture.cs b/src/Components/test/E2ETest/Infrastructure/ServerFixtures/AspNetSiteServerFixture.cs index 0ef7b7abd7..7d3e3c3ad8 100644 --- a/src/Components/test/E2ETest/Infrastructure/ServerFixtures/AspNetSiteServerFixture.cs +++ b/src/Components/test/E2ETest/Infrastructure/ServerFixtures/AspNetSiteServerFixture.cs @@ -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 System; @@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures } var sampleSitePath = FindSampleOrTestSitePath( - BuildWebHostMethod.Method.DeclaringType.Assembly.GetName().Name); + BuildWebHostMethod.Method.DeclaringType.Assembly.FullName); return BuildWebHostMethod(new[] { diff --git a/src/Components/test/E2ETest/Infrastructure/ServerFixtures/DevHostServerFixture.cs b/src/Components/test/E2ETest/Infrastructure/ServerFixtures/DevHostServerFixture.cs index 1f85e9e8f5..cd47e47fdb 100644 --- a/src/Components/test/E2ETest/Infrastructure/ServerFixtures/DevHostServerFixture.cs +++ b/src/Components/test/E2ETest/Infrastructure/ServerFixtures/DevHostServerFixture.cs @@ -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.Hosting; @@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures protected override IWebHost CreateWebHost() { ContentRoot = FindSampleOrTestSitePath( - typeof(TProgram).Assembly.GetName().Name); + typeof(TProgram).Assembly.FullName); var args = new List { diff --git a/src/Components/test/E2ETest/Infrastructure/ServerFixtures/ServerFixture.cs b/src/Components/test/E2ETest/Infrastructure/ServerFixtures/ServerFixture.cs index c06aec2206..3cd8539c61 100644 --- a/src/Components/test/E2ETest/Infrastructure/ServerFixtures/ServerFixture.cs +++ b/src/Components/test/E2ETest/Infrastructure/ServerFixtures/ServerFixture.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection; using System.Threading; namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures @@ -27,26 +28,13 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures protected abstract string StartAndGetRootUri(); - protected static string FindSolutionDir() - { - return FindClosestDirectoryContaining( - "Components.sln", - Path.GetDirectoryName(typeof(ServerFixture).Assembly.Location)); - } - private static Dictionary FindProjects() { - var solutionDir = FindSolutionDir(); - - var testAssetsDirectories = new[] - { - Path.Combine(solutionDir, "test", "testassets"), - Path.Combine(solutionDir, "blazor", "testassets"), - }; - - return testAssetsDirectories - .SelectMany(d => new DirectoryInfo(d).EnumerateDirectories()) - .ToDictionary(d => d.Name, d => d.FullName); + return typeof(ServerFixture).Assembly.GetCustomAttributes() + .Where(m => m.Key.StartsWith("TestAssemblyApplication[")) + .ToDictionary(m => + m.Key.Replace("TestAssemblyApplication", "").TrimStart('[').TrimEnd(']'), + m => m.Value); } protected static string FindSampleOrTestSitePath(string projectName) @@ -60,28 +48,6 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures throw new ArgumentException($"Cannot find a sample or test site with name '{projectName}'."); } - private static string FindClosestDirectoryContaining( - string filename, - string startDirectory) - { - var dir = startDirectory; - while (true) - { - if (File.Exists(Path.Combine(dir, filename))) - { - return dir; - } - - dir = Directory.GetParent(dir)?.FullName; - if (string.IsNullOrEmpty(dir)) - { - throw new FileNotFoundException( - $"Could not locate a file called '{filename}' in " + - $"directory '{startDirectory}' or any parent directory."); - } - } - } - protected static void RunInBackgroundThread(Action action) { var isDone = new ManualResetEvent(false); diff --git a/src/Components/test/E2ETest/Infrastructure/ServerTestBase.cs b/src/Components/test/E2ETest/Infrastructure/ServerTestBase.cs index 623f4a313c..e13d12f49e 100644 --- a/src/Components/test/E2ETest/Infrastructure/ServerTestBase.cs +++ b/src/Components/test/E2ETest/Infrastructure/ServerTestBase.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using System; using Xunit; using Xunit.Abstractions; diff --git a/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj b/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj index c19c9a59fb..d7c8e2e767 100644 --- a/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj +++ b/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj @@ -1,15 +1,16 @@  + + + netcoreapp3.0 - $(DefaultItemExcludes);node_modules\** - - false + Components.E2ETests - true + true false @@ -18,20 +19,10 @@ - - - - - - - - - - @@ -48,4 +39,7 @@ + + + diff --git a/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs index d9bb7df0dd..575454104e 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs @@ -4,9 +4,9 @@ using System; using BasicTestApp; using ComponentsApp.App.Pages; -using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; using Microsoft.AspNetCore.Components.E2ETest.Tests; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using Xunit; diff --git a/src/Components/test/E2ETest/ServerExecutionTests/ServerSideAppTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/ServerSideAppTest.cs index f4060cefee..4c1ff44814 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/ServerSideAppTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/ServerSideAppTest.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using System; diff --git a/src/Components/test/E2ETest/ServerExecutionTests/TestSubclasses.cs b/src/Components/test/E2ETest/ServerExecutionTests/TestSubclasses.cs index 1a6807c6be..1195b3ccdb 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/TestSubclasses.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/TestSubclasses.cs @@ -5,6 +5,7 @@ using BasicTestApp; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; using Microsoft.AspNetCore.Components.E2ETest.Tests; +using Microsoft.AspNetCore.E2ETesting; using Xunit.Abstractions; namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests diff --git a/src/Components/test/E2ETest/Tests/BinaryHttpClientTest.cs b/src/Components/test/E2ETest/Tests/BinaryHttpClientTest.cs index 20dedb36dd..41e3a6a83f 100644 --- a/src/Components/test/E2ETest/Tests/BinaryHttpClientTest.cs +++ b/src/Components/test/E2ETest/Tests/BinaryHttpClientTest.cs @@ -4,6 +4,7 @@ using BasicTestApp.HttpClientTest; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using System; diff --git a/src/Components/test/E2ETest/Tests/BindTest.cs b/src/Components/test/E2ETest/Tests/BindTest.cs index eb75e3cffc..4a9bcd6499 100644 --- a/src/Components/test/E2ETest/Tests/BindTest.cs +++ b/src/Components/test/E2ETest/Tests/BindTest.cs @@ -4,6 +4,7 @@ using BasicTestApp; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using Xunit; diff --git a/src/Components/test/E2ETest/Tests/CascadingValueTest.cs b/src/Components/test/E2ETest/Tests/CascadingValueTest.cs index 115bb30f5c..2b76b7149c 100644 --- a/src/Components/test/E2ETest/Tests/CascadingValueTest.cs +++ b/src/Components/test/E2ETest/Tests/CascadingValueTest.cs @@ -4,6 +4,7 @@ using BasicTestApp; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using Xunit; using Xunit.Abstractions; diff --git a/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs b/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs index dc6ca816d0..7a42598a6f 100644 --- a/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs +++ b/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs @@ -11,6 +11,7 @@ using BasicTestApp; using BasicTestApp.HierarchicalImportsTest.Subdir; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using Xunit; diff --git a/src/Components/test/E2ETest/Tests/EventBubblingTest.cs b/src/Components/test/E2ETest/Tests/EventBubblingTest.cs index b75b89643a..b3092ac385 100644 --- a/src/Components/test/E2ETest/Tests/EventBubblingTest.cs +++ b/src/Components/test/E2ETest/Tests/EventBubblingTest.cs @@ -4,6 +4,7 @@ using BasicTestApp; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using System; using Xunit; diff --git a/src/Components/test/E2ETest/Tests/EventCallbackTest.cs b/src/Components/test/E2ETest/Tests/EventCallbackTest.cs index 43ffba6e92..f93fbb78ac 100644 --- a/src/Components/test/E2ETest/Tests/EventCallbackTest.cs +++ b/src/Components/test/E2ETest/Tests/EventCallbackTest.cs @@ -4,6 +4,7 @@ using BasicTestApp; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using Xunit; using Xunit.Abstractions; diff --git a/src/Components/test/E2ETest/Tests/EventTest.cs b/src/Components/test/E2ETest/Tests/EventTest.cs index d3056837fb..40f20d48c5 100644 --- a/src/Components/test/E2ETest/Tests/EventTest.cs +++ b/src/Components/test/E2ETest/Tests/EventTest.cs @@ -4,6 +4,7 @@ using BasicTestApp; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Interactions; using Xunit; diff --git a/src/Components/test/E2ETest/Tests/FormsTest.cs b/src/Components/test/E2ETest/Tests/FormsTest.cs index 1ebf4c3e09..2512303265 100644 --- a/src/Components/test/E2ETest/Tests/FormsTest.cs +++ b/src/Components/test/E2ETest/Tests/FormsTest.cs @@ -5,6 +5,7 @@ using BasicTestApp; using BasicTestApp.FormsTest; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using System; diff --git a/src/Components/test/E2ETest/Tests/HostedInAspNetTest.cs b/src/Components/test/E2ETest/Tests/HostedInAspNetTest.cs index 08816f43f0..3ac2de0cd9 100644 --- a/src/Components/test/E2ETest/Tests/HostedInAspNetTest.cs +++ b/src/Components/test/E2ETest/Tests/HostedInAspNetTest.cs @@ -1,8 +1,9 @@ -// 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.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using System; diff --git a/src/Components/test/E2ETest/Tests/HttpClientTest.cs b/src/Components/test/E2ETest/Tests/HttpClientTest.cs index b48d378d89..025a6e74df 100644 --- a/src/Components/test/E2ETest/Tests/HttpClientTest.cs +++ b/src/Components/test/E2ETest/Tests/HttpClientTest.cs @@ -4,6 +4,7 @@ using BasicTestApp.HttpClientTest; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using System; diff --git a/src/Components/test/E2ETest/Tests/InteropTest.cs b/src/Components/test/E2ETest/Tests/InteropTest.cs index e576fa72c7..d5e7e28b77 100644 --- a/src/Components/test/E2ETest/Tests/InteropTest.cs +++ b/src/Components/test/E2ETest/Tests/InteropTest.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using BasicTestApp; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using Xunit; diff --git a/src/Components/test/E2ETest/Tests/MonoSanityTest.cs b/src/Components/test/E2ETest/Tests/MonoSanityTest.cs index cfd8ed5e84..67c2eb9ac0 100644 --- a/src/Components/test/E2ETest/Tests/MonoSanityTest.cs +++ b/src/Components/test/E2ETest/Tests/MonoSanityTest.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using System; diff --git a/src/Components/test/E2ETest/Tests/PerformanceTest.cs b/src/Components/test/E2ETest/Tests/PerformanceTest.cs index 7c6cdba8b7..bb274c393f 100644 --- a/src/Components/test/E2ETest/Tests/PerformanceTest.cs +++ b/src/Components/test/E2ETest/Tests/PerformanceTest.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using System; using System.Linq; diff --git a/src/Components/test/E2ETest/Tests/RoutingTest.cs b/src/Components/test/E2ETest/Tests/RoutingTest.cs index 6605c729e3..5e351b4a4f 100644 --- a/src/Components/test/E2ETest/Tests/RoutingTest.cs +++ b/src/Components/test/E2ETest/Tests/RoutingTest.cs @@ -8,6 +8,7 @@ using BasicTestApp; using BasicTestApp.RouterTest; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Interactions; using Xunit; diff --git a/src/Components/test/E2ETest/Tests/StandaloneAppTest.cs b/src/Components/test/E2ETest/Tests/StandaloneAppTest.cs index 840e6ea4c8..f0c870dda1 100644 --- a/src/Components/test/E2ETest/Tests/StandaloneAppTest.cs +++ b/src/Components/test/E2ETest/Tests/StandaloneAppTest.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; +using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using System; diff --git a/src/Components/test/E2ETest/package-lock.json b/src/Components/test/E2ETest/package-lock.json deleted file mode 100644 index e5d847385a..0000000000 --- a/src/Components/test/E2ETest/package-lock.json +++ /dev/null @@ -1,627 +0,0 @@ -{ - "name": "microsoft.aspnetcore.components.e2etest", - "version": "0.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "ajv": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.1.tgz", - "integrity": "sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww==", - "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" - } - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "2.1.2" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "requires": { - "lodash": "4.17.11" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "0.14.5" - } - }, - "bl": { - "version": "1.2.2", - "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz", - "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", - "requires": { - "readable-stream": "2.3.6", - "safe-buffer": "5.1.2" - } - }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "requires": { - "buffer-alloc-unsafe": "1.1.0", - "buffer-fill": "1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" - }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "requires": { - "delayed-stream": "1.0.0" - } - }, - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "1.0.5", - "path-key": "2.0.1", - "semver": "5.6.0", - "shebang-command": "1.2.0", - "which": "1.3.1" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "1.0.0" - } - }, - "debug": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", - "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", - "requires": { - "ms": "2.1.1" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "0.1.1", - "safer-buffer": "2.1.2" - } - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "1.4.0" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "requires": { - "pend": "1.2.0" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.7", - "mime-types": "2.1.21" - } - }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "1.0.0" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "6.6.1", - "har-schema": "2.0.0" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.15.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" - }, - "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" - }, - "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", - "requires": { - "mime-db": "1.37.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - } - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1.0.2" - } - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", - "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==" - }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.8.0", - "caseless": "0.12.0", - "combined-stream": "1.0.7", - "extend": "3.0.2", - "forever-agent": "0.6.1", - "form-data": "2.3.3", - "har-validator": "5.1.3", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.21", - "oauth-sign": "0.9.0", - "performance-now": "2.1.0", - "qs": "6.5.2", - "safe-buffer": "5.1.2", - "tough-cookie": "2.4.3", - "tunnel-agent": "0.6.0", - "uuid": "3.3.2" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "selenium-standalone": { - "version": "6.15.4", - "resolved": "https://registry.npmjs.org/selenium-standalone/-/selenium-standalone-6.15.4.tgz", - "integrity": "sha512-J4FZzbkgnQ0D148ZgR9a+SqdnXPyKEhWLHP4pg5dP8b3U0CZmfzXL2gp/R4c1FrmXujosueVE57XO9//l4sEaA==", - "requires": { - "async": "2.6.1", - "commander": "2.19.0", - "cross-spawn": "6.0.5", - "debug": "4.1.0", - "lodash": "4.17.11", - "minimist": "1.2.0", - "mkdirp": "0.5.1", - "progress": "2.0.1", - "request": "2.88.0", - "tar-stream": "1.6.2", - "urijs": "1.19.1", - "which": "1.3.1", - "yauzl": "2.10.0" - } - }, - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "requires": { - "shebang-regex": "1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" - }, - "sshpk": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", - "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", - "requires": { - "asn1": "0.2.4", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.2", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.2", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "safer-buffer": "2.1.2", - "tweetnacl": "0.14.5" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "requires": { - "bl": "1.2.2", - "buffer-alloc": "1.2.0", - "end-of-stream": "1.4.1", - "fs-constants": "1.0.0", - "readable-stream": "2.3.6", - "to-buffer": "1.1.1", - "xtend": "4.0.1" - } - }, - "to-buffer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", - "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "1.1.31", - "punycode": "1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "2.1.1" - } - }, - "urijs": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.1.tgz", - "integrity": "sha512-xVrGVi94ueCJNrBSTjWqjvtgvl3cyOTThp2zaMaFNGp3F542TR6sM3f2o8RqZl+AwteClSVmoCyt0ka4RjQOQg==" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "1.3.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "2.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "requires": { - "buffer-crc32": "0.2.13", - "fd-slicer": "1.1.0" - } - } - } -} diff --git a/src/Components/test/E2ETest/yarn.lock b/src/Components/test/E2ETest/yarn.lock new file mode 100644 index 0000000000..de1c0d6edb --- /dev/null +++ b/src/Components/test/E2ETest/yarn.lock @@ -0,0 +1,575 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +ajv@^6.5.5: + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +async@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" + integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== + dependencies: + lodash "^4.17.11" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +bl@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.0.tgz#e1a574cdf528e4053019bb800b041c0ac88da493" + integrity sha512-wbgvOpqopSr7uq6fJrLH8EsvYMJf9gzfo2jCsL2eTy75qXPukA4pCgHamOQkZtY5vmfVtjB+P3LNlMHW5CEZXA== + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + +buffer-crc32@~0.2.3: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + dependencies: + delayed-stream "~1.0.0" + +commander@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +end-of-stream@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + dependencies: + once "^1.4.0" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fd-slicer@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" + integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= + dependencies: + pend "~1.2.0" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +inherits@^2.0.3, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +lodash@^4.17.11: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +mime-db@~1.38.0: + version "1.38.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad" + integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.22" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd" + integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog== + dependencies: + mime-db "~1.38.0" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +pend@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + +progress@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +psl@^1.1.24: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +readable-stream@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.1.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.2.0.tgz#de17f229864c120a9f56945756e4f32c4045245d" + integrity sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +request@2.88.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +selenium-standalone@^6.15.4: + version "6.15.6" + resolved "https://registry.yarnpkg.com/selenium-standalone/-/selenium-standalone-6.15.6.tgz#55cc610e405dd74e312c77f3ac7336795ca2cd0c" + integrity sha512-iQJbjJyGY4+n9voj+QIxkjEKmk9csPL91pxjqYyX5/1jjJDw7ce0ZuTnLeNaFmFdjY/nAwcoMRvqpDPmmmyr5A== + dependencies: + async "^2.6.2" + commander "^2.19.0" + cross-spawn "^6.0.5" + debug "^4.1.1" + lodash "^4.17.11" + minimist "^1.2.0" + mkdirp "^0.5.1" + progress "2.0.3" + request "2.88.0" + tar-stream "2.0.0" + urijs "^1.19.1" + which "^1.3.1" + yauzl "^2.10.0" + +semver@^5.5.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +tar-stream@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.0.0.tgz#8829bbf83067bc0288a9089db49c56be395b6aea" + integrity sha512-n2vtsWshZOVr/SY4KtslPoUlyNh06I2SGgAOCZmquCEjlbV/LjY2CY80rDtdQRHFOYXNlgBDo6Fr3ww2CWPOtA== + dependencies: + bl "^2.2.0" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +urijs@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/urijs/-/urijs-1.19.1.tgz#5b0ff530c0cbde8386f6342235ba5ca6e995d25a" + integrity sha512-xVrGVi94ueCJNrBSTjWqjvtgvl3cyOTThp2zaMaFNGp3F542TR6sM3f2o8RqZl+AwteClSVmoCyt0ka4RjQOQg== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +which@^1.2.9, which@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +yauzl@^2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" + integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= + dependencies: + buffer-crc32 "~0.2.3" + fd-slicer "~1.1.0" diff --git a/src/ProjectTemplates/ProjectTemplates.sln b/src/ProjectTemplates/ProjectTemplates.sln new file mode 100644 index 0000000000..5f0e44beda --- /dev/null +++ b/src/ProjectTemplates/ProjectTemplates.sln @@ -0,0 +1,101 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28627.84 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Web.ProjectTemplates", "Web.ProjectTemplates\Microsoft.DotNet.Web.ProjectTemplates.csproj", "{3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Web.Spa.ProjectTemplates", "Web.Spa.ProjectTemplates\Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj", "{96251C41-7953-46DC-B131-5A070640959A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Web.Client.ItemTemplates", "Web.Client.ItemTemplates\Microsoft.DotNet.Web.Client.ItemTemplates.csproj", "{92F0615B-4C8F-456C-86C0-39384BB7031E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Web.ItemTemplates", "Web.ItemTemplates\Microsoft.DotNet.Web.ItemTemplates.csproj", "{BC03F087-9B6F-4A66-9571-B0C5C204A101}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectTemplates.Tests", "test\ProjectTemplates.Tests.csproj", "{AF371A60-8A85-4ADF-BE44-0F2B94234DB1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A8E11D55-EC73-4B2B-87CE-277E6C9A8CB6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Debug|x64.ActiveCfg = Debug|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Debug|x64.Build.0 = Debug|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Debug|x86.ActiveCfg = Debug|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Debug|x86.Build.0 = Debug|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Release|Any CPU.Build.0 = Release|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Release|x64.ActiveCfg = Release|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Release|x64.Build.0 = Release|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Release|x86.ActiveCfg = Release|Any CPU + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5}.Release|x86.Build.0 = Release|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Debug|x64.ActiveCfg = Debug|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Debug|x64.Build.0 = Debug|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Debug|x86.ActiveCfg = Debug|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Debug|x86.Build.0 = Debug|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Release|Any CPU.Build.0 = Release|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Release|x64.ActiveCfg = Release|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Release|x64.Build.0 = Release|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Release|x86.ActiveCfg = Release|Any CPU + {96251C41-7953-46DC-B131-5A070640959A}.Release|x86.Build.0 = Release|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Debug|x64.ActiveCfg = Debug|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Debug|x64.Build.0 = Debug|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Debug|x86.ActiveCfg = Debug|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Debug|x86.Build.0 = Debug|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Release|Any CPU.Build.0 = Release|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Release|x64.ActiveCfg = Release|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Release|x64.Build.0 = Release|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Release|x86.ActiveCfg = Release|Any CPU + {92F0615B-4C8F-456C-86C0-39384BB7031E}.Release|x86.Build.0 = Release|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Debug|x64.ActiveCfg = Debug|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Debug|x64.Build.0 = Debug|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Debug|x86.ActiveCfg = Debug|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Debug|x86.Build.0 = Debug|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Release|Any CPU.Build.0 = Release|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Release|x64.ActiveCfg = Release|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Release|x64.Build.0 = Release|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Release|x86.ActiveCfg = Release|Any CPU + {BC03F087-9B6F-4A66-9571-B0C5C204A101}.Release|x86.Build.0 = Release|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Debug|x64.ActiveCfg = Debug|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Debug|x64.Build.0 = Debug|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Debug|x86.ActiveCfg = Debug|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Debug|x86.Build.0 = Debug|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Release|Any CPU.Build.0 = Release|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Release|x64.ActiveCfg = Release|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Release|x64.Build.0 = Release|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Release|x86.ActiveCfg = Release|Any CPU + {AF371A60-8A85-4ADF-BE44-0F2B94234DB1}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {3D3DE8B3-6B54-4CF4-82B0-718E0009A4E5} = {A8E11D55-EC73-4B2B-87CE-277E6C9A8CB6} + {96251C41-7953-46DC-B131-5A070640959A} = {A8E11D55-EC73-4B2B-87CE-277E6C9A8CB6} + {92F0615B-4C8F-456C-86C0-39384BB7031E} = {A8E11D55-EC73-4B2B-87CE-277E6C9A8CB6} + {BC03F087-9B6F-4A66-9571-B0C5C204A101} = {A8E11D55-EC73-4B2B-87CE-277E6C9A8CB6} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D2F122BA-928C-4179-B503-6744DB64BA13} + EndGlobalSection +EndGlobal diff --git a/src/ProjectTemplates/test/AssemblyInfo.AssemblyFixtures.cs b/src/ProjectTemplates/test/AssemblyInfo.AssemblyFixtures.cs new file mode 100644 index 0000000000..b14650ab24 --- /dev/null +++ b/src/ProjectTemplates/test/AssemblyInfo.AssemblyFixtures.cs @@ -0,0 +1,4 @@ +using Microsoft.AspNetCore.E2ETesting; +using ProjectTemplates.Tests.Helpers; + +[assembly: AssemblyFixture(typeof(ProjectFactoryFixture))] diff --git a/src/ProjectTemplates/test/BaselineTest.cs b/src/ProjectTemplates/test/BaselineTest.cs index 67562dec73..f06b3add1a 100644 --- a/src/ProjectTemplates/test/BaselineTest.cs +++ b/src/ProjectTemplates/test/BaselineTest.cs @@ -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 System; @@ -6,17 +6,21 @@ using System.IO; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using ProjectTemplates.Tests.Helpers; using Xunit; using Xunit.Abstractions; namespace Templates.Test { - public class BaselineTest : TemplateTestBase + public class BaselineTest { - public BaselineTest(ITestOutputHelper output) : base(output) + public BaselineTest(ProjectFactoryFixture projectFactory, ITestOutputHelper output) { + Project = projectFactory.CreateProject(output); } + public Project Project { get; set; } + public static TheoryData TemplateBaselines { get @@ -47,16 +51,16 @@ namespace Templates.Test [MemberData(nameof(TemplateBaselines))] public void Template_Produces_The_Right_Set_Of_Files(string arguments, string[] expectedFiles) { - RunDotNet(arguments); + Project.RunDotNet(arguments); foreach (var file in expectedFiles) { - AssertFileExists(file, shouldExist: true); + Project.AssertFileExists(file, shouldExist: true); } - var filesInFolder = Directory.EnumerateFiles(TemplateOutputDir, "*", SearchOption.AllDirectories); + var filesInFolder = Directory.EnumerateFiles(Project.TemplateOutputDir, "*", SearchOption.AllDirectories); foreach (var file in filesInFolder) { - var relativePath = file.Replace(TemplateOutputDir, "").Replace("\\", "/").Trim('/'); + var relativePath = file.Replace(Project.TemplateOutputDir, "").Replace("\\", "/").Trim('/'); if (relativePath.EndsWith(".csproj", StringComparison.Ordinal) || relativePath.EndsWith(".fsproj", StringComparison.Ordinal) || relativePath.EndsWith(".props", StringComparison.Ordinal) || diff --git a/src/ProjectTemplates/test/EmptyWebTemplateTest.cs b/src/ProjectTemplates/test/EmptyWebTemplateTest.cs index 9bb8cd5dcc..062b085149 100644 --- a/src/ProjectTemplates/test/EmptyWebTemplateTest.cs +++ b/src/ProjectTemplates/test/EmptyWebTemplateTest.cs @@ -1,26 +1,30 @@ -// 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.Testing.xunit; +using Microsoft.AspNetCore.E2ETesting; +using ProjectTemplates.Tests.Helpers; using Xunit; using Xunit.Abstractions; namespace Templates.Test { - public class EmptyWebTemplateTest : TemplateTestBase + public class EmptyWebTemplateTest { - public EmptyWebTemplateTest(ITestOutputHelper output) : base(output) + public EmptyWebTemplateTest(ProjectFactoryFixture projectFactory, ITestOutputHelper output) { + Project = projectFactory.CreateProject(output); } + public Project Project { get; } + [Fact] public void EmptyWebTemplate() { - RunDotNetNew("web"); + Project.RunDotNetNew("web"); foreach (var publish in new[] { false, true }) { - using (var aspNetProcess = StartAspNetProcess(publish)) + using (var aspNetProcess = Project.StartAspNetProcess(publish)) { aspNetProcess.AssertOk("/"); } diff --git a/src/ProjectTemplates/test/Helpers/TemplateTestBase.cs b/src/ProjectTemplates/test/Helpers/ProjectFactoryFixture.cs similarity index 72% rename from src/ProjectTemplates/test/Helpers/TemplateTestBase.cs rename to src/ProjectTemplates/test/Helpers/ProjectFactoryFixture.cs index 3aabb3efd0..69bbc342e9 100644 --- a/src/ProjectTemplates/test/Helpers/TemplateTestBase.cs +++ b/src/ProjectTemplates/test/Helpers/ProjectFactoryFixture.cs @@ -2,6 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Concurrent; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; @@ -11,33 +13,32 @@ using Templates.Test.Helpers; using Xunit; using Xunit.Abstractions; -namespace Templates.Test +namespace ProjectTemplates.Tests.Helpers { - public class TemplateTestBase : IDisposable + public class ProjectFactoryFixture : IDisposable { - private static readonly AsyncLocal _output = new AsyncLocal(); - private static object DotNetNewLock = new object(); - protected string ProjectName { get; set; } - protected string ProjectGuid { get; set; } - protected string TemplateOutputDir { get; set; } + private ConcurrentBag _projects = new ConcurrentBag(); - public static ITestOutputHelper Output => _output.Value; - - public TemplateTestBase(ITestOutputHelper output) + public Project CreateProject(ITestOutputHelper output) { - _output.Value = output; TemplatePackageInstaller.EnsureTemplatingEngineInitialized(output); + var project = new Project + { + DotNetNewLock = DotNetNewLock, + Output = output, + ProjectGuid = Guid.NewGuid().ToString("N").Substring(0, 6) + }; + project.ProjectName = $"AspNet.Template.{project.ProjectGuid}"; - ProjectGuid = Guid.NewGuid().ToString("N").Substring(0, 6); - ProjectName = $"AspNet.Template.{ProjectGuid}"; + _projects.Add(project); var assemblyPath = GetType().GetTypeInfo().Assembly.CodeBase; var assemblyUri = new Uri(assemblyPath, UriKind.Absolute); var basePath = Path.GetDirectoryName(assemblyUri.LocalPath); - TemplateOutputDir = Path.Combine(basePath, "TestTemplates", ProjectName); - Directory.CreateDirectory(TemplateOutputDir); + project.TemplateOutputDir = Path.Combine(basePath, "TestTemplates", project.ProjectName); + Directory.CreateDirectory(project.TemplateOutputDir); // We don't want any of the host repo's build config interfering with // how the test project is built, so disconnect it from the @@ -48,7 +49,7 @@ namespace Templates.Test $@" "; - File.WriteAllText(Path.Combine(TemplateOutputDir, "Directory.Build.props"), directoryBuildPropsContent); + File.WriteAllText(Path.Combine(project.TemplateOutputDir, "Directory.Build.props"), directoryBuildPropsContent); // TODO: remove this once we get a newer version of the SDK which supports an implicit FrameworkReference // cref https://github.com/aspnet/websdk/issues/424 @@ -57,10 +58,42 @@ $@" "; - File.WriteAllText(Path.Combine(TemplateOutputDir, "Directory.Build.targets"), directoryBuildTargetsContent); + File.WriteAllText(Path.Combine(project.TemplateOutputDir, "Directory.Build.targets"), directoryBuildTargetsContent); + + return project; } - protected void RunDotNetNew(string templateName, string auth = null, string language = null, bool useLocalDB = false, bool noHttps = false) + public void Dispose() + { + var list = new List(); + foreach (var project in _projects) + { + try + { + project.Dispose(); + } + catch(Exception e) + { + list.Add(e); + } + } + + if (list.Count > 0) + { + throw new AggregateException(list); + } + } + } + + public class Project + { + public string ProjectName { get; set; } + public string ProjectGuid { get; set; } + public string TemplateOutputDir { get; set; } + public ITestOutputHelper Output { get; set; } + public object DotNetNewLock { get; set; } + + public void RunDotNetNew(string templateName, string auth = null, string language = null, bool useLocalDB = false, bool noHttps = false) { var args = $"new {templateName} --debug:custom-hive \"{TemplatePackageInstaller.CustomHivePath}\""; @@ -92,7 +125,7 @@ $@" } } - protected void RunDotNet(string arguments) + public void RunDotNet(string arguments) { lock (DotNetNewLock) { @@ -100,9 +133,9 @@ $@" } } - protected void RunDotNetEfCreateMigration(string migrationName) + public void RunDotNetEfCreateMigration(string migrationName) { - var assembly = typeof(TemplateTestBase).Assembly; + var assembly = typeof(ProjectFactoryFixture).Assembly; var dotNetEfFullPath = assembly.GetCustomAttributes() .First(attribute => attribute.Key == "DotNetEfFullPath") @@ -118,7 +151,7 @@ $@" } } - protected void AssertDirectoryExists(string path, bool shouldExist) + public void AssertDirectoryExists(string path, bool shouldExist) { var fullPath = Path.Combine(TemplateOutputDir, path); var doesExist = Directory.Exists(fullPath); @@ -134,7 +167,7 @@ $@" } // If this fails, you should generate new migrations via migrations/updateMigrations.cmd - protected void AssertEmptyMigration(string migration) + public void AssertEmptyMigration(string migration) { var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); var file = Directory.EnumerateFiles(fullPath).Where(f => f.EndsWith($"{migration}.cs")).FirstOrDefault(); @@ -161,7 +194,7 @@ $@" return str.Replace("\n", string.Empty).Replace("\r", string.Empty); } - protected void AssertFileExists(string path, bool shouldExist) + public void AssertFileExists(string path, bool shouldExist) { var fullPath = Path.Combine(TemplateOutputDir, path); var doesExist = File.Exists(fullPath); @@ -176,13 +209,13 @@ $@" } } - protected string ReadFile(string path) + public string ReadFile(string path) { AssertFileExists(path, shouldExist: true); return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); } - protected AspNetProcess StartAspNetProcess(bool publish = false) + public AspNetProcess StartAspNetProcess(bool publish = false) { return new AspNetProcess(Output, TemplateOutputDir, ProjectName, publish); } @@ -192,7 +225,7 @@ $@" DeleteOutputDirectory(); } - private void DeleteOutputDirectory() + public void DeleteOutputDirectory() { const int NumAttempts = 10; diff --git a/src/ProjectTemplates/test/Helpers/WebDriverFactory.cs b/src/ProjectTemplates/test/Helpers/WebDriverFactory.cs index 891da0e771..c6f3b45f6a 100644 --- a/src/ProjectTemplates/test/Helpers/WebDriverFactory.cs +++ b/src/ProjectTemplates/test/Helpers/WebDriverFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.InteropServices; using System.Text.RegularExpressions; @@ -11,29 +11,5 @@ namespace Templates.Test.Helpers // Providing a smaller value won't improve the speed of the tests in any // significant way and will make them more prone to fail on slower drivers. internal const int DefaultMaxWaitTimeInSeconds = 10; - - public static bool HostSupportsBrowserAutomation - => string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("ASPNETCORE_BROWSER_AUTOMATION_DISABLED")) && - (IsAppVeyor || (IsVSTS && RuntimeInformation.OSDescription.Contains("Microsoft Windows")) || OSSupportsEdge()); - - private static bool IsAppVeyor - => Environment.GetEnvironmentVariables().Contains("APPVEYOR"); - - private static bool IsVSTS - => Environment.GetEnvironmentVariables().Contains("TF_BUILD"); - - private static int GetWindowsVersion() - { - var osDescription = RuntimeInformation.OSDescription; - var windowsVersion = Regex.Match(osDescription, "^Microsoft Windows (\\d+)\\..*"); - return windowsVersion.Success ? int.Parse(windowsVersion.Groups[1].Value) : -1; - } - - private static bool OSSupportsEdge() - { - var windowsVersion = GetWindowsVersion(); - return (windowsVersion >= 10 && windowsVersion < 2000) - || (windowsVersion >= 2016); - } } } diff --git a/src/ProjectTemplates/test/Infrastructure/AssemblyFixtureAttribute.cs b/src/ProjectTemplates/test/Infrastructure/AssemblyFixtureAttribute.cs deleted file mode 100644 index 20419ad3c4..0000000000 --- a/src/ProjectTemplates/test/Infrastructure/AssemblyFixtureAttribute.cs +++ /dev/null @@ -1,14 +0,0 @@ -// 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; - -[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] -public class AssemblyFixtureAttribute : Attribute -{ - public AssemblyFixtureAttribute(Type fixtureType) - { - FixtureType = fixtureType; - } - public Type FixtureType { get; private set; } -} diff --git a/src/ProjectTemplates/test/Infrastructure/BrowserFixture.cs b/src/ProjectTemplates/test/Infrastructure/BrowserFixture.cs deleted file mode 100644 index 0c8e49cbc0..0000000000 --- a/src/ProjectTemplates/test/Infrastructure/BrowserFixture.cs +++ /dev/null @@ -1,67 +0,0 @@ -// 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 Templates.Test.Helpers; -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; -using OpenQA.Selenium.Remote; -using Xunit.Abstractions; - -namespace Templates.Test.Infrastructure -{ - public class BrowserFixture : IDisposable - { - public IWebDriver Browser { get; } - - public ILogs Logs { get; } - - public ITestOutputHelper Output { get; set; } - - public BrowserFixture() - { - if(WebDriverFactory.HostSupportsBrowserAutomation) - { - var opts = new ChromeOptions(); - opts.AcceptInsecureCertificates = true; - - // Comment this out if you want to watch or interact with the browser (e.g., for debugging) - opts.AddArgument("--headless"); - - // Log errors - opts.SetLoggingPreference(LogType.Browser, LogLevel.All); - - // On Windows/Linux, we don't need to set opts.BinaryLocation - // But for Travis Mac builds we do - var binaryLocation = Environment.GetEnvironmentVariable("TEST_CHROME_BINARY"); - if (!string.IsNullOrEmpty(binaryLocation)) - { - opts.BinaryLocation = binaryLocation; - Console.WriteLine($"Set {nameof(ChromeOptions)}.{nameof(opts.BinaryLocation)} to {binaryLocation}"); - } - - try - { - var driver = new RemoteWebDriver(opts); - Browser = driver; - Logs = new RemoteLogs(driver); - } - catch (WebDriverException ex) - { - var message = - "Failed to connect to the web driver. Please see the readme and follow the instructions to install selenium." + - "Remember to start the web driver with `selenium-standalone start` before running the end-to-end tests."; - throw new InvalidOperationException(message, ex); - } - } - } - - public void Dispose() - { - if(Browser != null) - { - Browser.Dispose(); - } - } - } -} diff --git a/src/ProjectTemplates/test/Infrastructure/BrowserTestBase.cs b/src/ProjectTemplates/test/Infrastructure/BrowserTestBase.cs deleted file mode 100644 index dd0be82086..0000000000 --- a/src/ProjectTemplates/test/Infrastructure/BrowserTestBase.cs +++ /dev/null @@ -1,27 +0,0 @@ -// 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.Threading; -using OpenQA.Selenium; -using Xunit; -using Xunit.Abstractions; - -namespace Templates.Test.Infrastructure -{ - [CaptureSeleniumLogs] - public class BrowserTestBase : TemplateTestBase, IClassFixture - { - private static readonly AsyncLocal _browser = new AsyncLocal(); - private static readonly AsyncLocal _logs = new AsyncLocal(); - - public static IWebDriver Browser => _browser.Value; - - public static ILogs Logs => _logs.Value; - - public BrowserTestBase(BrowserFixture browserFixture, ITestOutputHelper output) : base(output) - { - _browser.Value = browserFixture.Browser; - _logs.Value = browserFixture.Logs; - } - } -} diff --git a/src/ProjectTemplates/test/Infrastructure/SeleniumServerFixture.cs b/src/ProjectTemplates/test/Infrastructure/SeleniumServerFixture.cs deleted file mode 100644 index c26052b1c7..0000000000 --- a/src/ProjectTemplates/test/Infrastructure/SeleniumServerFixture.cs +++ /dev/null @@ -1,103 +0,0 @@ -// 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.Internal; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using Templates.Test.Helpers; - -namespace Templates.Test.Infrastructure -{ - public class SeleniumServerFixture : IDisposable - { - private string _workingDirectory; - private Process _serverProcess; - private static readonly object _serverLock = new object(); - private const int ProcessTimeoutMilliseconds = 30 * 1000; - - public SeleniumServerFixture() - { - _workingDirectory = Directory.GetCurrentDirectory(); - StartSeleniumStandaloneServer(); - } - - public void Dispose() - { - if(_serverProcess != null) - { - _serverProcess.KillTree(); - _serverProcess.Dispose(); - } - } - - public void StartSeleniumStandaloneServer() - { - if (WebDriverFactory.HostSupportsBrowserAutomation) - { - lock (_serverLock) - { - // We have to make node_modules in this folder so that it doesn't go hunting higher up the tree - RunViaShell(_workingDirectory, "mkdir node_modules").WaitForExit(); - var npmInstallProcess = RunViaShell(_workingDirectory, $"npm install --prefix {_workingDirectory} selenium-standalone@6.15.1"); - npmInstallProcess.WaitForExit(); - - if (npmInstallProcess.ExitCode != 0) - { - var output = npmInstallProcess.StandardOutput.ReadToEnd(); - var error = npmInstallProcess.StandardError.ReadToEnd(); - throw new Exception($"Npm install exited with code {npmInstallProcess.ExitCode}\nStdErr: {error}\nStdOut: {output}"); - } - npmInstallProcess.KillTree(); - npmInstallProcess.Dispose(); - } - lock (_serverLock) - { - var seleniumInstallProcess = RunViaShell(_workingDirectory, "npx selenium-standalone install"); - seleniumInstallProcess.WaitForExit(ProcessTimeoutMilliseconds); - if (seleniumInstallProcess.ExitCode != 0) - { - var output = seleniumInstallProcess.StandardOutput.ReadToEnd(); - var error = seleniumInstallProcess.StandardError.ReadToEnd(); - throw new Exception($"selenium install exited with code {seleniumInstallProcess.ExitCode}\nStdErr: {error}\nStdOut: {output}"); - } - seleniumInstallProcess.KillTree(); - seleniumInstallProcess.Dispose(); - } - - // Starts a process that runs the selenium server - _serverProcess = RunViaShell(_workingDirectory, "npx selenium-standalone start"); - string line = ""; - while (line != null && !line.StartsWith("Selenium started") && !_serverProcess.StandardOutput.EndOfStream) - { - line = _serverProcess.StandardOutput.ReadLine(); - } - } - } - - private static Process RunViaShell(string workingDirectory, string commandAndArgs) - { - var (shellExe, argsPrefix) = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) - ? ("cmd", "/c") - : ("bash", "-c"); - - return Run(workingDirectory, shellExe, $"{argsPrefix} \"{commandAndArgs}\""); - } - - private static Process Run(string workingDirectory, string command, string args = null, IDictionary envVars = null) - { - var startInfo = new ProcessStartInfo(command, args) - { - UseShellExecute = false, - CreateNoWindow = true, - WorkingDirectory = workingDirectory, - RedirectStandardOutput = true, - RedirectStandardError = true - }; - - return Process.Start(startInfo); - } - } -} diff --git a/src/ProjectTemplates/test/MvcTemplateTest.cs b/src/ProjectTemplates/test/MvcTemplateTest.cs index 97ac398c52..88a0519773 100644 --- a/src/ProjectTemplates/test/MvcTemplateTest.cs +++ b/src/ProjectTemplates/test/MvcTemplateTest.cs @@ -1,32 +1,35 @@ -// 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.Testing.xunit; +using ProjectTemplates.Tests.Helpers; using Xunit; using Xunit.Abstractions; namespace Templates.Test { - public class MvcTemplateTest : TemplateTestBase + public class MvcTemplateTest { - public MvcTemplateTest(ITestOutputHelper output) : base(output) + public MvcTemplateTest(ProjectFactoryFixture projectFactory, ITestOutputHelper output) { + Project = projectFactory.CreateProject(output); } + public Project Project { get; } + [Theory] [InlineData(null)] [InlineData("F#", Skip = "https://github.com/aspnet/Templating/issues/673")] private void MvcTemplate_NoAuthImpl(string languageOverride) { - RunDotNetNew("mvc", language: languageOverride); + Project.RunDotNetNew("mvc", language: languageOverride); - AssertDirectoryExists("Areas", false); - AssertDirectoryExists("Extensions", false); - AssertFileExists("urlRewrite.config", false); - AssertFileExists("Controllers/AccountController.cs", false); + Project.AssertDirectoryExists("Areas", false); + Project.AssertDirectoryExists("Extensions", false); + Project.AssertFileExists("urlRewrite.config", false); + Project.AssertFileExists("Controllers/AccountController.cs", false); var projectExtension = languageOverride == "F#" ? "fsproj" : "csproj"; - var projectFileContents = ReadFile($"{ProjectName}.{projectExtension}"); + var projectFileContents = Project.ReadFile($"{Project.ProjectName}.{projectExtension}"); Assert.DoesNotContain(".db", projectFileContents); Assert.DoesNotContain("Microsoft.EntityFrameworkCore.Tools", projectFileContents); Assert.DoesNotContain("Microsoft.VisualStudio.Web.CodeGeneration.Design", projectFileContents); @@ -35,7 +38,7 @@ namespace Templates.Test foreach (var publish in new[] { false, true }) { - using (var aspNetProcess = StartAspNetProcess(publish)) + using (var aspNetProcess = Project.StartAspNetProcess(publish)) { aspNetProcess.AssertOk("/"); aspNetProcess.AssertOk("/Home/Privacy"); @@ -48,25 +51,25 @@ namespace Templates.Test [InlineData(false)] public void MvcTemplate_IndividualAuthImpl(bool useLocalDB) { - RunDotNetNew("mvc", auth: "Individual", useLocalDB: useLocalDB); + Project.RunDotNetNew("mvc", auth: "Individual", useLocalDB: useLocalDB); - AssertDirectoryExists("Extensions", false); - AssertFileExists("urlRewrite.config", false); - AssertFileExists("Controllers/AccountController.cs", false); + Project.AssertDirectoryExists("Extensions", false); + Project.AssertFileExists("urlRewrite.config", false); + Project.AssertFileExists("Controllers/AccountController.cs", false); - var projectFileContents = ReadFile($"{ProjectName}.csproj"); + var projectFileContents = Project.ReadFile($"{Project.ProjectName}.csproj"); if (!useLocalDB) { Assert.Contains(".db", projectFileContents); } - RunDotNetEfCreateMigration("mvc"); + Project.RunDotNetEfCreateMigration("mvc"); - AssertEmptyMigration("mvc"); + Project.AssertEmptyMigration("mvc"); foreach (var publish in new[] { false, true }) { - using (var aspNetProcess = StartAspNetProcess(publish)) + using (var aspNetProcess = Project.StartAspNetProcess(publish)) { aspNetProcess.AssertOk("/"); aspNetProcess.AssertOk("/Home/Privacy"); diff --git a/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj b/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj index 2b6dbd8473..d1b3dc11c0 100644 --- a/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj +++ b/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj @@ -1,12 +1,14 @@  + + + + netcoreapp3.0 + ProjectTemplates.E2ETests $(DefineConstants);XPLAT - - false - - true + true true false @@ -14,16 +16,13 @@ - - + + - - - @@ -50,4 +49,7 @@ + + + diff --git a/src/ProjectTemplates/test/RazorComponentsTemplateTest.cs b/src/ProjectTemplates/test/RazorComponentsTemplateTest.cs index 21139881f1..f52fff5645 100644 --- a/src/ProjectTemplates/test/RazorComponentsTemplateTest.cs +++ b/src/ProjectTemplates/test/RazorComponentsTemplateTest.cs @@ -1,12 +1,14 @@ // 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.E2ETesting; using Microsoft.Extensions.CommandLineUtils; using OpenQA.Selenium; +using ProjectTemplates.Tests.Helpers; using System.IO; using System.Net; +using System.Threading; using Templates.Test.Helpers; -using Templates.Test.Infrastructure; using Xunit; using Xunit.Abstractions; @@ -14,25 +16,28 @@ namespace Templates.Test { public class RazorComponentsTemplateTest : BrowserTestBase { - public RazorComponentsTemplateTest(BrowserFixture browserFixture, ITestOutputHelper output) : base(browserFixture, output) + public RazorComponentsTemplateTest(ProjectFactoryFixture projectFactory, BrowserFixture browserFixture, ITestOutputHelper output) : base(browserFixture, output) { + Project = projectFactory.CreateProject(output); } - [Fact] + public Project Project { get; } + + [Fact(Skip = "https://github.com/aspnet/AspNetCore/issues/8244")] public void RazorComponentsTemplateWorks() { - RunDotNetNew("razorcomponents"); + Project.RunDotNetNew("razorcomponents"); TestApplication(publish: false); TestApplication(publish: true); } private void TestApplication(bool publish) { - using (var aspNetProcess = StartAspNetProcess(publish)) + using (var aspNetProcess = Project.StartAspNetProcess(publish)) { aspNetProcess.AssertStatusCode("/", HttpStatusCode.OK, "text/html"); - if (WebDriverFactory.HostSupportsBrowserAutomation) + if (BrowserFixture.IsHostAutomationSupported()) { aspNetProcess.VisitInBrowser(Browser); TestBasicNavigation(); @@ -42,9 +47,12 @@ namespace Templates.Test private void TestBasicNavigation() { + // Give components.server enough time to load so that it can replace + // the prerendered content before we start making assertions. + Thread.Sleep(5000); Browser.WaitForElement("ul"); // element gets project ID injected into it during template execution - Assert.Contains(ProjectGuid, Browser.Title); + Assert.Contains(Project.ProjectGuid, Browser.Title); // Initially displays the home page Assert.Equal("Hello, world!", Browser.GetText("h1")); @@ -59,7 +67,7 @@ namespace Templates.Test var counterDisplay = Browser.FindElement("h1 + p"); Assert.Equal("Current count: 0", counterDisplay.Text); Browser.Click(counterComponent, "button"); - Assert.Equal("Current count: 1", counterDisplay.Text); + WaitAssert.Equal("Current count: 1", () => Browser.FindElement("h1+p").Text); // Can navigate to the 'fetch data' page Browser.Click(By.PartialLinkText("Fetch data")); diff --git a/src/ProjectTemplates/test/RazorPagesTemplateTest.cs b/src/ProjectTemplates/test/RazorPagesTemplateTest.cs index abb3357be0..950db88321 100644 --- a/src/ProjectTemplates/test/RazorPagesTemplateTest.cs +++ b/src/ProjectTemplates/test/RazorPagesTemplateTest.cs @@ -1,26 +1,30 @@ -// 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.Testing.xunit; +using ProjectTemplates.Tests.Helpers; using Xunit; using Xunit.Abstractions; namespace Templates.Test { - public class RazorPagesTemplateTest : TemplateTestBase + public class RazorPagesTemplateTest { - public RazorPagesTemplateTest(ITestOutputHelper output) : base(output) + public RazorPagesTemplateTest(ProjectFactoryFixture projectFactory, ITestOutputHelper output) { + Project = projectFactory.CreateProject(output); } + public Project Project { get; } + [Fact] private void RazorPagesTemplate_NoAuthImpl() { - RunDotNetNew("razor"); + Project.RunDotNetNew("razor"); - AssertFileExists("Pages/Shared/_LoginPartial.cshtml", false); + Project.AssertFileExists("Pages/Shared/_LoginPartial.cshtml", false); - var projectFileContents = ReadFile($"{ProjectName}.csproj"); + var projectFileContents = Project.ReadFile($"{Project.ProjectName}.csproj"); Assert.DoesNotContain(".db", projectFileContents); Assert.DoesNotContain("Microsoft.EntityFrameworkCore.Tools", projectFileContents); Assert.DoesNotContain("Microsoft.VisualStudio.Web.CodeGeneration.Design", projectFileContents); @@ -29,7 +33,7 @@ namespace Templates.Test foreach (var publish in new[] { false, true }) { - using (var aspNetProcess = StartAspNetProcess(publish)) + using (var aspNetProcess = Project.StartAspNetProcess(publish)) { aspNetProcess.AssertOk("/"); aspNetProcess.AssertOk("/Privacy"); @@ -42,23 +46,23 @@ namespace Templates.Test [InlineData(true)] public void RazorPagesTemplate_IndividualAuthImpl( bool useLocalDB) { - RunDotNetNew("razor", auth: "Individual", useLocalDB: useLocalDB); + Project.RunDotNetNew("razor", auth: "Individual", useLocalDB: useLocalDB); - AssertFileExists("Pages/Shared/_LoginPartial.cshtml", true); + Project.AssertFileExists("Pages/Shared/_LoginPartial.cshtml", true); - var projectFileContents = ReadFile($"{ProjectName}.csproj"); + var projectFileContents = Project.ReadFile($"{Project.ProjectName}.csproj"); if (!useLocalDB) { Assert.Contains(".db", projectFileContents); } - RunDotNetEfCreateMigration("razorpages"); + Project.RunDotNetEfCreateMigration("razorpages"); - AssertEmptyMigration("razorpages"); + Project.AssertEmptyMigration("razorpages"); foreach (var publish in new[] { false, true }) { - using (var aspNetProcess = StartAspNetProcess(publish)) + using (var aspNetProcess = Project.StartAspNetProcess(publish)) { aspNetProcess.AssertOk("/"); aspNetProcess.AssertOk("/Privacy"); diff --git a/src/ProjectTemplates/test/SpaTemplateTest/AngularTemplateTest.cs b/src/ProjectTemplates/test/SpaTemplateTest/AngularTemplateTest.cs index e034670e86..0cb22521a2 100644 --- a/src/ProjectTemplates/test/SpaTemplateTest/AngularTemplateTest.cs +++ b/src/ProjectTemplates/test/SpaTemplateTest/AngularTemplateTest.cs @@ -1,19 +1,17 @@ -// 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.Testing.xunit; -using Templates.Test.Infrastructure; +using Microsoft.AspNetCore.E2ETesting; +using ProjectTemplates.Tests.Helpers; using Xunit; using Xunit.Abstractions; -[assembly: AssemblyFixture(typeof(SeleniumServerFixture))] namespace Templates.Test.SpaTemplateTest { public class AngularTemplateTest : SpaTemplateTestBase { - public AngularTemplateTest(BrowserFixture browserFixture, ITestOutputHelper output) : base(browserFixture, output) - { - } + public AngularTemplateTest(ProjectFactoryFixture projectFactory, BrowserFixture browserFixture, ITestOutputHelper output) + : base(projectFactory, browserFixture, output) { } [Fact(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/1854")] public void AngularTemplate_Works() diff --git a/src/ProjectTemplates/test/SpaTemplateTest/ReactReduxTemplateTest.cs b/src/ProjectTemplates/test/SpaTemplateTest/ReactReduxTemplateTest.cs index f904f1af02..470e00c3f6 100644 --- a/src/ProjectTemplates/test/SpaTemplateTest/ReactReduxTemplateTest.cs +++ b/src/ProjectTemplates/test/SpaTemplateTest/ReactReduxTemplateTest.cs @@ -1,16 +1,17 @@ // 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 Templates.Test.Infrastructure; +using Microsoft.AspNetCore.E2ETesting; +using ProjectTemplates.Tests.Helpers; using Xunit; using Xunit.Abstractions; -[assembly: AssemblyFixture(typeof(SeleniumServerFixture))] namespace Templates.Test.SpaTemplateTest { public class ReactReduxTemplateTest : SpaTemplateTestBase { - public ReactReduxTemplateTest(BrowserFixture browserFixture, ITestOutputHelper output) : base(browserFixture, output) + public ReactReduxTemplateTest(ProjectFactoryFixture projectFactory, BrowserFixture browserFixture, ITestOutputHelper output) + : base(projectFactory, browserFixture, output) { } diff --git a/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs b/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs index 5e7c046701..54967702a7 100644 --- a/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs +++ b/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs @@ -1,16 +1,17 @@ // 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 Templates.Test.Infrastructure; +using Microsoft.AspNetCore.E2ETesting; +using ProjectTemplates.Tests.Helpers; using Xunit; using Xunit.Abstractions; -[assembly: AssemblyFixture(typeof(SeleniumServerFixture))] namespace Templates.Test.SpaTemplateTest { public class ReactTemplateTest : SpaTemplateTestBase { - public ReactTemplateTest(BrowserFixture browserFixture, ITestOutputHelper output) : base(browserFixture, output) + public ReactTemplateTest(ProjectFactoryFixture projectFactory, BrowserFixture browserFixture, ITestOutputHelper output) + : base(projectFactory, browserFixture, output) { } diff --git a/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs b/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs index 6d21ddacd9..f8d9164805 100644 --- a/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs +++ b/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs @@ -1,11 +1,12 @@ -// 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.E2ETesting; using OpenQA.Selenium; +using ProjectTemplates.Tests.Helpers; using System.IO; using System.Net; using Templates.Test.Helpers; -using Templates.Test.Infrastructure; using Xunit; using Xunit.Abstractions; @@ -13,21 +14,25 @@ using Xunit.Abstractions; #if EDGE [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] #endif -[assembly: TestFramework("Templates.Test.Helpers.XunitExtensions.XunitTestFrameworkWithAssemblyFixture", "Templates.Test")] +[assembly: TestFramework("Microsoft.AspNetCore.E2ETesting.XunitTestFrameworkWithAssemblyFixture", "ProjectTemplates.Tests")] namespace Templates.Test.SpaTemplateTest { public class SpaTemplateTestBase : BrowserTestBase { - public SpaTemplateTestBase(BrowserFixture browserFixture, ITestOutputHelper output) : base(browserFixture, output) + public SpaTemplateTestBase( + ProjectFactoryFixture projectFactory, BrowserFixture browserFixture, ITestOutputHelper output) : base(browserFixture, output) { + Project = projectFactory.CreateProject(output); } + public Project Project { get; } + // Rather than using [Theory] to pass each of the different values for 'template', // it's important to distribute the SPA template tests over different test classes // so they can be run in parallel. Xunit doesn't parallelize within a test class. protected void SpaTemplateImpl(string template, bool noHttps = false) { - RunDotNetNew(template, noHttps: noHttps); + Project.RunDotNetNew(template, noHttps: noHttps); // For some SPA templates, the NPM root directory is './ClientApp'. In other // templates it's at the project root. Strictly speaking we shouldn't have @@ -35,7 +40,7 @@ namespace Templates.Test.SpaTemplateTest // build time, but by doing it up front we can avoid having multiple NPM // installs run concurrently which otherwise causes errors when tests run // in parallel. - var clientAppSubdirPath = Path.Combine(TemplateOutputDir, "ClientApp"); + var clientAppSubdirPath = Path.Combine(Project.TemplateOutputDir, "ClientApp"); Assert.True(File.Exists(Path.Combine(clientAppSubdirPath, "package.json")), "Missing a package.json"); Npm.RestoreWithRetry(Output, clientAppSubdirPath); @@ -47,11 +52,11 @@ namespace Templates.Test.SpaTemplateTest private void TestApplication(bool publish) { - using (var aspNetProcess = StartAspNetProcess(publish)) + using (var aspNetProcess = Project.StartAspNetProcess(publish)) { aspNetProcess.AssertStatusCode("/", HttpStatusCode.OK, "text/html"); - if (WebDriverFactory.HostSupportsBrowserAutomation) + if (BrowserFixture.IsHostAutomationSupported()) { aspNetProcess.VisitInBrowser(Browser); TestBasicNavigation(); @@ -63,7 +68,7 @@ namespace Templates.Test.SpaTemplateTest { Browser.WaitForElement("ul"); // <title> element gets project ID injected into it during template execution - Assert.Contains(ProjectGuid, Browser.Title); + Assert.Contains(Project.ProjectGuid, Browser.Title); // Initially displays the home page Assert.Equal("Hello, world!", Browser.GetText("h1")); diff --git a/src/ProjectTemplates/test/WebApiTemplateTest.cs b/src/ProjectTemplates/test/WebApiTemplateTest.cs index 06c6ba58b4..93c8dc6890 100644 --- a/src/ProjectTemplates/test/WebApiTemplateTest.cs +++ b/src/ProjectTemplates/test/WebApiTemplateTest.cs @@ -1,25 +1,29 @@ -// 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 ProjectTemplates.Tests.Helpers; using Xunit; using Xunit.Abstractions; namespace Templates.Test { - public class WebApiTemplateTest : TemplateTestBase + public class WebApiTemplateTest { - public WebApiTemplateTest(ITestOutputHelper output) : base(output) + public WebApiTemplateTest(ProjectFactoryFixture factoryFixture, ITestOutputHelper output) { + Project = factoryFixture.CreateProject(output); } + public Project Project { get; } + [Fact] public void WebApiTemplate() { - RunDotNetNew("webapi"); + Project.RunDotNetNew("webapi"); foreach (var publish in new[] { false, true }) { - using (var aspNetProcess = StartAspNetProcess(publish)) + using (var aspNetProcess = Project.StartAspNetProcess(publish)) { aspNetProcess.AssertOk("/api/values"); aspNetProcess.AssertNotFound("/"); diff --git a/src/ProjectTemplates/test/package.json b/src/ProjectTemplates/test/package.json new file mode 100644 index 0000000000..3a1ea190f6 --- /dev/null +++ b/src/ProjectTemplates/test/package.json @@ -0,0 +1,16 @@ +{ + "name": "microsoft.aspnetcore.projecttemplates.tests", + "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" + }, + "author": "", + "license": "Apache-2.0", + "dependencies": { + "selenium-standalone": "^6.15.4" + } +} diff --git a/src/ProjectTemplates/test/yarn.lock b/src/ProjectTemplates/test/yarn.lock new file mode 100644 index 0000000000..de1c0d6edb --- /dev/null +++ b/src/ProjectTemplates/test/yarn.lock @@ -0,0 +1,575 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +ajv@^6.5.5: + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +async@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" + integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== + dependencies: + lodash "^4.17.11" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +bl@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.0.tgz#e1a574cdf528e4053019bb800b041c0ac88da493" + integrity sha512-wbgvOpqopSr7uq6fJrLH8EsvYMJf9gzfo2jCsL2eTy75qXPukA4pCgHamOQkZtY5vmfVtjB+P3LNlMHW5CEZXA== + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + +buffer-crc32@~0.2.3: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + dependencies: + delayed-stream "~1.0.0" + +commander@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +end-of-stream@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + dependencies: + once "^1.4.0" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fd-slicer@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" + integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= + dependencies: + pend "~1.2.0" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +inherits@^2.0.3, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +lodash@^4.17.11: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +mime-db@~1.38.0: + version "1.38.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad" + integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.22" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd" + integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog== + dependencies: + mime-db "~1.38.0" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +pend@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + +progress@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +psl@^1.1.24: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +readable-stream@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.1.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.2.0.tgz#de17f229864c120a9f56945756e4f32c4045245d" + integrity sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +request@2.88.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +selenium-standalone@^6.15.4: + version "6.15.6" + resolved "https://registry.yarnpkg.com/selenium-standalone/-/selenium-standalone-6.15.6.tgz#55cc610e405dd74e312c77f3ac7336795ca2cd0c" + integrity sha512-iQJbjJyGY4+n9voj+QIxkjEKmk9csPL91pxjqYyX5/1jjJDw7ce0ZuTnLeNaFmFdjY/nAwcoMRvqpDPmmmyr5A== + dependencies: + async "^2.6.2" + commander "^2.19.0" + cross-spawn "^6.0.5" + debug "^4.1.1" + lodash "^4.17.11" + minimist "^1.2.0" + mkdirp "^0.5.1" + progress "2.0.3" + request "2.88.0" + tar-stream "2.0.0" + urijs "^1.19.1" + which "^1.3.1" + yauzl "^2.10.0" + +semver@^5.5.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +tar-stream@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.0.0.tgz#8829bbf83067bc0288a9089db49c56be395b6aea" + integrity sha512-n2vtsWshZOVr/SY4KtslPoUlyNh06I2SGgAOCZmquCEjlbV/LjY2CY80rDtdQRHFOYXNlgBDo6Fr3ww2CWPOtA== + dependencies: + bl "^2.2.0" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +urijs@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/urijs/-/urijs-1.19.1.tgz#5b0ff530c0cbde8386f6342235ba5ca6e995d25a" + integrity sha512-xVrGVi94ueCJNrBSTjWqjvtgvl3cyOTThp2zaMaFNGp3F542TR6sM3f2o8RqZl+AwteClSVmoCyt0ka4RjQOQg== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +which@^1.2.9, which@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +yauzl@^2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" + integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= + dependencies: + buffer-crc32 "~0.2.3" + fd-slicer "~1.1.0" diff --git a/src/Shared/E2ETesting/BrowserFixture.cs b/src/Shared/E2ETesting/BrowserFixture.cs new file mode 100644 index 0000000000..139a844956 --- /dev/null +++ b/src/Shared/E2ETesting/BrowserFixture.cs @@ -0,0 +1,88 @@ +// 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.Reflection; +using OpenQA.Selenium; +using OpenQA.Selenium.Chrome; +using OpenQA.Selenium.Remote; +using Xunit.Abstractions; +using Xunit.Sdk; + +namespace Microsoft.AspNetCore.E2ETesting +{ + public class BrowserFixture : IDisposable + { + public BrowserFixture(IMessageSink diagnosticsMessageSink) + { + DiagnosticsMessageSink = diagnosticsMessageSink; + + if (!IsHostAutomationSupported()) + { + DiagnosticsMessageSink.OnMessage(new DiagnosticMessage("Host does not support browser automation.")); + return; + } + + var opts = new ChromeOptions(); + + // Comment this out if you want to watch or interact with the browser (e.g., for debugging) + opts.AddArgument("--headless"); + + // Log errors + opts.SetLoggingPreference(LogType.Browser, LogLevel.All); + + // On Windows/Linux, we don't need to set opts.BinaryLocation + // But for Travis Mac builds we do + var binaryLocation = Environment.GetEnvironmentVariable("TEST_CHROME_BINARY"); + if (!string.IsNullOrEmpty(binaryLocation)) + { + opts.BinaryLocation = binaryLocation; + DiagnosticsMessageSink.OnMessage(new DiagnosticMessage($"Set {nameof(ChromeOptions)}.{nameof(opts.BinaryLocation)} to {binaryLocation}")); + } + + var driver = new RemoteWebDriver(SeleniumStandaloneServer.Instance.Uri, opts); + driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1); + Browser = driver; + Logs = new RemoteLogs(driver); + } + + public IWebDriver Browser { get; } + + public ILogs Logs { get; } + + public IMessageSink DiagnosticsMessageSink { get; } + + public static bool IsHostAutomationSupported() + { + // We emit an assemblymetadata attribute that reflects the value of SeleniumE2ETestsSupported at build + // time and we use that to conditionally skip Selenium tests parts. + var attribute = typeof(BrowserFixture).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>() + .SingleOrDefault(a => a.Key == "Microsoft.AspNetCore.Testing.Selenium.Supported"); + var attributeValue = attribute != null ? bool.Parse(attribute.Value) : false; + + // The environment variable below can be set up before running the tests so as to override the default + // value provided in the attribute. + var environmentOverride = Environment + .GetEnvironmentVariable("MICROSOFT_ASPNETCORE_TESTING_SELENIUM_SUPPORTED"); + var environmentOverrideValue = !string.IsNullOrWhiteSpace(environmentOverride) ? bool.Parse(attribute.Value) : false; + + if (environmentOverride != null) + { + return environmentOverrideValue; + } + else + { + return attributeValue; + } + } + + public void Dispose() + { + if (Browser != null) + { + Browser.Dispose(); + } + } + } +} diff --git a/src/Components/test/E2ETest/Infrastructure/BrowserTestBase.cs b/src/Shared/E2ETesting/BrowserTestBase.cs similarity index 94% rename from src/Components/test/E2ETest/Infrastructure/BrowserTestBase.cs rename to src/Shared/E2ETesting/BrowserTestBase.cs index 2487632d09..1d7dba3888 100644 --- a/src/Components/test/E2ETest/Infrastructure/BrowserTestBase.cs +++ b/src/Shared/E2ETesting/BrowserTestBase.cs @@ -6,7 +6,7 @@ using OpenQA.Selenium; using Xunit; using Xunit.Abstractions; -namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure +namespace Microsoft.AspNetCore.E2ETesting { [CaptureSeleniumLogs] public class BrowserTestBase : IClassFixture<BrowserFixture> diff --git a/src/ProjectTemplates/test/Infrastructure/CaptureSeleniumLogsAttribute.cs b/src/Shared/E2ETesting/CaptureSeleniumLogsAttribute.cs similarity index 85% rename from src/ProjectTemplates/test/Infrastructure/CaptureSeleniumLogsAttribute.cs rename to src/Shared/E2ETesting/CaptureSeleniumLogsAttribute.cs index 6bbcc0deea..304659f5f4 100644 --- a/src/ProjectTemplates/test/Infrastructure/CaptureSeleniumLogsAttribute.cs +++ b/src/Shared/E2ETesting/CaptureSeleniumLogsAttribute.cs @@ -1,10 +1,13 @@ -using OpenQA.Selenium; +// 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.Reflection; +using OpenQA.Selenium; using Xunit.Sdk; -namespace Templates.Test.Infrastructure +namespace Microsoft.AspNetCore.E2ETesting { // This has to use BeforeAfterTestAttribute because running the log capture // in the BrowserFixture.Dispose method is too late, and we can't add logging @@ -25,7 +28,7 @@ namespace Templates.Test.Infrastructure var logs = BrowserTestBase.Logs; var output = BrowserTestBase.Output; - if(logs != null && output != null) + if (logs != null && output != null) { // Put browser logs first, the test UI will truncate output after a certain length // and the browser logs will include exceptions thrown by js in the browser. diff --git a/src/Shared/E2ETesting/E2ETesting.props b/src/Shared/E2ETesting/E2ETesting.props new file mode 100644 index 0000000000..11841cae03 --- /dev/null +++ b/src/Shared/E2ETesting/E2ETesting.props @@ -0,0 +1,26 @@ +<Project> + <PropertyGroup> + <_DefaultProjectFilter>$(MSBuildProjectDirectory)\..\..</_DefaultProjectFilter> + <DefaultItemExcludes>$(DefaultItemExcludes);node_modules\**</DefaultItemExcludes> + <SeleniumE2ETestsSupported Condition="'$(SeleniumE2ETestsSupported)' == '' and '$(TargetArchitecture)' != 'arm' and '$(OS)' == 'Windows_NT'">true</SeleniumE2ETestsSupported> + <EnforcePrerequisites Condition="'$(SeleniumE2ETestsSupported)' == 'true' and '$(EnforcePrerequisites)' == ''">true</EnforcePrerequisites> + + <!-- WebDriver is not strong-named, so this test project cannot be strong named either. --> + <SignAssembly>false</SignAssembly> + </PropertyGroup> + + <ItemGroup> + <Compile Include="$(SharedSourceRoot)E2ETesting\**\*.cs" LinkBase="Selenium" /> + </ItemGroup> + + <ItemGroup> + <None Include="$(SharedSourceRoot)E2ETesting\E2ETesting.props" Link="Selenium\E2ETesting.props" /> + <None Include="$(SharedSourceRoot)E2ETesting\E2ETesting.targets" Link="Selenium\E2ETesting.targets" /> + </ItemGroup> + + <ItemGroup> + <Reference Include="Selenium.Support" /> + <Reference Include="Selenium.WebDriver" /> + </ItemGroup> + +</Project> diff --git a/src/Shared/E2ETesting/E2ETesting.targets b/src/Shared/E2ETesting/E2ETesting.targets new file mode 100644 index 0000000000..d3f3cdda1f --- /dev/null +++ b/src/Shared/E2ETesting/E2ETesting.targets @@ -0,0 +1,105 @@ +<Project> + <!-- Version of this SDK is set in global.json --> + <Sdk Name="Yarn.MSBuild" /> + + <!-- Ensuring that everything is ready before build --> + + <Target Name="EnsureNodeJSRestored" Condition="'$(SeleniumE2ETestsSupported)' == 'true'" BeforeTargets="Build"> + <Message Text="Running yarn install on $(MSBuildProjectFile)" Importance="High" /> + + <Message Condition="'$(EnforcePrerequisites)' == ''" + Importance="High" + Text="Prerequisites were not enforced at build time. Running Yarn or the E2E tests might fail as a result. Check /src/Shared/E2ETesting/Readme.md for instructions." /> + + <Yarn Command="install" /> + </Target> + + <Target + Name="WarnSeleniumNotSupported" + BeforeTargets="Build" + Condition="'$(SeleniumE2ETestsSupported)' == ''"> + <Message Importance="High" Text="Selenium tests are not supported for OS '$(OS)' and architecture '$(TargetArchitecture)'." /> + </Target> + + <!-- Running prerequisites --> + + <Target Name="EnsurePrerequisites" Condition="'$(EnforcePrerequisites)' == 'true'" BeforeTargets="EnsureNodeJSRestored"> + <PropertyGroup> + <_PackageJson>$(MSBuildProjectDirectory)\package.json</_PackageJson> + </PropertyGroup> + + <!-- JAVA --> + <Message Importance="High" Text="Ensuring JAVA is available" /> + <Exec Command="java -version" /> + <Message Importance="High" Text="JAVA is available on the PATH" /> + + <!-- package.json --> + <Error Condition="!Exists('$(_PackageJson)')" Text="Can't find $(_PackageJson)" /> + <ReadLinesFromFile File="$(_PackageJson)"> + <Output TaskParameter="Lines" ItemName="_PackageJsonLines" /> + </ReadLinesFromFile> + + <PropertyGroup> + <_PackageJsonLinesContent>@(_PackageJsonLines)</_PackageJsonLinesContent> + <_PackageJsonSeleniumPackage>"selenium-standalone": "^6.15.4"</_PackageJsonSeleniumPackage> + </PropertyGroup> + + <Error + Condition="!$(_PackageJsonLinesContent.Contains ('$(_PackageJsonSeleniumPackage)'))" + Text="Can't find dependency $(_PackageJsonSeleniumPackage) in '$(_PackageJson)'" /> + </Target> + + <!-- Resolve content roots at build time --> + + <Target Name="_ResolveTestProjectReferences" DependsOnTargets="ResolveReferences"> + <PropertyGroup> + <_DefaultProjectRoot>$([System.IO.Path]::GetFullPath($(_DefaultProjectFilter)))</_DefaultProjectRoot> + </PropertyGroup> + <ItemGroup> + <_ContentRootProjectReferencesUnfiltered + Include="@(ReferencePath)" + Condition="'%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference'" /> + <_ContentRootProjectReferencesFilter + Include="@(_ContentRootProjectReferencesUnfiltered->StartsWith('$(_DefaultProjectRoot)'))" /> + <_ContentRootProjectReferences + Include="@(_ContentRootProjectReferencesFilter)" + Condition="'%(Identity)' == 'True'" /> + </ItemGroup> + </Target> + + <Target Name="_AddTestProjectMetadataAttributes" BeforeTargets="BeforeCompile" DependsOnTargets="_ResolveTestProjectReferences"> + <ItemGroup> + <_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" /> + </ItemGroup> + + <ItemGroup> + <AssemblyAttribute + Condition=" '%(_ContentRootMetadata.Identity)' != '' " + Include="System.Reflection.AssemblyMetadataAttribute"> + <_Parameter1>TestAssemblyApplication[%(_ContentRootMetadata.AssemblyName)]</_Parameter1> + <_Parameter2>%(_ContentRootMetadata.ContentRootPath)</_Parameter2> + </AssemblyAttribute> + </ItemGroup> + </Target> + + <Target Name="_AddSeleniumSupportedMetadataAttribute" BeforeTargets="BeforeCompile"> + <PropertyGroup> + <_SeleniumE2ETestsSupportedAttributeValue>false</_SeleniumE2ETestsSupportedAttributeValue> + <_SeleniumE2ETestsSupportedAttributeValue Condition="'$(SeleniumE2ETestsSupported)' == 'true'">true</_SeleniumE2ETestsSupportedAttributeValue> + </PropertyGroup> + <ItemGroup> + <AssemblyAttribute + Include="System.Reflection.AssemblyMetadataAttribute"> + <_Parameter1>Microsoft.AspNetCore.Testing.Selenium.Supported</_Parameter1> + <_Parameter2>$(_SeleniumE2ETestsSupportedAttributeValue)</_Parameter2> + </AssemblyAttribute> + </ItemGroup> + </Target> + +</Project> diff --git a/src/Components/test/E2ETest/Infrastructure/SeleniumStandaloneServer.cs b/src/Shared/E2ETesting/SeleniumStandaloneServer.cs similarity index 98% rename from src/Components/test/E2ETest/Infrastructure/SeleniumStandaloneServer.cs rename to src/Shared/E2ETesting/SeleniumStandaloneServer.cs index 88fe3ac2d1..d8667db6bd 100644 --- a/src/Components/test/E2ETest/Infrastructure/SeleniumStandaloneServer.cs +++ b/src/Shared/E2ETesting/SeleniumStandaloneServer.cs @@ -12,7 +12,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Internal; -namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure +namespace Microsoft.AspNetCore.E2ETesting { class SeleniumStandaloneServer { diff --git a/src/Components/test/E2ETest/Infrastructure/WaitAssert.cs b/src/Shared/E2ETesting/WaitAssert.cs similarity index 97% rename from src/Components/test/E2ETest/Infrastructure/WaitAssert.cs rename to src/Shared/E2ETesting/WaitAssert.cs index e1c9b77f36..4aa0a055a3 100644 --- a/src/Components/test/E2ETest/Infrastructure/WaitAssert.cs +++ b/src/Shared/E2ETesting/WaitAssert.cs @@ -9,7 +9,7 @@ using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using Xunit; -namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure +namespace Microsoft.AspNetCore.E2ETesting { // XUnit assertions, but hooked into Selenium's polling mechanism diff --git a/src/Shared/E2ETesting/XUnitExtensions/AssemblyFixtureAttribute.cs b/src/Shared/E2ETesting/XUnitExtensions/AssemblyFixtureAttribute.cs new file mode 100644 index 0000000000..b90aca7438 --- /dev/null +++ b/src/Shared/E2ETesting/XUnitExtensions/AssemblyFixtureAttribute.cs @@ -0,0 +1,17 @@ +// 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; + +namespace Microsoft.AspNetCore.E2ETesting +{ + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + public class AssemblyFixtureAttribute : Attribute + { + public AssemblyFixtureAttribute(Type fixtureType) + { + FixtureType = fixtureType; + } + public Type FixtureType { get; private set; } + } +} diff --git a/src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XUnitTestCollectionRunnerWIthAssemblyFixture.cs b/src/Shared/E2ETesting/XUnitExtensions/XUnitTestCollectionRunnerWIthAssemblyFixture.cs similarity index 95% rename from src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XUnitTestCollectionRunnerWIthAssemblyFixture.cs rename to src/Shared/E2ETesting/XUnitExtensions/XUnitTestCollectionRunnerWIthAssemblyFixture.cs index f71331738e..e9d30ed893 100644 --- a/src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XUnitTestCollectionRunnerWIthAssemblyFixture.cs +++ b/src/Shared/E2ETesting/XUnitExtensions/XUnitTestCollectionRunnerWIthAssemblyFixture.cs @@ -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 System; @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Xunit.Abstractions; using Xunit.Sdk; -namespace Templates.Test.Helpers.XunitExtensions +namespace Microsoft.AspNetCore.E2ETesting { public class XunitTestCollectionRunnerWithAssemblyFixture : XunitTestCollectionRunner { @@ -45,4 +45,4 @@ namespace Templates.Test.Helpers.XunitExtensions return runner.RunAsync(); } } -} \ No newline at end of file +} diff --git a/src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XunitTestAssemblyRunnerWithAssemblyFixture.cs b/src/Shared/E2ETesting/XUnitExtensions/XunitTestAssemblyRunnerWithAssemblyFixture.cs similarity index 96% rename from src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XunitTestAssemblyRunnerWithAssemblyFixture.cs rename to src/Shared/E2ETesting/XUnitExtensions/XunitTestAssemblyRunnerWithAssemblyFixture.cs index 920df95a5a..b50e17cb43 100644 --- a/src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XunitTestAssemblyRunnerWithAssemblyFixture.cs +++ b/src/Shared/E2ETesting/XUnitExtensions/XunitTestAssemblyRunnerWithAssemblyFixture.cs @@ -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 System; @@ -9,7 +9,7 @@ using System.Threading.Tasks; using Xunit.Abstractions; using Xunit.Sdk; -namespace Templates.Test.Helpers.XunitExtensions +namespace Microsoft.AspNetCore.E2ETesting { public class XunitTestAssemblyRunnerWithAssemblyFixture : XunitTestAssemblyRunner { @@ -69,4 +69,4 @@ namespace Templates.Test.Helpers.XunitExtensions new ExceptionAggregator(Aggregator), cancellationTokenSource).RunAsync(); } -} \ No newline at end of file +} diff --git a/src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XunitTestFrameworkExecutorWithAssemblyFixture.cs b/src/Shared/E2ETesting/XUnitExtensions/XunitTestFrameworkExecutorWithAssemblyFixture.cs similarity index 90% rename from src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XunitTestFrameworkExecutorWithAssemblyFixture.cs rename to src/Shared/E2ETesting/XUnitExtensions/XunitTestFrameworkExecutorWithAssemblyFixture.cs index 17133c77bc..420a13082e 100644 --- a/src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XunitTestFrameworkExecutorWithAssemblyFixture.cs +++ b/src/Shared/E2ETesting/XUnitExtensions/XunitTestFrameworkExecutorWithAssemblyFixture.cs @@ -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 System.Collections.Generic; @@ -6,7 +6,7 @@ using System.Reflection; using Xunit.Abstractions; using Xunit.Sdk; -namespace Templates.Test.Helpers.XunitExtensions +namespace Microsoft.AspNetCore.E2ETesting { public class XunitTestFrameworkExecutorWithAssemblyFixture : XunitTestFrameworkExecutor { @@ -23,4 +23,4 @@ namespace Templates.Test.Helpers.XunitExtensions } } } -} \ No newline at end of file +} diff --git a/src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XunitTestFrameworkWithAssemblyFixture.cs b/src/Shared/E2ETesting/XUnitExtensions/XunitTestFrameworkWithAssemblyFixture.cs similarity index 85% rename from src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XunitTestFrameworkWithAssemblyFixture.cs rename to src/Shared/E2ETesting/XUnitExtensions/XunitTestFrameworkWithAssemblyFixture.cs index ea5075238d..c09fc41294 100644 --- a/src/ProjectTemplates/test/Infrastructure/XUnitExtensions/XunitTestFrameworkWithAssemblyFixture.cs +++ b/src/Shared/E2ETesting/XUnitExtensions/XunitTestFrameworkWithAssemblyFixture.cs @@ -1,11 +1,11 @@ -// 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 System.Reflection; using Xunit.Abstractions; using Xunit.Sdk; -namespace Templates.Test.Helpers.XunitExtensions +namespace Microsoft.AspNetCore.E2ETesting { public class XunitTestFrameworkWithAssemblyFixture : XunitTestFramework { @@ -17,4 +17,4 @@ namespace Templates.Test.Helpers.XunitExtensions protected override ITestFrameworkExecutor CreateExecutor(AssemblyName assemblyName) => new XunitTestFrameworkExecutorWithAssemblyFixture(assemblyName, SourceInformationProvider, DiagnosticMessageSink); } -} \ No newline at end of file +}