lib/capybara/poltergeist/client/compiled/node.js in poltergeist-1.5.1 vs lib/capybara/poltergeist/client/compiled/node.js in poltergeist-1.6.0

- old
+ new

@@ -2,11 +2,11 @@ Poltergeist.Node = (function() { var name, _fn, _i, _len, _ref, _this = this; - Node.DELEGATES = ['allText', 'visibleText', 'getAttribute', 'value', 'set', 'setAttribute', 'isObsolete', 'removeAttribute', 'isMultiple', 'select', 'tagName', 'find', 'isVisible', 'position', 'trigger', 'parentId', 'mouseEventTest', 'scrollIntoView', 'isDOMEqual', 'isDisabled', 'deleteText']; + Node.DELEGATES = ['allText', 'visibleText', 'getAttribute', 'value', 'set', 'setAttribute', 'isObsolete', 'removeAttribute', 'isMultiple', 'select', 'tagName', 'find', 'getAttributes', 'isVisible', 'position', 'trigger', 'parentId', 'parentIds', 'mouseEventTest', 'scrollIntoView', 'isDOMEqual', 'isDisabled', 'deleteText', 'containsSelection']; function Node(page, id) { this.page = page; this.id = id; } @@ -45,10 +45,15 @@ var pos, test; this.scrollIntoView(); pos = this.mouseEventPosition(); test = this.mouseEventTest(pos.x, pos.y); if (test.status === 'success') { - this.page.mouseEvent(name, pos.x, pos.y); + if (name === 'rightclick') { + this.page.mouseEvent('click', pos.x, pos.y, 'right'); + this.trigger('contextmenu'); + } else { + this.page.mouseEvent(name, pos.x, pos.y); + } return pos; } else { throw new Poltergeist.MouseEventFailed(name, test.selector, pos); } };