/// <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); })); }
/// <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"); })); }
/// <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); }); }
/// <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); }); }
/// <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); }); }
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()); }
/// <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; })); }
/// <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); }); }
/// <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; })); }
public void ThrowTimeoutExceptionWithParamTest() { GenericWait.WaitFor <object[]>(this.IsTwoParameters, (new List <object>()).ToArray()); }
public void ThrowExceptionWithParamTest() { GenericWait.WaitFor <string>(this.ThrowError, TESTSTRING); }
public void ThrowTimeoutExceptionWithoutParamTest() { GenericWait.WaitFor(this.IsParamTest); }
public void ThrowExceptionWithoutParamTest() { GenericWait.WaitFor(this.ThrowError); }
/// <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))); }
public void PassStringForTest() { int internalNumber = 0; GenericWait.WaitFor <string>((p) => p.Equals(TESTSTRING + internalNumber++), TESTSTRING + "3"); }
/// <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)); }
public void PassStringForTest() { GenericWait.WaitFor <string>(this.IsParamTestString, TESTSTRING); }
public void WaitForTest() { Assert.IsFalse(GenericWait.WaitFor <bool>(this.IsParamTest)); }
public void PassNoParamForTest() { initialReturnValue = false; GenericWait.WaitFor(IsNotParamTest); }
public void PassNoParamForTest() { GenericWait.WaitFor(IsNotParamTest); }