Sha256: fa44ee86cb23baffcab59f70404825f30bf0726a0ea9ff021520bbacf6e4a673

Contents?: true

Size: 756 Bytes

Versions: 2

Compression:

Stored size: 756 Bytes

Contents

# encoding: utf-8
require File.expand_path('spec_helper', File.dirname(__FILE__))

describe "Images" do

  before :each do
    browser.goto(WatirSpec.files + "/images.html")
  end

  describe "#length" do
    it "returns the number of images" do
      browser.images.length.should == 9
    end
  end

  describe "#[]" do
    it "returns the image at the given index" do
      browser.images[5].id.should == "square"
    end
  end

  describe "#each" do
    it "iterates through images correctly" do
      count = 0

      browser.images.each_with_index do |c, index|
        c.id.should == browser.image(:index, index).id
        c.value.should == browser.image(:index, index).value

        count += 1
      end

      count.should > 0
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
watir-webdriver-0.0.9 spec/watirspec/images_spec.rb
watir-webdriver-0.0.8 spec/watirspec/images_spec.rb