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?
self.tag_name == "select" && self["multiple"]
end
def ==(other)
invoke("equals", other.native) == "true"
end
end
end

View File

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