blob: a468e31003aea63b618ae3dfbce24c454379950b (
plain)
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
92
93
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using System.Diagnostics;
namespace Xamarin.Forms.Core.UITests
{
[TestFixture]
[Category ("Stepper")]
internal class StepperGalleryTests : BaseTestFixture
{
// TODO: Checking enabled / disabled states
// TODO: Port to new conventions
public StepperGalleryTests ()
{
ShouldResetPerFixture = false;
}
protected override void NavigateToGallery ()
{
App.NavigateToGallery (GalleryQueries.StepperGalleryLegacy);
}
[Test]
[Description ("Check all elements exist")]
public void StepperGalleryAllElementsPresent ()
{
// App.WaitForElement (PlatformQueries.LabelWithText ("0"));
// var labels = App.Query (PlatformQueries.LabelWithText ("0"));
// Assert.AreEqual (2, labels.Length);
// var steppers = App.Query (PlatformQueries.Steppers);
// Assert.AreEqual (2, steppers.Length);
// App.Screenshot ("All elements exist");
}
// [Test]
// [Description ("Check that value changed event fires")]
// public void StepperGalleryValueChangedEventTest ()
// {
// StepperGalleryAllElementsPresent ();
// var labelText = "";
// for (int i = 1; i <= 5; i++) {
// App.Tap (PlatformQueries.StepperWithIndex (0));
// App.Screenshot (string.Format ("Tapped first stepper {0} times", i));
// App.WaitForElement (PlatformQueries.LabelWithText ((i*10).ToString ()));
// labelText = App.GetTextForQuery (PlatformQueries.LabelWithText ((i*10).ToString ()));
// Assert.AreEqual ((i*10).ToString (), labelText);
// }
// for (int i = 1; i <= 5; i++) {
// App.Tap (PlatformQueries.StepperWithIndex (1));
// App.Screenshot (string.Format ("Tapped second stepper {0} times", i));
// App.WaitForElement (PlatformQueries.LabelWithText ((i*.05).ToString ()));
// labelText = App.GetTextForQuery (PlatformQueries.LabelWithText ((i*.05).ToString ()));
// Assert.AreEqual ((i*.05).ToString (), labelText);
// }
// }
///*******************************************************/
///**************** Landscape tests **********************/
///*******************************************************/
// [Test]
// [Description ("Check all elements exist - Landscape")]
// public void StepperGalleryAllElementsPresetLandscape ()
// {
// App.SetOrientationLandscape ();
// App.Screenshot ("Rotated to Landscape");
// StepperGalleryAllElementsPresent ();
// App.SetOrientationPortrait ();
// App.Screenshot ("Rotated to Portrait");
// }
// [Test]
// [Description ("Check that events fire - Landscape")]
//// [Category ("Single")]
// public void StepperGalleryEventTestLandscape ()
// {
// App.SetOrientationLandscape ();
// App.Screenshot ("Rotated to Landscape");
// StepperGalleryValueChangedEventTest ();
// App.SetOrientationPortrait ();
// App.Screenshot ("Rotated to Portrait");
// }
}
}
|