Sha256: 5182d8ffa044950ecbeaa786a7abf7b856c0b64ee81fd8f13622f77612dd5fe2

Contents?: true

Size: 852 Bytes

Versions: 3

Compression:

Stored size: 852 Bytes

Contents

# frozen_string_literal: true

require 'watirspec_helper'

module Watir
  describe TextAreaCollection do
    before do
      browser.goto WatirSpec.url_for('forms_with_input_elements.html')
    end

    context 'when locating by :value' do
      before do
        browser.textarea(index: 0).set 'foo1'
        browser.textarea(index: 1).set 'foo2'
      end

      it 'finds textareas by string' do
        expect(browser.textareas(value: 'foo1').map(&:id)).to eq [browser.textarea(index: 0).id]
        expect(browser.textareas(value: 'foo2').map(&:id)).to eq [browser.textarea(index: 1).id]
      end

      it 'finds textareas by regexp' do
        expect(browser.textareas(value: /foo/)[0].id).to eq browser.textarea(index: 0).id
        expect(browser.textareas(value: /foo/)[1].id).to eq browser.textarea(index: 1).id
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
watir-7.3.0 spec/watirspec/elements/textareas_spec.rb
watir-7.2.2 spec/watirspec/elements/textareas_spec.rb
watir-7.2.1 spec/watirspec/elements/textareas_spec.rb