[Tests] Fix UITests that are failing on API 19 android (#1129)

* [Tests] use back for picker tests on Android

* [Tests] See if waiting fixes issues with failing uitest
This commit is contained in:
Rui Marinho 2017-09-08 11:26:52 +01:00 коммит произвёл GitHub
Родитель c1bab7c9e2
Коммит 15fbdc80f0
4 изменённых файлов: 13 добавлений и 15 удалений

Просмотреть файл

@ -44,15 +44,12 @@ namespace Xamarin.Forms.Controls.Issues
public void DatePickerCancelShouldUnfocus()
{
RunningApp.Tap(q => q.Marked(DatePicker));
RunningApp.WaitForElement(q => q.Marked("Cancel"));
RunningApp.Tap(q => q.Marked("Cancel"));
RunningApp.Back();
RunningApp.WaitForElement(q => q.Marked("Click to focus DatePicker"));
RunningApp.Tap(q => q.Marked("Click to focus DatePicker"));
RunningApp.WaitForElement(q => q.Marked("Cancel"));
RunningApp.Tap(q => q.Marked("Cancel"));
RunningApp.Back();
}
#endif

Просмотреть файл

@ -44,15 +44,12 @@ namespace Xamarin.Forms.Controls.Issues
public void TimePickerCancelShouldUnfocus()
{
RunningApp.Tap(q => q.Marked(TimePicker));
RunningApp.WaitForElement(q => q.Marked("Cancel"));
RunningApp.Tap(q => q.Marked("Cancel"));
RunningApp.Back();
RunningApp.WaitForElement(q => q.Marked("Click to focus TimePicker"));
RunningApp.Tap(q => q.Marked("Click to focus TimePicker"));
RunningApp.WaitForElement(q => q.Marked("Cancel"));
RunningApp.Tap(q => q.Marked("Cancel"));
RunningApp.Back();
}
#endif

Просмотреть файл

@ -67,13 +67,15 @@ namespace Xamarin.Forms.Controls.Issues
// These controls show a pop-up which we have to cancel/done out of before we can continue
#if __ANDROID__
var cancelButtonText = "Cancel";
RunningApp.Back();
#elif __IOS__
var cancelButtonText = "Done";
RunningApp.WaitForElement(q => q.Marked(cancelButtonText));
RunningApp.Tap(q => q.Marked(cancelButtonText));
#else
var cancelButtonText = "X";
#endif
RunningApp.WaitForElement(q => q.Marked(cancelButtonText));
RunningApp.Tap(q => q.Marked(cancelButtonText));
}
if (frameShouldRegisterTap)

Просмотреть файл

@ -65,13 +65,15 @@ namespace Xamarin.Forms.Controls.Issues
// These controls show a pop-up which we have to cancel/done out of before we can continue
#if __ANDROID__
var cancelButtonText = "Cancel";
System.Threading.Tasks.Task.Delay(1000).Wait();
RunningApp.Back();
#elif __IOS__
var cancelButtonText = "Done";
RunningApp.WaitForElement(q => q.Marked(cancelButtonText));
RunningApp.Tap(q => q.Marked(cancelButtonText));
#else
var cancelButtonText = "Cancel";
#endif
RunningApp.WaitForElement(q => q.Marked(cancelButtonText));
RunningApp.Tap(q => q.Marked(cancelButtonText));
}
// Since InputTransparent is set to false, the start label should not have changed