Sha256: 1e310ee665f59ebcee1613b0c5197c4c9a5d5632964f17ffef718a36a967b7a7

Contents?: true

Size: 745 Bytes

Versions: 8

Compression:

Stored size: 745 Bytes

Contents

require "selenium-webdriver"
require "teabag/runner"

module Teabag
  module Drivers
    class SeleniumDriver < BaseDriver

      def run_specs(suite, url)
        runner = Teabag::Runner.new(suite)

        driver = Selenium::WebDriver.for(:firefox)
        driver.navigate.to("#{url}?reporter=Console")

        Selenium::WebDriver::Wait.new(timeout: 180, interval: 0.01, message: "Timed out").until do
          done = driver.execute_script("return window.Teabag && window.Teabag.finished")
          driver.execute_script("return Teabag.getMessages()").each do |line|
            runner.process("#{line}\n")
          end
          done
        end

        runner.failure_count
      ensure
        driver.quit
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
teabag-0.4.6 lib/teabag/drivers/selenium_driver.rb
teabag-0.4.5 lib/teabag/drivers/selenium_driver.rb
teabag-0.4.4 lib/teabag/drivers/selenium_driver.rb
teabag-0.4.3 lib/teabag/drivers/selenium_driver.rb
teabag-0.4.2 lib/teabag/drivers/selenium_driver.rb
teabag-0.4.1 lib/teabag/drivers/selenium_driver.rb
teabag-0.4.0 lib/teabag/drivers/selenium_driver.rb
teabag-0.3.6 lib/teabag/drivers/selenium_driver.rb