Exemple #1
0
 /// <summary>
 /// Gets the CSS value for the given attribute
 /// </summary>
 /// <param name="attributeName">The given attribute name</param>
 /// <returns>The CSS value</returns>
 /// <example>
 /// <code source = "../SeleniumUnitTesting/LazyElementUnitTests.cs" region="LazyElementGetCssValue" lang="C#" />
 /// </example>
 public string GetCssValue(string attributeName)
 {
     return(GenericWait.WaitFor <string>(() =>
     {
         return this.GetElement(this.GetTheExistingElement).GetCssValue(attributeName);
     }));
 }
Exemple #2
0
 /// <summary>
 /// Gets the current value of an element - Useful for get input box text
 /// </summary>
 /// <returns>The element's current value</returns>
 /// <example>
 /// <code source = "../SeleniumUnitTesting/LazyElementUnitTests.cs" region="LazyElementSendKeys" lang="C#" />
 /// </example>
 public string GetValue()
 {
     return(GenericWait.WaitFor <string>(() =>
     {
         return this.GetElement(this.GetTheVisibleElement).GetAttribute("value");
     }));
 }
Exemple #3
0
 /// <summary>
 /// Submit the lazy element
 /// </summary>
 /// <example>
 /// <code source = "../SeleniumUnitTesting/LazyElementUnitTests.cs" region="LazyElementSubmit" lang="C#" />
 /// </example>
 public void Submit()
 {
     GenericWait.WaitFor(() =>
     {
         IWebElement element = this.GetElement(this.GetTheExistingElement);
         this.ExecuteEvent(() => element.Submit(), "Submit");
         return(true);
     });
 }
Exemple #4
0
 /// <summary>
 /// Clear the lazy element
 /// </summary>
 /// <example>
 /// <code source = "../SeleniumUnitTesting/LazyElementUnitTests.cs" region="LazyElementClear" lang="C#" />
 /// </example>
 public void Clear()
 {
     GenericWait.WaitFor(() =>
     {
         IWebElement element = this.GetElement(this.GetTheVisibleElement);
         this.ExecuteEvent(() => element.Clear(), "Clear");
         return(true);
     });
 }
Exemple #5
0
 /// <summary>
 /// Send keys to the lazy element
 /// </summary>
 /// <param name="keys">The keys to send to the lazy element</param>
 /// <example>
 /// <code source = "../SeleniumUnitTesting/LazyElementUnitTests.cs" region="LazyElementSendKeys" lang="C#" />
 /// </example>
 public void SendKeys(string keys)
 {
     GenericWait.WaitFor(() =>
     {
         IWebElement element = this.GetElement(this.GetTheVisibleElement);
         this.ExecuteEvent(() => element.SendKeys(keys), "SendKeys");
         return(true);
     });
 }
Exemple #6
0
        public void PassObjectArrayForTest()
        {
            List <object> objects = new List <object>();

            objects.Add((object)"one");
            objects.Add((object)new Dictionary <int, Guid>());

            GenericWait.WaitFor <object[]>(this.IsTwoParameters, objects.ToArray());
        }
Exemple #7
0
 /// <summary>
 /// Get a mailbox by name
 /// </summary>
 /// <param name="mailbox">The mailbox name</param>
 /// <returns>The mailbox</returns>
 /// <example>
 /// <code source="../EmailUnitTests/EmailUnitWithDriver.cs" region="GetMailbox" lang="C#" />
 /// </example>
 public virtual IMailFolder GetMailbox(string mailbox)
 {
     return(GenericWait.WaitFor <IMailFolder>(() =>
     {
         CurrentMailBox = mailbox;
         CurrentFolder = EmailConnection.GetFolder(mailbox);
         CurrentFolder.Open(FolderAccess.ReadWrite);
         return CurrentFolder;
     }));
 }
Exemple #8
0
 /// <summary>
 /// Select a mailbox by name
 /// </summary>
 /// <param name="mailbox">The name of the mailbox</param>
 /// <example>
 /// <code source="../EmailUnitTests/EmailUnitWithDriver.cs" region="SelectMailbox" lang="C#" />
 /// </example>
 public virtual void SelectMailbox(string mailbox)
 {
     GenericWait.WaitFor <bool>(() =>
     {
         CurrentMailBox = mailbox;
         CurrentFolder  = EmailConnection.GetFolder(mailbox);
         CurrentFolder.Open(FolderAccess.ReadWrite);
         return(true);
     });
 }
Exemple #9
0
        /// <summary>
        /// Get the list of mailbox names in a specific namespace
        /// </summary>
        /// /// <param name="folderNamespace">The folderNamespace</param>
        /// <returns>A list of mailbox names in a specific namespace</returns>
        public virtual List <string> GetMailBoxNamesInNamespace(FolderNamespace folderNamespace)
        {
            return(GenericWait.WaitFor <List <string> >(() =>
            {
                List <string> mailBoxes = new List <string>();

                // Get all mailboxes in folderNamespace
                foreach (IMailFolder mailbox in EmailConnection.GetFolders(folderNamespace))
                {
                    mailBoxes.Add(mailbox.FullName);
                }

                return mailBoxes;
            }));
        }
Exemple #10
0
 public void ThrowTimeoutExceptionWithParamTest()
 {
     GenericWait.WaitFor <object[]>(this.IsTwoParameters, (new List <object>()).ToArray());
 }
Exemple #11
0
 public void ThrowExceptionWithParamTest()
 {
     GenericWait.WaitFor <string>(this.ThrowError, TESTSTRING);
 }
Exemple #12
0
 public void ThrowTimeoutExceptionWithoutParamTest()
 {
     GenericWait.WaitFor(this.IsParamTest);
 }
Exemple #13
0
 public void ThrowExceptionWithoutParamTest()
 {
     GenericWait.WaitFor(this.ThrowError);
 }
Exemple #14
0
 /// <summary>
 /// Get a list of messages that meet the search criteria
 /// </summary>
 /// <param name="condition">The search condition</param>
 /// <param name="headersOnly">Only get header data</param>
 /// <param name="markRead">Mark the email as read</param>
 /// <returns>The list of messages that match the search criteria</returns>
 public virtual List <MimeMessage> SearchMessages(SearchQuery condition, bool headersOnly = true, bool markRead = false)
 {
     return(GenericWait.WaitFor(() => this.GetSearchResults(condition, headersOnly, markRead)));
 }
Exemple #15
0
        public void PassStringForTest()
        {
            int internalNumber = 0;

            GenericWait.WaitFor <string>((p) => p.Equals(TESTSTRING + internalNumber++), TESTSTRING + "3");
        }
Exemple #16
0
 /// <summary>
 /// Get a list of messages that meet the search criteria
 /// </summary>
 /// <param name="condition">The search condition</param>
 /// <param name="headersOnly">Only get header data</param>
 /// <param name="markRead">Mark the email as read</param>
 /// <returns>The list of messages that match the search criteria</returns>
 /// /// <example>
 /// <code source = "../EmailUnitTests/EmailUnitWithDriver.cs" region="SearchMessages1" lang="C#" />
 /// <code source = "../EmailUnitTests/EmailUnitWithDriver.cs" region="SearchMessages2" lang="C#" />
 /// </example>
 public virtual List <MimeMessage> SearchMessages(SearchQuery condition, bool headersOnly = true, bool markRead = false)
 {
     object[] args = { condition, headersOnly, markRead };
     return(GenericWait.WaitFor <List <MimeMessage>, object[]>(this.GetSearchResults, args));
 }
Exemple #17
0
 public void PassStringForTest()
 {
     GenericWait.WaitFor <string>(this.IsParamTestString, TESTSTRING);
 }
Exemple #18
0
 public void WaitForTest()
 {
     Assert.IsFalse(GenericWait.WaitFor <bool>(this.IsParamTest));
 }
Exemple #19
0
 public void PassNoParamForTest()
 {
     initialReturnValue = false;
     GenericWait.WaitFor(IsNotParamTest);
 }
Exemple #20
0
 public void PassNoParamForTest()
 {
     GenericWait.WaitFor(IsNotParamTest);
 }