Skip to content

Commit

Permalink
Enabled 44th Set of UITests migrated from XamarinUITest into Appium (#42
Browse files Browse the repository at this point in the history
) (#26563)

* Migrated Issues : Issue55555, Issue4138, Issue3840, Issue3292

* Modified code changes

* Modified the migrated tests

* Updated Issue55555 sample

* reverted 4138

---------

Co-authored-by: HarishKumarSF4517 <harish.kumar@syncfusion.com>
  • Loading branch information
anandhan-rajagopal and HarishKumarSF4517 authored Dec 13, 2024
1 parent 38b3c64 commit bc098bf
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 38 deletions.
11 changes: 7 additions & 4 deletions src/Controls/tests/TestCases.HostApp/Issues/XFIssue/Issue3840.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Microsoft.Maui.Layouts;

namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 3840, "[iOS] Translation change causes ScrollView to reset to initial position (0, 0)",
Expand Down Expand Up @@ -50,9 +52,10 @@ protected override void Init()
}
};

// TODO: Uncomment
//var mainLayout = new AbsoluteLayout();
//mainLayout.Children.Add(scroll, new Rect(0, 0, 1, 1), AbsoluteLayoutFlags.All);
//Content = mainLayout;
var mainLayout = new AbsoluteLayout();
mainLayout.Children.Add(scroll);
AbsoluteLayout.SetLayoutBounds(scroll, new Rect(0, 0, 1, 1));
AbsoluteLayout.SetLayoutFlags(scroll, AbsoluteLayoutFlags.All);
Content = mainLayout;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ protected override void Init()
lstView.HasUnevenRows = true;
lstView.IsGroupingEnabled = true;
lstView.GroupDisplayBinding = new Binding("LongName");
#if !WINDOWS // Getting exception while running the sample with GroupShortNameBinding on windows, Issue: /~https://github.com/dotnet/maui/issues/26534.
lstView.GroupShortNameBinding = new Binding("ShortName");
#endif

lstView.ItemTemplate = new DataTemplate(typeof(DemoTextCell));
lstView.ItemTemplate.SetBinding(DemoTextCell.TextProperty, "Name");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue3292 : _IssuesUITest
{

public Issue3292(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "TableSection.Title property binding fails in XAML";

// [Test]
// [Category(UITestCategories.TableView)]
// [FailsOnIOS]
// public void Issue3292Test()
// {
// App.WaitForElement(q => q.Marked("Hello World Changed"));
// }
[Test]
[Category(UITestCategories.TableView)]
public void Issue3292Test()
{
App.WaitForElementTillPageNavigationSettled("Hello World Changed");
}
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
using NUnit.Framework;
#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST // In iOS and Catalyst, WaitForNoElement throws a timeout exception eventhough the text is not visible on the screen by scrolling.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue3840 : _IssuesUITest
{
const string FailedText = "Test Failed if Visible";
const string FirstButton = "FirstClick";
const string SecondButton = "SecondClick";
public Issue3840(TestDevice testDevice) : base(testDevice)
{
{
}

public override string Issue => "[iOS] Translation change causes ScrollView to reset to initial position (0, 0)";

// TODO: The _ variables need to be AutomationId values
// [Test]
// [FailsOnIOSWhenRunningOnXamarinUITest]
// [Category(UITestCategories.ScrollView)]
// public void TranslatingViewKeepsScrollViewPosition()
// {
// App.WaitForElement(_failedText);
// App.Tap(_button1);
// App.Tap(_button2);
//#if WINDOWS
// var label = App.WaitForElement(_failedText);
// Assert.AreEqual(0, label[0].Rect.Height);
// Assert.AreEqual(0, label[0].Rect.Width);
//#else
// var result = App.QueryUntilNotPresent(() => App.Query(_failedText));
//#endif
// }
}
[Test]
[Category(UITestCategories.ScrollView)]
public void TranslatingViewKeepsScrollViewPosition()
{
App.WaitForElement(FailedText);
App.Tap(FirstButton);
App.WaitForElement(SecondButton);
App.Tap(SecondButton);
App.WaitForNoElement(FailedText);
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ public Issue55555(TestDevice testDevice) : base(testDevice)

public override string Issue => "Header problem";

//[Test]
//[Category(UITestCategories.ListView)]
//[FailsOnIOS]
//public void TGroupDisplayBindingPresentRecycleElementTest()
//{
// App.WaitForElement(q => q.Marked("vegetables"));
//}
[Test]
[Category(UITestCategories.ListView)]
public void TGroupDisplayBindingPresentRecycleElementTest()
{
App.WaitForElement("vegetables");
}
}

0 comments on commit bc098bf

Please sign in to comment.