Sha256: 57fc937852ff527ad05dc673452c1e05f01b94b940c2aa52d51b3f9944cdc817

Contents?: true

Size: 1.67 KB

Versions: 1

Compression:

Stored size: 1.67 KB

Contents

require_relative '../spec_helper'

describe 'WebElements::SelectList' do
  let(:select_list_object) { double('select_list_object') }
  let(:select_list_definition) { ::Fluent::WebElements::SelectList.new(select_list_object, :platform => :watir_webdriver) }
  let(:select_list_options) { [select_list_object, select_list_object] }
  
  # select_list_actual == select_list_definition
  
  it 'should determine if an option is selected' do
    select_list_object.stub(:selected?).with('testing').and_return(true)
    select_list_definition.selected?('testing')
  end

  it 'should be able to select an item by option' do
    select_list_object.should_receive(:select).and_return(true)
    select_list_definition.select('testing')
  end

  it 'should be able to select an item by value' do
    select_list_object.should_receive(:select_value).and_return(true)
    select_list_definition.select_value('testing')
  end

  it 'should return an array of selected options' do
    select_list_object.stub(:selected_options).and_return(select_list_options)
    select_list_object.stub(:text).and_return(select_list_object)
    select_list_definition.selected_options.should == select_list_options
  end

  it 'should get the values for any selected options' do
    select_list_object.stub(:selected_options).and_return(select_list_options)
    select_list_object.stub(:value).and_return(select_list_object)
    select_list_definition.selected_values.should == select_list_options
  end

  it 'should determine if an option is available in the list' do
    select_list_object.stub(:include?).with('testing').and_return(true)
    select_list_definition.include?('testing')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluent-0.2.0 spec/web_elements/select_list_spec.rb