Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Housekeeping] Fix iOS 14 broken tests #13638

Merged
merged 3 commits into from
Feb 5, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected override void Init()
Content = new StackLayout { Children = { label, listView, listView2, listView3 } };
}

#if (UITEST && __IOS__)
#if UITEST && __IOS__
[Test]
public void Bugzilla43161Test()
{
Expand All @@ -66,4 +66,4 @@ public void Bugzilla43161Test()
}
#endif
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.ComponentModel;
using System.Windows.Input;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Shapes;

Expand All @@ -21,6 +18,9 @@ namespace Xamarin.Forms.Controls.Issues
#endif
public partial class Issue12685 : TestContentPage
{
const string StatusLabelId = "StatusLabelId";
const string PathId = "PathId";

const string ResetStatus = "Path touch event not fired, touch path above.";
const string ClickedStatus = "Path was clicked, click reset button to start over.";

Expand All @@ -29,7 +29,7 @@ protected override void Init()
var layout = new StackLayout();
var statusLabel = new Label
{
AutomationId = "LabelValue",
AutomationId = StatusLabelId,
Text = ResetStatus,
};

Expand All @@ -42,6 +42,7 @@ protected override void Init()

var path = new Path
{
AutomationId = PathId,
Data = pathGeometry,
Fill = lgb
};
Expand Down Expand Up @@ -69,11 +70,12 @@ protected override void Init()
[Test]
public void ShapesPathReceiveGestureRecognizers()
{
var testLabel = RunningApp.WaitForFirstElement("LabelValue");
var testLabel = RunningApp.WaitForFirstElement(StatusLabelId);
Assert.AreEqual(ResetStatus, testLabel.ReadText());
var pathRect = testLabel.Rect;
RunningApp.TapCoordinates(pathRect.X + 100, pathRect.Y-100);
Assert.AreEqual(ClickedStatus, RunningApp.WaitForFirstElement("LabelValue").ReadText());
var testPath = RunningApp.WaitForFirstElement(PathId);
var pathRect = testPath.Rect;
RunningApp.TapCoordinates(pathRect.X + 1, pathRect.Y + 1);
Assert.AreEqual(ClickedStatus, RunningApp.WaitForFirstElement(StatusLabelId).ReadText());
}
#endif
}
Expand Down