コード例 #1
0
ファイル: LazyElement.cs プロジェクト: cakriwut/MAQS
 /// <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);
     }));
 }
コード例 #2
0
ファイル: LazyElement.cs プロジェクト: cakriwut/MAQS
 /// <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");
     }));
 }
コード例 #3
0
ファイル: LazyElement.cs プロジェクト: cakriwut/MAQS
 /// <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);
     });
 }
コード例 #4
0
ファイル: LazyElement.cs プロジェクト: cakriwut/MAQS
 /// <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);
     });
 }
コード例 #5
0
ファイル: LazyElement.cs プロジェクト: cakriwut/MAQS
 /// <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);
     });
 }
コード例 #6
0
ファイル: GenericWaitTests.cs プロジェクト: ca-borja/MAQS
        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());
        }
コード例 #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;
     }));
 }
コード例 #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);
     });
 }
コード例 #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;
            }));
        }
コード例 #10
0
ファイル: GenericWaitTests.cs プロジェクト: ca-borja/MAQS
 public void ThrowTimeoutExceptionWithParamTest()
 {
     GenericWait.WaitFor <object[]>(this.IsTwoParameters, (new List <object>()).ToArray());
 }
コード例 #11
0
ファイル: GenericWaitTests.cs プロジェクト: ca-borja/MAQS
 public void ThrowExceptionWithParamTest()
 {
     GenericWait.WaitFor <string>(this.ThrowError, TESTSTRING);
 }
コード例 #12
0
ファイル: GenericWaitTests.cs プロジェクト: ca-borja/MAQS
 public void ThrowTimeoutExceptionWithoutParamTest()
 {
     GenericWait.WaitFor(this.IsParamTest);
 }
コード例 #13
0
ファイル: GenericWaitTests.cs プロジェクト: ca-borja/MAQS
 public void ThrowExceptionWithoutParamTest()
 {
     GenericWait.WaitFor(this.ThrowError);
 }
コード例 #14
0
ファイル: EmailDriver.cs プロジェクト: Magenic/MAQS
 /// <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)));
 }
コード例 #15
0
ファイル: GenericWaitTests.cs プロジェクト: ca-borja/MAQS
        public void PassStringForTest()
        {
            int internalNumber = 0;

            GenericWait.WaitFor <string>((p) => p.Equals(TESTSTRING + internalNumber++), TESTSTRING + "3");
        }
コード例 #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));
 }
コード例 #17
0
 public void PassStringForTest()
 {
     GenericWait.WaitFor <string>(this.IsParamTestString, TESTSTRING);
 }
コード例 #18
0
ファイル: GenericWaitTests.cs プロジェクト: ca-borja/MAQS
 public void WaitForTest()
 {
     Assert.IsFalse(GenericWait.WaitFor <bool>(this.IsParamTest));
 }
コード例 #19
0
ファイル: GenericWaitTests.cs プロジェクト: ca-borja/MAQS
 public void PassNoParamForTest()
 {
     initialReturnValue = false;
     GenericWait.WaitFor(IsNotParamTest);
 }
コード例 #20
0
 public void PassNoParamForTest()
 {
     GenericWait.WaitFor(IsNotParamTest);
 }