lib/capybara/poltergeist/client/browser.coffee in poltergeist-1.10.0 vs lib/capybara/poltergeist/client/browser.coffee in poltergeist-1.11.0

- old
+ new

@@ -234,12 +234,12 @@ command.sendError(new Poltergeist.FrameNotFound(name)) push_frame: (name, timeout = (new Date().getTime()) + 2000) -> @pushFrame(@current_command, name, timeout) - pop_frame: -> - @current_command.sendResponse(@currentPage.popFrame()) + pop_frame: (pop_all = false)-> + @current_command.sendResponse(@currentPage.popFrame(pop_all)) window_handles: -> handles = @pages.filter((p) -> !p.closed).map((p) -> p.handle) @current_command.sendResponse(handles) @@ -344,10 +344,13 @@ # That's why we need something more realistic like user behavior. if !target.containsSelection() target.mouseEvent('click') for sequence in keys - key = if sequence.key? then @currentPage.keyCode(sequence.key) else sequence + key = if sequence.key? + @currentPage.keyCode(sequence.key) || sequence.key + else + sequence if sequence.modifier? modifier_keys = @currentPage.keyModifierKeys(sequence.modifier) modifier_code = @currentPage.keyModifierCode(sequence.modifier) @currentPage.sendEvent('keydown', modifier_key) for modifier_key in modifier_keys @currentPage.sendEvent('keypress', key, null, null, modifier_code)