summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core.UITests.Shared/Queries.cs
blob: 199b3f25ff174bfcf0888e60a5f86616111015ac (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

using Xamarin.UITest;
using Xamarin.UITest.Queries;

namespace Xamarin.Forms.Core.UITests
{	
	internal static class GalleryQueries
	{
		public const string AutomationIDGallery = "* marked:'AutomationID Gallery'";
		public const string ActivityIndicatorGallery = "* marked:'ActivityIndicator Gallery'";
		public const string BoxViewGallery = "* marked:'BoxView Gallery'";
		public const string ButtonGallery = "* marked:'Button Gallery'";
		public const string ContextActionsListGallery = "* marked:'ContextActions List Gallery'";
		public const string ContextActionsTableGallery = "* marked:'ContextActions Table Gallery'";
		public const string DatePickerGallery = "* marked:'DatePicker Gallery'";
		public const string EditorGallery = "* marked:'Editor Gallery'";
		public const string EntryGallery = "* marked:'Entry Gallery'";
		public const string FrameGallery = "* marked:'Frame Gallery'";
		public const string ImageGallery = "* marked:'Image Gallery'";
		public const string LabelGallery = "* marked:'Label Gallery'";
		public const string ListViewGallery = "* marked:'ListView Gallery'";
		public const string OpenGLViewGallery = "* marked:'OpenGLView Gallery'";
		public const string PickerGallery = "* marked:'Picker Gallery'";
		public const string ProgressBarGallery = "* marked:'ProgressBar Gallery'";
		public const string ScrollViewGallery = "* marked:'ScrollView Gallery'";
		public const string ScrollViewGalleryHorizontal = "* marked:'ScrollView Gallery Horizontal'";
		public const string SearchBarGallery = "* marked:'SearchBar Gallery'";
		public const string SliderGallery = "* marked:'Slider Gallery'";
		public const string StepperGallery = "* marked:'Stepper Gallery'";
		public const string SwitchGallery = "* marked:'Switch Gallery'";
		public const string TableViewGallery = "* marked:'TableView Gallery'";
		public const string TimePickerGallery = "* marked:'TimePicker Gallery'";
		public const string WebViewGallery = "* marked:'WebView Gallery'";
		public const string ToolbarItemGallery = "* marked:'ToolbarItems Gallery'";
		public const string DisplayAlertGallery = "* marked:'DisplayAlert Gallery'";
		public const string ActionSheetGallery = "* marked:'ActionSheet Gallery'";
		public const string RootPagesGallery = "* marked:'RootPages Gallery'";

		public const string AppearingGallery = "* marked:'Appearing Gallery'";

		// Legacy galleries
		public const string CellsGalleryLegacy = "* marked:'Cells Gallery - Legacy'";
		public const string UnevenListGalleryLegacy = "* marked:'UnevenList Gallery - Legacy'";
	}

	internal static class Queries
	{
		#region Platform queries

		public static Func<AppQuery, AppQuery> NavigationBarBackButton ()
		{
			return PlatformQueries.NavigationBarBackButton;
		}

		public static Func<AppQuery, AppQuery> PageWithoutNavigationBar ()
		{
			return PlatformQueries.PageWithoutNavigationBar;
		}

		public static Func<AppQuery, AppQuery> Root ()
		{
			return PlatformQueries.Root;
		}

		#endregion

	}

	internal static class Views
	{
		public static readonly string ActivityIndicator = PlatformViews.ActivityIndicator;
		public static readonly string BoxView = PlatformViews.BoxView;
		public static readonly string Button = PlatformViews.Button;
		public static readonly string DatePicker = PlatformViews.DatePicker;
		public static readonly string Editor = PlatformViews.Editor;
		public static readonly string Entry = PlatformViews.Entry;
		public static readonly string Frame = PlatformViews.Frame;
		public static readonly string Image = PlatformViews.Image;
		public static readonly string Label = PlatformViews.Label;
		public static readonly string ListView = PlatformViews.ListView;
		public static readonly string OpenGLView = PlatformViews.OpenGLView;
		public static readonly string Picker = PlatformViews.Picker;
		public static readonly string ProgressBar = PlatformViews.ProgressBar;
		public static readonly string SearchBar = PlatformViews.SearchBar;
		public static readonly string Slider = PlatformViews.Slider;
		public static readonly string Stepper = PlatformViews.Stepper;
		public static readonly string Switch = PlatformViews.Switch;
		public static readonly string TableView = PlatformViews.TableView;
		public static readonly string TimePicker = PlatformViews.TimePicker;
		public static readonly string WebView = PlatformViews.WebView;
	}

	internal static class Rects
	{
		public static AppRect RootViewRect (this IApp app)
		{
			return app.Query (q => q.Raw ("* index:0"))[0].Rect;
		}
	}
}