-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue2981.cs
45 lines (37 loc) · 1.1 KB
/
Issue2981.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github5000)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 2981, "Long Press on ListView causes crash")]
public class Issue2981 : TestContentPage
{
protected override void Init()
{
var listView = new ListView();
listView.ItemsSource = new[] { "Cell1", "Cell2" };
Content = listView;
}
#if UITEST && !__WINDOWS__
// This test won't work on Windows right now because we can only test desktop, so touch events
// (like LongPress) don't really work. The test should work manually on a touch screen, though.
[Test]
public void Issue2981Test()
{
RunningApp.Screenshot("I am at Issue 1");
RunningApp.TouchAndHold(q => q.Marked("Cell1"));
RunningApp.Screenshot("Long Press first cell");
RunningApp.TouchAndHold(q => q.Marked("Cell2"));
RunningApp.Screenshot("Long Press second cell");
}
#endif
}
}