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

Commit 739483e

Browse files
authored
[Housekeeping] Fix iOS 14 broken tests (#13638)
* Fix ShapesPathReceiveGestureRecognizers * Avoid execute Bugzilla43161Test in iOS 14 * Not ignore Bugzilla43161 test
1 parent 50a6d53 commit 739483e

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43161.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected override void Init()
5656
Content = new StackLayout { Children = { label, listView, listView2, listView3 } };
5757
}
5858

59-
#if (UITEST && __IOS__)
59+
#if UITEST && __IOS__
6060
[Test]
6161
public void Bugzilla43161Test()
6262
{
@@ -66,4 +66,4 @@ public void Bugzilla43161Test()
6666
}
6767
#endif
6868
}
69-
}
69+
}

Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue12685.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.ComponentModel;
3-
using System.Windows.Input;
4-
using Xamarin.Forms.CustomAttributes;
1+
using Xamarin.Forms.CustomAttributes;
52
using Xamarin.Forms.Internals;
63
using Xamarin.Forms.Shapes;
74

@@ -21,6 +18,9 @@ namespace Xamarin.Forms.Controls.Issues
2118
#endif
2219
public partial class Issue12685 : TestContentPage
2320
{
21+
const string StatusLabelId = "StatusLabelId";
22+
const string PathId = "PathId";
23+
2424
const string ResetStatus = "Path touch event not fired, touch path above.";
2525
const string ClickedStatus = "Path was clicked, click reset button to start over.";
2626

@@ -29,7 +29,7 @@ protected override void Init()
2929
var layout = new StackLayout();
3030
var statusLabel = new Label
3131
{
32-
AutomationId = "LabelValue",
32+
AutomationId = StatusLabelId,
3333
Text = ResetStatus,
3434
};
3535

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

4343
var path = new Path
4444
{
45+
AutomationId = PathId,
4546
Data = pathGeometry,
4647
Fill = lgb
4748
};
@@ -69,11 +70,12 @@ protected override void Init()
6970
[Test]
7071
public void ShapesPathReceiveGestureRecognizers()
7172
{
72-
var testLabel = RunningApp.WaitForFirstElement("LabelValue");
73+
var testLabel = RunningApp.WaitForFirstElement(StatusLabelId);
7374
Assert.AreEqual(ResetStatus, testLabel.ReadText());
74-
var pathRect = testLabel.Rect;
75-
RunningApp.TapCoordinates(pathRect.X + 100, pathRect.Y-100);
76-
Assert.AreEqual(ClickedStatus, RunningApp.WaitForFirstElement("LabelValue").ReadText());
75+
var testPath = RunningApp.WaitForFirstElement(PathId);
76+
var pathRect = testPath.Rect;
77+
RunningApp.TapCoordinates(pathRect.X + 1, pathRect.Y + 1);
78+
Assert.AreEqual(ClickedStatus, RunningApp.WaitForFirstElement(StatusLabelId).ReadText());
7779
}
7880
#endif
7981
}

0 commit comments

Comments
 (0)