Sha256: b4e9d5c27298a85cfbf124bdc2e4ea098716c1783a6e3c7c8d580835d8819f3a

Contents?: true

Size: 994 Bytes

Versions: 25

Compression:

Stored size: 994 Bytes

Contents

require "watirspec_helper"

describe "Elements" do
  before :each do
    browser.goto(WatirSpec.url_for("forms_with_input_elements.html"))
  end

  describe "#[]" do
    context "when elements do not exist" do
      it "returns not existing element" do
        expect(browser.elements(id: "non-existing")[0]).not_to exist
      end
    end
  end

  describe "#eq and #eql?" do
    before { browser.goto WatirSpec.url_for("forms_with_input_elements.html") }

    it "returns true if the two collections have the same Watir Elements" do
      a = browser.select_list(name: "new_user_languages").options
      b = browser.select_list(id: "new_user_languages").options

      expect(a).to eq b
      expect(a).to eql(b)
    end

    it "returns false if the two collections are not the same" do
      a = browser.select_list(name: "new_user_languages").options
      b = browser.select_list(id: "new_user_role").options

      expect(a).to_not eq b
      expect(a).to_not eql(b)
    end
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
watir-6.9.1 spec/watirspec/elements/elements_spec.rb
watir-6.9.0 spec/watirspec/elements/elements_spec.rb
watir-6.8.4 spec/watirspec/elements/elements_spec.rb
watir-6.8.3 spec/watirspec/elements/elements_spec.rb
watir-6.8.2 spec/watirspec/elements/elements_spec.rb
watir-6.8.1 spec/watirspec/elements/elements_spec.rb
watir-6.8.0 spec/watirspec/elements/elements_spec.rb
watir-6.7.3 spec/watirspec/elements/elements_spec.rb
watir-6.7.2 spec/watirspec/elements/elements_spec.rb
watir-6.7.1 spec/watirspec/elements/elements_spec.rb
watir-6.7.0 spec/watirspec/elements/elements_spec.rb
watir-6.6.3 spec/watirspec/elements/elements_spec.rb
watir-6.6.2 spec/watirspec/elements/elements_spec.rb
watir-6.6.1 spec/watirspec/elements/elements_spec.rb
watir-6.6.0 spec/watirspec/elements/elements_spec.rb
watir-6.5.0 spec/watirspec/elements/elements_spec.rb
watir-6.4.3 spec/watirspec/elements/elements_spec.rb
watir-6.4.2 spec/watirspec/elements/elements_spec.rb
watir-6.4.1 spec/watirspec/elements/elements_spec.rb
watir-6.4.0 spec/watirspec/elements/elements_spec.rb