public void Invitation_Is_Received_By_The_Correct_Users()
        {
            LoginSteps.LoginTestUser1();
            FriendsSteps.RemoveUserFromFriends(TestUsers.TestUser2);
            FriendsSteps.AddUserToFriends(TestUsers.TestUser2);

            LoginSteps.LoginTestUser2();
            this.UserStartPage.UnacceptedInvitationsLink.Wait.ForExists();

            // Reverse to initial state (the two test users ARE friends)
            FriendsSteps.AcceptUserInvitation();
        }
        public void Request_Notification_Disappears_After_Friendship_Approval()
        {
            LoginSteps.LoginTestUser1();
            FriendsSteps.RemoveUserFromFriends(TestUsers.TestUser2);
            FriendsSteps.AddUserToFriends(TestUsers.TestUser2);

            LoginSteps.LoginTestUser2();
            this.UserStartPage.UnacceptedInvitationsLink.Wait.ForExists();

            FriendsSteps.AcceptUserInvitation();
            this.Browser.Refresh();

            this.UserStartPage.UnacceptedInvitationsLink.Wait.ForExistsNot();
        }
        public void Removing_A_Friend_Removes_Him_From_Your_Friends_List()
        {
            LoginSteps.LoginTestUser1();
            FriendsSteps.RemoveUserFromFriends(TestUsers.TestUser2);

            NavigateTo.Page(this.FriendsPage);
            Manager.Current.ActiveBrowser.RefreshDomTree();
            this.FriendsPage.Elements.NoFriendsMessage.Wait.ForExists(5000);

            // Reverse to initial state (the two test users ARE friends)
            FriendsSteps.AddUserToFriends(TestUsers.TestUser2);
            LoginSteps.LoginTestUser2();
            FriendsSteps.AcceptUserInvitation();
        }
        public void Requesting_A_Friendship_Does_Not_Add_User_To_Your_Friends_Without_Approval()
        {
            LoginSteps.LoginTestUser1();
            FriendsSteps.RemoveUserFromFriends(TestUsers.TestUser2);
            FriendsSteps.AddUserToFriends(TestUsers.TestUser2);

            NavigateTo.Page(this.FriendsPage);

            this.FriendsPage.Elements.SentInvitationsList.Wait.ForExists(5000);

            // Reverse to initial state (the two test users ARE friends)
            LoginSteps.LoginTestUser2();
            FriendsSteps.AcceptUserInvitation();
        }
        public void Invitation_Notification_Link_Navigates_To_The_Correct_Place()
        {
            LoginSteps.LoginTestUser1();
            FriendsSteps.RemoveUserFromFriends(TestUsers.TestUser2);
            FriendsSteps.AddUserToFriends(TestUsers.TestUser2);

            LoginSteps.LoginTestUser2();
            this.UserStartPage.UnacceptedInvitationsLink.Click();
            this.Browser.WaitUntilReady();

            Assert.AreEqual(this.FriendsPage.Url, this.Browser.Url);

            // Reverse to initial state (the two test users ARE friends)
            FriendsSteps.AcceptUserInvitation();
        }