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

test: Replace deprecated ByIosUIAutomation in ScrollingSearchingTest #881

Merged
merged 1 commit into from
Dec 21, 2024
Merged
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
22 changes: 11 additions & 11 deletions test/integration/IOS/ScrollingSearchingTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Appium.Net.Integration.Tests.helpers;
using System.Collections.Generic;
using Appium.Net.Integration.Tests.helpers;
using NUnit.Framework;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.iOS;
Expand Down Expand Up @@ -29,21 +30,20 @@ public void AfterEach()
}

[Test]
public void ScrollToTestCase()
public void ScrollToToolbarsElementUsingToVisibleTrueTest()
{
var slider = _driver
.FindElement(new ByIosUIAutomation(".tableViews()[0]"
+ ".scrollToElementWithPredicate(\"name CONTAINS 'Slider'\")"));
Assert.That(slider.GetAttribute("name"), Is.EqualTo("Sliders"));
var Toolbars = _driver.FindElement(new ByIosNSPredicate("name == 'Toolbars'"));
_driver.ExecuteScript("mobile: scroll", new Dictionary<string, string> { { "element", Toolbars.Id }, { "toVisible", "true" } });
Assert.That(Toolbars.Displayed, Is.True, "The 'Toolbars' element should be visible after scrolling.");
}

[Test]
public void ScrollToExactTestCase()
public void ScrollToSwitchesElementUsingDirectionDownTest()
{
var table = _driver.FindElement(new ByIosUIAutomation(".tableViews()[0]"));
var slider = table.FindElement(
new ByIosUIAutomation(".scrollToElementWithPredicate(\"name CONTAINS 'Slider'\")"));
Assert.That(slider.GetAttribute("name"), Is.EqualTo("Sliders"));
var table = _driver.FindElement(new ByIosNSPredicate("type == 'XCUIElementTypeTable'"));
_driver.ExecuteScript("mobile: scroll", new Dictionary<string, string> { { "direction", "down" }, { "element", table.Id } });
var switches = table.FindElement(new ByIosNSPredicate("name CONTAINS 'Switches'"));
Assert.That(switches.GetAttribute("visible"), Is.EqualTo("true"));
}
}
}
Loading