Sha256: 0eb145b6f4d3bd4ba46a3bf7436bb30bd8c5d131daeed1c3908e19f42abf2e99

Contents?: true

Size: 993 Bytes

Versions: 3

Compression:

Stored size: 993 Bytes

Contents

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

describe PageObject::Elements::TableRow do
  let(:table_cell) { double('table_cell') }
  let(:table_row_driver) { double('table_row_driver') }

  describe "interface" do
    context "for selenium" do
      it "should return a table cell when indexed" do
        @sel_table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :selenium)        
        table_row_driver.should_receive(:find_element).with(:xpath, "./th|td[1]").and_return(table_cell)
        @sel_table_row[0].should be_instance_of PageObject::Elements::TableCell
      end
    end

    context "for watir" do
      it "should return a table cell when indexed" do
        @wat_table_row = PageObject::Elements::TableRow.new(table_row_driver, :platform => :watir)    
        table_row_driver.should_receive(:[]).with(1).and_return(table_cell)
        @wat_table_row[1].should be_instance_of PageObject::Elements::TableCell
      end
    end    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
page-object-0.0.4 spec/page-object/elements/table_row_spec.rb
page-object-0.0.3 spec/page-object/elements/table_row_spec.rb
page-object-0.0.2 spec/page-object/elements/table_row_spec.rb