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

Commit

Permalink
Fix UI Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis committed Jun 1, 2022
1 parent b2d70cd commit 9f26f70
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
Expand Up @@ -152,16 +152,16 @@ public ICommand OtherCommand
[Category(UITestCategories.UwpIgnore)]
public void Bugzilla31330Test()
{
RunningApp.WaitForElement(c => c.Marked("Something 2"));
RunningApp.WaitForElement(c => c.Marked("Something 2"), timeout: TimeSpan.FromSeconds(2), postTimeout: TimeSpan.FromSeconds(1));
RunningApp.ActivateContextMenu("Something 1");
RunningApp.WaitForElement(c => c.Marked("Delete"));
RunningApp.Tap(c => c.Marked("Delete"));
RunningApp.DismissContextMenu();
RunningApp.Tap(c => c.Marked("Something 2"));
RunningApp.ActivateContextMenu("Something 2");
RunningApp.WaitForElement(c => c.Marked("Delete"));
RunningApp.WaitForElement(c => c.Marked("Delete"), timeout: TimeSpan.FromSeconds(2), postTimeout: TimeSpan.FromSeconds(1));
RunningApp.Tap(c => c.Marked("Delete"));
RunningApp.WaitForNoElement(c => c.Marked("Something 2"));
RunningApp.WaitForNoElement(c => c.Marked("Something 2"), timeout: TimeSpan.FromSeconds(2), postTimeout: TimeSpan.FromSeconds(1));
}
#endif
}
Expand Down
Expand Up @@ -78,15 +78,15 @@ public void PagesAreCollected()
{
RunningApp.WaitForElement(q => q.Marked("Open"));
RunningApp.Tap(q => q.Marked("Open"));
RunningApp.WaitForElement(q => q.Marked("Testing..."));
RunningApp.WaitForElement(q => q.Marked("Testing..."), timeout: TimeSpan.FromSeconds(2), postTimeout: TimeSpan.FromSeconds(1));
RunningApp.Back();
RunningApp.WaitForElement(q => q.Marked("Open"));
RunningApp.WaitForElement(q => q.Marked("Open"), timeout: TimeSpan.FromSeconds(2), postTimeout: TimeSpan.FromSeconds(1));
RunningApp.Tap(q => q.Marked("Open"));
RunningApp.WaitForElement(q => q.Marked("Testing..."));
RunningApp.WaitForElement(q => q.Marked("Testing..."), timeout: TimeSpan.FromSeconds(1), postTimeout: TimeSpan.FromSeconds(1));
RunningApp.Back();
RunningApp.WaitForElement(q => q.Marked("Open"));
RunningApp.WaitForElement(q => q.Marked("Open"), timeout: TimeSpan.FromSeconds(2), postTimeout: TimeSpan.FromSeconds(1));
RunningApp.Tap(q => q.Marked("Open"));
RunningApp.WaitForElement(q => q.Marked("Success"));
RunningApp.WaitForElement(q => q.Marked("Success"), timeout: TimeSpan.FromSeconds(2), postTimeout: TimeSpan.FromSeconds(1));
}
#endif
}
Expand Down
Expand Up @@ -68,11 +68,11 @@ public void Issue51503Test()
{
for (int i = 0; i < 3; i++)
{
RunningApp.WaitForElement(q => q.Marked("Button"));
RunningApp.WaitForElement(q => q.Marked("Button"), timeout: TimeSpan.FromSeconds(2), postTimeout: TimeSpan.FromSeconds(1));

RunningApp.Tap(q => q.Marked("Button"));

RunningApp.WaitForElement(q => q.Marked("VisualElement"));
RunningApp.WaitForElement(q => q.Marked("VisualElement"), timeout: TimeSpan.FromSeconds(2), postTimeout: TimeSpan.FromSeconds(1));

RunningApp.Back();
}
Expand Down
Expand Up @@ -146,15 +146,17 @@ class Issue4187Model
#if UITEST && __ANDROID__

UITest.Queries.AppResult[] GetPickerEditText(UITest.IApp RunningApp) =>
RunningApp.Query(q => q.TextField()).Where(x => x.Class.Contains("PickerEditText")).ToArray();
RunningApp.Query(q => q.TextField()).Where(x => x.Class.Contains("PickerEditText") || x.Class.Contains("PickerAppCompatEditText")).ToArray();

[Test]
public void Issue4187Test()
{
RunningApp.WaitForElement("Text 1");
UITest.Queries.AppResult[] fields = RunningApp.Query(q => q.TextField());

Assert.AreEqual(7, GetPickerEditText(RunningApp).Length, "picker count");
var edittexts = GetPickerEditText(RunningApp);

Assert.AreEqual(7, edittexts.Length, "picker count");
TapOnPicker(1);
Assert.IsTrue(DialogIsOpened(), "#1");
RunningApp.Tap("Text 2");
Expand Down

0 comments on commit 9f26f70

Please sign in to comment.