Created
June 11, 2013 17:59
-
-
Save richdownie/5759189 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given /I click_on "(.*)" "(.*)"/ do |value, type| | |
steps %Q{ | |
And I wait until "#{value}" "#{type}" renders | |
} | |
@driver.find_element(type.to_sym => value).click | |
end | |
When /I wait for "(.*)" "(.*)" to render/ do |what, how| | |
start_time = Time.now.to_i | |
wait = Selenium::WebDriver::Wait.new(:timeout => 60) | |
wait.until { | |
element = @driver.find_element(:xpath, ".//" + how + "[text()='" + what + "']") | |
element if element.displayed? | |
} | |
end_time = Time.now.to_i - start_time | |
puts (end_time.to_s + " seconds to render " + what.inspect + how.to_sym.inspect) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment