Skip to content

Commit

Permalink
Fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Sep 16, 2024
1 parent f2ac36b commit 3770b10
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public WindowsAppiumAutomatedAppOptionsBuilder UseAppId(string appId)
return this;
}

public WindowsAppiumAutomatedAppOptionsBuilder UseExecutablePath(string executablePath)
public WindowsAppiumAutomatedAppOptionsBuilder UseAppExecutablePath(string executablePath)
{
DriverOptions.App = executablePath;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ public class AppiumDriverManagerTests
{
protected AppiumAutomatedAppOptions CreateAppOptions()
{
var builder = new WindowsAppiumAutomatedAppOptionsBuilder("test");
var key = "test";
var builder = OperatingSystem.IsWindows()
? (AppiumAutomatedAppOptionsBuilder)new WindowsAppiumAutomatedAppOptionsBuilder(key)
: (AppiumAutomatedAppOptionsBuilder)new AndroidAppiumAutomatedAppOptionsBuilder(key);
return builder.Build();
}

Expand All @@ -24,8 +27,13 @@ public void CanCreateDriver()
[Fact]
public void CanCreateAndStartDriver()
{
if (!OperatingSystem.IsWindows())
return;

using var appium = new AppiumServiceManager(new());
using var driverManager = new AppiumDriverManager(appium, CreateAppOptions());
var builder = new WindowsAppiumAutomatedAppOptionsBuilder("test");
builder.UseAppExecutablePath("C:\\Windows\\System32\\notepad.exe");
using var driverManager = new AppiumDriverManager(appium, builder.Build());

driverManager.StartDriver();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using DeviceRunners.UIAutomation.Playwright;
using DeviceRunners.UIAutomation;
using DeviceRunners.UIAutomation.Playwright;

using Xunit;
using Xunit.Abstractions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DeviceRunners.UIAutomation.Playwright;
using DeviceRunners.UIAutomation;

using Xunit.Abstractions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ public TestApp(IReadOnlyList<IAutomatedAppCommand> commands)
}

public IAutomatedAppCommandManager Commands { get; }

public IAutomatedAppElement FindElement(Action<IBy> by) =>
throw new NotImplementedException();

public IReadOnlyList<IAutomatedAppElement> FindElements(Action<IBy> by) =>
throw new NotImplementedException();
}

public class DerivedApp : TestApp
Expand All @@ -78,5 +84,11 @@ public AnotherApp(IReadOnlyList<IAutomatedAppCommand> commands)
}

public IAutomatedAppCommandManager Commands { get; }

public IAutomatedAppElement FindElement(Action<IBy> by) =>
throw new NotImplementedException();

public IReadOnlyList<IAutomatedAppElement> FindElements(Action<IBy> by) =>
throw new NotImplementedException();
}
}

0 comments on commit 3770b10

Please sign in to comment.