Tag name for nodes
This commit is contained in:
parent
286c81f584
commit
cbe0153950
|
@ -20,6 +20,12 @@ class Webcat::Driver::Culerity
|
||||||
def click
|
def click
|
||||||
node.click
|
node.click
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tag_name
|
||||||
|
# FIXME: this might be the dumbest way ever of getting the tag name
|
||||||
|
# there has to be something better...
|
||||||
|
node.to_xml[/^\s*<([a-z0-9\-\:]+)/, 1]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :app, :rack_server
|
attr_reader :app, :rack_server
|
||||||
|
|
|
@ -15,6 +15,10 @@ class Webcat::Driver::RackTest
|
||||||
def click
|
def click
|
||||||
session.visit(attribute(:href))
|
session.visit(attribute(:href))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tag_name
|
||||||
|
node.node_name
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
include ::Rack::Test::Methods
|
include ::Rack::Test::Methods
|
||||||
|
|
|
@ -45,6 +45,12 @@ shared_examples_for 'driver' do
|
||||||
@driver.find('//a')[1].attribute(:id).should == 'foo'
|
@driver.find('//a')[1].attribute(:id).should == 'foo'
|
||||||
@driver.find('//a')[1].attribute(:rel).should be_nil
|
@driver.find('//a')[1].attribute(:rel).should be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should extract node tag name" do
|
||||||
|
@driver.find('//a')[0].tag_name.should == 'a'
|
||||||
|
@driver.find('//a')[1].tag_name.should == 'a'
|
||||||
|
@driver.find('//p')[1].tag_name.should == 'p'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue