Skip to content

Commit

Permalink
Merge pull request #13 from Dor-bl/TestApp_Path
Browse files Browse the repository at this point in the history
Avoid using relative path for WpfApplication
  • Loading branch information
aristotelos authored Apr 10, 2024
2 parents 583d2bf + 1c2d4af commit 7b90cb6
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/FlaUI.WebDriver.UITests/TestUtil/TestApplication.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
using System.IO;
using System.Linq;

namespace FlaUI.WebDriver.UITests.TestUtil
{
public static class TestApplication
{
public static string FullPath => Path.GetFullPath("..\\..\\..\\..\\TestApplications\\WpfApplication\\bin\\Release\\WpfApplication.exe");
}

private static readonly string s_currentDirectory = Directory.GetCurrentDirectory();
private static readonly string s_solutionDirectory = FindSolutionDirectory(s_currentDirectory);

private static string FindSolutionDirectory(string currentDirectory)
{
while (!Directory.GetFiles(currentDirectory, "*.sln").Any())
{
currentDirectory = Directory.GetParent(currentDirectory).FullName;
}
return currentDirectory;
}

public static string FullPath => Path.Combine(s_solutionDirectory, "TestApplications", "WpfApplication", "bin", "Release", "WpfApplication.exe");
}

}

0 comments on commit 7b90cb6

Please sign in to comment.