Class: Accessibility::HasDescendentShortlyMatcher
- Inherits:
-
AbstractMatcher
- Object
- AbstractMatcher
- Accessibility::HasDescendentShortlyMatcher
- Includes:
- DSL
- Defined in:
- lib/rspec/expectations/ax_elements.rb
Overview
Custom matcher for RSpec to check if an element has the specified descendent element within a grace period. Used for testing things after an asynchronous action is performed.
Instance Attribute Summary
Attributes inherited from AbstractMatcher
Instance Method Summary collapse
- #description ⇒ String
- #failure_message_for_should ⇒ String
- #failure_message_for_should_not ⇒ String
- #matches?(ancestor) ⇒ Boolean
Methods included from DSL
#app_with_bundle_identifier, #app_with_name, #app_with_pid, #cancel, #click, #confirm, #decrement, #delete, #double_click, #drag_mouse_to, #element_at_point, #element_under_mouse, #graph, #hide, #highlight, #increment, #method_missing, #move_mouse_to, #pick, #press, #raise, #right_click, #screenshot, #scroll, #scroll_menu_to, #scroll_to, #select_menu_item, #set, #set_focus_to, #show_about_window_for, #show_menu, #show_preferences_window_for, #subtree, #system_wide, #terminate, #type, #unhide, #wait_for, #wait_for_child, #wait_for_descendant, #wait_for_invalidation_of
Methods inherited from AbstractMatcher
Constructor Details
This class inherits a constructor from Accessibility::AbstractMatcher
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Accessibility::DSL
Instance Method Details
#description ⇒ String
152 153 154 |
# File 'lib/rspec/expectations/ax_elements.rb', line 152 def description "should have a descendent matching #{qualifier.describe} before a timeout occurs" end |
#failure_message_for_should ⇒ String
142 143 144 |
# File 'lib/rspec/expectations/ax_elements.rb', line 142 def "Expected #@ancestor to have descendent #{qualifier.describe} before a timeout occurred" end |
#failure_message_for_should_not ⇒ String
147 148 149 |
# File 'lib/rspec/expectations/ax_elements.rb', line 147 def "Expected #@ancestor to NOT have descendent #@result before a timeout occurred" end |
#matches?(ancestor) ⇒ Boolean
135 136 137 138 139 |
# File 'lib/rspec/expectations/ax_elements.rb', line 135 def matches? ancestor @filters[:ancestor] = @ancestor = ancestor @result = wait_for kind, filters, &block !@result.blank? end |