Skip to content

Commit cf8894d

Browse files
committed
Update Microsoft.AspNetCore.Components.E2ETests.csproj
Set SeleniumProcessTrackingFolder Include package.json Yarn install Update Microsoft.AspNetCore.Components.E2ETests.csproj Update Microsoft.AspNetCore.Components.E2ETests.csproj Install yarn first Update Microsoft.AspNetCore.Components.E2ETests.csproj Update SeleniumStandaloneServer.cs Update runtests.cmd Update SeleniumStandaloneServer.cs Update SeleniumStandaloneServer.cs Update SeleniumStandaloneServer.cs Update SeleniumStandaloneServer.cs Only target VS windows helix queue Only run on windows, fix npm call Update Microsoft.AspNetCore.Components.E2ETests.csproj Update Microsoft.AspNetCore.Components.E2ETests.csproj Try resolving content root path on helix to current dir Strip out extra assembly name gunk from content root publish test assets use AppContext.BaseDirectory
1 parent e9ea3ad commit cf8894d

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

src/Components/test/E2ETest/Infrastructure/ServerFixtures/ServerFixture.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ private static Dictionary<string, string> FindProjects()
3939

4040
protected static string FindSampleOrTestSitePath(string projectName)
4141
{
42+
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
43+
{
44+
return Path.Combine(AppContext.BaseDirectory, projectName.Split(",")[0]);
45+
}
46+
4247
var projects = _projects.Value;
4348
if (projects.TryGetValue(projectName, out var dir))
4449
{

src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111
Temporarily disabled until this runs on macOS
1212
-->
1313
<SkipTests Condition="'$(SeleniumE2ETestsSupported)' != 'true'">true</SkipTests>
14-
<!-- https://github.com/aspnet/AspNetCore/issues/6857 -->
15-
<BuildHelixPayload>false</BuildHelixPayload>
16-
17-
<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
18-
<BaseOutputPath />
19-
<OutputPath />
20-
2114
</PropertyGroup>
2215

2316
<ItemGroup>
@@ -44,7 +37,25 @@
4437
<ProjectReference Include="..\testassets\TestServer\Components.TestServer.csproj" />
4538
</ItemGroup>
4639

40+
<ItemGroup>
41+
<HelixPreCommand Include="call npm i yarn;call node_modules\.bin\yarn install" />
42+
<HelixContent Include="package.json" />
43+
<HelixContent Include="yarn.lock" />
44+
<!-- This is currently windows only -->
45+
<HelixProjectPlatform Remove="Linux;OSX" />
46+
<HelixProjectPlatform Remove="@(HelixProjectPlatform)" />
47+
<HelixProjectTargetQueue Include="Windows.10.Amd64.ClientRS4.VS2017.Open" />
48+
</ItemGroup>
49+
4750
<!-- Shared testing infrastructure for running E2E tests using selenium -->
4851
<Import Project="$(SharedSourceRoot)E2ETesting\E2ETesting.targets" />
4952

53+
<Target Name="PublishAssets" AfterTargets="Publish">
54+
<ItemGroup>
55+
<_PublishFiles Include="$(MSBuildThisFileDirectory)..\testassets\**\*.*" />
56+
</ItemGroup>
57+
<Copy
58+
SourceFiles="@(_PublishFiles)"
59+
DestinationFolder="$(PublishDir)\%(RecursiveDir)" />
60+
</Target>
5061
</Project>

src/Shared/E2ETesting/SeleniumStandaloneServer.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ private static async Task InitializeInstance(ITestOutputHelper output)
107107
// It's important that we get the folder value before we start the process to prevent
108108
// untracked processes when the tracking folder is not correctly configure.
109109
var trackingFolder = GetProcessTrackingFolder();
110+
111+
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
112+
{
113+
// Just create a random tracking folder on helix
114+
trackingFolder = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName());
115+
Directory.CreateDirectory(trackingFolder);
116+
}
117+
110118
if (!Directory.Exists(trackingFolder))
111119
{
112120
throw new InvalidOperationException($"Invalid tracking folder. Set the 'SeleniumProcessTrackingFolder' MSBuild property to a valid folder.");

0 commit comments

Comments
 (0)