From 17fdde66d94155fc62a034fa6658995bef6fd6e5 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 22 Mar 2016 13:02:25 -0700 Subject: Initial import --- .../Issue530.cs | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue530.cs (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue530.cs') diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue530.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue530.cs new file mode 100644 index 00000000..f71f53bf --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue530.cs @@ -0,0 +1,66 @@ +using System; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; + +using Xamarin.Forms.CustomAttributes; + +#if UITEST +using NUnit.Framework; +using Xamarin.UITest; +#endif + +namespace Xamarin.Forms.Controls +{ + [Preserve (AllMembers = true)] + [Issue (IssueTracker.Github, 530, "ListView does not render if source is async", PlatformAffected.iOS)] + public class Issue530 : TestContentPage + { + ListView _list; + Button _button; + + protected override void Init () + { + var dataTemplate = new DataTemplate (typeof (TextCell)); + dataTemplate.SetBinding (TextCell.TextProperty, new Binding (".")); + + _list = new ListView { + ItemTemplate = dataTemplate + }; + + _button = new Button { + Text = "Load", + }; + + _button.Clicked += async (sender, e) => { + await Task.Delay (1000); + _list.ItemsSource = new [] {"John","Paul", "George", "Ringo"}; + }; + Content = new StackLayout { + Children = { + _button, + _list, + } + }; + } + +#if UITEST + [Test] + [UiTest (typeof(ListView))] + public void Issue530TestsLoadAsync () + { + RunningApp.WaitForElement (q => q.Button ("Load")); + RunningApp.Screenshot ("All elements present"); + RunningApp.Tap (q => q.Button ("Load")); + + RunningApp.WaitForElement (q => q.Marked ("John")); + RunningApp.WaitForElement (q => q.Marked ("Paul")); + RunningApp.WaitForElement (q => q.Marked ("George")); + RunningApp.WaitForElement (q => q.Marked ("Ringo")); + + RunningApp.Screenshot ("List items loaded async"); + } +#endif + + } +} -- cgit v1.2.3