Exemplo n.º 1
0
        public void IsVisibleWorksForShowingHidingTabs()
        {
            RunningApp.WaitForElement("TopTab2");
            RunningApp.Tap("HideTop2");
            RunningApp.WaitForNoElement("TopTab2");

            RunningApp.WaitForElement("TopTab3");
            RunningApp.Tap("HideTop3");
            RunningApp.WaitForNoElement("TopTab3");

            RunningApp.WaitForElement("Tab 2");
            RunningApp.Tap("HideBottom2");
            RunningApp.WaitForNoElement("Tab 2");

            RunningApp.WaitForElement("Tab 3");
            RunningApp.Tap("HideBottom3");
            RunningApp.WaitForNoElement("Tab 3");

            RunningApp.Tap("ShowAllTabs");
            RunningApp.WaitForElement("TopTab2");
            RunningApp.WaitForElement("TopTab3");
            RunningApp.WaitForElement("Tab 2");
            RunningApp.WaitForElement("Tab 3");
        }
Exemplo n.º 2
0
        public void Issue417TestsNavigateAndPopToRoot()
        {
            RunningApp.WaitForElement(q => q.Marked("First Page"));
            RunningApp.WaitForElement(q => q.Button("Next Page"));
            RunningApp.Screenshot("All elements present");

            RunningApp.Tap(q => q.Button("Next Page"));

            RunningApp.WaitForElement(q => q.Marked("Second Page"));
            RunningApp.WaitForElement(q => q.Button("Next Page 2"));
            RunningApp.Screenshot("At second page");
            RunningApp.Tap(q => q.Button("Next Page 2"));

            RunningApp.WaitForElement(q => q.Marked("Third Page"));
            RunningApp.WaitForElement(q => q.Button("Pop to root"));
            RunningApp.Screenshot("At third page");
            RunningApp.Tap(q => q.Button("Pop to root"));

            RunningApp.WaitForElement(q => q.Marked("First Page"));
            RunningApp.WaitForElement(q => q.Button("Next Page"));
            RunningApp.Screenshot("All elements present");

            RunningApp.Screenshot("Popped to root");
        }
Exemplo n.º 3
0
        public void Issue8741Test()
        {
            RunningApp.WaitForElement("Add");
            RunningApp.Tap("Add");
#if __ANDROID__
            var toolbarItemColorValue = GetToolbarItemColorValue();
            int disabledAlpha         = GetAlphaValue(toolbarItemColorValue);
#endif
            Assert.AreEqual("0", RunningApp.WaitForElement("ClickCount")[0].ReadText());

            RunningApp.Tap("ToggleEnabled");
            RunningApp.Tap("Add");
#if __ANDROID__
            toolbarItemColorValue = GetToolbarItemColorValue();
            int enabledAlpha = GetAlphaValue(toolbarItemColorValue);
            Assert.Less(disabledAlpha, enabledAlpha);
#endif
            Assert.AreEqual("1", RunningApp.WaitForElement("ClickCount")[0].ReadText());

            RunningApp.Tap("ToggleEnabled");
            RunningApp.Tap("Add");

            Assert.AreEqual("1", RunningApp.WaitForElement("ClickCount")[0].ReadText());
        }
Exemplo n.º 4
0
        public void TestImagesDisappearCorrectly()
        {
            RunningApp.WaitForElement(_fileName);
            var elementsBefore = RunningApp.WaitForElement(_fileName);
            var imageCell      = RunningApp.Query(app => app.Marked(_theListView).Descendant()).Where(x => x.Class.Contains("Image")).FirstOrDefault();

#if __IOS__
            Assert.AreEqual(4, elementsBefore.Where(x => x.Class.Contains("Image")).Count());
#else
            Assert.AreEqual(3, elementsBefore.Length);
#endif

            Assert.IsNotNull(imageCell);

            RunningApp.Tap("ClickMe");
            var elementsAfter  = RunningApp.WaitForElement(_fileName);
            var imageCellAfter = RunningApp.Query(app => app.Marked(_theListView).Descendant()).Where(x => x.Class.Contains("Image")).FirstOrDefault();
            Assert.IsNull(imageCellAfter);
#if __IOS__
            Assert.AreEqual(0, elementsAfter.Where(x => x.Class.Contains("Image")).Count());
#endif

#if __ANDROID__
            foreach (var newElement in elementsAfter)
            {
                foreach (var oldElement in elementsBefore)
                {
                    if (newElement.Class == oldElement.Class)
                    {
                        Assert.IsTrue(newElement.Rect.Height < oldElement.Rect.Height);
                        continue;
                    }
                }
            }
#endif
        }
Exemplo n.º 5
0
        public void CollectionViewItemsLayoutUpdate()
        {
            RunningApp.WaitForElement("CollectionView5354");
            RunningApp.WaitForElement("Button5354");
            var colView = RunningApp.Query("CollectionView5354").Single();

            for (var i = 0; i < 3; i++)
            {
                RunningApp.WaitForNoElement("NoElement", timeout: TimeSpan.FromSeconds(3));

                AppResult[] lastCellResults = null;

                RunningApp.QueryUntilPresent(() =>
                {
                    RunningApp.DragCoordinates(colView.Rect.CenterX, colView.Rect.Y + colView.Rect.Height - 50, colView.Rect.CenterX, colView.Rect.Y + 5);

                    lastCellResults = RunningApp.Query("Image49");

                    return(lastCellResults);
                }, 100, 1);

                RunningApp.Tap("Button5354");
            }
        }
Exemplo n.º 6
0
        public void MonkiesShouldLoad()
        {
            RunningApp.WaitForElement("MonkeyLoadButton");
            RunningApp.Tap("MonkeyLoadButton");
            RunningApp.WaitForElement("monkeysLoaded");

            var monkeyImages = RunningApp.QueryUntilPresent(() =>
            {
                var images = RunningApp.WaitForElement("MonkeyImages");

                if (images[0].Rect.Height < 20 || images[0].Rect.Width < 20)
                {
                    return(null);
                }

                return(images);
            });

            monkeyImages = monkeyImages ?? RunningApp.WaitForElement("MonkeyImages");

            Assert.IsNotNull(monkeyImages);
            Assert.GreaterOrEqual(monkeyImages[0].Rect.Height, 20);
            Assert.GreaterOrEqual(monkeyImages[0].Rect.Width, 20);
        }
Exemplo n.º 7
0
        public void EditorTextDoesNotDisplayNonnumericInput()
        {
            RunningApp.WaitForElement("Start Editor");
            RunningApp.Tap("Start Editor");

            RunningApp.EnterText("123");

            var editor = RunningApp.Query(q => q.Text("123"));

            Assert.That(editor.Length, Is.GreaterThanOrEqualTo(1), "The editor text should be '123'.");
            RunningApp.EnterText("A");
            editor = RunningApp.Query(q => q.Text("123"));
            Assert.That(editor.Length, Is.GreaterThanOrEqualTo(1), "The editor text should be '123'.");

            var failedEditor = RunningApp.Query(q => q.Text("123A"));

            Assert.That(failedEditor.Length, Is.EqualTo(0), "The editor text should only be '123'.");

            RunningApp.EnterText("4");

            var editor2 = RunningApp.Query(q => q.Text("1234"));

            Assert.That(editor2.Length, Is.GreaterThanOrEqualTo(1), "The editor text should now be '1234'.");
        }
Exemplo n.º 8
0
        public void SelectedItemTap()
        {
            var id        = "1";
            var idContext = "1 Context";
            var initalLog = "Item '{0}' tapped\nItem '{0}' selected\n";

            var forId1 = string.Format(initalLog, id);

            RunningApp.WaitForElement(q => q.Marked(id));
            RunningApp.Tap(q => q.Marked(id));
            RunningApp.WaitForElement(q => q.Text(forId1));
            RunningApp.Tap(q => q.Marked(id));
            forId1 = string.Format("Item '{0}' tapped\n" + initalLog, id);
            RunningApp.WaitForElement(q => q.Text(forId1));

            var forIdContext = string.Format(initalLog, idContext);

            RunningApp.WaitForElement(q => q.Marked(idContext));
            RunningApp.Tap(q => q.Marked(idContext));
            RunningApp.WaitForElement(q => q.Text(forIdContext + forId1));
            RunningApp.Tap(q => q.Marked(idContext));
            forIdContext = string.Format("Item '{0}' tapped\n" + initalLog, idContext);
            RunningApp.WaitForElement(q => q.Text(forIdContext + forId1));
        }
Exemplo n.º 9
0
        public void Issue7167Test()
        {
            // arrange
            // add items to the list and scroll down till item "25"
            RunningApp.Screenshot("Empty ListView");
            RunningApp.Tap(q => q.Button(AddRangeCommandId));
            RunningApp.Tap(q => q.Button(AddRangeCommandId));
            RunningApp.WaitForElement(c => c.Index(25).Property("Enabled", true));
            RunningApp.Print.Tree();
            RunningApp.ScrollDownTo(a => a.Marked("25").Property("text").Contains("25"),
                                    b => b.Marked(ListViewId), ScrollStrategy.Auto);
            RunningApp.WaitForElement(x => x.Marked("25"));

            // act
            // when adding additional items via a addrange and a CollectionChangedEventArgs.Action.Reset is sent
            // then the listview shouldnt reset or it should not scroll to the top
            RunningApp.Tap(q => q.Marked(AddRangeCommandId));

            // assert
            // assert that item "25" is still visible
            var result = RunningApp.Query(x => x.Marked(ListViewId).Child().Marked("25"));

            Assert.That(result?.Length <= 0);
        }
Exemplo n.º 10
0
 public void Issue3273Test()
 {
     RunningApp.WaitForElement("Move items");
     RunningApp.Tap("Move items");
     RunningApp.WaitForElement("Success");
 }
Exemplo n.º 11
0
 public void Issue1469Test()
 {
     RunningApp.Tap("Select 3rd item");
     RunningApp.WaitForElement("Success");
 }
Exemplo n.º 12
0
 public void Bugzilla58645Test()
 {
     RunningApp.WaitForElement(q => q.Marked(ButtonId));
     RunningApp.Tap(q => q.Marked(ButtonId));
 }
 public void Bugzilla56771Test()
 {
     RunningApp.WaitForElement(q => q.Marked(BtnAdd));
     RunningApp.Tap(q => q.Marked(BtnAdd));
     RunningApp.WaitForElement(q => q.Marked(Success));
 }
Exemplo n.º 14
0
 public void AddingItemsToNonVisibleListViewDoesntCrash()
 {
     RunningApp.Tap(add2);
     RunningApp.Tap(add3);
     RunningApp.WaitForElement(success);
 }
Exemplo n.º 15
0
		public void MoveGroup()
		{
			RunningApp.WaitForElement("MoveGroup");
			RunningApp.Tap("MoveGroup");
		}
Exemplo n.º 16
0
 public void Issue2923TestTwo()
 {
     RunningApp.Tap(q => q.Marked("ResetButton"));
     RunningApp.Screenshot("Tabs Reset");
     RunningApp.WaitForElement(q => q.Marked("ResetPageLabel"));
 }
Exemplo n.º 17
0
 public void TapBackArrow(string backArrowIcon = BackButtonAutomationId)
 {
     RunningApp.WaitForElement(backArrowIcon, "Back Arrow Not Found");
     RunningApp.Tap(backArrowIcon);
 }
Exemplo n.º 18
0
 public void TestPageDoesntCrash()
 {
     ShouldShowMenu();
     RunningApp.Tap(c => c.Marked("Item 1"));
     RunningApp.Screenshot("Didn't crash");
 }
Exemplo n.º 19
0
 public void Issue3001Test()
 {
     RunningApp.WaitForElement(q => q.Marked(ButtonId));
     RunningApp.Tap(q => q.Marked(ButtonId));
     RunningApp.WaitForElement(q => q.Marked(ReadyId), timeout: TimeSpan.FromSeconds(5));
 }
Exemplo n.º 20
0
 void SetImageSourceToNull()
 {
     RunningApp.Tap("ClickMe");
     RunningApp.WaitForElement(_appearText);
 }
Exemplo n.º 21
0
 public void Issue9092Test()
 {
     RunningApp.Screenshot("I see button");
     RunningApp.Tap(q => q.Marked("AddButton"));
     RunningApp.Screenshot("I see button with added text");
 }
Exemplo n.º 22
0
 public void NSRangeException()
 {
     RunningApp.WaitForElement(q => q.Marked("Load"));
     RunningApp.Tap(q => q.Marked("Load"));
     RunningApp.WaitForElement(q => q.Marked("5"));
 }
Exemplo n.º 23
0
 public void NavigateBack()
 {
     RunningApp.Tap("BackButtonImage");
 }
Exemplo n.º 24
0
 public void AllEmptyGroupsShouldNotCrashOnItemInsert()
 {
     RunningApp.WaitForElement(Test9580);
     RunningApp.Tap(Test9580);
     RunningApp.WaitForElement(Success);
 }
Exemplo n.º 25
0
 public void DoesNotCrash()
 {
     RunningApp.Tap(q => q.Marked("Animate"));
     RunningApp.WaitForElement(q => q.Marked("Success"), timeout: TimeSpan.FromSeconds(25));
 }
Exemplo n.º 26
0
		public void RemoveGroup()
		{
			RunningApp.WaitForElement("Avengers");
			RunningApp.Tap("RemoveGroup");
			RunningApp.WaitForNoElement("Avengers");
		}
Exemplo n.º 27
0
		public void AddGroup()
		{
			RunningApp.WaitForElement("AddGroup");
			RunningApp.Tap("AddGroup");
			RunningApp.WaitForElement("Excalibur");
		}
Exemplo n.º 28
0
		public void ReplaceGroup()
		{
			RunningApp.WaitForElement("Fantastic Four");
			RunningApp.Tap("ReplaceGroup");
			RunningApp.WaitForElement("Alpha Flight");
		}
Exemplo n.º 29
0
 public void SpanGestureCommand()
 {
     RunningApp.WaitForElement(kText);
     RunningApp.Tap(kText);
     RunningApp.WaitForElement($"{kText}: 1");
 }
Exemplo n.º 30
0
 public void RemovingImageWithGestureFromLayoutWithinGestureHandlerDoesNotCrash()
 {
     RunningApp.WaitForElement(ImageId);
     RunningApp.Tap(ImageId);
 }