Sha256: a0596b753819bd2b1cb69e83a342f6b69c69d2a445dcfaad26598344017fe042
Contents?: true
Size: 906 Bytes
Versions: 23
Compression:
Stored size: 906 Bytes
Contents
require "watirspec_helper" describe "Divs" do before :each do browser.goto(WatirSpec.url_for("non_control_elements.html")) end describe "with selectors" do it "returns the matching elements" do expect(browser.divs(id: "header").to_a).to eq [browser.div(id: "header")] end end describe "#length" do it "returns the number of divs" do expect(browser.divs.length).to eq 12 end end describe "#[]" do it "returns the div at the given index" do expect(browser.divs[1].id).to eq "outer_container" end end describe "#each" do it "iterates through divs correctly" do count = 0 browser.divs.each_with_index do |d, index| expect(d.id).to eq browser.div(index: index).id expect(d.class_name).to eq browser.div(index: index).class_name count += 1 end expect(count).to be > 0 end end end
Version data entries
23 entries across 23 versions & 1 rubygems
Version | Path |
---|---|
watir-6.0.2 | spec/watirspec/elements/divs_spec.rb |
watir-6.0.1 | spec/watirspec/elements/divs_spec.rb |
watir-6.0.0 | spec/watirspec/elements/divs_spec.rb |