-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Dor-bl/TestApp_Path
Avoid using relative path for WpfApplication
- Loading branch information
Showing
1 changed file
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
|
||
} |