add "submit" method to Node that allows to submit a form node without clicking a button
This commit is contained in:
parent
4ceb8740fa
commit
83905bb48c
|
@ -77,6 +77,10 @@ class Capybara::Driver::Webkit
|
|||
invoke "path"
|
||||
end
|
||||
|
||||
def submit(opts)
|
||||
invoke "submit"
|
||||
end
|
||||
|
||||
def trigger(event)
|
||||
invoke "trigger", event
|
||||
end
|
||||
|
|
|
@ -97,6 +97,10 @@ Capybara = {
|
|||
return this.nodes[index].tagName.toLowerCase();
|
||||
},
|
||||
|
||||
submit: function(index) {
|
||||
return this.nodes[index].submit();
|
||||
},
|
||||
|
||||
click: function (index) {
|
||||
var clickEvent = document.createEvent('MouseEvents');
|
||||
clickEvent.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
|
|
Loading…
Reference in New Issue