mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
Fetch a node's tag name
This commit is contained in:
parent
2a7d49d503
commit
ba3f0b1a18
3 changed files with 9 additions and 2 deletions
|
@ -33,7 +33,7 @@ class Capybara::Driver::Webkit
|
|||
end
|
||||
|
||||
def tag_name
|
||||
raise NotImplementedError
|
||||
invoke "tagName"
|
||||
end
|
||||
|
||||
def visible?
|
||||
|
|
|
@ -125,5 +125,8 @@ describe Capybara::Driver::Webkit do
|
|||
expect { subject.execute_script(%<invalid salad>) }.
|
||||
to raise_error(Capybara::Driver::Webkit::WebkitError)
|
||||
end
|
||||
end
|
||||
|
||||
it "returns a node's tag name" do
|
||||
subject.find("//p").first.tag_name.should == "P"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,6 +24,10 @@ Capybara = {
|
|||
|
||||
attribute: function (index, name) {
|
||||
return this.nodes[index].getAttribute(name);
|
||||
},
|
||||
|
||||
tagName: function(index) {
|
||||
return this.nodes[index].tagName;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue