Sha256: 559a4de306c43340f011d50d78f0acd1cbfc2215307d964f6cfab2049ab796d6

Contents?: true

Size: 1.38 KB

Versions: 13

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'
require 'page-object/elements'

describe PageObject::Elements::TextArea do
  let(:textarea) { PageObject::Elements::TextArea }

  describe "when mapping how to find an element" do
    it "should map watir types to same" do
      [:class, :id, :index, :name, :tag_name, :xpath].each do |t|
        identifier = textarea.watir_identifier_for t => 'value'
        identifier.keys.first.should == t
      end
    end

    it "should map selenium types to watir" do
      identifier = textarea.watir_identifier_for :css => 'value'
      identifier.keys.first.should == :tag_name
    end

    it "should map selenium types to same" do
      [:class, :css, :id, :name, :xpath, :index].each do |t|
        key, value = textarea.selenium_identifier_for t => 'value'
        key.should == t
      end
    end

    it "should map watir types to selenium" do
      key, value = textarea.selenium_identifier_for :tag_name => 'value'
      key.should == :css
    end
  end
  
  describe "interface" do
    context "for Selenium" do
      it "should set its' value" do
        text_area_element = double('text_area')
        text_area = PageObject::Elements::TextArea.new(text_area_element, :platform => :selenium_webdriver)
        text_area_element.should_receive(:clear)
        text_area_element.should_receive(:send_keys).with('Joseph')
        text_area.value = 'Joseph'
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
page-object-0.5.4 spec/page-object/elements/text_area_spec.rb
page-object-0.5.3 spec/page-object/elements/text_area_spec.rb
page-object-0.5.2 spec/page-object/elements/text_area_spec.rb
page-object-0.5.1 spec/page-object/elements/text_area_spec.rb
page-object-0.5.0 spec/page-object/elements/text_area_spec.rb
page-object-0.4.4 spec/page-object/elements/text_area_spec.rb
page-object-0.4.3 spec/page-object/elements/text_area_spec.rb
page-object-0.4.2 spec/page-object/elements/text_area_spec.rb
page-object-0.4.1 spec/page-object/elements/text_area_spec.rb
page-object-0.4.0 spec/page-object/elements/text_area_spec.rb
page-object-0.3.2 spec/page-object/elements/text_area_spec.rb
page-object-0.3.1 spec/page-object/elements/text_area_spec.rb
page-object-0.3.0 spec/page-object/elements/text_area_spec.rb