public void TestBackForMember() { // Go to the sign in and request a new password. Get(_loginUrl); _forgotPasswordLink.Click(); AssertPath(_newPasswordUrl); // Go back. _cancelButton.Click(); AssertUrl(HomeUrl); }
public void TestChangeEmailAddress() { // LogIn. var member = _memberAccountsCommand.CreateTestMember(0, false); LogIn(member); // Change email. AssertUrl(_notActivatedUrl); _changeEmailAddressLink.Click(); // Assert that the user was redirected to the appropriate page. var changeEmailUrl = _changeEmailUrl.AsNonReadOnly(); changeEmailUrl.QueryString["returnUrl"] = _notActivatedUrl.PathAndQuery; AssertUrl(changeEmailUrl); // Assert that selecting the cancel button returns the browser to this form. Assert.IsTrue(_cancelButton.IsVisible); _cancelButton.Click(); AssertUrl(_notActivatedUrl); }
public void TestChangeEmailAddress() { // LogIn. var member = _memberAccountsCommand.CreateTestMember(0, true); _emailVerificationsCommand.UnverifyEmailAddress(member.EmailAddresses[0].Address, null); LogIn(member); // Resend a verification. AssertUrlWithoutQuery(_notVerifiedUrl); _resendVerificationEmailButton.Click(); // Change email. AssertUrlWithoutQuery(_verificationSentUrl); _changeEmailAddressLink.Click(); // Assert that the user was redirected to the appropriate page. var changeEmailUrl = _changeEmailUrl.AsNonReadOnly(); changeEmailUrl.QueryString["returnUrl"] = _verificationSentUrl.PathAndQuery; AssertUrl(changeEmailUrl); // Assert that selecting the cancel button returns the browser to this form. Assert.IsTrue(_cancelButton.IsVisible); _cancelButton.Click(); AssertUrl(_verificationSentUrl); }
private void FollowViewFriendsLink(IList <Member> friends, int index) { var lnkFullName = new HtmlLinkTester(Browser, AddBodyPrefix("FormContent_Content") + "_contactsListControl_rptContacts_ctl" + index.ToString("D2") + "_ucContactsListDetails_lnkViewFriends"); lnkFullName.Click(); AssertPage <ViewFriendsFriends>(); AssertPageContains(friends[index].FullName); }
public void TestChangedEmailAddress() { // Create a verification. var member = _memberAccountsCommand.CreateTestMember(0, true); _emailVerificationsCommand.UnverifyEmailAddress(member.EmailAddresses[0].Address, null); var emailVerification = new EmailVerification { UserId = member.Id, EmailAddress = member.GetBestEmailAddress().Address }; _emailVerificationsCommand.CreateEmailVerification(emailVerification); // Change email. LogIn(member); AssertUrlWithoutQuery(_notVerifiedUrl); _changeEmailAddressLink.Click(); // Assert that the user was redirected to the appropriate page. var changeEmailUrl = _changeEmailUrl.AsNonReadOnly(); changeEmailUrl.QueryString["returnUrl"] = _notVerifiedUrl.PathAndQuery; AssertUrl(changeEmailUrl); // Change the email address. const string newEmail = "*****@*****.**"; _emailAddressTextBox.Text = newEmail; _sendButton.Click(); // Changing an email results in reactivation. AssertUrl(_activationSentUrl); // Logout and try to log in again with the old email. LogOut(); // Browse to the page. Get(GetVerificationUrl(emailVerification.VerificationCode)); // Assert that the error message is displayed. Assert.IsTrue(_loginButton.IsVisible); AssertErrorMessage("The verification code with value '" + emailVerification.VerificationCode + "' cannot be found. Please log in to request another verification email."); }
public void TestErrors() { // LogIn. var member0 = _memberAccountsCommand.CreateTestMember(0, false); var member1 = _memberAccountsCommand.CreateTestMember(1, false); LogIn(member0); // Change email. AssertUrl(_notActivatedUrl); _changeEmailAddressLink.Click(); // Assert that the user was redirected to the appropriate page. var changeEmailUrl = _changeEmailUrl.AsNonReadOnly(); changeEmailUrl.QueryString["returnUrl"] = _notActivatedUrl.PathAndQuery; AssertUrl(changeEmailUrl); // Try to change with an empty email address. _emailAddressTextBox.Text = string.Empty; _sendButton.Click(); AssertUrl(changeEmailUrl); AssertErrorMessage("The email address is required."); // Try to change with the same email address. _emailAddressTextBox.Text = member1.EmailAddresses[0].Address; _sendButton.Click(); AssertUrl(changeEmailUrl); AssertErrorMessage("The email address is already being used by another user."); }
public void TestIPhoneHome() { Browser.UseMobileUserAgent = true; Get(EmployerHomeUrl); AssertUrl(EmployerHomeUrl); AssertPageDoesNotContain(HomeContent); AssertPageContains(PhoneHomeContent); // Click the link to get to the home page. _continueLink.Click(); AssertUrlWithoutQuery(EmployerHomeUrl); AssertPageContains(HomeContent); AssertPageDoesNotContain(PhoneHomeContent); // Going back to the home page should not result in the iPhone prompt for the rest of the session. Get(EmployerHomeUrl); AssertUrl(EmployerHomeUrl); AssertPageContains(HomeContent); AssertPageDoesNotContain(PhoneHomeContent); }
public void TestDisplay() { // Create the member and friend. var member = CreateMember(); var friends = CreateFriends(member.Id, 1, 1); // Create friends friends. var friendsFriends = CreateFriends(friends[0].Id, 2, 1); friendsFriends.Add(member); // Log in. LogIn(member); GetPage <ViewFriends>(); // View friends friends. _lnkViewFriends.Click(); AssertFriendsFriends(member.Id, friends[0], friendsFriends, true, true); }