Example #1
0
        public void SaveFullUserData_ShouldSaveSuccessfully()
        {
            //Arrange
            var firstName     = "Michael Watson";
            var lastName      = "Aaaaaaaaaaaaaaaaa";
            var completeName  = $"{lastName}, {firstName}";
            var companyName   = "Microsoft";
            var title         = "Technical Solutions Professional";
            var phoneNumber   = "555-555-5555";
            var emailAddress  = "*****@*****.**";
            var streetAddress = "394 Pacific Ave.";
            var city          = "San Francisco";
            var state         = "CA";
            var zipCode       = "94111";

            //Act
            UserListPage.WaitForPageNavigationToComplete();
            UserListPage.TapOnAddNewUser();

            NewUserPage.WaitForPageNavigationToComplete();
            NewUserPage.EnterFirstName(firstName, false);
            NewUserPage.EnterLastName(lastName, false);
            NewUserPage.EnterCompanyName(companyName, false);
            NewUserPage.EnterTitle(title, false);

            NewUserPage.ScrollDownToEntry(NewUserPage.PhoneEntry);
            NewUserPage.EnterPhoneNumber(phoneNumber, false);
            NewUserPage.EnterEmailAddress(emailAddress, false);

            NewUserPage.ScrollDownToEntry(NewUserPage.ZipEntry);
            NewUserPage.EnterStreet(streetAddress, false);
            NewUserPage.EnterCity(city, false);
            NewUserPage.EnterState(state, false);
            NewUserPage.EnterZip(zipCode, false);
            NewUserPage.SaveNewUser();

            UserListPage.WaitForPageNavigationToComplete();
            UserListPage.WaitForIndicatorToDisappear();
            //Assert
            //Notice that we only check one element. Typically a save call is routed through an API.
            //It is safe to assume that if 1 property of the object saves, than all properties were saved
            app.WaitForElement(x => x.Text(completeName), "Timed out waiting for saved user to appear", TimeSpan.FromSeconds(30));
        }
Example #2
0
        public void ChangeFirstUserFirstNameAndSave_ShouldSaveAppropriately()
        {
            //Arrange
            var firstName = "!@#$%^&*()";

            //Act
            UserListPage.SelectFirstUserInList();
            UserDetailsPage.EditUser();
            EditUserPage.WaitForPageNavigationToComplete();

            var currentFirstName = EditUserPage.GetFirstName();
            var currentLastName  = EditUserPage.GetLastName();

            EditUserPage.EnterFirstName(firstName, true);
            EditUserPage.SaveNewUser();
            EditUserPage.Back();
            UserListPage.WaitForIndicatorToDisappear();

            //Assert
            app.ScrollDownTo($"{currentLastName}, {firstName}");
        }