Module: Dill::DSL

Defined in:
lib/dill/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#widget_lookup_scopeObject



28
29
30
# File 'lib/dill/dsl.rb', line 28

def widget_lookup_scope
  @widget_lookup_scope ||= default_widget_lookup_scope
end

Instance Method Details

#documentDocument

Returns the current document with the class of the current object set as the widget lookup scope.

Returns:

  • (Document)

    the current document with the class of the current object set as the widget lookup scope.



7
8
9
# File 'lib/dill/dsl.rb', line 7

def document
  Document.new(widget_lookup_scope)
end

#eventually(wait_time = Capybara.default_wait_time, &block) ⇒ Object

re-run one or more assertions until either they all pass, or Dill times out, which will result in a test failure.



34
35
36
# File 'lib/dill/dsl.rb', line 34

def eventually(wait_time = Capybara.default_wait_time, &block)
  Checkpoint.wait_for wait_time, &block
end

#has_widget?(name, *args) ⇒ Boolean

Returns Whether one or more widgets exist in the current document.

Returns:

  • (Boolean)

    Whether one or more widgets exist in the current document.



13
14
15
# File 'lib/dill/dsl.rb', line 13

def has_widget?(name, *args)
  document.has_widget?(name, *args)
end

#value(name, *args) ⇒ Object



17
18
19
# File 'lib/dill/dsl.rb', line 17

def value(name, *args)
  widget(name, *args).value
end

#widget(name, *args) ⇒ Object

Returns a widget instance for the given name.

Parameters:



24
25
26
# File 'lib/dill/dsl.rb', line 24

def widget(name, *args)
  document.widget(name, *args)
end