Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
[Tests] Fix UITests that are failing on API 19 android (#1129)
Browse files Browse the repository at this point in the history
* [Tests] use back for picker tests on Android

* [Tests] See if waiting fixes issues with failing uitest
  • Loading branch information
rmarinho authored Sep 8, 2017
1 parent c1bab7c commit 15fbdc8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@ protected override void Init()
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@ protected override void Init()
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ public void VerifyTapBubbling(string menuItem, bool frameShouldRegisterTap)
// 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ public void VerifyInputTransparent(string menuItem)
// 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
Expand Down

0 comments on commit 15fbdc8

Please sign in to comment.