Sha256: 8a9b9cd232907295f0758d466d266d97a6a11e83d7bc6462efcd0d1ff9328180

Contents?: true

Size: 1.72 KB

Versions: 12

Compression:

Stored size: 1.72 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe 'Utility Functions for the Grid' do
  before(:all) do
    @controller = Controller.new(
      :ring_server_port => 12353,
      :loglevel => Logger::ERROR)
    @controller.start
    1.upto(1) do
      provider = Provider.new(
        :ring_server_port => 12353,
        :loglevel => Logger::ERROR, :browser_type => 'safari')
      provider.start
    end
    grid = Watir::Grid.new(:ring_server_port => 12353)
    grid.start(:read_all => true)
    @browser = grid.browsers[0]
  end

  after(:all) do
    @controller.stop
  end

  it 'should get the logged-in user for the remote provider' do
    @browser[:object].get_logged_in_user.should == `whoami`.chomp
  end

  it 'should enumerate any running browsers on the remote provider' do
    @browser[:object].get_running_browsers(['firefox-bin']).size.should == 0
  end

  it 'should be able to start a new firefox browser' do
    @browser[:object].start_firefox_jssh
    sleep 5
    @browser[:object].get_running_browsers(['firefox-bin']).size.should == 1
  end

  it 'should be able to kill all firefox browsers' do
    @browser[:object].kill_browser('firefox-bin')
    @browser[:object].get_running_browsers(['firefox-bin']).size.should == 0
  end

  it 'should be able to start a new firefox browser specified by path' do
    @browser[:object].start_firefox_jssh
      ("/Applications/Firefox.app/Contents/MacOS/firefox-bin")
    sleep 5
    @browser[:object].get_running_browsers(['firefox-bin']).size.should == 1
  end

  it 'should be able to kill all browsers' do
    @browser[:object].kill_all_browsers
    @browser[:object].get_running_browsers.size.should == 0
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
watirgrid-1.1.3.pre spec/utilities_spec.rb
watirgrid-1.1.2 spec/utilities_spec.rb
watirgrid-1.1.1 spec/utilities_spec.rb
watirgrid-1.1.0 spec/utilities_spec.rb
watirgrid-1.0.6 spec/utilities_spec.rb
watirgrid-1.0.5 spec/utilities_spec.rb
watirgrid-1.0.4 spec/utilities_spec.rb
watirgrid-1.0.4.pre spec/utilities_spec.rb
watirgrid-1.0.3 spec/utilities_spec.rb
watirgrid-1.0.3.pre spec/utilities_spec.rb
watirgrid-1.0.1 spec/utilities_spec.rb
watirgrid-1.0.0 spec/utilities_spec.rb