Class: TestCentricity::AppAlert
- Inherits:
-
AppUIElement
- Object
- AppUIElement
- TestCentricity::AppAlert
- Defined in:
- lib/testcentricity/app_elements/alert.rb
Instance Attribute Summary
Attributes inherited from AppUIElement
#context, #locator, #name, #parent, #type
Instance Method Summary collapse
- #accept ⇒ Object
- #await(seconds) ⇒ Object
- #dismiss ⇒ Object
-
#initialize(name, parent, locator, context) ⇒ AppAlert
constructor
A new instance of AppAlert.
Methods inherited from AppUIElement
#clear, #click, #disabled?, #double_tap, #enabled?, #exists?, #get_attribute, #get_caption, #get_locator, #get_name, #get_object_type, #get_value, #height, #hidden?, #scroll, #selected?, #send_keys, #set, #swipe, #tag_name, #tap, #visible?, #wait_until_exists, #wait_until_gone, #wait_until_hidden, #wait_until_value_changes, #wait_until_value_is, #wait_until_visible, #width, #x_loc, #y_loc
Constructor Details
#initialize(name, parent, locator, context) ⇒ AppAlert
Returns a new instance of AppAlert.
3 4 5 6 |
# File 'lib/testcentricity/app_elements/alert.rb', line 3 def initialize(name, parent, locator, context) super @type = :alert end |
Instance Method Details
#accept ⇒ Object
17 18 19 20 |
# File 'lib/testcentricity/app_elements/alert.rb', line 17 def accept alert_accept wait_until_gone(5) end |
#await(seconds) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/testcentricity/app_elements/alert.rb', line 8 def await(seconds) timeout = seconds.nil? ? Environ.default_max_wait_time : seconds wait = Selenium::WebDriver::Wait.new(timeout: timeout) wait.until { exists? } true rescue false end |
#dismiss ⇒ Object
22 23 24 25 |
# File 'lib/testcentricity/app_elements/alert.rb', line 22 def dismiss alert_dismiss wait_until_gone(5) end |