Class: Webrat::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber-wordpress/webrat-patches.rb

Instance Method Summary collapse

Instance Method Details

#scoped_domObject



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/cucumber-wordpress/webrat-patches.rb', line 30

def scoped_dom
  begin
    @scope.dom.css(@selector).first
  rescue Nokogiri::CSS::SyntaxError => e
    begin
      @scope.dom.xpath(@selector).first
    rescue Nokogiri::XML::XPath::SyntaxError
      raise e
    end
  end
end