diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2016-05-11 08:21:41 -0600 |
---|---|---|
committer | kingces95 <kingces95@users.noreply.github.com> | 2016-05-11 07:21:41 -0700 |
commit | 846c1dc0ecb70920f15f4884b69396cc52ba3e96 (patch) | |
tree | 5c99c116418e36ada4c72cdc8ee9cc0ac1fad9c1 /Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2289.xaml.cs | |
parent | ad3a6f68f009555387847efc37b324187b24212a (diff) | |
download | xamarin-forms-846c1dc0ecb70920f15f4884b69396cc52ba3e96.tar.gz xamarin-forms-846c1dc0ecb70920f15f4884b69396cc52ba3e96.tar.bz2 xamarin-forms-846c1dc0ecb70920f15f4884b69396cc52ba3e96.zip |
Make RunningApp.Screenshot do nothing unless SCREENSHOTS symbol defined (#169)
* Make RunningApp.Screenshot do nothing unless SCREENSHOTS symbol is defined
* Replace IApp casts with conditional compilation directives
* Fix warning
* Remove EnableLocalScreenshots
* Add Ignore attributes to keep tests from "failing" in Test Cloud
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2289.xaml.cs')
-rw-r--r-- | Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2289.xaml.cs | 69 |
1 files changed, 25 insertions, 44 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2289.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2289.xaml.cs index 580ec9ce..6fdc2572 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2289.xaml.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2289.xaml.cs @@ -43,75 +43,56 @@ namespace Xamarin.Forms.Controls public ICommand DeleteCommand { get; protected set; } -#if UITEST +#if UITEST && __IOS__ [Test] [Ignore("Fails sometimes on XTC")] public void TestIsEnabledFalse () { - if (RunningApp is iOSApp) { - var disable1 = RunningApp.Query (c => c.Marked ("txtCellDisable1")) [0]; - Assert.IsFalse (disable1.Enabled); - var disable2 = RunningApp.Query (c => c.Marked ("txtCellDisable2")) [0]; - Assert.IsFalse (disable2.Enabled); - } + var disable1 = RunningApp.Query (c => c.Marked ("txtCellDisable1")) [0]; + Assert.IsFalse (disable1.Enabled); + var disable2 = RunningApp.Query (c => c.Marked ("txtCellDisable2")) [0]; + Assert.IsFalse (disable2.Enabled); } [Test] [Ignore("Fails sometimes on XTC")] public void TestIsEnabledFalseContextActions () { - if (RunningApp is iOSApp) { - var disable1 = RunningApp.Query (c => c.Marked ("txtCellDisableContextActions1")) [0]; - Assert.IsFalse (disable1.Enabled); - - var screenBounds = RunningApp.Query (q => q.Raw ("* index:0")) [0].Rect; - - if (RunningApp is iOSApp) { - RunningApp.DragCoordinates (screenBounds.Width - 10, disable1.Rect.CenterY, 10, disable1.Rect.CenterY); - } else { - disable1 = RunningApp.Query (c => c.Marked ("txtCellDisableContextActions1")) [0]; - RunningApp.TouchAndHoldCoordinates (disable1.Rect.CenterX, disable1.Rect.CenterY); - } - RunningApp.Screenshot ("Not showing context menu"); - RunningApp.WaitForNoElement (c => c.Marked ("More")); - RunningApp.TapCoordinates (screenBounds.CenterX, screenBounds.CenterY); - } + var disable1 = RunningApp.Query (c => c.Marked ("txtCellDisableContextActions1")) [0]; + Assert.IsFalse (disable1.Enabled); + + var screenBounds = RunningApp.Query (q => q.Raw ("* index:0")) [0].Rect; + + RunningApp.DragCoordinates (screenBounds.Width - 10, disable1.Rect.CenterY, 10, disable1.Rect.CenterY); + + RunningApp.Screenshot ("Not showing context menu"); + RunningApp.WaitForNoElement (c => c.Marked ("More")); + RunningApp.TapCoordinates (screenBounds.CenterX, screenBounds.CenterY); } [Test] [Ignore("Fails sometimes on XTC")] public void TestIsEnabledTrue () { - if (RunningApp is iOSApp) { - var disable1 = RunningApp.Query (c => c.Marked ("txtCellEnable1")) [0]; - Assert.IsTrue (disable1.Enabled); - var disable2 = RunningApp.Query (c => c.Marked ("txtCellEnable2")) [0]; - Assert.IsTrue (disable2.Enabled); - } - + var disable1 = RunningApp.Query (c => c.Marked ("txtCellEnable1")) [0]; + Assert.IsTrue (disable1.Enabled); + var disable2 = RunningApp.Query (c => c.Marked ("txtCellEnable2")) [0]; + Assert.IsTrue (disable2.Enabled); } [Test] [Ignore("Fails sometimes on XTC")] public void TestIsEnabledTrueContextActions () { - if (RunningApp is iOSApp) { - var disable1 = RunningApp.Query (c => c.Marked ("txtCellEnabledContextActions1")) [0]; - Assert.IsTrue (disable1.Enabled); - - var screenBounds = RunningApp.Query (q => q.Raw ("* index:0")) [0].Rect; + var disable1 = RunningApp.Query (c => c.Marked ("txtCellEnabledContextActions1")) [0]; + Assert.IsTrue (disable1.Enabled); - if (RunningApp is iOSApp) { - RunningApp.DragCoordinates (screenBounds.Width - 10, disable1.Rect.CenterY, 10, disable1.Rect.CenterY); - } else { - disable1 = RunningApp.Query (c => c.Marked ("txtCellEnabledContextActions1")) [0]; - RunningApp.TouchAndHoldCoordinates (disable1.Rect.CenterX, disable1.Rect.CenterY); - } + var screenBounds = RunningApp.Query (q => q.Raw ("* index:0")) [0].Rect; - RunningApp.Screenshot ("Showing context menu"); - RunningApp.WaitForElement (c => c.Marked ("More")); - } + RunningApp.DragCoordinates (screenBounds.Width - 10, disable1.Rect.CenterY, 10, disable1.Rect.CenterY); + RunningApp.Screenshot ("Showing context menu"); + RunningApp.WaitForElement (c => c.Marked ("More")); } #endif |