Exemple #1
0
        public static void ScreenshotIfFailed(this Xamarin.UITest.IApp app)
        {
            var status = TestContext.CurrentContext?.Result?.Status ?? TestStatus.Inconclusive;

            if (status == TestStatus.Failed)
            {
                try {
                    app.TakeScreenshot("Failure", TestContext.CurrentContext.Test.Name);
                } catch { }
            }
        }
Exemple #2
0
        public static void AssertUITestBackdoorResult(this Xamarin.UITest.IApp app, BarcodeFormat format, string value)
        {
            // First wait for the result
            app.WaitForElement(q => q.Marked("Barcode Result"), "Barcode not scanned, no result found", TimeSpan.FromSeconds(10));

            app.TakeScreenshot("Scan Result Found");

            var result = app.Query(q => q.Marked(format + "|" + value));

            Assert.AreEqual(1, result.Count());

            app.Tap(q => q.Marked("OK"));
        }