Exemplo n.º 1
0
        public void Bugzilla26993Test()
        {
            RunningApp.Screenshot("I am at BZ26993");

            RunningApp.WaitForElement(q => q.WebView(0).Css("#CellID0"));
            RunningApp.Tap(q => q.WebView(0).Css("#LinkID0"));

            RunningApp.Screenshot("Load local HTML");

            RunningApp.WaitForNoElement(q => q.WebView(0).Css("#LinkID0"));
            UITest.Queries.AppWebResult[] newElem =
                RunningApp.RetryUntilPresent(() => RunningApp.Query(q => q.WebView(0).Css("h1")));

            Assert.AreEqual("#LocalHtmlPage", newElem[0].Id);

            RunningApp.Screenshot("I see the Label");
        }
Exemplo n.º 2
0
        public void LegacyImageSourceProperties()
        {
            RunningApp.WaitForElement("Nothing Crashed");
            RunningApp.RetryUntilPresent(
                () =>
            {
                var result = RunningApp.WaitForElement("Image1");

                if (result[0].Rect.Height > 50)
                {
                    return(result);
                }

                return(null);
            }, 10, 2000);

            // ensure url images have loaded
            System.Threading.Thread.Sleep(2000);
        }
Exemplo n.º 3
0
		public void CollectionViewInfiniteScroll()
		{
			RunningApp.WaitForElement ("CollectionView5623");

			var colView = RunningApp.Query("CollectionView5623").Single();

			AppResult[] lastCellResults = null;

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

				lastCellResults = RunningApp.Query("99");

				return lastCellResults;
			}, 100, 1);

			Assert.IsTrue(lastCellResults?.Any() ?? false);
		}
Exemplo n.º 4
0
        UITest.Queries.AppResult TestForImageVisible()
        {
            var images = RunningApp.RetryUntilPresent(() =>
            {
                var result = RunningApp.WaitForElement(_fileNameAutomationId);

                if (result[0].Rect.Height > 1)
                {
                    return(result);
                }

                return(new UITest.Queries.AppResult[0]);
            }, 10, 4000);

            Assert.AreEqual(1, images.Length);
            var imageVisible = images[0];

            Assert.Greater(imageVisible.Rect.Height, 1);
            Assert.Greater(imageVisible.Rect.Width, 1);
            return(imageVisible);
        }
Exemplo n.º 5
0
        void ImageCellTest(bool fileSource)
        {
            string className = "ImageView";

            SetupTest(nameof(ListView), fileSource);

            var imageVisible =
                RunningApp.RetryUntilPresent(GetImage, 10, 2000);

            Assert.AreEqual(1, imageVisible.Length);
            SetImageSourceToNull();

            imageVisible = GetImage();

            UITest.Queries.AppResult[] GetImage()
            {
                return(RunningApp
                       .Query(app => app.Marked(_theListView).Descendant())
                       .Where(x => x.Class != null && x.Class.Contains(className)).ToArray());
            }
        }
Exemplo n.º 6
0
 public void Issue6286_WebView_Test()
 {
     RunningApp.RetryUntilPresent(() => RunningApp.WaitForElement("success"));
 }