Sha256: ef6bc8f223c381d85a7dca1b8a1fceed9745003e514021cb6a5589455d538239

Contents?: true

Size: 1.26 KB

Versions: 6

Compression:

Stored size: 1.26 KB

Contents

require File.expand_path("../helper", __FILE__)

class TestSelenium < Test::Unit::TestCase
  def test_successful_connection_from_environment
    selenium = Sauce::Selenium.new(:job_name => "Sauce gem test suite: test_selenium.rb",
                                   :browser_url => "http://www.google.com/")
    selenium.start
    selenium.open "/"
    selenium.stop
  end

  def test_passed
    selenium = Sauce::Selenium.new(:job_name => "This test should be marked as passed",
                                   :browser_url => "http://www.google.com/")
    selenium.start
    job_id = selenium.session_id
    begin
      selenium.passed!
    ensure
      selenium.stop
    end

    job = Sauce::Job.find(job_id)
    while job.status == "in progress"
      sleep 0.5
      job.refresh!
    end

    assert job.passed, job
  end

  def test_failed
    selenium = Sauce::Selenium.new(:job_name => "This test should be marked as failed",
                                   :browser_url => "http://www.google.com/")
    selenium.start
    job_id = selenium.session_id
    begin
      selenium.failed!
    ensure
      selenium.stop
    end

    job = Sauce::Job.find(job_id)
    while job.status == "in progress"
      sleep 0.5
      job.refresh!
    end
    assert !job.passed, job
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sauce-1.0.2 test/test_selenium.rb
sauce-1.0.1 test/test_selenium.rb
sauce-1.0.0 test/test_selenium.rb
sauce-0.20.0 test/test_selenium.rb
sauce-0.19.1 test/test_selenium.rb
sauce-0.19.0 test/test_selenium.rb