void SwipePreviousItem(UITest.Queries.AppRect rect) { #if __ANDROID__ RunningApp.DragCoordinates(rect.X + 10, rect.Y, rect.X + rect.Width - 10, rect.Y); #else RunningApp.SwipeLeftToRight("carouseView"); #endif }
void CompareTextLocation(UITest.Queries.AppRect initialRect, int i) { var newRect = RunningApp.WaitForFirstElement($"InitialText{i}").Rect; Assert.AreEqual(newRect.X, initialRect.X, $"Error With Test :{i}"); Assert.AreEqual(newRect.Y, initialRect.Y, $"Error With Test :{i}"); Assert.AreEqual(newRect.CenterX, initialRect.CenterX, $"Error With Test :{i}"); Assert.AreEqual(newRect.CenterY, initialRect.CenterY, $"Error With Test :{i}"); }
void VisitSubGallery(string galleryName, bool scrollDown, string lastItem, string firstPageItem, int updateItemsCount, bool testItemSource, bool testAddRemove) { App.WaitForElement(t => t.Marked(galleryName)); App.Tap(t => t.Marked(galleryName)); //let's test the update if (testItemSource) { UITest.Queries.AppRect collectionViewFrame = TestItemsExist(scrollDown, lastItem); TestUpdateItemsWorks(scrollDown, firstPageItem, updateItemsCount.ToString(), collectionViewFrame); } if (testAddRemove) { TestAddRemoveReplaceWorks(lastItem); } }
public void TopTabsDontScrollBackToStartWhenSelected() { var element1 = RunningApp.WaitForElement("Tab 1", "Shell hasn't loaded")[0].Rect; RunningApp.WaitForNoElement("Tab 12", "Tab shouldn't be visible"); UITest.Queries.AppRect element2 = element1; for (int i = 2; i < 20; i++) { var results = RunningApp.Query($"Tab {i}"); if (results.Length == 0) { break; } element2 = results[0].Rect; } RunningApp.DragCoordinates(element2.CenterX, element2.CenterY, element1.CenterX, element1.CenterY); RunningApp.WaitForNoElement("Tab 1"); bool testPassed = false; // figure out what tabs are visible for (int i = 20; i > 1; i--) { var results = RunningApp.Query($"Tab {i}"); if (results.Length > 0) { RunningApp.Tap($"Tab {i}"); RunningApp.WaitForElement($"Tab {i}"); testPassed = true; break; } } RunningApp.WaitForNoElement("Tab 1"); Assert.IsTrue(testPassed); }
void TestUpdateItemsWorks(bool scrollDown, string itemMarked, string updateItemsCount, UITest.Queries.AppRect collectionViewFrame) { App.WaitForElement(t => t.Marked(_entryUpdate)); App.ScrollForElement($"* marked:'{itemMarked}'", new Drag(collectionViewFrame, scrollDown ? Drag.Direction.TopToBottom : Drag.Direction.LeftToRight, Drag.DragLength.Long), 50); App.ClearText(_entryUpdate); App.EnterText(_entryUpdate, updateItemsCount); App.DismissKeyboard(); App.Tap(_btnUpdate); App.WaitForNoElement(t => t.Marked(itemMarked)); }