1
0
Fork 0
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:
Jason Morrison 2011-02-26 14:55:40 -05:00
parent 2a7d49d503
commit ba3f0b1a18
3 changed files with 9 additions and 2 deletions

View file

@ -33,7 +33,7 @@ class Capybara::Driver::Webkit
end
def tag_name
raise NotImplementedError
invoke "tagName"
end
def visible?

View file

@ -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

View file

@ -24,6 +24,10 @@ Capybara = {
attribute: function (index, name) {
return this.nodes[index].getAttribute(name);
},
tagName: function(index) {
return this.nodes[index].tagName;
}
};