1
- using System ;
2
- using System . ComponentModel ;
3
- using System . Windows . Input ;
4
- using Xamarin . Forms . CustomAttributes ;
1
+ using Xamarin . Forms . CustomAttributes ;
5
2
using Xamarin . Forms . Internals ;
6
3
using Xamarin . Forms . Shapes ;
7
4
@@ -21,6 +18,9 @@ namespace Xamarin.Forms.Controls.Issues
21
18
#endif
22
19
public partial class Issue12685 : TestContentPage
23
20
{
21
+ const string StatusLabelId = "StatusLabelId" ;
22
+ const string PathId = "PathId" ;
23
+
24
24
const string ResetStatus = "Path touch event not fired, touch path above." ;
25
25
const string ClickedStatus = "Path was clicked, click reset button to start over." ;
26
26
@@ -29,7 +29,7 @@ protected override void Init()
29
29
var layout = new StackLayout ( ) ;
30
30
var statusLabel = new Label
31
31
{
32
- AutomationId = "LabelValue" ,
32
+ AutomationId = StatusLabelId ,
33
33
Text = ResetStatus ,
34
34
} ;
35
35
@@ -42,6 +42,7 @@ protected override void Init()
42
42
43
43
var path = new Path
44
44
{
45
+ AutomationId = PathId ,
45
46
Data = pathGeometry ,
46
47
Fill = lgb
47
48
} ;
@@ -69,11 +70,12 @@ protected override void Init()
69
70
[ Test ]
70
71
public void ShapesPathReceiveGestureRecognizers ( )
71
72
{
72
- var testLabel = RunningApp . WaitForFirstElement ( "LabelValue" ) ;
73
+ var testLabel = RunningApp . WaitForFirstElement ( StatusLabelId ) ;
73
74
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 ( ) ) ;
77
79
}
78
80
#endif
79
81
}
0 commit comments