Sha256: 1bc1f48269cd770aa7e67951d8b048cf27b8d113ead3e0c583ec4797841aa8f6

Contents?: true

Size: 767 Bytes

Versions: 1

Compression:

Stored size: 767 Bytes

Contents

require 'selenium-webdriver'

module Smokes
  # This class loads all the tests
  class TestsLoader
    def initialize(url, selected_tests, config_variables)
      @url = url
      @selected_tests = selected_tests
      @config_variables = config_variables
      start_browser
    end

    def run
      @browser.get @url
      itirate_tests
    end

    private

    def start_browser
      @browser = Selenium::WebDriver.for @config_variables[:browser].to_sym
      @wait = Selenium::WebDriver::Wait.new(timeout: @config_variables[:wait_time_out])
    end

    def itirate_tests
      @selected_tests.each do |selected_test|
        filename = "smokes/#{selected_test}.smoke"
        Smokes::TestParser.new(filename, @browser, @wait).run
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smokes-0.1.2 lib/smokes/tests_loader.rb