Implement element equality
This commit is contained in:
parent
3bc96bcb19
commit
0efbbe0fbc
|
@ -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
|
||||
|
|
|
@ -338,6 +338,10 @@ Capybara = {
|
|||
};
|
||||
mouseTrigger('mousemove', options);
|
||||
mouseTrigger('mouseup', options);
|
||||
},
|
||||
|
||||
equals: function(index, targetIndex) {
|
||||
return this.nodes[index] === this.nodes[targetIndex];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue