lib/page-object/accessors.rb in page-object-0.8.5 vs lib/page-object/accessors.rb in page-object-0.8.6

- old
+ new

@@ -1026,9 +1026,33 @@ self.send("#{name}_element").exists? end end # + # adds two methods - one to retrieve a svg, and another to check + # the svg's existence. + # + # @example + # svg(:circle, :id => 'circle') + # # will generate 'circle_element', and 'circle?' methods + # + # @param [Symbol] the name used for the generated methods + # @param [Hash] identifier how we find a svg. You can use a multiple paramaters + # by combining of any of the following except xpath. The valid keys are: + # * :class => Watir and Selenium + # * :css => Selenium only + # * :id => Watir and Selenium + # * :index => Watir and Selenium + # * :name => Watir and Selenium + # * :xpath => Watir and Selenium + # @param optional block to be invoked when element method is called + # + def svg(name, identifier={:index => 0}, &block) + standard_methods(name, identifier, 'svg_for', &block) + end + + + # # methods to generate accessors for types that follow the same # pattern as element # # @example # address(:home_address, :id => "home_address")