-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
CollectionViewItemsUpdatingScrollMode.cs
74 lines (66 loc) · 1.91 KB
/
CollectionViewItemsUpdatingScrollMode.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.CollectionView)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.None, 8888888, "CollectionView ItemsUpdatingScrollMode", PlatformAffected.All)]
public class CollectionViewItemsUpdatingScrollMode : TestNavigationPage
{
protected override void Init()
{
#if APP
Device.SetFlags(new List<string>(Device.Flags ?? new List<string>()) { "CollectionView_Experimental" });
PushAsync(new GalleryPages.CollectionViewGalleries.ScrollModeGalleries.ScrollModeTestGallery());
#endif
}
#if UITEST
[Test]
public void KeepItemsInView()
{
RunningApp.WaitForElement("ScrollToMiddle");
RunningApp.Tap("ScrollToMiddle");
RunningApp.WaitForElement("Vegetables.jpg, 10");
for (int n = 0; n < 25; n++)
{
RunningApp.Tap("AddItemAbove");
}
RunningApp.WaitForElement("Vegetables.jpg, 10");
}
[Test]
public void KeepScrollOffset()
{
RunningApp.WaitForElement("SelectScrollMode");
RunningApp.Tap("SelectScrollMode");
RunningApp.Tap("KeepScrollOffset");
RunningApp.WaitForElement("ScrollToMiddle");
RunningApp.Tap("ScrollToMiddle");
RunningApp.WaitForElement("Vegetables.jpg, 10");
RunningApp.Tap("AddItemAbove");
RunningApp.WaitForElement("photo.jpg, 9");
}
[Test]
public void KeepLastItemInView()
{
RunningApp.WaitForElement("SelectScrollMode");
RunningApp.Tap("SelectScrollMode");
RunningApp.Tap("KeepLastItemInView");
RunningApp.WaitForElement("ScrollToMiddle");
RunningApp.Tap("ScrollToMiddle");
RunningApp.WaitForElement("Vegetables.jpg, 10");
RunningApp.Tap("AddItemToEnd");
RunningApp.WaitForElement("Added item");
}
#endif
}
}