Class: BeforeTest
- Inherits:
-
Object
- Object
- BeforeTest
- Defined in:
- lib/template/before-ruby.rb
Instance Method Summary collapse
-
#initialize(testCase, driver) ⇒ BeforeTest
constructor
A new instance of BeforeTest.
- #run ⇒ Object
Constructor Details
#initialize(testCase, driver) ⇒ BeforeTest
Returns a new instance of BeforeTest.
4 5 6 7 |
# File 'lib/template/before-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/before-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 |