Skip to content

Commit

Permalink
Update Dependencies, Handle issue AvaloniaUI#114
Browse files Browse the repository at this point in the history
  • Loading branch information
joecare99 committed Jan 12, 2025
1 parent 787d9a6 commit 3934801
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
</PropertyGroup>

<ItemGroup>
<AvaloniaResource Include="Assets\**"/>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.3"/>
<PackageReference Include="Avalonia.Desktop" Version="11.0.5"/>
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.5"/>
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.5"/>
<PackageReference Include="Avalonia" Version="11.2.3" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.5"/>
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.3" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
</PropertyGroup>

<ItemGroup>
<AvaloniaResource Include="Assets\**"/>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.3"/>
<PackageReference Include="Avalonia.Desktop" Version="11.0.10"/>
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10"/>
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.10"/>
<PackageReference Include="Avalonia" Version="11.2.3" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10"/>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1"/>
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.3" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
</ItemGroup>
</Project>
20 changes: 11 additions & 9 deletions src/Avalonia.Samples/Testing/TestableApp.Appium/CalculatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace TestableApp.Appium;
[Collection("Default")]
public class CalculatorTests
{
private readonly AppiumDriver<AppiumWebElement> _session;
private readonly AppiumDriver _session;


public CalculatorTests(DefaultAppFixture fixture)
Expand All @@ -18,10 +18,11 @@ public CalculatorTests(DefaultAppFixture fixture)
public void Should_Add_Numbers()
{
// Assert:
var firstOperandInput = _session.FindElementByAccessibilityId("FirstOperandInput")!;
var secondOperandInput = _session.FindElementByAccessibilityId("SecondOperandInput")!;
var addButton = _session.FindElementByAccessibilityId("AddButton")!;
var resultBox = _session.FindElementByAccessibilityId("ResultBox")!;
const string ByAccessibilityId = "AccessibilityId";
var firstOperandInput = _session.FindElement(ByAccessibilityId, "FirstOperandInput")!;
var secondOperandInput = _session.FindElement(ByAccessibilityId, "SecondOperandInput")!;
var addButton = _session.FindElement(ByAccessibilityId, "AddButton")!;
var resultBox = _session.FindElement(ByAccessibilityId, "ResultBox")!;

// Act:
firstOperandInput.Clear();
Expand All @@ -39,10 +40,11 @@ public void Should_Add_Numbers()
public void Cannot_Divide_By_Zero()
{
// Assert:
var firstOperandInput = _session.FindElementByAccessibilityId("FirstOperandInput")!;
var secondOperandInput = _session.FindElementByAccessibilityId("SecondOperandInput")!;
var divideButton = _session.FindElementByAccessibilityId("DivideButton")!;
var resultBox = _session.FindElementByAccessibilityId("ResultBox")!;
const string ByAccessibilityId = "AccessibilityId";
var firstOperandInput = _session.FindElement(ByAccessibilityId, "FirstOperandInput")!;
var secondOperandInput = _session.FindElement("AccessibilityId", "SecondOperandInput")!;
var divideButton = _session.FindElement("AccessibilityId", "DivideButton")!;
var resultBox = _session.FindElement("AccessibilityId", "ResultBox")!;

// Act:
firstOperandInput.Clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public DefaultAppFixture()
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
ConfigureWin32Options(options);
Session = new WindowsDriver<AppiumWebElement>(
Session = new WindowsDriver(
new Uri("http://127.0.0.1:4723"),
options);

Expand All @@ -40,7 +40,7 @@ public DefaultAppFixture()
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
ConfigureMacOptions(options);
Session = new MacDriver<AppiumWebElement>(
Session = new MacDriver(
new Uri("http://127.0.0.1:4723/wd/hub"),
options);
}
Expand All @@ -53,22 +53,22 @@ public DefaultAppFixture()
protected virtual void ConfigureWin32Options(AppiumOptions options)
{
var path = Path.GetFullPath(TestAppPath);
options.AddAdditionalCapability(MobileCapabilityType.App, path);
options.AddAdditionalCapability(MobileCapabilityType.PlatformName, MobilePlatform.Windows);
options.AddAdditionalCapability(MobileCapabilityType.DeviceName, "WindowsPC");
options.App = path;
options.PlatformName = MobilePlatform.Windows;
options.DeviceName= "WindowsPC";
// options.AddAdditionalCapability("appArguments", "--customArg");
}

protected virtual void ConfigureMacOptions(AppiumOptions options)
{
options.AddAdditionalCapability("appium:bundleId", TestAppBundleId);
options.AddAdditionalCapability(MobileCapabilityType.PlatformName, MobilePlatform.MacOS);
options.AddAdditionalCapability(MobileCapabilityType.AutomationName, "mac2");
options.AddAdditionalCapability("appium:showServerLogs", true);
options.AddAdditionalOption("appium:bundleId", TestAppBundleId);
options.PlatformName = MobilePlatform.MacOS;
options.AutomationName = "mac2";
options.AddAdditionalOption("appium:showServerLogs", true);
// options.AddAdditionalCapability("appium:arguments", new[] { "--customArg" });
}

public AppiumDriver<AppiumWebElement> Session { get; }
public AppiumDriver Session { get; }

public void Dispose()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void Should_Add_Numbers()

// Raise click event on the button:
window.AddButton.Focus();
window.KeyPress(Key.Enter, RawInputModifiers.None);
window.KeyPressQwerty(PhysicalKey.Enter, RawInputModifiers.None);

Assert.That(window.ResultBox.Text, Is.EqualTo("30"));
}
Expand All @@ -49,7 +49,7 @@ public void Cannot_Divide_By_Zero()

// Raise click event on the button:
window.DivideButton.Focus();
window.KeyPress(Key.Enter, RawInputModifiers.None);
window.KeyPressQwerty(PhysicalKey.Enter, RawInputModifiers.None);

Assert.That(window.ResultBox.Text, Is.EqualTo("Cannot divide by zero!"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3" />
<PackageReference Include="Avalonia.Headless.NUnit" Version="11.2.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void Should_Add_Numbers()

// Raise click event on the button:
window.AddButton.Focus();
window.KeyPress(Key.Enter, RawInputModifiers.None);
window.KeyPressQwerty(PhysicalKey.Enter, RawInputModifiers.None);

Assert.Equal("30", window.ResultBox.Text);
}
Expand All @@ -49,7 +49,7 @@ public void Cannot_Divide_By_Zero()

// Raise click event on the button:
window.DivideButton.Focus();
window.KeyPress(Key.Enter, RawInputModifiers.None);
window.KeyPressQwerty(PhysicalKey.Enter, RawInputModifiers.None);

Assert.Equal("Cannot divide by zero!", window.ResultBox.Text);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3" />
<PackageReference Include="Avalonia.Headless.XUnit" Version="11.2.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.3" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.1" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.3" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.1" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.1" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.1" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.3" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
</Project>

0 comments on commit 3934801

Please sign in to comment.