-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
ScrollViewUITests.cs
91 lines (81 loc) · 2.08 KB
/
ScrollViewUITests.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
namespace Microsoft.Maui.AppiumTests
{
class ScrollViewUITests : UITest
{
const string ScrollViewGallery = "ScrollView Gallery";
public ScrollViewUITests(TestDevice device)
: base(device)
{
}
protected override void FixtureSetup()
{
base.FixtureSetup();
App.NavigateToGallery(ScrollViewGallery);
}
protected override void FixtureTeardown()
{
base.FixtureTeardown();
this.Back();
}
[Test]
[Description("Scroll element to the start")]
public void ScrollToElement1Start()
{
if (Device == TestDevice.Mac || Device == TestDevice.iOS)
{
App.Click("Start");
App.WaitForElement("the scrollto button");
App.Screenshot("Element is on the top");
}
else
{
Assert.Ignore("This test is failing, likely due to product issue");
}
}
[Test]
[Description("Scroll element to the center")]
public void ScrollToElement2Center()
{
if (Device == TestDevice.Mac || Device == TestDevice.iOS)
{
App.Click("Center");
App.WaitForElement("the scrollto button");
App.WaitForElement("the before");
App.WaitForElement("the after");
App.Screenshot("Element is in the center");
}
else
{
Assert.Ignore("This test is failing, likely due to product issue");
}
}
[Test]
[Description("Scroll element to the end")]
public void ScrollToElement3End()
{
if (Device == TestDevice.Mac || Device == TestDevice.iOS)
{
App.Click("End");
App.WaitForElement("the scrollto button");
App.Screenshot("Element is in the end");
}
else
{
Assert.Ignore("This test is failing, likely due to product issue");
}
}
[Test]
[Description("Scroll down the ScrollView using a gesture")]
public void ScrollUpAndDownWithGestures()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows });
App.ScrollDown("thescroller", ScrollStrategy.Gesture, 0.75);
App.Screenshot("Element scrolled down");
App.ScrollUp("thescroller", ScrollStrategy.Gesture, 0.75);
App.Screenshot("Element scrolled up");
}
}
}