Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Appium dependency to v5 #18

Merged
merged 4 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/UITests.Android/UITests.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0-rc.7" />
<PackageReference Include="Appium.WebDriver" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
Expand Down
2 changes: 1 addition & 1 deletion samples/UITests.Windows/UITests.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0-rc.7" />
<PackageReference Include="Appium.WebDriver" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
Expand Down
2 changes: 1 addition & 1 deletion samples/UITests.iOS/UITests.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0-rc.7" />
<PackageReference Include="Appium.WebDriver" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
Expand Down
2 changes: 1 addition & 1 deletion samples/UITests.macOS/UITests.macOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0-rc.7" />
<PackageReference Include="Appium.WebDriver" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using OpenQA.Selenium.Appium.Android;
using OpenQA.Selenium.Appium.Windows;
using Plugin.Maui.UITestHelpers.Core;

namespace Plugin.Maui.UITestHelpers.Appium
Expand Down Expand Up @@ -60,11 +61,13 @@ CommandResponse LaunchApp(IDictionary<string, object> parameters)
{ "bundleId", _app.GetAppId() },
});
}
else if (_app.GetTestDevice() == TestDevice.Windows)
else if (_app.Driver is WindowsDriver windowsDriver)
{
#pragma warning disable CS0618 // Type or member is obsolete
_app.Driver.LaunchApp();
#pragma warning restore CS0618 // Type or member is obsolete
// Appium driver removed the LaunchApp method in 5.0.0, so we need to use the executeScript method instead
// Currently the appium-windows-driver reports the following commands as compatible:
// startRecordingScreen,stopRecordingScreen,launchApp,closeApp,deleteFile,deleteFolder,
// click,scroll,clickAndDrag,hover,keys,setClipboard,getClipboard
windowsDriver.ExecuteScript("windows: launchApp", [_app.GetAppId()]);
}
else
{
Expand Down Expand Up @@ -122,11 +125,12 @@ CommandResponse CloseApp(IDictionary<string, object> parameters)
{ "bundleId", _app.GetAppId() },
});
}
else if (_app.GetTestDevice() == TestDevice.Windows)
else if (_app.Driver is WindowsDriver windowsDriver)
{
#pragma warning disable CS0618 // Type or member is obsolete
_app.Driver.CloseApp();
#pragma warning restore CS0618 // Type or member is obsolete
// This is still here for now, but it looks like it will get removed just like
// LaunchApp was in 5.0.0, in which case we may need to use:
// windowsDriver.ExecuteScript("windows: closeApp", [_app.GetAppId()]);
windowsDriver.CloseApp();
}
else
_app.Driver.TerminateApp(_app.GetAppId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0-rc.7" />
<PackageReference Include="System.Drawing.Common" Version="8.0.3" />
<PackageReference Include="Appium.WebDriver" Version="5.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.6" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading