Sha256: 2a83fbb2770a21df3184087a1c36eef6fceaf1607997d7c7c9d573dca58c7a96

Contents?: true

Size: 895 Bytes

Versions: 7

Compression:

Stored size: 895 Bytes

Contents

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

describe PageObject::Elements::HiddenField do
  let(:hiddenfield) { PageObject::Elements::HiddenField }

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

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

  describe "interface" do
    it "should register with type :hidden" do
      expect(::PageObject::Elements.element_class_for(:input, :hidden)).to eql ::PageObject::Elements::HiddenField
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
page-object-1.2.0 spec/page-object/elements/hidden_field_spec.rb
page-object-1.1.1 spec/page-object/elements/hidden_field_spec.rb
page_object-1.1.3 spec/page-object/elements/hidden_field_spec.rb
page_object-1.1.2 spec/page-object/elements/hidden_field_spec.rb
page_object-1.1.1 spec/page-object/elements/hidden_field_spec.rb
page-object-1.1.0 spec/page-object/elements/hidden_field_spec.rb
page-object-1.0.3 spec/page-object/elements/hidden_field_spec.rb