Exemple #1
0
        private static void AlertBoxCloseCore(this WisejWebDriver driver, MessageBoxIcon icon, string message,
                                              int timeoutInSeconds)
        {
            AlertBox alertBox = driver.AlertBoxGetCore(icon, message, timeoutInSeconds);

            Assert.IsNotNull(alertBox, GetMessage("AlertBox with {0} not found.", icon, message));

            IWidget closeButton = alertBox.CloseButton;

            Assert.IsNotNull(closeButton,
                             GetMessage("AlertBox close button with {0} not found.", icon, message));
            Assert.IsTrue(closeButton.Enabled,
                          GetMessage("AlertBox close button with {0} isn\'t enabled.", icon, message));
            closeButton.Click();
        }
Exemple #2
0
 /// <summary>
 /// Returns a <see cref="AlertBox"/> matching the specified message.
 /// </summary>
 /// <param name="driver">The <see cref="WisejWebDriver"/> to use.</param>
 /// <param name="message">The AlertBox message to search for (default is an empty string).</param>
 /// <param name="timeoutInSeconds">The number of seconds to wait for the AlertBox (default is 5).</param>
 /// <returns>The first matching AlertBox.</returns>
 public static AlertBox AlertBoxGet(this WisejWebDriver driver, string message = "", int timeoutInSeconds = 5)
 {
     return(driver.AlertBoxGetCore(MessageBoxIcon.None, message, timeoutInSeconds));
 }
Exemple #3
0
 /// <summary>
 /// Returns a <see cref="AlertBox"/> matching the specified icon.
 /// </summary>
 /// <param name="driver">The <see cref="WisejWebDriver"/> to use.</param>
 /// <param name="icon">The AlertBox icon to look for.</param>
 /// <param name="timeoutInSeconds">The number of seconds to wait for the AlertBox (default is 5).</param>
 /// <returns>The first matching AlertBox.</returns>
 public static AlertBox AlertBoxGet(this WisejWebDriver driver, MessageBoxIcon icon, int timeoutInSeconds = 5)
 {
     return(driver.AlertBoxGetCore(icon, null, timeoutInSeconds));
 }
 /// <summary>
 /// Returns a <see cref="AlertBox"/> matching the specified icon.
 /// </summary>
 /// <param name="driver">The <see cref="WisejWebDriver"/> to use.</param>
 /// <param name="icon">The AlertBox icon to look for.</param>
 /// <param name="timeoutInSeconds">The number of seconds to wait for the AlertBox (default is 5).</param>
 /// <returns>The first matching AlertBox.</returns>
 public static AlertBox AlertBoxGet(this WisejWebDriver driver, MessageBoxIcon icon, long timeoutInSeconds = 5)
 {
     return(driver.AlertBoxGetCore(false, icon, string.Empty, timeoutInSeconds));
 }