Module: Cello::PageObjects::TextareaHelper

Included in:
ElementHelper
Defined in:
lib/cello/pageobjects/html_elements/textarea_helper.rb

Instance Method Summary collapse

Instance Method Details

#define_extras_for_textarea(name) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/cello/pageobjects/html_elements/textarea_helper.rb', line 4

def define_extras_for_textarea(name)
  define_method "#{name}_is_enable?" do
    !(send(name).disabled?)
  end
  define_method "#{name}_clear" do
    send(name).clear
  end
  define_method "#{name}_get_text" do
    send(name).value
  end
  define_method "#{name}_fill_with" do |text|
    send(name).set text
  end
  define_method "#{name}_dont_contain" do |text|
    !(send(name).value.include? text)
  end
  define_method "#{name}_contains" do |text|
    send(name).value.include? text
  end
  define_method "#{name}_text_is" do |text|
    send(name).value == text
  end
  define_method "#{name}_is_empty?" do 
    send(name).value.empty?
  end
  define_method "#{name}_text_size" do 
    send(name).value.size
  end
end