Skip to content

Commit fa3c27c

Browse files
refactor: Update to work with Selenium 4 (with element factory) (#469)
* Add most fixes * Get proect to build * Use new platform setting more consistantly * Get WinAppTests kind of working * Drop one off web elements Add 'App' as a known capablity Transition from AddAdditionalCapability to AddAdditionalOption * Use Selenium 4 RC2 and remove extra using statements * Cleanup mobile selectors and image compare test * Fix mobile By bug * Undo local test code * Address PR comments * Add back IdempotencyHeader * PR related cleanup * Update to latest Selenium RC * Update PageObjects code to work with new Element and driver paradigm Update tests to leverage configuration DeviceName and AddAdditionalAppiumOption * Work with web element factory * Update to work with upcoming RC4 * Move to official release as there will be no RC4 * Update copyright * Put Newtonsoft back * Use ternary operator * Remove outdated using statements
1 parent 135c1d3 commit fa3c27c

File tree

62 files changed

+471
-459
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+471
-459
lines changed

src/Appium.Net/Appium.Net.csproj

+5-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<Product>Appium-Dotnet-Driver</Product>
99
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
1010
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
11-
<Copyright>Copyright © 2020</Copyright>
11+
<Copyright>Copyright © 2021</Copyright>
1212
<PackageProjectUrl>https://github.com/appium/appium-dotnet-driver</PackageProjectUrl>
1313
<RepositoryUrl>https://github.com/appium/appium-dotnet-driver</RepositoryUrl>
1414
<RepositoryType>git</RepositoryType>
@@ -26,8 +26,8 @@
2626
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
2727
</PropertyGroup>
2828

29-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
30-
<DocumentationFile>Appium.Net.xml</DocumentationFile>
29+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
30+
<DocumentationFile>Appium.Net.xml</DocumentationFile>
3131
</PropertyGroup>
3232
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net45|AnyCPU'">
3333
<DocumentationFile>Appium.Net.xml</DocumentationFile>
@@ -48,9 +48,8 @@
4848
<PrivateAssets>all</PrivateAssets>
4949
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5050
</PackageReference>
51-
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
52-
<PackageReference Include="Selenium.Support" Version="3.141.0" />
53-
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
51+
<PackageReference Include="Selenium.Support" Version="4.0.0" />
52+
<PackageReference Include="Selenium.WebDriver" Version="4.0.0" />
5453
</ItemGroup>
5554

5655
<ItemGroup>

src/Appium.Net/Appium.Net.xml

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Appium.Net/Appium/Android/AndroidDriver.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using OpenQA.Selenium.Appium.Enums;
1717
using OpenQA.Selenium.Appium.Interfaces;
1818
using OpenQA.Selenium.Appium.Service;
19-
using OpenQA.Selenium.Remote;
2019
using System;
2120
using System.Collections.Generic;
2221
using System.Drawing;
@@ -303,7 +302,7 @@ public IList<string> GetPerformanceDataTypes() =>
303302
public string EndTestCoverage(string intent, string path) =>
304303
AndroidCommandExecutionHelper.EndTestCoverage(this, intent, path);
305304

306-
protected override RemoteWebElementFactory CreateElementFactory() => new AndroidElementFactory(this);
305+
protected override WebElementFactory CreateElementFactory() => new AndroidElementFactory(this);
307306

308307
public void SetSetting(string setting, object value) =>
309308
AndroidCommandExecutionHelper.SetSetting(this, setting, value);

src/Appium.Net/Appium/Android/AndroidElement.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
using OpenQA.Selenium.Appium.Enums;
1616
using OpenQA.Selenium.Appium.Interfaces;
17-
using OpenQA.Selenium.Remote;
1817
using System.Collections.Generic;
1918

2019
namespace OpenQA.Selenium.Appium.Android
@@ -26,7 +25,7 @@ public class AndroidElement : AppiumWebElement, IFindByAndroidUIAutomator<Appium
2625
/// </summary>
2726
/// <param name="parent">Driver in use.</param>
2827
/// <param name="id">ID of the element.</param>
29-
public AndroidElement(RemoteWebDriver parent, string id)
28+
public AndroidElement(WebDriver parent, string id)
3029
: base(parent, id)
3130
{
3231
}

src/Appium.Net/Appium/Android/AndroidElementFactory.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
using OpenQA.Selenium.Remote;
2-
1+

32
namespace OpenQA.Selenium.Appium.Android
43
{
54
public class AndroidElementFactory : CachedElementFactory<AndroidElement>
65
{
7-
public AndroidElementFactory(RemoteWebDriver parentDriver) : base(parentDriver)
6+
public AndroidElementFactory(WebDriver parentDriver) : base(parentDriver)
87
{
98
}
109

11-
protected override AndroidElement CreateCachedElement(RemoteWebDriver parentDriver, string elementId)
10+
protected override AndroidElement CreateCachedElement(WebDriver parentDriver, string elementId)
1211
{
1312
return new AndroidElement(parentDriver, elementId);
1413
}

src/Appium.Net/Appium/AppiumCapabilities.cs

-28
This file was deleted.

0 commit comments

Comments
 (0)