Skip to content
Open
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
10 changes: 9 additions & 1 deletion test/integration/Android/ElementTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ public class ElementTest
[OneTimeSetUp]
public void BeforeAll()
{
if (Env.IsCiEnvironment())
{
Assert.Ignore("Skipping ElementTest test fixture in CI environment");
}
var capabilities = Env.ServerIsRemote()
? Caps.GetAndroidUIAutomatorCaps(Apps.Get("androidApiDemos"))
: Caps.GetAndroidUIAutomatorCaps(Apps.Get("androidApiDemos"));
Expand All @@ -28,13 +32,17 @@ public void BeforeAll()
[SetUp]
public void SetUp()
{
_driver.StartActivity("io.appium.android.apis/.ApiDemos");
_driver?.StartActivity("io.appium.android.apis/.ApiDemos");
}

[Test]
[Ignore("Temporarily disabled until GetProperty(\"className\") behavior is verified for this test")]
public void GetPropertyTest()
{
if (Env.IsCiEnvironment())
{
Assert.Ignore("Skipping GetPropertyTest test in CI environment");
}
var myElement = WaitForElement(_driver, MobileBy.Id("android:id/content"));
var propertyValue = myElement.GetProperty("className");
Assert.That(propertyValue, Is.Not.Null);
Expand Down
23 changes: 14 additions & 9 deletions test/integration/helpers/Filters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ public class Filters
{
public static IWebElement FirstWithName<TW>(IList<TW> els, string name) where TW : IWebElement
{
for (var i = 0; i < els.Count; i++)
int count = els.Count;
for (var i = 0; i < count; i++)
{
if (els[i].GetAttribute("name") == name)
var el = els[i];
if (el.GetAttribute("name") == name)
{
return (TW) els[i];
return el;
}
}
return null;
Expand All @@ -20,11 +22,13 @@ public static IWebElement FirstWithName<TW>(IList<TW> els, string name) where TW
public static IList<IWebElement> FilterWithName<TW>(IList<TW> els, string name) where TW : IWebElement
{
var res = new List<IWebElement>();
for (var i = 0; i < els.Count; i++)
int count = els.Count;
for (var i = 0; i < count; i++)
{
if (els[i].GetAttribute("name") == name)
var el = els[i];
if (el.GetAttribute("name") == name)
{
res.Add(els[i]);
res.Add(el);
}
}
return res;
Expand All @@ -33,12 +37,13 @@ public static IList<IWebElement> FilterWithName<TW>(IList<TW> els, string name)
public static IList<IWebElement> FilterDisplayed<TW>(IList<TW> els) where TW : IWebElement
{
var res = new List<IWebElement>();
for (var i = 0; i < els.Count; i++)
int count = els.Count;
for (var i = 0; i < count; i++)
{
IWebElement el = els[i];
if (els[i].Displayed)
if (el.Displayed)
{
res.Add(els[i]);
res.Add(el);
}
}
return res;
Expand Down
Loading