Пример #1
0
        public void TappingChevronBlueIcon()
        {
            app.WaitForElement("Sign In Now");
            app.Screenshot("App has started");

            app.Tap("Sign In Now");
            app.Screenshot("Tapped 'Sign In Now' Button");

            app.WaitForElement("Email");
            app.Screenshot("Waiting for element, 'E-mail' to appear");

            app.EnterText("Email", "*****@*****.**");
            app.Screenshot("Entered in my E-Mail information");

            app.EnterText("Password", "snoop222");
            app.Screenshot("Entered in my Password");

            app.Tap("Sign In");
            app.Screenshot("Tapped 'Sign In' Button");

            app.WaitForElement("chevron_blueIcon.png");
            app.Screenshot("Waiting for element, 'chevron_blueIcon.png'");

            app.Tap(x => x.Id("chevron_blueIcon.png").Index(0));
            app.Screenshot("Tapped on First 'chevron_blueIcon.png");
        }
Пример #2
0
        public void TheNextButtonShowsThePasswordField()
        {
            app.EnterText(ValidEmail);

            app.GoToPasswordScreen();

            app.Screenshot("Login password page.");
        }
Пример #3
0
        public void CreditCardNumber_TooShort_DisplayErrorMessage()
        {
            app.WaitForElement(c => c.Class("UINavigationBar").Marked("Simple Credit Card Validator"));
            app.EnterText(c => c.Class("UITextField"), new string('9', 15));
            app.Tap(c => c.Marked("Validate Credit Card").Class("UIButton"));

            app.WaitForElement(c => c.Marked("Credit card number is too short.").Class("UILabel"));
        }
Пример #4
0
 public void UpdateFirstName()
 {
     app.WaitForElement(x => x.Marked("Armstead, Evan"));             // wait for the list to appear
     app.Screenshot("App start, display list");
     app.ScrollDownTo("Green, Monica");
     app.Screenshot("Scrolled to Monica Green");
     app.Tap(x => x.Marked("Green, Monica"));
     app.WaitForElement(x => x.Class("MKNewAnnotationContainerView")); // wait for the map to appear
     Thread.Sleep(2000);                                               // wait 2 seconds to give map time to fully render
     app.Screenshot("Detail screen");
     app.Tap(x => x.Id("edit.png"));
     app.Screenshot("Edit screen");
     app.ScrollDownTo("First");
     app.Tap(x => x.Marked("Monica"));
     app.ClearText();
     app.Screenshot("Cleared first name field");
     app.EnterText("Erica");
     app.DismissKeyboard();
     app.Screenshot("Altered value of company name field");
     app.Tap(x => x.Id("save.png"));
     app.WaitForElement(x => x.Class("MKNewAnnotationContainerView")); // wait for the map to appear
     Thread.Sleep(2000);                                               // wait 2 seconds to give map time to fully render
     app.Screenshot("Saved changes, navigated to detail screen, first name updated");
     app.Tap(x => x.Marked("List"));
     app.ScrollDownTo("Green, Erica");
     app.Screenshot("First name updated on list screen, first name updated");
 }
Пример #5
0
        public void CreditCardNumber_ToShort_DisplayErrorMessage()
        {
            // Arrange - Nothing to do because the queries have already been initialized.

            // Act
            _app.EnterText(EditTextView, new string('9', 15));
            _app.Tap(ValidateButton);

            // Assert
            AppResult[] result = _app.Query(ShortErrorMessage);
            Assert.IsTrue(result.Any(), "The error message is not being displayed.");
        }
        public void TappingTheDoneButtonCreatesANewTimeEntryWhoseDescriptionMatchesWhatWasTypedInTheDescriptionField()
        {
            var description = "UI testing the Toggl App";

            app.EnterText(description);
            app.Tap(StartTimeEntry.DoneButton);

            app.WaitForElement(query => query.Marked(description));
        }
Пример #7
0
 public void AppLaunches()
 {
     app.Tap(x => x.Marked("1-855-XAMARIN"));
     app.Screenshot("Tapped on view with class: UITextFieldLabel marked: 1-855-XAMARIN");
     app.ClearText(x => x.Class("UITextField").Text("1-855-XAMARIN"));
     app.EnterText(x => x.Class("UITextField"), "test recorder");
     app.Tap(x => x.Marked("Translate"));
     app.Screenshot("Tapped on view with class: UIButton marked: Translate");
 }
Пример #8
0
 public void NewTest()
 {
     app.Tap(x => x.Marked(".NET-Programmierer und Architekten: Strategien 2017"));
     app.Screenshot("Tapped on view with class: UILabel marked: .NET-Programmierer und Architekten: Strategien 2017");
     app.Tap(x => x.Class("UISwitch"));
     app.Screenshot("Tapped on view with class: UISwitch");
     app.SetSliderValue(x => x.Class("UISlider"), 6000000);
     app.Tap(x => x.Class("UINavigationItemButtonView"));
     app.Screenshot("Tapped on view with class: UINavigationItemButtonView");
     app.Tap(x => x.Id("favorites.png"));
     app.Screenshot("Tapped on view with class: UITabBarSwappableImageView");
     app.Tap(x => x.Id("speakers.png"));
     app.Screenshot("Tapped on view with class: UITabBarSwappableImageView");
     app.Tap(x => x.Marked("Dominick Baier"));
     app.Screenshot("Tapped on view with class: UILabel marked: Dominick Baier");
     app.Tap(x => x.Text("Conference App"));
     app.Screenshot("Tapped on view with class: UILabel marked: Conference App");
     app.Tap(x => x.Id("Feedback.png"));
     app.Screenshot("Tapped on view with class: UITabBarSwappableImageView");
     //app.Tap(x => x.Class("UIImageView").Index(22));
     //app.Screenshot("Tapped on view with class: UIImageView");
     app.Tap(x => x.Marked("E-Mail"));
     app.Screenshot("Tapped on view with class: UITextFieldLabel marked: E-Mail");
     app.EnterText(x => x.Class("UITextField"), "*****@*****.**");
     app.Tap(x => x.Marked("Alter"));
     app.Screenshot("Tapped on view with class: UITextFieldLabel marked: Alter");
     app.EnterText(x => x.Class("UITextField").Index(1), "45");
     app.Tap(x => x.Marked("Geschlecht"));
     app.Screenshot("Tapped on view with class: UITextFieldLabel marked: Geschlecht");
     app.Tap(x => x.Marked("Mann").Index(1));
     app.Screenshot("Tapped on view with class: UILabel marked: Mann");
     app.Tap(x => x.Marked("Done"));
     app.Screenshot("Tapped on view with class: UIToolbarTextButton marked: Done");
     app.Tap(x => x.Text("Senden"));
     app.Screenshot("Tapped on view with class: UIButtonLabel marked: Senden");
     app.Tap(x => x.Marked("OK"));
     app.Screenshot("Tapped on view with class: _UIAlertControllerActionView marked: OK");
 }
Пример #9
0
 public void NewTest()
 {
     app.Tap(x => x.Marked("Sign-in"));
     app.Screenshot("Tapped on view with class: UIButton marked: Sign-in");
     app.Tap(x => x.Class("UIWebView").Css("INPUT._56bg._4u9z._5ruq"));
     app.Screenshot("Tapped on view with class: UIWebView");
     app.EnterText(x => x.Class("UIWebView").Css("INPUT._56bg._4u9z._5ruq"), "*****@*****.**");
     app.Tap(x => x.Class("UIWebView").Css("INPUT#u_0_2"));
     app.Screenshot("Tapped on view with class: UIWebView");
     app.EnterText(x => x.Class("UIWebView").Css("INPUT#u_0_2"), "Imperial09!");
     app.Tap(x => x.Class("UIWebView").Css("BUTTON#u_0_6"));
     app.Screenshot("Tapped on view with class: UIWebView");
     app.Tap(x => x.Marked("OK"));
     app.Screenshot("Tapped on view with class: _UIAlertControllerActionView marked: OK");
     app.Tap(x => x.Class("UITableViewCellContentView"));
     app.Screenshot("Tapped on view with class: UITableViewCellContentView");
     app.Tap(x => x.Marked("Borrow"));
     app.Screenshot("Tapped on view with class: _UIAlertControllerActionView marked: Borrow");
     app.Tap(x => x.Text("Send borrow request"));
     app.Screenshot("Tapped on view with class: UIButtonLabel marked: Send borrow request");
     app.Tap(x => x.Marked("Okay"));
     app.Screenshot("Tapped on view with class: _UIAlertControllerActionView marked: Okay");
 }
Пример #10
0
        public void A_Register()
        {
            string str          = generator.RandomString(3, false);
            int    rand         = generator.RandomNumber(3, 100);
            string randomnumber = rand.ToString();
            string email        = String.Concat(str, randomnumber);
            string remain       = "@pampers.com";

            EmailFinal = String.Concat("james.", email, remain);
            Thread.Sleep(20000);
            app.SwipeRightToLeft();
            app.SwipeRightToLeft();
            app.SwipeRightToLeft();
            Thread.Sleep(7000);
            //app.Flash("I’m already a member");
            app.Tap("Let’s get started!");
            Thread.Sleep(3000);
            app.Tap(x => x.TextField().Index(0));
            app.EnterText("James");
            app.Tap(x => x.TextField().Index(1));
            app.EnterText(EmailFinal);
            app.Tap(x => x.TextField().Index(2));
            app.EnterText("magicA123");
            app.DismissKeyboard();
            app.Tap("I'd love to join!");
            Thread.Sleep(15000);
            app.Tap("Let me add the date");
            Thread.Sleep(5000);
            app.Tap("Done");
            app.Tap("Save and continue");
            Thread.Sleep(5000);
            app.Tap("Let's lock this down");
            Thread.Sleep(3000);
            Console.Write("--- Register Success ---");
            //B_Login();
        }
Пример #11
0
        public void EnterText()
        {
            //Arrange
            string typedText = "Hello world!";
            string retrievedText;

            //Act
            app.Tap(MyEntry);
            app.ClearText();
            app.Screenshot("Entry Tapped");

            app.EnterText(typedText);
            app.DismissKeyboard();
            app.Screenshot($"Entered Text: {typedText}");

            //Assert
            retrievedText = app.Query(MyLabel).FirstOrDefault()?.Text;
            Assert.AreEqual(typedText, retrievedText, "The typed text does not match the text displayed on the screen");
        }
Пример #12
0
    public void LoweringMaxTempTurnsLabelRed()
    {
        // Let something load before proceeding
        app.WaitForElement(x => x.Id("JunctionTemperatureLabel"));
        app.Screenshot("Initial launch");

        app.SetSliderValue(x => x.Class("UISlider"), 12);
        app.SetSliderValue(x => x.Class("UISlider").Index(1), 5);
        // Have to scroll down on small screens to make lower views accessible
        app.ScrollDown(withinMarked: "CalcScrollView");
        app.SetSliderValue(x => x.Class("UISlider").Index(2), 0.5);
        app.Screenshot("Sliders set for 5V from 12V at 0.5A");

        app.ScrollUp(withinMarked: "CalcScrollView");
        app.Tap(x => x.Id("hamburger.png"));
        app.Screenshot("Opened settings");

        app.Tap(x => x.Marked("Fahrenheit (°F)"));
        app.Screenshot("Tapped on view with class: UILabel marked: Fahrenheit (°F)");

        app.Tap(x => x.Marked("257"));
        app.ClearText(x => x.Class("UITextField").Index(2));
        app.EnterText(x => x.Class("UITextField").Index(2), "215");
        app.Tap(x => x.Marked("Done"));
        app.Screenshot("Lowered max junction temperature below current temperature");

        //app.Tap(x => x.Class("UIView").Index(6));
        app.SwipeRightToLeft();
        //app.Repl();
        app.Screenshot("Closed settings");

        app.WaitForElement(x => x.Id("JunctionTemperatureLabel"));
        var isRed = Convert.ToBoolean(app.Query(x => x.Id("JunctionTemperatureLabel").
                                                Invoke("textColor").Invoke("red"))[0]);

        Assert.IsTrue(isRed);
    }
Пример #13
0
 public void UpdateFirstName()
 {
     app.Screenshot("App Started");
     app.Tap(x => x.Marked("Enter a unique phrase"));
     app.EnterText("UseLocalDataSource");
     app.Screenshot("Entered data parition phrase");
     app.Tap(x => x.Marked("Continue"));
     Thread.Sleep(10000);             // wait 10 seconds to let list and all images load
     app.Screenshot("App start, display list");
     app.ScrollDownTo("Green, Monica");
     app.Screenshot("Scrolled to Monica Green");
     app.Tap(x => x.Marked("Green, Monica"));
     app.WaitForElement(x => x.Class("MKNewAnnotationContainerView")); // wait for the map to appear
     Thread.Sleep(2000);                                               // wait 2 seconds to give map time to fully render
     app.Screenshot("Detail screen");
     app.Tap(x => x.Id("edit.png"));
     app.Screenshot("Edit screen");
     app.ScrollDownTo("First");
     app.Tap(x => x.Marked("Monica"));
     Thread.Sleep(1000);
     app.ClearText();
     app.Screenshot("Cleared first name field");
     app.EnterText("Erica");
     app.DismissKeyboard();
     app.Screenshot("Altered value of company name field");
     app.Tap(x => x.Id("save.png"));
     app.WaitForElement(x => x.Class("MKNewAnnotationContainerView")); // wait for the map to appear
     Thread.Sleep(2000);                                               // wait 2 seconds to give map time to fully render
     app.Screenshot("Saved changes, navigated to detail screen, first name updated");
     app.Tap(x => x.Marked("List"));
     app.Screenshot("First name updated on list screen, first name updated");
 }
 public static void EnterText(this iOSApp app, Func <AppQuery, AppQuery> lambda, string text, string screenshot)
 {
     app.EnterText(lambda, text);
     app.Screenshot(screenshot);
 }
Пример #15
0
 public void UpdateFirstName()
 {
     app.Screenshot("App Started");
     app.EnterText(x => x.Class("UITextField"), "UseLocalDataSource");
     app.Screenshot("Entered data parition phrase");
     app.Tap(x => x.Text("Continue"));
     app.WaitForElement(x => x.Marked("Armstead, Evan"));
     Thread.Sleep(3000);             // wait a few seconds for list images to fully load
     app.Screenshot("Display list");
     app.Tap(x => x.Marked("Armstead, Evan"));
     app.WaitForElement(x => x.Class("MKNewAnnotationContainerView")); // wait for the map to appear
     Thread.Sleep(2000);                                               // wait 2 seconds to give map time to fully render
     app.Screenshot("Detail screen");
     app.Tap(x => x.Id("edit.png"));
     app.Screenshot("Edit screen");
     app.ScrollDownTo("First");
     app.Tap(x => x.Marked("Evan"));
     app.ClearText();
     app.Screenshot("Cleared first name field");
     app.EnterText("Jonathan");
     app.DismissKeyboard();
     app.Screenshot("Altered value of first name field");
     app.Tap(x => x.Id("save.png"));
     app.WaitForElement(x => x.Class("MKNewAnnotationContainerView")); // wait for the map to appear
     Thread.Sleep(2000);                                               // wait 2 seconds to give map time to fully render
     app.Screenshot("Saved changes, navigated to detail screen, first name updated");
     app.Tap(x => x.Marked("List"));
     app.Screenshot("First name updated on list screen");
 }
Пример #16
0
		public void UserCanAddItemAndThenViewThisItemOnTheirProfile()
		{
			app.Tap(x => x.Marked("Sign-in"));
			app.WaitForElement("Tapped on view with class: UIButton marked: Sign-in");
			app.Tap(x => x.Class("UIWebView").Css("INPUT._56bg._4u9z._5ruq"));
			app.WaitForElement("Tapped on view with class: UIWebView");
			app.EnterText(x => x.Class("UIWebView").Css("INPUT._56bg._4u9z._5ruq"), "*****@*****.**");
			app.Tap(x => x.Class("UIWebView").Css("INPUT#u_0_2"));
			app.WaitForElement("Tapped on view with class: UIWebView");
			app.EnterText(x => x.Class("UIWebView").Css("INPUT#u_0_2"), "Imperial09!");
			app.Tap(x => x.Class("UIWebView").Css("BUTTON#u_0_6"));
			app.WaitForElement("Tapped on view with class: UIWebView");
			app.Tap(x => x.Id("*****@*****.**"));
			app.WaitForElement("Tapped on view with class: UITabBarSwappableImageView");
			app.Tap(x => x.Marked("Enter Category"));
			app.WaitForElement("Tapped on view with class: UITextFieldLabel marked: Enter Category");
			app.Tap(x => x.Marked("Done"));
			app.WaitForElement("Tapped on view with class: UIToolbarTextButton marked: Done");
			app.Tap(x => x.Marked("Enter Name"));
			app.WaitForElement("Tapped on view with class: UITextFieldLabel marked: Enter Name");
			app.EnterText(x => x.Class("UITextField").Index(1), "Snakes and Ladders");
			app.Tap(x => x.Text("Enter Description"));
			app.WaitForElement("Tapped on view with class: UITextView");
			app.Tap(x => x.Marked("Done"));
			app.WaitForElement("Tapped on view with class: UIToolbarTextButton marked: Done");
			app.Tap(x => x.Marked("Enter Number of Days Willing to Lend"));
			app.WaitForElement("Tapped on view with class: UITextFieldLabel marked: Enter Number of Days Willing to Lend");
			app.EnterText(x => x.Class("UITextField").Index(2), "12");
			app.Tap(x => x.Class("Xamarin_Forms_Platform_iOS_Platform_DefaultRenderer"));
			app.WaitForElement("Tapped on view with class: Xamarin_Forms_Platform_iOS_Platform_DefaultRenderer");
			app.Tap(x => x.Marked("Enter Location"));
			app.WaitForElement("Tapped on view with class: UITextFieldLabel marked: Enter Location");
			app.EnterText(x => x.Class("UITextField").Index(3), "Reading");
			app.Tap(x => x.Class("Xamarin_Forms_Platform_iOS_Platform_DefaultRenderer"));
			app.WaitForElement("Tapped on view with class: Xamarin_Forms_Platform_iOS_Platform_DefaultRenderer");
			app.Tap(x => x.Class("UIButtonLabel").Text("Add Item").Marked("Add Item"));
			app.WaitForElement("Tapped on view with class: UIButtonLabel marked: Add Item");
			app.Tap(x => x.Marked("Ok"));
			app.WaitForElement("Tapped on view with class: _UIAlertControllerActionView marked: Ok");
			app.Tap(x => x.Marked("Profile"));
			app.WaitForElement("Tapped on view with class: UITabBarButton marked: Profile");
			app.Tap(x => x.Marked("Board Game"));
			app.WaitForElement("Tapped on view with class: UILabel marked: Board Game");
			app.Tap(x => x.Marked("Delete"));
			app.WaitForElement("Tapped on view with class: _UIAlertControllerActionView marked: Delete");
		}
Пример #17
0
        public void CrawlDevices()
        {
            app.Screenshot("Login");
            app.Tap(b => b.Button("Local"));
            app.EnterText("Hestia");
            app.Screenshot("Server connect");
            app.Tap(t => t.Text("Enter IP"));
            app.EnterText("94.212.164.28");
            app.Tap(t => t.Text("Connect"));
            app.Screenshot("Devices");
            app.Tap(b => b.Button("Edit"));
            app.Screenshot("Devices edit mode");
            app.Tap(i => i.Id("AddDeviceIcon"));
            app.Screenshot("New device manufacturer");
            app.Tap(t => t.Text("mock"));
            app.Screenshot("New device type");
            app.Tap(t => t.Text("lock"));
            app.Screenshot("New device properties");

            var l = app.Query(t => t.Text("NAME"));

            app.TapCoordinates(l[1].Rect.CenterX, l[1].Rect.CenterY + 20);
            app.EnterText("TestLock");

            l = app.Query(t => t.Text("IP"));
            app.TapCoordinates(l[1].Rect.CenterX, l[1].Rect.CenterY + 20);
            app.EnterText("0.0.0.0");

            app.Tap(b => b.Button("Save"));
            app.Screenshot("Added device");
            app.Tap(t => t.Text("TestLock"));
            app.Screenshot("Device activators");
            app.Tap(c => c.Class("UISwitch"));
            app.Tap(t => t.Text("Devices"));
            app.Tap(b => b.Button("Edit"));

            app.Tap(t => t.Text("TestLock"));
            app.Screenshot("Edit device");
            l = app.Query(t => t.Text("TestLock"));
            app.TapCoordinates(l[0].Rect.CenterX, l[0].Rect.CenterY);
            app.EnterText("UITestLock");
            app.Tap(b => b.Button("Save"));

            app.WaitForElement(t => t.Text("UITestLock"));
            l = app.Query(t => t.Text("UITestLock"));
            app.TapCoordinates(l[0].Rect.X, l[0].Rect.CenterY);
            app.Screenshot("Delete device");
            app.TapCoordinates(l[0].Rect.Width - 1, l[0].Rect.CenterY);
            app.Tap(b => b.Button("Done"));
        }