mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
alert should be considered a test failure unless overridden by the test case
This commit is contained in:
1 parent
5218b7618e
commit
fe8319f971
1 file changed
+7
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package org.jvnet.hudson.test;
|
||||
|
||||
import com.gargoylesoftware.htmlunit.AlertHandler;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlImage;
|
||||
import com.google.inject.Injector;
|
||||
import hudson.ClassicPluginStrategy;
|
||||
@@ -1659,6 +1660,12 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
|
||||
}
|
||||
});
|
||||
|
||||
setAlertHandler(new AlertHandler() {
|
||||
public void handleAlert(Page page, String message) {
|
||||
throw new AssertionError("Alert dialog poped up: "+message);
|
||||
}
|
||||
});
|
||||
|
||||
// avoid a hang by setting a time out. It should be long enough to prevent
|
||||
// false-positive timeout on slow systems
|
||||
setTimeout(60*1000);
|
||||
|
||||
Reference in new issue
Block a user