lib/gametel/accessors.rb in gametel-0.5.2 vs lib/gametel/accessors.rb in gametel-0.5.3

- old
+ new

@@ -137,10 +137,11 @@ # # @param [String] the name used for the generated methods # @param [Hash] locator indicating an id for how the view is found. # The only valid keys are: # * :id + # * :text # def view(name, locator) define_method(name) do platform.click_view(locator) end @@ -158,10 +159,11 @@ # # @param [String] the name used for the generated methods # @param [Hash] locator indicating an id for how the progress bar is found. # The only valid keys are: # * :id + # * :index # def progress(name, locator) define_method("#{name}") do platform.get_progress(locator) end @@ -175,10 +177,13 @@ platform.set_progress(locator, value) end define_method("#{name}_secondary=") do |value| platform.set_secondary_progress(locator, value) end + define_method("#{name}_view") do + Gametel::Views::Progress.new(platform, locator) + end end # # Generates one method to get the selected item text. # @example @@ -187,16 +192,20 @@ # # @param [String] the name used for the generated methods # @param [Hash] locator indicating an id for how the spinner is found. # The only valid keys are: # * :id + # * :index # def spinner(name, locator) define_method(name) do platform.get_spinner_value(locator) end define_method("select_#{name}") do |value| platform.select_spinner_value(locator, value) + end + define_method("#{name}_view") do + Gametel::Views::Spinner.new(platform, locator) end end end end