Skip to content

Commit 039862b

Browse files
Fix integration test to be run on mac
1 parent 917b7a3 commit 039862b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

BrowserStackLocal/BrowserStackLocalIntegrationTests/IntegrationTests.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace BrowserStackLocalIntegrationTests
1111
{
1212
public class IntegrationTests
1313
{
14+
static readonly OperatingSystem os = Environment.OSVersion;
15+
static readonly string binaryName = os.Platform.ToString() == "Unix" ? "BrowserStackLocal-darwin-x64" : "BrowserStackLocal.exe";
1416
private static string username = Environment.GetEnvironmentVariable("BROWSERSTACK_USERNAME");
1517
private static string accesskey = Environment.GetEnvironmentVariable("BROWSERSTACK_ACCESS_KEY");
1618

@@ -31,7 +33,7 @@ void startWithOptions()
3133
}
3234

3335
Assert.DoesNotThrow(new TestDelegate(startWithOptions));
34-
Process[] binaryInstances = Process.GetProcessesByName("BrowserStackLocal");
36+
Process[] binaryInstances = Process.GetProcessesByName(binaryName);
3537
Assert.AreNotEqual(binaryInstances.Length, 0);
3638

3739
IWebDriver driver;
@@ -52,7 +54,7 @@ void startWithOptions()
5254
driver.Quit();
5355
local.stop();
5456

55-
binaryInstances = Process.GetProcessesByName("BrowserStackLocal");
57+
binaryInstances = Process.GetProcessesByName(binaryName);
5658
Assert.AreEqual(binaryInstances.Length, 0);
5759
}
5860

@@ -74,7 +76,7 @@ public void TestBinaryState()
7476
[TearDown]
7577
public void TestCleanup()
7678
{
77-
foreach(Process p in Process.GetProcessesByName("BrowserStackLocal"))
79+
foreach(Process p in Process.GetProcessesByName(binaryName))
7880
{
7981
p.Kill();
8082
}

0 commit comments

Comments
 (0)