delay ui test a bit so elements can vanish first (#4726)
authorShane Neuville <shane94@hotmail.com>
Thu, 13 Dec 2018 19:15:39 +0000 (12:15 -0700)
committerStephane Delcroix <stephane@delcroix.org>
Thu, 13 Dec 2018 19:15:39 +0000 (20:15 +0100)
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue4597.cs

index 8834f1d..653b5be 100644 (file)
@@ -65,7 +65,7 @@ namespace Xamarin.Forms.Controls.Issues
                                                _button.Image = null;
                                                _imageButton.Source = null;
                                                _listView.ItemsSource = new string[] { null };
-                                               button.Text = _appearText;
+                                               Device.BeginInvokeOnMainThread(() => button.Text = _appearText);
                                        }
                                        else
                                        {
@@ -73,7 +73,7 @@ namespace Xamarin.Forms.Controls.Issues
                                                _button.Image = _fileName;
                                                _imageButton.Source = _fileName;
                                                _listView.ItemsSource = new string[] { _fileName };
-                                               button.Text = _disappearText;
+                                               Device.BeginInvokeOnMainThread(() => button.Text = _disappearText);
                                        }
                                })
                        };
@@ -109,6 +109,7 @@ namespace Xamarin.Forms.Controls.Issues
                        Assert.IsNotNull(imageCell);
 
                        RunningApp.Tap("ClickMe");
+                       RunningApp.WaitForElement(_appearText);
                        var elementsAfter = RunningApp.WaitForElement(_fileName);
                        var imageCellAfter = RunningApp.Query(app => app.Marked(_theListView).Descendant()).Where(x => x.Class.Contains("Image")).FirstOrDefault();
                        Assert.IsNull(imageCellAfter);