Top Level Namespace

Includes:
Accessibility::DSL

Defined Under Namespace

Modules: AX, Accessibility, Mouse Classes: Boxed, CFRange, CGPoint, CGRect, CGSize, Exception, KeyCoder, NSArray, NSDictionary, NSObject, NSString, NilClass, Range

Constant Summary collapse

KAXIdentifierAttribute =

Added for backwards compatability with Snow Leopard. This attribute is standard with Lion and newer. AXElements depends on it being defined.

Returns:

  • (String)
'AXIdentifier'

Instance Method Summary collapse

Methods included from Accessibility::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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Accessibility::DSL

Instance Method Details

#have_child(kind, filters = {}) { ... } ⇒ Object

Assert that the receiving element has the specified child element. You can use any filters you would normally use in a search, including a block.

Examples:


window.toolbar.should have_child(:search_field)
table.should have_child(:row, static_text: { value: /42/ })

search_field.should_not have_child(:busy_indicator)

Parameters:

  • (#to_s)
  • (Hash)

Yields:

  • An optional block to be used as part of the search qualifier



174
175
176
# File 'lib/rspec/expectations/ax_elements.rb', line 174

def have_child kind, filters = {}, &block
  Accessibility::HasChildMatcher.new kind, filters, &block
end

#have_descendent(kind, filters = {}) { ... } ⇒ Object Also known as: have_descendant

Assert that the given element has the specified descendent. You can pass any parameters you normally would use during a search, including a block.

Examples:


app.main_window.should have_descendent(:button, title: 'Press Me')

row.should_not have_descendent(:check_box)

Parameters:

  • (#to_s)
  • (Hash)

Yields:

  • An optional block to be used as part of the search qualifier



192
193
194
# File 'lib/rspec/expectations/ax_elements.rb', line 192

def have_descendent kind, filters = {}, &block
  Accessibility::HasDescendentMatcher.new kind, filters, &block
end

#shortly_have_child(kind, filters = {}) { ... } ⇒ Object

Assert that the given element has the specified child soon. This method will block until the child is found or a timeout occurs. You can pass any parameters you normally would use during a search, including a block.

Examples:


app.main_window.should shortly_have_child(:row, static_text: { value: 'Cake' })

row.should_not shortly_have_child(:check_box)

Parameters:

  • (#to_s)
  • (Hash)

Yields:

  • An optional block to be used as part of the search qualifier



212
213
214
# File 'lib/rspec/expectations/ax_elements.rb', line 212

def shortly_have_child kind, filters = {}, &block
  Accessibility::HasChildShortlyMatcher.new(kind, filters, &block)
end

#shortly_have_descendent(kind, filters = {}) { ... } ⇒ Object Also known as: shortly_have_descendant

Assert that the given element has the specified descendent soon. This method will block until the descendent is found or a timeout occurs. You can pass any parameters you normally would use during a search, including a block.

Examples:


app.main_window.should shortly_have_child(:row, static_text: { value: 'Cake' })

row.should_not shortly_have_child(:check_box)

Parameters:

  • (#to_s)
  • (Hash)

Yields:

  • An optional block to be used as part of the search qualifier



231
232
233
# File 'lib/rspec/expectations/ax_elements.rb', line 231

def shortly_have_descendent kind, filters = {}, &block
  Accessibility::HasDescendentShortlyMatcher.new kind, filters, &block
end