Sha256: 7dde9a47386fd0c8088b51d4c0de2844b8a33082caccfd684ca1058ff079e6d2

Contents?: true

Size: 736 Bytes

Versions: 1

Compression:

Stored size: 736 Bytes

Contents

class TravianBot
  class Application
    module Navigate
      def to_resources_page(selenium)
        to_page(selenium, 'resources')
      end
      
      def to_village_page(selenium)
        to_page(selenium, 'village')
      end
      
      def to_map_page(selenium)
        to_page(selenium, 'map')
      end
      
      def to_stats_page(selenium)
        to_page(selenium, 'stats')
      end
      
      def to_reports_page(selenium)
        to_page(selenium, 'reports')
      end
      
      private
      def to_page(selenium, target)
        wait = Selenium::WebDriver::Wait.new
        link = selenium.find_element(:xpath, "//ul[@id='navigation']/li[@class='#{target}']/a")
        link.click
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
travian_bot-0.2.0 lib/travian_bot/application/navigate.rb