From 2ca5467e3bc2350d6265f39670a20129591ea80d Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Tue, 18 Jun 2019 04:21:30 -0600 Subject: [PATCH] wait for test to finish so it doesn't break later tests (#6562) --- .../Xamarin.Forms.Controls.Issues.Shared/Issue1905.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1905.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1905.cs index f2490ca66..045eb7bb7 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1905.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1905.cs @@ -75,6 +75,7 @@ namespace Xamarin.Forms.Controls.Issues lst.RefreshCommand = new Command(async () => { var newitems = new List(); + newitems.Add("data refreshed"); await Task.Delay(5000); for (int i = 0; i < 1000; i++) { @@ -98,7 +99,13 @@ namespace Xamarin.Forms.Controls.Issues [Test] public void TestIssue1905RefreshShows() { + // wait for test to load + RunningApp.WaitForElement("btnRefresh"); RunningApp.Screenshot("Should show refresh control"); + + // wait for test to finish so it doesn't keep working + // in the background and break the next test + RunningApp.WaitForElement("data refreshed"); } #endif }