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:
parent
3bc96bcb19
commit
0efbbe0fbc
2 changed files with 8 additions and 0 deletions
|
@ -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
|
||||||
|
|
|
@ -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];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue