Sha256: e54d2d418ceffef37d29375d74ad58c01fd279a3de0914c8e47e3a5e021beea6

Contents?: true

Size: 795 Bytes

Versions: 1

Compression:

Stored size: 795 Bytes

Contents

require "watirspec_helper"

describe 'TextArea' do
  before :each do
    browser.goto WatirSpec.url_for('forms_with_input_elements.html')
  end

  context 'when locating by :value' do
    before(:each) 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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-6.10.1 spec/watirspec/elements/textareas_spec.rb