Module: Seleniumrc::SeleniumDsl

Includes:
TestUnitDsl, WaitFor
Included in:
SeleniumTestCase
Defined in:
lib/seleniumrc/dsl/selenium_dsl.rb

Instance Attribute Summary collapse

Attributes included from WaitFor

#default_timeout

Instance Method Summary collapse

Methods included from TestUnitDsl

#assert_attribute, #assert_checked, #assert_element_contains, #assert_element_does_not_contain_text, #assert_element_not_present, #assert_element_present, #assert_location_ends_in, #assert_next_sibling, #assert_not_checked, #assert_not_visible, #assert_selected, #assert_text, #assert_text_in_order, #assert_text_not_present, #assert_text_present, #assert_title, #assert_value, #assert_visible

Methods included from WaitFor

#default_wait_for_time, #flunk, #time_class, #wait_for

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



24
25
26
# File 'lib/seleniumrc/dsl/selenium_dsl.rb', line 24

def method_missing(name, *args)
  return selenium_driver.send(name, *args)
end

Instance Attribute Details

#configurationObject

The SeleniumConfiguration object.



4
5
6
# File 'lib/seleniumrc/dsl/selenium_dsl.rb', line 4

def configuration
  @configuration ||= SeleniumConfiguration.instance
end

#selenium_driverObject

Returns the value of attribute selenium_driver.



8
9
10
# File 'lib/seleniumrc/dsl/selenium_dsl.rb', line 8

def selenium_driver
  @selenium_driver
end

Instance Method Details

#download(path) ⇒ Object

Download a file from the Application Server



13
14
15
16
17
# File 'lib/seleniumrc/dsl/selenium_dsl.rb', line 13

def download(path)
  uri = URI.parse(configuration.browser_url + path)
  puts "downloading #{uri.to_s}"
  Net::HTTP.get(uri)
end

#open_home_pageObject

Open the home page of the Application and wait for the page to load.



20
21
22
# File 'lib/seleniumrc/dsl/selenium_dsl.rb', line 20

def open_home_page
  selenium_driver.open(configuration.browser_url)
end