Sha256: db11c8b552d309fccd06bf2e1ebbd19943d0ad58f7c225a8812d1850ec8a7173

Contents?: true

Size: 986 Bytes

Versions: 8

Compression:

Stored size: 986 Bytes

Contents

require "watirspec_helper"

describe "Collections" do

  it "returns inner elements of parent element having different html tag" do
    browser.goto(WatirSpec.url_for("collections.html"))
    expect(browser.span(id: "a_span").divs.size).to eq 2
  end

  it "returns inner elements of parent element having same html tag" do
    browser.goto(WatirSpec.url_for("collections.html"))
    expect(browser.span(id: "a_span").spans.size).to eq 2
  end

  it "returns correct subtype of elements" do
    browser.goto(WatirSpec.url_for("collections.html"))
    collection = browser.span(id: "a_span").spans.to_a
    expect(collection.all? { |el| el.is_a? Watir::Span}).to eq true
  end

  it "can contain more than one type of element" do
    browser.goto(WatirSpec.url_for("nested_elements.html"))
    collection = browser.div(id: "parent").children
    expect(collection.any? { |el| el.is_a? Watir::Span}).to eq true
    expect(collection.any? { |el| el.is_a? Watir::Div}).to eq true
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
watir-6.4.2 spec/watirspec/elements/collections_spec.rb
watir-6.4.1 spec/watirspec/elements/collections_spec.rb
watir-6.4.0 spec/watirspec/elements/collections_spec.rb
watir-6.4.0.rc2 spec/watirspec/elements/collections_spec.rb
watir-6.4.0.rc1 spec/watirspec/elements/collections_spec.rb
watir-6.3.0 spec/watirspec/elements/collections_spec.rb
watir-6.2.1 spec/watirspec/elements/collections_spec.rb
watir-6.2.0 spec/watirspec/elements/collections_spec.rb