コード例 #1
0
ファイル: MessagingModule.cs プロジェクト: misterPaul0/Curt
 /// <summary>
 /// Composes a message to send to a user, then performs the message action.
 /// The test will also validate the username of the recipient.
 /// </summary>
 /// <param name="userName">The username of the recipient</param>
 /// <param name="subject">The subject for the message.</param>
 /// <param name="content">The body of the message.</param>
 /// <param name="msgAction">The action to perform after composing the message.
 /// The current options are: "Send", "Save", "Delete" and "Cancel".</param>
 public void ComposeMessage(string userName, string subject, string content, string msgAction)
 {
     ComposeLink.ClickNoWait();
     ToTextField.TypeText(userName);
     System.Threading.Thread.Sleep(1000);
     ValidateUserLink.ClickNoWait();
     System.Threading.Thread.Sleep(2000);
     Assert.IsTrue(ModuleMessageSpan.InnerHtml.Contains("Username '" + userName + "' is valid"), MessageSpan.InnerHtml);
     SubjectTextField.TypeText(subject);
     HTMLEditorModeSpan.ClickNoWait();
     System.Threading.Thread.Sleep(1000);
     htmlField.TypeText(content);
     if (msgAction.CompareTo("Send") == 0)
     {
         SendLink.Click();
     }
     else if (msgAction.CompareTo("Save") == 0)
     {
         SaveMsgLink.Click();
     }
     else if (msgAction.CompareTo("Delete") == 0)
     {
         DeleteMsgLink.Click();
     }
     else if (msgAction.CompareTo("Cancel") == 0)
     {
         CancelMsgLink.Click();
     }
 }
コード例 #2
0
ファイル: MessagingModule.cs プロジェクト: misterPaul0/Curt
        /// <summary>
        /// Sends a message to a user.
        /// The test will also validate the username of the recipient.
        /// </summary>
        /// <param name="userName">The username of the message recipient.</param>
        /// <param name="subject">The subject for the message.</param>
        /// <param name="body">The body of the message.</param>
        public void SendMsgToUser(string userName, string subject, string body)
        {
            System.Threading.Thread.Sleep(1000);
            ComposeLink.Click();
            System.Threading.Thread.Sleep(2000);
            //Setting textfield.value does not appear to work properly
            ToTextField.TypeText(userName);
            System.Threading.Thread.Sleep(3000);
            ValidateUserLink.Click();
            System.Threading.Thread.Sleep(1000);
            Assert.IsTrue(MessageSpan.InnerHtml.Contains("Username '" + userName + "' is valid"));
            SubjectTextField.TypeText(subject);

            HTMLEditorModeSpan.Click();
            System.Threading.Thread.Sleep(2000);
            htmlField.Value = body;
            SendLink.Click();
        }