Sha256: 3c212c18420b449e19cae89157fd352572997d82dd617a7816526cbf65f8b561

Contents?: true

Size: 887 Bytes

Versions: 19

Compression:

Stored size: 887 Bytes

Contents

require "watirspec_helper"

describe "List" do

  before :each do
    browser.goto(WatirSpec.url_for("non_control_elements.html"))
  end

  it "returns the list items assocaited with an Ol" do
    items = browser.ol(id: "favorite_compounds").list_items
    expect(items).to be_a Watir::LICollection
    expect(items).to all( be_a Watir::LI)
  end

  it "returns the list items assocaited with an Ul" do
    items = browser.ul(id: "navbar").list_items
    expect(items).to be_a Watir::LICollection
    expect(items).to all( be_a Watir::LI)
  end

  it "returns the list item size" do
    items = browser.ol(id: "favorite_compounds").list_items
    expect(items.size).to eq 5
  end

  it "returns list item at an index" do
    items = browser.ol(id: "favorite_compounds").list_items
    third = browser.ol(id: "favorite_compounds").li(index: 2)

    expect(items[2]).to eq third
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
watir-6.13.0 spec/watirspec/elements/list_spec.rb
watir-6.12.0 spec/watirspec/elements/list_spec.rb
watir-6.11.0 spec/watirspec/elements/list_spec.rb
watir-6.11.0.beta2 spec/watirspec/elements/list_spec.rb
watir-6.11.0.beta1 spec/watirspec/elements/list_spec.rb
watir-6.10.3 spec/watirspec/elements/list_spec.rb
watir-6.10.2 spec/watirspec/elements/list_spec.rb
watir-6.10.0 spec/watirspec/elements/list_spec.rb
watir-6.9.1 spec/watirspec/elements/list_spec.rb
watir-6.9.0 spec/watirspec/elements/list_spec.rb
watir-6.8.4 spec/watirspec/elements/list_spec.rb
watir-6.8.3 spec/watirspec/elements/list_spec.rb
watir-6.8.2 spec/watirspec/elements/list_spec.rb
watir-6.8.1 spec/watirspec/elements/list_spec.rb
watir-6.8.0 spec/watirspec/elements/list_spec.rb
watir-6.7.3 spec/watirspec/elements/list_spec.rb
watir-6.7.2 spec/watirspec/elements/list_spec.rb
watir-6.7.1 spec/watirspec/elements/list_spec.rb
watir-6.7.0 spec/watirspec/elements/list_spec.rb