Class: RFormUnit::FormTestCase

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
Driver
Defined in:
lib/rformunit/form_testcase.rb

Instance Method Summary collapse

Methods included from Driver

#close_window, #driver, #focus_window, #init, #key_press, #open_file_dialog, #set_autoit_option, #wait_and_focus_window, #wait_for_window, #window_exists?

Instance Method Details

#default_testObject



12
13
14
# File 'lib/rformunit/form_testcase.rb', line 12

def default_test
   super unless(self.class == FormTestCase)
end

#timeout_check_equal(duration, expected, &block) ⇒ Object

assert the block’s return value instance every 1 second until timeout with specifed duration



17
18
19
20
21
22
23
24
25
# File 'lib/rformunit/form_testcase.rb', line 17

def timeout_check_equal(duration, expected, &block)
   execute_ok = false
   duration.times do
      sleep(1)
      text = instance_eval(&block)
      execute_ok = true and break if (text == expected)
   end
   execute_ok.should == true
end

#timeout_check_include?(duration, expected, &block) ⇒ Boolean Also known as: timeout_check_include

Returns:

  • (Boolean)


28
29
30
31
32
33
34
35
36
# File 'lib/rformunit/form_testcase.rb', line 28

def timeout_check_include?(duration, expected, &block)
   execute_ok = false
   duration.times do
      sleep(1)
      text = instance_eval(&block)
      execute_ok = true and break if text and text.include?(expected)
   end
   execute_ok.should == true
end