Sha256: 61d47ba053b9082caddaf1055e302e383358506a616878d67658edb79c033a84

Contents?: true

Size: 1.54 KB

Versions: 7

Compression:

Stored size: 1.54 KB

Contents

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

describe PageObject::Elements::Heading do
  let(:heading) { PageObject::Elements::Heading }

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

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

  describe "interface" do
    it "should register with tag :h1" do
      expect(::PageObject::Elements.element_class_for(:h1)).to eql ::PageObject::Elements::Heading
    end

    it "should register with tag :h2" do
      expect(::PageObject::Elements.element_class_for(:h2)).to eql ::PageObject::Elements::Heading
    end

    it "should register with tag :h3" do
      expect(::PageObject::Elements.element_class_for(:h3)).to eql ::PageObject::Elements::Heading
    end

    it "should register with tag :h4" do
      expect(::PageObject::Elements.element_class_for(:h4)).to eql ::PageObject::Elements::Heading
    end

    it "should register with tag :h5" do
      expect(::PageObject::Elements.element_class_for(:h5)).to eql ::PageObject::Elements::Heading
    end

    it "should register with tag :h6" do
      expect(::PageObject::Elements.element_class_for(:h6)).to eql ::PageObject::Elements::Heading
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

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