예제 #1
0
        public async Task AddContactTest(string firstName, string lastName, string phoneNumber, bool shouldUseReturnKey)
        {
            //Arrange

            //Act
            await AddContact(firstName, lastName, phoneNumber, shouldUseReturnKey).ConfigureAwait(false);

            //Assert
            Assert.IsTrue(ContactsListPage.DoesContactExist(firstName, lastName, phoneNumber));
        }
예제 #2
0
        public async Task RestoreDeletedContactTest(bool shouldConfirmAlertDialog)
        {
            //Arrange
            var firstName   = TestConstants.TestFirstName;
            var lastName    = TestConstants.TestLastName;
            var phoneNumber = TestConstants.TestPhoneNumber;

            //Act
            await AddContact(firstName, lastName, phoneNumber, false).ConfigureAwait(false);

            ContactsListPage.DeleteContact(firstName, lastName, phoneNumber);

            try
            {
                await ContactsListPage.WaitForPullToRefreshActivityIndicator(3).ConfigureAwait(false);
            }
            catch
            {
            }
            await ContactsListPage.WaitForNoPullToRefreshActivityIndicator().ConfigureAwait(false);

            Assert.IsFalse(ContactsListPage.DoesContactExist(firstName, lastName, phoneNumber));

            ContactsListPage.TapRestoreDeletedContactsButton(shouldConfirmAlertDialog);

            if (shouldConfirmAlertDialog)
            {
                ContactsListPage.WaitForPageToLoad();

                try
                {
                    await ContactsListPage.WaitForPullToRefreshActivityIndicator(3).ConfigureAwait(false);
                }
                catch
                {
                }

                await ContactsListPage.WaitForNoPullToRefreshActivityIndicator().ConfigureAwait(false);

                ContactsListPage.PullToRefresh();
                await ContactsListPage.WaitForNoPullToRefreshActivityIndicator().ConfigureAwait(false);
            }

            //Assert
            if (shouldConfirmAlertDialog)
            {
                Assert.IsTrue(ContactsListPage.DoesContactExist(firstName, lastName, phoneNumber));
            }
            else
            {
                Assert.IsFalse(ContactsListPage.DoesContactExist(firstName, lastName, phoneNumber));
            }
        }
예제 #3
0
파일: Tests.cs 프로젝트: nateous/XamList
        Task AddContact(string firstName, string lastName, string phoneNumber, bool shouldUseReturnKey)
        {
            ContactsListPage.TapAddContactButton();

            ContactDetailsPage.WaitForPageToLoad();

            ContactDetailsPage.PopulateAllTextFields(firstName, lastName, phoneNumber, shouldUseReturnKey);
            ContactDetailsPage.TapSaveButton();

            ContactsListPage.WaitForPageToLoad();
            return(ContactsListPage.WaitForNoPullToRefreshActivityIndicatorAsync());
        }
예제 #4
0
        public async Task EnterContactInformationThenPressCancel(string firstName, string lastName, string phoneNumber)
        {
            //Arrange

            //Act
            ContactsListPage.TapAddContactButton();

            ContactDetailsPage.WaitForPageToLoad();

            ContactDetailsPage.PopulateAllTextFields(firstName, lastName, phoneNumber, false);
            ContactDetailsPage.TapCancelButton();

            ContactsListPage.WaitForPageToLoad();
            await ContactsListPage.WaitForNoPullToRefreshActivityIndicator().ConfigureAwait(false);

            //Assert
            Assert.IsFalse(ContactsListPage.DoesContactExist(firstName, lastName, phoneNumber));
        }
예제 #5
0
        public async Task RestoreDeletedContactTest(bool shouldConfirmAlertDialog)
        {
            //Arrange
            var firstName   = TestConstants.TestFirstName;
            var lastName    = TestConstants.TestLastName;
            var phoneNumber = TestConstants.TestPhoneNumber;

            //Act
            await AddContact(firstName, lastName, phoneNumber, false);

            await ContactsListPage.DeleteContact(firstName, lastName, phoneNumber);

            Assert.IsFalse(ContactsListPage.DoesContactExist(firstName, lastName, phoneNumber));

            ContactsListPage.TapRestoreDeletedContactsButton(shouldConfirmAlertDialog);

            switch (shouldConfirmAlertDialog)
            {
            case true:
                ContactsListPage.WaitForPageToLoad();
                await ContactsListPage.WaitForPullToRefreshActivityIndicatorAsync();

                await ContactsListPage.WaitForNoPullToRefreshActivityIndicatorAsync();

                ContactsListPage.PullToRefresh();
                await ContactsListPage.WaitForNoPullToRefreshActivityIndicatorAsync();

                break;
            }

            //Assert
            switch (shouldConfirmAlertDialog)
            {
            case true:
                Assert.IsTrue(ContactsListPage.DoesContactExist(firstName, lastName, phoneNumber));
                break;

            case false:
                Assert.IsFalse(ContactsListPage.DoesContactExist(firstName, lastName, phoneNumber));
                break;
            }
        }
예제 #6
0
        async Task AddContact(string firstName, string lastName, string phoneNumber, bool shouldUseReturnKey)
        {
            ContactsListPage.TapAddContactButton();

            ContactDetailsPage.WaitForPageToLoad();

            ContactDetailsPage.PopulateAllTextFields(firstName, lastName, phoneNumber, shouldUseReturnKey);
            ContactDetailsPage.TapSaveButton();

            ContactsListPage.WaitForPageToLoad();

            try
            {
                await ContactsListPage.WaitForPullToRefreshActivityIndicator(3).ConfigureAwait(false);
            }
            catch
            {
            }

            await ContactsListPage.WaitForNoPullToRefreshActivityIndicator().ConfigureAwait(false);
        }