示例#1
0
        public void BackdoorTest()
        {
            app.Screenshot("Invoking Positive Backdoor");

            app.Invoke("PositiveBackdoor", "hello");

            app.Screenshot("Invoking Negative Backdoor");

            app.Invoke("NegativeBackdoor");
        }
        public void CreditCardNumber_TooShort_DisplayErrorMessage()
        {
            //Start of Greenspector measure
            app.Invoke("StartMeasureBackdoor");

            app.WaitForElement(c => c.Marked("action_bar_title").Text("Enter Credit Card Number"));
            app.EnterText(c => c.Marked("creditCardNumberText"), new string('9', 15));
            app.Tap(c => c.Marked("validateButton"));

            app.WaitForElement(c => c.Marked("errorMessagesText").Text("Credit card number is too short."));

            //Stop of Greenspector measure
            app.Invoke("StopMeasureBackdoor", "TestBackdoor");
        }
示例#3
0
        int ConvertAndroidDrawingHexColorToInt(string colorStringAsHex)
        {
            if (!colorStringAsHex[0].Equals('#') || colorStringAsHex.Length != 7)
            {
                throw new Exception("Invalid Hex String. Color string must start with \"#\" and be followed by 6 hexadecimal characters");
            }

            return(int.Parse(_app.Invoke("GetColorAsInt", colorStringAsHex).ToString()));
        }
        public void test()
        {
            _mainPage.GoToScanPage();
            //_app.WaitForElement(c => c.Marked("button1"));
            _app.Invoke("Test");
            //_app.Repl();

            var idDisplayed = _mainPage.IsIdDisplayed("zxingDefaultOverlay");

            Assert.IsTrue(idDisplayed);
        }
示例#5
0
文件: Tests.cs 项目: wenlz/Moyeu
 public void SwitchToFavorites_WithTwoFavs()
 {
     app.Invoke("reportFullyDrawn");
     app.Tap(q => q.Id("toolbar").Class("ImageButton"));
     app.WaitForElement(q => q.Id("left_drawer"),
                        postTimeout: TimeSpan.FromSeconds(1));
     app.Tap(q => q.Id("left_drawer").Descendant().Text("Favorites"));
     app.WaitForNoElement(q => q.Id("left_drawer"),
                          postTimeout: TimeSpan.FromSeconds(1));
     app.Screenshot("Two favorites");
 }
 public static void LogToDevice(this AndroidApp app, string text, params object[] formatArgs)
 {
     try
     {
         var finalText = formatArgs.Length > 0 ? string.Format(text, formatArgs) : text;
         Console.WriteLine(finalText);
         app.Invoke("*******Xamarin Log*******", finalText);
     }
     catch (Exception)
     {
     }
 }
示例#7
0
        public void Use_backdoor_for_second_activity()
        {
            // Arrange
            app.WaitForElement(c => c.Marked("button1"));
            app.Invoke("StartActivityTwo");

            // Act
            EnterTextOnActivityTwo("Text #2");

            //Assert
            AssertTextHasBeenEnteredOnSecondActivity("Text #2");
        }
示例#8
0
        private FileInfo TakeScreenshotOfExample(string exampleName)
        {
            // need to ensure that we take screenshot with same orientation
            _app.SetOrientationPortrait();

            _app.WaitForElement(c => c.Marked("examplesList"));

            _app.ScrollDownTo(c => c.Text(exampleName));

            _app.Screenshot(exampleName);

            _app.Tap(c => c.Text(exampleName));

            _app.WaitForElement(c => c.Marked("fragment_container"));

            _app.Invoke("InitExampleForUiTest");

            return(_app.Screenshot(exampleName));
        }
 public void BeforeEachTest()
 {
     app = ConfigureApp.Android.InstalledApp("com.xamarin.example.creditcardvalidator").StartApp();
     //Greenspector Measure Set Up
     app.Invoke("SetUpMeasureBackdoor", "[Put your Greenspector TOKEN]");
 }