Skip to content

Commit

Permalink
Stage WinAppDriver into its own folder (#15953)
Browse files Browse the repository at this point in the history
WinAppDriver depends on a bunch of .NET assemblies that collide *big time*. Let's just quarantine it.

I kept the fallback to $TESTDIR\WinAppDriver.exe because there's a chance that the Windows build depends on it.
  • Loading branch information
DHowett authored Sep 15, 2023
1 parent 4bc34e4 commit 2fa8e76
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/cascadia/WindowsTerminal_UIATests/Init.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ class Init
public static void SetupAll(TestContext context)
{
Log.Comment("Searching for WinAppDriver in the same directory where this test was launched from...");
string winAppDriver = Path.Combine(context.TestDeploymentDir, "WinAppDriver.exe");
string winAppDriver = Path.Combine(context.TestDeploymentDir, "WinAppDriver", "WinAppDriver.exe");

if (!File.Exists(winAppDriver))
{
winAppDriver = Path.Combine(context.TestDeploymentDir, "WinAppDriver.exe");
}

Log.Comment($"Attempting to launch WinAppDriver at: {winAppDriver}");
Log.Comment($"Working directory: {Environment.CurrentDirectory}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy &quot;$(SolutionDir)\dep\WinAppDriver\*&quot; &quot;$(OutDir)\&quot;</PostBuildEvent>
<PostBuildEvent>mkdir &quot;$(OutDir)\WinAppDriver&quot; 2&gt;nul &amp; copy &quot;$(SolutionDir)\dep\WinAppDriver\*&quot; &quot;$(OutDir)\WinAppDriver\&quot;</PostBuildEvent>
</PropertyGroup>
<Import Project="..\..\common.nugetversions.targets" />
</Project>
</Project>
4 changes: 2 additions & 2 deletions src/host/ft_uia/Host.Tests.UIA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy "$(SolutionDir)\dep\WinAppDriver\*" "$(OutDir)\"</PostBuildEvent>
<PostBuildEvent>mkdir &quot;$(OutDir)\WinAppDriver&quot; 2&gt;nul &amp; copy &quot;$(SolutionDir)\dep\WinAppDriver\*&quot; &quot;$(OutDir)\WinAppDriver\&quot;</PostBuildEvent>
</PropertyGroup>
<Import Project="..\..\common.nugetversions.targets" />
</Project>
</Project>
7 changes: 6 additions & 1 deletion src/host/ft_uia/Init.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ class Init
public static void SetupAll(TestContext context)
{
Log.Comment("Searching for WinAppDriver in the same directory where this test was launched from...");
string winAppDriver = Path.Combine(context.TestDeploymentDir, "WinAppDriver.exe");
string winAppDriver = Path.Combine(context.TestDeploymentDir, "WinAppDriver", "WinAppDriver.exe");

if (!File.Exists(winAppDriver))
{
winAppDriver = Path.Combine(context.TestDeploymentDir, "WinAppDriver.exe");
}

Log.Comment($"Attempting to launch WinAppDriver at: {winAppDriver}");
Log.Comment($"Working directory: {Environment.CurrentDirectory}");
Expand Down

0 comments on commit 2fa8e76

Please sign in to comment.