Class: Statt::Client
- Inherits:
-
Selenium::Client::Driver
- Object
- Selenium::Client::Driver
- Statt::Client
- Defined in:
- lib/statt/client.rb
Instance Method Summary collapse
- #click_button_by_text(value) ⇒ Object
- #click_link_by_text(value) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #source ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 12 |
# File 'lib/statt/client.rb', line 5 def initialize( = {}) = { :host => "localhost", :port => 4444, :timeout => 300, :browser => "*firefox", :url => "http://localhost:3000"}.merge() super() end |
Instance Method Details
#click_button_by_text(value) ⇒ Object
22 23 24 |
# File 'lib/statt/client.rb', line 22 def (value) click "xpath=//input[@value='#{value}']" end |
#click_link_by_text(value) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/statt/client.rb', line 26 def click_link_by_text(value) begin click "xpath=//a[text()='#{value}']" rescue Exception => msg begin click "xpath=//a/*[text()='#{value}']" rescue Exception => msg puts "Couldn\'t locate '#{value}' #{msg}" end end end |
#source ⇒ Object
38 39 40 |
# File 'lib/statt/client.rb', line 38 def source end |
#start ⇒ Object
14 15 16 |
# File 'lib/statt/client.rb', line 14 def start start_new_browser_session end |
#stop ⇒ Object
18 19 20 |
# File 'lib/statt/client.rb', line 18 def stop close_current_browser_session end |