示例#1
0
文件: Issue11869.cs 项目: hevey/maui
        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");
        }
示例#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");
        }
示例#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());
        }
示例#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
        }
示例#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");
            }
        }
示例#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);
        }
示例#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'.");
        }
示例#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));
        }
示例#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);
        }
示例#10
0
 public void Issue3273Test()
 {
     RunningApp.WaitForElement("Move items");
     RunningApp.Tap("Move items");
     RunningApp.WaitForElement("Success");
 }
示例#11
0
 public void Issue1469Test()
 {
     RunningApp.Tap("Select 3rd item");
     RunningApp.WaitForElement("Success");
 }
示例#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));
 }
示例#14
0
 public void AddingItemsToNonVisibleListViewDoesntCrash()
 {
     RunningApp.Tap(add2);
     RunningApp.Tap(add3);
     RunningApp.WaitForElement(success);
 }
示例#15
0
		public void MoveGroup()
		{
			RunningApp.WaitForElement("MoveGroup");
			RunningApp.Tap("MoveGroup");
		}
示例#16
0
 public void Issue2923TestTwo()
 {
     RunningApp.Tap(q => q.Marked("ResetButton"));
     RunningApp.Screenshot("Tabs Reset");
     RunningApp.WaitForElement(q => q.Marked("ResetPageLabel"));
 }
示例#17
0
 public void TapBackArrow(string backArrowIcon = BackButtonAutomationId)
 {
     RunningApp.WaitForElement(backArrowIcon, "Back Arrow Not Found");
     RunningApp.Tap(backArrowIcon);
 }
示例#18
0
 public void TestPageDoesntCrash()
 {
     ShouldShowMenu();
     RunningApp.Tap(c => c.Marked("Item 1"));
     RunningApp.Screenshot("Didn't crash");
 }
示例#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));
 }
示例#20
0
 void SetImageSourceToNull()
 {
     RunningApp.Tap("ClickMe");
     RunningApp.WaitForElement(_appearText);
 }
示例#21
0
 public void Issue9092Test()
 {
     RunningApp.Screenshot("I see button");
     RunningApp.Tap(q => q.Marked("AddButton"));
     RunningApp.Screenshot("I see button with added text");
 }
示例#22
0
文件: Issue1875.cs 项目: hevey/maui
 public void NSRangeException()
 {
     RunningApp.WaitForElement(q => q.Marked("Load"));
     RunningApp.Tap(q => q.Marked("Load"));
     RunningApp.WaitForElement(q => q.Marked("5"));
 }
示例#23
0
文件: Issue8529.cs 项目: hevey/maui
 public void NavigateBack()
 {
     RunningApp.Tap("BackButtonImage");
 }
示例#24
0
 public void AllEmptyGroupsShouldNotCrashOnItemInsert()
 {
     RunningApp.WaitForElement(Test9580);
     RunningApp.Tap(Test9580);
     RunningApp.WaitForElement(Success);
 }
示例#25
0
 public void DoesNotCrash()
 {
     RunningApp.Tap(q => q.Marked("Animate"));
     RunningApp.WaitForElement(q => q.Marked("Success"), timeout: TimeSpan.FromSeconds(25));
 }
示例#26
0
		public void RemoveGroup()
		{
			RunningApp.WaitForElement("Avengers");
			RunningApp.Tap("RemoveGroup");
			RunningApp.WaitForNoElement("Avengers");
		}
示例#27
0
		public void AddGroup()
		{
			RunningApp.WaitForElement("AddGroup");
			RunningApp.Tap("AddGroup");
			RunningApp.WaitForElement("Excalibur");
		}
示例#28
0
		public void ReplaceGroup()
		{
			RunningApp.WaitForElement("Fantastic Four");
			RunningApp.Tap("ReplaceGroup");
			RunningApp.WaitForElement("Alpha Flight");
		}
示例#29
0
 public void SpanGestureCommand()
 {
     RunningApp.WaitForElement(kText);
     RunningApp.Tap(kText);
     RunningApp.WaitForElement($"{kText}: 1");
 }
示例#30
0
 public void RemovingImageWithGestureFromLayoutWithinGestureHandlerDoesNotCrash()
 {
     RunningApp.WaitForElement(ImageId);
     RunningApp.Tap(ImageId);
 }