Module: TerminusSpec::Platforms::WatirWebDriver::WebObject
- Defined in:
- lib/terminus_spec/platform_watir/web_objects/all.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#attribute(attribute_name) ⇒ String?
Get the value of a the given attribute of the object.
- #clear ⇒ Object
- #exists? ⇒ Boolean
-
#send_keys(*args) ⇒ Object
Send keystrokes to the object.
- #tag_name ⇒ Object
- #text ⇒ Object
- #value ⇒ Object
- #visible? ⇒ Boolean
-
#wait_until(timeout = 5, message = nil, &block) ⇒ Object
Waits until a given returns true (and thus was executed).
-
#when_not_visible(timeout = 5) ⇒ Object
Waits until an object is not visible on the screen.
-
#when_present(timeout = 5) ⇒ Object
Waits until an object is present on the screen.
-
#when_visible(timeout = 5) ⇒ Object
Waits until an object is visible on the screen.
Instance Method Details
#==(other) ⇒ Object
6 7 8 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 6 def ==(other) @web_object == other # other.element?? end |
#attribute(attribute_name) ⇒ String?
Get the value of a the given attribute of the object.
81 82 83 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 81 def attribute(attribute_name) @web_object.attribute_value attribute_name end |
#clear ⇒ Object
30 31 32 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 30 def clear @web_object.clear end |
#exists? ⇒ Boolean
14 15 16 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 14 def exists? @web_object.exists? end |
#send_keys(*args) ⇒ Object
Send keystrokes to the object.
41 42 43 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 41 def send_keys(*args) @web_object.send_keys(*args) end |
#tag_name ⇒ Object
26 27 28 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 26 def tag_name @web_object.tag_name end |
#text ⇒ Object
18 19 20 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 18 def text @web_object.text end |
#value ⇒ Object
22 23 24 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 22 def value @web_object.value end |
#visible? ⇒ Boolean
10 11 12 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 10 def visible? @web_object.present? end |
#wait_until(timeout = 5, message = nil, &block) ⇒ Object
Waits until a given returns true (and thus was executed).
74 75 76 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 74 def wait_until(timeout=5, =nil, &block) Object::Watir::Wait.until(timeout, , &block) end |
#when_not_visible(timeout = 5) ⇒ Object
Waits until an object is not visible on the screen.
63 64 65 66 67 68 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 63 def when_not_visible(timeout=5) Object::Watir::Wait.while(timeout, "Object still visible after #{timeout} seconds") do visible? end self end |
#when_present(timeout = 5) ⇒ Object
Waits until an object is present on the screen.
47 48 49 50 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 47 def when_present(timeout=5) @web_object.wait_until_present(timeout) self end |
#when_visible(timeout = 5) ⇒ Object
Waits until an object is visible on the screen.
54 55 56 57 58 59 |
# File 'lib/terminus_spec/platform_watir/web_objects/all.rb', line 54 def when_visible(timeout=5) Object::Watir::Wait.until(timeout, "Object was not visible in #{timeout} seconds") do visible? end self end |