summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@gmail.com>2017-09-05 22:18:05 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-10-23 04:30:09 (GMT)
commit95c51598724561b0ed1c8940736ceb7972f0db22 (patch)
treed6facaa82936e834ce609cf34f78d286968b2f99 /Xamarin.Forms.Controls.Issues
parentc56f36257e4cedc21e27bbae535b70d427821af5 (diff)
downloadxamarin-forms-95c51598724561b0ed1c8940736ceb7972f0db22.zip
xamarin-forms-95c51598724561b0ed1c8940736ceb7972f0db22.tar.gz
xamarin-forms-95c51598724561b0ed1c8940736ceb7972f0db22.tar.bz2
Split up test
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44096.cs108
1 files changed, 51 insertions, 57 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44096.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44096.cs
index 91ef39a..37c135d 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44096.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44096.cs
@@ -18,12 +18,20 @@ namespace Xamarin.Forms.Controls.Issues
public class Bugzilla44096 : TestContentPage
{
bool _flag;
+ const string Child = "Child";
+ const string Original = "Original";
+ const string ToggleColor = "color";
+ const string ToggleIsEnabled = "disabled";
+
+ const string StackLayout = "stackLayout";
+ const string ContentView = "contentView";
+ const string Grid = "grid";
protected override void Init()
{
var result = new Label
{
- Text = "Original"
+ Text = Original
};
var grid = new Grid
@@ -31,7 +39,7 @@ namespace Xamarin.Forms.Controls.Issues
IsEnabled = true,
WidthRequest = 250,
HeightRequest = 50,
- AutomationId = "grid"
+ AutomationId = Grid
};
AddTapGesture(result, grid);
@@ -40,7 +48,7 @@ namespace Xamarin.Forms.Controls.Issues
IsEnabled = true,
WidthRequest = 250,
HeightRequest = 50,
- AutomationId = "contentView"
+ AutomationId = ContentView
};
AddTapGesture(result, contentView);
@@ -49,7 +57,7 @@ namespace Xamarin.Forms.Controls.Issues
IsEnabled = true,
WidthRequest = 250,
HeightRequest = 50,
- AutomationId = "stackLayout"
+ AutomationId = StackLayout
};
AddTapGesture(result, stackLayout);
@@ -73,21 +81,21 @@ namespace Xamarin.Forms.Controls.Issues
_flag = !_flag;
}),
- AutomationId = "color"
+ AutomationId = ToggleColor
};
var disabled = new Button
{
- Text = "Disabled",
+ Text = "Toggle IsEnabled",
Command = new Command(() =>
{
grid.IsEnabled = false;
contentView.IsEnabled = false;
stackLayout.IsEnabled = false;
- result.Text = "Original";
+ result.Text = Original;
}),
- AutomationId = "disabled"
+ AutomationId = ToggleIsEnabled
};
var parent = new StackLayout
@@ -116,72 +124,58 @@ namespace Xamarin.Forms.Controls.Issues
{
Command = new Command(() =>
{
- result.Text = "Child";
+ result.Text = Child;
})
};
view.GestureRecognizers.Add(tapGestureRecognizer);
}
#if UITEST
+
[Test]
- public void Test()
+ public void TestGrid()
{
- RunningApp.WaitForElement(q => q.Marked("grid"));
- RunningApp.Tap(q => q.Marked("grid"));
- RunningApp.WaitForElement(q => q.Marked("Child"));
-
- RunningApp.WaitForElement(q => q.Marked("contentView"));
- RunningApp.Tap(q => q.Marked("contentView"));
- RunningApp.WaitForElement(q => q.Marked("Child"));
-
- RunningApp.WaitForElement(q => q.Marked("stackLayout"));
- RunningApp.Tap(q => q.Marked("stackLayout"));
- RunningApp.WaitForElement(q => q.Marked("Child"));
-
- RunningApp.WaitForElement(q => q.Marked("color"));
- RunningApp.Tap(q => q.Marked("color"));
-
- RunningApp.WaitForElement(q => q.Marked("grid"));
- RunningApp.Tap(q => q.Marked("grid"));
- RunningApp.WaitForElement(q => q.Marked("Child"));
-
- RunningApp.WaitForElement(q => q.Marked("contentView"));
- RunningApp.Tap(q => q.Marked("contentView"));
- RunningApp.WaitForElement(q => q.Marked("Child"));
+ TestControl(Grid);
+ }
- RunningApp.WaitForElement(q => q.Marked("stackLayout"));
- RunningApp.Tap(q => q.Marked("stackLayout"));
- RunningApp.WaitForElement(q => q.Marked("Child"));
+ [Test]
+ public void TestContentView()
+ {
+ TestControl(ContentView);
+ }
- RunningApp.WaitForElement(q => q.Marked("disabled"));
- RunningApp.Tap(q => q.Marked("disabled"));
+ [Test]
+ public void TestStackLayout()
+ {
+ TestControl(StackLayout);
+ }
- RunningApp.WaitForElement(q => q.Marked("grid"));
- RunningApp.Tap(q => q.Marked("grid"));
- RunningApp.WaitForElement(q => q.Marked("Original"));
+ void TestControl(string control)
+ {
+ RunningApp.WaitForElement(q => q.Marked(control));
+ RunningApp.Tap(q => q.Marked(control));
+ RunningApp.WaitForElement(q => q.Marked(Child));
- RunningApp.WaitForElement(q => q.Marked("contentView"));
- RunningApp.Tap(q => q.Marked("contentView"));
- RunningApp.WaitForElement(q => q.Marked("Original"));
+ RunningApp.WaitForElement(q => q.Marked(ToggleColor));
+ RunningApp.Tap(q => q.Marked(ToggleColor));
- RunningApp.WaitForElement(q => q.Marked("stackLayout"));
- RunningApp.Tap(q => q.Marked("stackLayout"));
- RunningApp.WaitForElement(q => q.Marked("Original"));
+ RunningApp.WaitForElement(q => q.Marked(control));
+ RunningApp.Tap(q => q.Marked(control));
+ RunningApp.WaitForElement(q => q.Marked(Child));
- RunningApp.WaitForElement(q => q.Marked("color"));
- RunningApp.Tap(q => q.Marked("color"));
+ RunningApp.WaitForElement(q => q.Marked(ToggleIsEnabled));
+ RunningApp.Tap(q => q.Marked(ToggleIsEnabled));
- RunningApp.WaitForElement(q => q.Marked("grid"));
- RunningApp.Tap(q => q.Marked("grid"));
- RunningApp.WaitForElement(q => q.Marked("Original"));
+ RunningApp.WaitForElement(q => q.Marked(control));
+ RunningApp.Tap(q => q.Marked(control));
+ RunningApp.WaitForElement(q => q.Marked(Original));
- RunningApp.WaitForElement(q => q.Marked("contentView"));
- RunningApp.Tap(q => q.Marked("contentView"));
- RunningApp.WaitForElement(q => q.Marked("Original"));
+ RunningApp.WaitForElement(q => q.Marked(ToggleColor));
+ RunningApp.Tap(q => q.Marked(ToggleColor));
- RunningApp.WaitForElement(q => q.Marked("stackLayout"));
- RunningApp.Tap(q => q.Marked("stackLayout"));
- RunningApp.WaitForElement(q => q.Marked("Original"));
+ RunningApp.WaitForElement(q => q.Marked(control));
+ RunningApp.Tap(q => q.Marked(control));
+ RunningApp.WaitForElement(q => q.Marked(Original));
}
#endif
}