Skip to content

Instantly share code, notes, and snippets.

@huguogang
Created October 1, 2013 06:26
Show Gist options
  • Save huguogang/6774553 to your computer and use it in GitHub Desktop.
Save huguogang/6774553 to your computer and use it in GitHub Desktop.
Client side script for SJTXE (Selenium JavaScript Testing eXtension for ExtJS)
//Client side utilities for Selenium tests of ExtJS web applications
//requires ExtJS and Underscore libraries
//SJTXE - Selenium JavaScript Testing eXtension for ExtJS
(function(root, Ext) {
var root = root || window;
var me = root;
var Ext = Ext;
//private vars
var hasAjaxFailure = false;
var onAjaxError = function(conn, response, options, eOpts) {
hasAjaxFailure = true;
};
Ext.onReady(function() {
Ext.Ajax.on({
requestexception: onAjaxError
});
});
//exposed object
var SJTXE = {
VERSION: '0.0',
hasAjaxFailure: function() {return hasAjaxFailure}
};
root.SJTXE = SJTXE;
return SJTXE;
})(this, Ext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment