Class: Test
- Inherits:
-
Object
- Object
- Test
- Defined in:
- lib/template/test-ruby.rb
Instance Method Summary collapse
-
#initialize(testCase, driver) ⇒ Test
constructor
A new instance of Test.
- #run ⇒ Object
Constructor Details
#initialize(testCase, driver) ⇒ Test
Returns a new instance of Test.
4 5 6 7 |
# File 'lib/template/test-ruby.rb', line 4 def initialize(testCase,driver) @testCase = testCase @driver = driver end |
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/template/test-ruby.rb', line 8 def run # Here some example inputs = @testCase['testCases'] inputs.each do |key,input| element = @driver.find_element :css => key element.send_keys input end = @driver.find_element :css => ".uk-button-primary" .click # wait = Selenium::WebDriver::Wait.new(:timeout => 30) wait.until { @driver.find_element :css => ".uk-alert" } # # puts "Page title is #{@driver.title}" end |