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

[Testing] Enabling ported UITests from Xamarin.UITests to Appium - 44 #26563

Merged
merged 1 commit into from
Dec 13, 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
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");
}
}
Loading