Add slimerjs flag to test engine.

Jonathan Frederic 12 years ago committed by Jonathan Frederic
parent edbaff8400
commit f6e7312b5b

@ -15,11 +15,13 @@ casper.notebook_test(function () {
this.execute_cell_then(index);
this.then(function () {
// When running in xvfb, the Slimer window doesn't always have focus
// immediately. By clicking on a new element on the page we ccan force
// it to gain focus.
this.click_cell_editor(1);
this.click_cell_editor(0);
if (this.slimerjs) {
// When running in xvfb, the Slimer window doesn't always have focus
// immediately. By clicking on a new element on the page we ccan force
// it to gain focus.
this.click_cell_editor(1);
this.click_cell_editor(0);
}
this.validate_notebook_state('initial state', 'edit', 0);
this.trigger_keydown('esc');

@ -453,18 +453,15 @@ casper.assert_colors_equal = function (hex_color, local_color, msg) {
casper.notebook_test = function(test) {
// Wrap a notebook test to reduce boilerplate.
//
// If you want to read parameters from the commandline, use the following
// (i.e. value=):
// if (casper.cli.options.value) {
// casper.exit(1);
// }
this.open_new_notebook();
// Echo whether or not we are running this test using SlimerJS
if (this.evaluate(function(){
return typeof InstallTrigger !== 'undefined'; // Firefox 1.0+
})) { console.log('This test is running in SlimerJS.'); }
})) {
console.log('This test is running in SlimerJS.');
this.slimerjs = true;
}
// Make sure to remove the onbeforeunload callback. This callback is
// responsable for the "Are you sure you want to quit?" type messages.

Loading…
Cancel
Save