lib/capybara/poltergeist/client/compiled/main.js in poltergeist-1.1.2 vs lib/capybara/poltergeist/client/compiled/main.js in poltergeist-1.2.0
- old
+ new
@@ -1,27 +1,30 @@
-var Poltergeist,
+var Poltergeist, _ref,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Poltergeist = (function() {
-
function Poltergeist(port, width, height) {
var that;
+
this.browser = new Poltergeist.Browser(this, width, height);
this.connection = new Poltergeist.Connection(this, port);
that = this;
phantom.onError = function(message, stack) {
return that.onError(message, stack);
};
this.running = false;
}
Poltergeist.prototype.runCommand = function(command) {
+ var error;
+
this.running = true;
try {
return this.browser[command.name].apply(this.browser, command.args);
- } catch (error) {
+ } catch (_error) {
+ error = _error;
if (error instanceof Poltergeist.Error) {
return this.sendError(error);
} else {
return this.sendError(new Poltergeist.BrowserError(error.toString(), error.stack));
}
@@ -55,23 +58,22 @@
})();
window.Poltergeist = Poltergeist;
Poltergeist.Error = (function() {
-
function Error() {}
return Error;
})();
Poltergeist.ObsoleteNode = (function(_super) {
-
__extends(ObsoleteNode, _super);
function ObsoleteNode() {
- return ObsoleteNode.__super__.constructor.apply(this, arguments);
+ _ref = ObsoleteNode.__super__.constructor.apply(this, arguments);
+ return _ref;
}
ObsoleteNode.prototype.name = "Poltergeist.ObsoleteNode";
ObsoleteNode.prototype.args = function() {
@@ -84,31 +86,47 @@
return ObsoleteNode;
})(Poltergeist.Error);
-Poltergeist.ClickFailed = (function(_super) {
+Poltergeist.FrameNotFound = (function(_super) {
+ __extends(FrameNotFound, _super);
- __extends(ClickFailed, _super);
+ function FrameNotFound(frameName) {
+ this.frameName = frameName;
+ }
- function ClickFailed(selector, position) {
+ FrameNotFound.prototype.name = "Poltergeist.FrameNotFound";
+
+ FrameNotFound.prototype.args = function() {
+ return [this.frameName];
+ };
+
+ return FrameNotFound;
+
+})(Poltergeist.Error);
+
+Poltergeist.MouseEventFailed = (function(_super) {
+ __extends(MouseEventFailed, _super);
+
+ function MouseEventFailed(eventName, selector, position) {
+ this.eventName = eventName;
this.selector = selector;
this.position = position;
}
- ClickFailed.prototype.name = "Poltergeist.ClickFailed";
+ MouseEventFailed.prototype.name = "Poltergeist.MouseEventFailed";
- ClickFailed.prototype.args = function() {
- return [this.selector, this.position];
+ MouseEventFailed.prototype.args = function() {
+ return [this.eventName, this.selector, this.position];
};
- return ClickFailed;
+ return MouseEventFailed;
})(Poltergeist.Error);
Poltergeist.JavascriptError = (function(_super) {
-
__extends(JavascriptError, _super);
function JavascriptError(errors) {
this.errors = errors;
}
@@ -122,10 +140,9 @@
return JavascriptError;
})(Poltergeist.Error);
Poltergeist.BrowserError = (function(_super) {
-
__extends(BrowserError, _super);
function BrowserError(message, stack) {
this.message = message;
this.stack = stack;