From 6bc31bd143b8f99f51b9ed0bf4758b300d242256 Mon Sep 17 00:00:00 2001 From: "E.Z. Hart" Date: Fri, 4 Jan 2019 12:08:48 -0700 Subject: [PATCH] Automate UI test 1028 --- .../Issue1028.cs | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1028.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1028.cs index b6ff7f1..4b06ae8 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1028.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1028.cs @@ -1,19 +1,23 @@ -using System.Diagnostics; - -using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.CustomAttributes; using Xamarin.Forms.Internals; +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + namespace Xamarin.Forms.Controls.Issues { [Preserve (AllMembers=true)] [Issue (IssueTracker.Github, 1028, "ViewCell in TableView raises exception - root page is ContentPage, Content is TableView" ,PlatformAffected.WinPhone, NavigationBehavior.PushModalAsync)] - public class Issue1028 : ContentPage + public class Issue1028 : TestContentPage { // Issue1028, ViewCell with StackLayout causes exception when nested in a table section. This occurs when the app's root page is a ContentPage with a TableView. - public Issue1028 () + protected override void Init() { - Content = new TableView { - Root = new TableRoot ("Table Title") { + Content = new TableView + { + Root = new TableRoot("Table Title") { new TableSection ("Section 1 Title") { new ViewCell { View = new StackLayout { @@ -28,5 +32,13 @@ namespace Xamarin.Forms.Controls.Issues } }; } - } +#if UITEST + [Test] + public void ViewCellInTableViewDoesNotCrash() + { + // If we can see this element, then we didn't crash. + RunningApp.WaitForElement("Custom Slider View:"); + } +#endif + } } -- 2.7.4