1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00

Implement element equality

This commit is contained in:
Matthew Horan 2012-11-17 19:30:29 -05:00
parent 3bc96bcb19
commit 0efbbe0fbc
2 changed files with 8 additions and 0 deletions

View file

@ -122,5 +122,9 @@ module Capybara::Webkit
def multiple_select? def multiple_select?
self.tag_name == "select" && self["multiple"] self.tag_name == "select" && self["multiple"]
end end
def ==(other)
invoke("equals", other.native) == "true"
end
end end
end end

View file

@ -338,6 +338,10 @@ Capybara = {
}; };
mouseTrigger('mousemove', options); mouseTrigger('mousemove', options);
mouseTrigger('mouseup', options); mouseTrigger('mouseup', options);
},
equals: function(index, targetIndex) {
return this.nodes[index] === this.nodes[targetIndex];
} }
}; };