示例#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);
        }