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

- old
+ new

@@ -1,12 +1,12 @@ # Proxy object for forwarding method calls to the node object inside the page. class Poltergeist.Node @DELEGATES = ['allText', 'visibleText', 'getAttribute', 'value', 'set', 'setAttribute', 'isObsolete', - 'removeAttribute', 'isMultiple', 'select', 'tagName', 'find', - 'isVisible', 'position', 'trigger', 'parentId', 'mouseEventTest', - 'scrollIntoView', 'isDOMEqual', 'isDisabled', 'deleteText'] + 'removeAttribute', 'isMultiple', 'select', 'tagName', 'find', 'getAttributes', + 'isVisible', 'position', 'trigger', 'parentId', 'parentIds', 'mouseEventTest', + 'scrollIntoView', 'isDOMEqual', 'isDisabled', 'deleteText', 'containsSelection'] constructor: (@page, @id) -> parent: -> new Poltergeist.Node(@page, this.parentId()) @@ -33,10 +33,14 @@ pos = this.mouseEventPosition() test = this.mouseEventTest(pos.x, pos.y) if test.status == 'success' - @page.mouseEvent(name, pos.x, pos.y) + if name == 'rightclick' + @page.mouseEvent('click', pos.x, pos.y, 'right') + this.trigger('contextmenu') + else + @page.mouseEvent(name, pos.x, pos.y) pos else throw new Poltergeist.MouseEventFailed(name, test.selector, pos) dragTo: (other) ->