Sha256: 840920ded0fefbda9788c7307007ec4c98538e3e4de92dab751ada50b2fcd978

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

require 'selenium-connect'

describe SeleniumConnect do

  let(:google) { Google.new(SeleniumConnect.start) }

  context "Common" do
    it "logging", :wip => true do
      SeleniumConnect.configure do |c|
        c.log = "#{Dir.pwd}/runner.out"
      end
      google.visit
      SeleniumConnect.finish
      File.read('runner.out').empty?.should == false
      File.delete('runner.out')
    end
  end

  context "Firefox" do
    it "blank config" do
      SeleniumConnect.configure do end
      google.visit
      google.page_title.should include("Google")
      SeleniumConnect.finish
    end

    it "localhost" do
      SeleniumConnect.configure do |c|
        c.host  = "localhost"
      end
      google.visit
      google.page_title.should include("Google")
      SeleniumConnect.finish
    end

    it "profile name" do
      pending "requires machine setup to run, and need a public example"
      SeleniumConnect.configure do |c|
        c.profile_name  = "YourProfileName"
      end
    end

    it "profile path" do
      pending "need to add a profile to the repo"
      SeleniumConnect.configure do |c|
        c.profile_path  = "#{Dir.pwd}/path/to/profile"
      end
    end

  end #Context//Firefox
end #Describe

class Google
  attr_accessor :page

  def initialize(driver)
    @page = driver
  end

  def visit
    page.get "http://www.google.com"
  end

  def page_title
    page.getTitle
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
selenium-connect-1.3.0 spec/basic_spec.rb