Skip to content

Reenable Components E2E #9076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ private static Dictionary<string, string> FindProjects()

protected static string FindSampleOrTestSitePath(string projectName)
{
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
{
return Path.Combine(AppContext.BaseDirectory, projectName.Split(",")[0]);
}

var projects = _projects.Value;
if (projects.TryGetValue(projectName, out var dir))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@
Temporarily disabled until this runs on macOS
-->
<SkipTests Condition="'$(SeleniumE2ETestsSupported)' != 'true'">true</SkipTests>
<!-- https://github.com/aspnet/AspNetCore/issues/6857 -->
<BuildHelixPayload>false</BuildHelixPayload>

<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
<BaseOutputPath />
<OutputPath />

</PropertyGroup>

<ItemGroup>
Expand All @@ -44,7 +37,25 @@
<ProjectReference Include="..\testassets\TestServer\Components.TestServer.csproj" />
</ItemGroup>

<ItemGroup>
<HelixPreCommand Include="call npm i yarn;call node_modules\.bin\yarn install" />
<HelixContent Include="package.json" />
<HelixContent Include="yarn.lock" />
<!-- This is currently windows only -->
<HelixProjectPlatform Remove="Linux;OSX" />
<HelixProjectPlatform Remove="@(HelixProjectPlatform)" />
<HelixProjectTargetQueue Include="Windows.10.Amd64.ClientRS4.VS2017.Open" />
</ItemGroup>

<!-- Shared testing infrastructure for running E2E tests using selenium -->
<Import Project="$(SharedSourceRoot)E2ETesting\E2ETesting.targets" />

<Target Name="PublishAssets" AfterTargets="Publish">
<ItemGroup>
<_PublishFiles Include="$(MSBuildThisFileDirectory)..\testassets\**\*.*" />
</ItemGroup>
<Copy
SourceFiles="@(_PublishFiles)"
DestinationFolder="$(PublishDir)\%(RecursiveDir)" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
using System.Linq;
using System.Threading.Tasks;
using Grpc.Core;
using Microsoft.Extensions.Logging;

namespace GrpcService_CSharp
{
public class GreeterService : Greeter.GreeterBase
{
private readonly ILogger<GreeterService> logger;
public GreeterService(ILogger<GreeterService> _logger)
{
logger = _logger;
}
public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
{
return Task.FromResult(new HelloReply
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<div class="main">
<div class="top-row px-4">
<LogInDisplay />
<LoginDisplay />
<a href="https://docs.microsoft.com/en-us/aspnet/" target="_blank">About</a>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Pages
{
Expand All @@ -15,6 +16,12 @@ public class ErrorModel : PageModel

public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);

private readonly ILogger<ErrorModel> logger;

public ErrorModel(ILogger<ErrorModel> _logger)
{
logger = _logger;
}
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Pages
{
public class IndexModel : PageModel
{
private readonly ILogger<IndexModel> logger;

public IndexModel(ILogger<IndexModel> _logger)
{
logger = _logger;
}
public void OnGet()
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Pages
{
public class PrivacyModel : PageModel
{
private readonly ILogger<PrivacyModel> logger;

public PrivacyModel(ILogger<PrivacyModel> _logger)
{
logger = _logger;
}
public void OnGet()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@
</div>
</nav>
</header>
<main role="main" class="pb-3">
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</main>
</div>

<footer class="border-top footer text-muted">
<div class="container">
&copy; copyrightYear - Company.WebApplication1 - <a asp-area="" asp-page="/Privacy">Privacy</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#endif
using Microsoft.AspNetCore.Mvc;
using Company.WebApplication1.Models;
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Controllers
{
Expand All @@ -16,6 +17,12 @@ namespace Company.WebApplication1.Controllers
#endif
public class HomeController : Controller
{
private readonly ILogger<HomeController> logger;

public HomeController(ILogger<HomeController> _logger)
{
logger = _logger;
}
public IActionResult Index()
{
return View();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@
</div>
</nav>
</header>
<main role="main" class="pb-3">
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</main>
</div>

<footer class="border-top footer text-muted">
<div class="container">
&copy; copyrightYear - Company.WebApplication1 - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ open System.Collections.Generic
open System.Linq
open System.Threading.Tasks
open Microsoft.AspNetCore.Mvc
open Microsoft.Extensions.Logging

type HomeController () =
type HomeController (_logger : ILogger<HomeController>) =
inherit Controller()
let mutable logger = _logger

member this.Index () =
this.View()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@
</div>
</nav>
</header>
<main role="main" class="pb-3">
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</main>
</div>

<footer class="border-top footer text-muted">
<div class="container">
&copy; copyrightYear - Company.WebApplication1 - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.AspNetCore.Authorization;
#endif
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Controllers
{
Expand All @@ -17,6 +18,12 @@ namespace Company.WebApplication1.Controllers
[ApiController]
public class WeatherController : ControllerBase
{
private readonly ILogger<WeatherController> logger;

public WeatherController(ILogger<WeatherController> _logger)
{
logger = _logger;
}
[HttpGet]
public ActionResult<WeatherResult> GetWeatherForecasts(string location, TemperatureUnit unit)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ open System.Collections.Generic
open System.Linq
open System.Threading.Tasks
open Microsoft.AspNetCore.Mvc
open Microsoft.Extensions.Logging

type public TemperatureUnit =
| Celsius=0
Expand All @@ -18,8 +19,9 @@ type WeatherResult = {

[<Route("api/SampleData/[controller]")>]
[<ApiController>]
type WeatherController () =
type WeatherController (_logger : ILogger<WeatherController>) =
inherit ControllerBase()
let mutable logger = _logger

[<HttpGet>]
member this.Get(location:string, unit: TemperatureUnit) =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Controllers
{
public class OidcConfigurationController : Controller
{
public OidcConfigurationController(IClientRequestParametersProvider clientRequestParametersProvider)
private readonly ILogger<OidcConfigurationController> logger;

public OidcConfigurationController(IClientRequestParametersProvider clientRequestParametersProvider, ILogger<OidcConfigurationController> _logger)
{
ClientRequestParametersProvider = clientRequestParametersProvider;
logger = _logger;
}

public IClientRequestParametersProvider ClientRequestParametersProvider { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#if (IndividualLocalAuth)
using Microsoft.AspNetCore.Authorization;
#endif
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Controllers
{
Expand All @@ -15,6 +16,12 @@ namespace Company.WebApplication1.Controllers
[Route("api/[controller]")]
public class SampleDataController : Controller
{
private readonly ILogger<SampleDataController> logger;

public SampleDataController(ILogger<SampleDataController> _logger)
{
logger = _logger;
}
private static string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public class ErrorModel : PageModel
{
private readonly ILogger<ErrorModel> logger;

public ErrorModel(ILogger<ErrorModel> _logger)
{
logger = _logger;
}
public string RequestId { get; set; }

public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Controllers
{
public class OidcConfigurationController : Controller
{
public OidcConfigurationController(IClientRequestParametersProvider clientRequestParametersProvider)
private readonly ILogger<OidcConfigurationController> logger;

public OidcConfigurationController(IClientRequestParametersProvider clientRequestParametersProvider, ILogger<OidcConfigurationController> _logger)
{
ClientRequestParametersProvider = clientRequestParametersProvider;
logger = _logger;
}

public IClientRequestParametersProvider ClientRequestParametersProvider { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@
using Microsoft.AspNetCore.Authorization;
#endif
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Controllers
{
#if (IndividualLocalAuth)
#if (IndividualLocalAuth)
[Authorize]
#endif
#endif
[Route("api/[controller]")]
public class SampleDataController : Controller
{
private readonly ILogger<SampleDataController> logger;

public SampleDataController(ILogger<SampleDataController> _logger)
{
logger = _logger;
}
private static string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace Company.WebApplication1.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public class ErrorModel : PageModel
{
private readonly ILogger<ErrorModel> logger;

public ErrorModel(ILogger<ErrorModel> _logger)
{
logger = _logger;
}
public string RequestId { get; set; }

public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
Expand Down
Loading