コード例 #1
0
 public void ElementContained_NoElement()
 {
     RunInAllBrowsers(browser =>
     {
         browser.NavigateToUrl("ElementContained.aspx");
         AssertUI.CheckIfNotContainsElement(browser.First("#no"), "span");
     });
 }
コード例 #2
0
 public void ElementContained_OneElement_ExpectedFailure()
 {
     try
     {
         RunInAllBrowsers(browser =>
         {
             browser.NavigateToUrl("ElementContained.aspx");
             AssertUI.CheckIfNotContainsElement(browser.First("#one"), "span");
         });
     }
     catch (Exception ex)
     {
         if (ex.Message.Contains("children"))
         {
             throw;
         }
     }
 }
コード例 #3
0
 public void ElementContained_TwoElement_ExpectedFailure()
 {
     try
     {
         RunInAllBrowsers(browser =>
         {
             browser.NavigateToUrl("ElementContained.aspx");
             AssertUI.CheckIfNotContainsElement(browser.First("#two"), "span");
         });
     }
     catch (Exception ex)
     {
         var message = ex.ToString();
         if (!message.Contains("children") || !message.Contains("2"))
         {
             throw;
         }
     }
 }