Пример #1
0
 public void AlertTest4()
 {
     RunInAllBrowsers(browser =>
     {
         browser.NavigateToUrl("/Alert.aspx");
         browser.First("#button").Click();
         AssertUI.CheckIfAlertText(browser, s => s.EndsWith("test"), "alert text doesn't end with 'test.'");
     });
 }
Пример #2
0
 public void ExpectedExceptionTest2()
 {
     ExpectException(typeof(AlertException));
     RunInAllBrowsers(browser =>
     {
         browser.NavigateToUrl("/Alert.aspx");
         browser.First("#button").Click();
         AssertUI.CheckIfAlertText(browser, s => s.EndsWith("test."), "alert text doesn't end with 'test.'");
     });
 }
Пример #3
0
 public void ExpectedExceptionTest()
 {
     try
     {
         RunInAllBrowsers(browser =>
         {
             browser.NavigateToUrl("/Alert.aspx");
             browser.First("#button").Click();
             AssertUI.CheckIfAlertText(browser, s => s.EndsWith("test."), "alert text doesn't end with 'test.'");
         });
     }
     catch (Exception e)
     {
         var message = e.ToString();
         if (!message.Contains("confirm test"))
         {
             throw;
         }
     }
 }