dill 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dill.rb +3 -15
- data/lib/dill/capybara.rb +7 -0
- data/lib/dill/checkpoint.rb +52 -34
- data/lib/dill/conversions.rb +2 -0
- data/lib/dill/dsl.rb +15 -5
- data/lib/dill/version.rb +1 -1
- data/lib/dill/widgets.rb +56 -0
- data/lib/dill/{auto_table.rb → widgets/auto_table.rb} +5 -3
- data/lib/dill/{base_table.rb → widgets/base_table.rb} +0 -0
- data/lib/dill/widgets/check_box.rb +26 -0
- data/lib/dill/widgets/document.rb +13 -0
- data/lib/dill/widgets/field.rb +26 -0
- data/lib/dill/{field_group.rb → widgets/field_group.rb} +0 -86
- data/lib/dill/{form.rb → widgets/form.rb} +9 -0
- data/lib/dill/{list.rb → widgets/list.rb} +40 -6
- data/lib/dill/{list_item.rb → widgets/list_item.rb} +0 -0
- data/lib/dill/widgets/parts/container.rb +29 -0
- data/lib/dill/widgets/parts/struct.rb +117 -0
- data/lib/dill/widgets/select.rb +29 -0
- data/lib/dill/{table.rb → widgets/table.rb} +1 -1
- data/lib/dill/widgets/text_field.rb +23 -0
- data/lib/dill/widgets/widget.rb +404 -0
- data/lib/dill/{widget_class.rb → widgets/widget_class.rb} +0 -0
- data/lib/dill/{widget_name.rb → widgets/widget_name.rb} +0 -0
- metadata +53 -16
- data/lib/dill/document.rb +0 -14
- data/lib/dill/node_text.rb +0 -9
- data/lib/dill/widget.rb +0 -516
- data/lib/dill/widget_checkpoint.rb +0 -30
- data/lib/dill/widget_container.rb +0 -23
@@ -1,30 +0,0 @@
|
|
1
|
-
module Dill
|
2
|
-
# A Checkpoint that bypasses the standard wait time if the current
|
3
|
-
# Capybara driver doesn't support waiting.
|
4
|
-
class WidgetCheckpoint < Checkpoint
|
5
|
-
# Returns the Capybara driver in use.
|
6
|
-
def driver
|
7
|
-
Capybara.current_session.driver
|
8
|
-
end
|
9
|
-
|
10
|
-
def initialize(*)
|
11
|
-
if immediate?
|
12
|
-
super 0
|
13
|
-
else
|
14
|
-
super
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
protected
|
19
|
-
|
20
|
-
def rescuable_errors
|
21
|
-
@rescuable_errors ||= super + driver.invalid_element_errors
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def immediate?
|
27
|
-
! driver.wait?
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Dill
|
2
|
-
module WidgetContainer
|
3
|
-
def has_widget?(name)
|
4
|
-
widget_class(name).present_in?(root)
|
5
|
-
end
|
6
|
-
|
7
|
-
def widget(name)
|
8
|
-
widget_class(name).find_in(root)
|
9
|
-
end
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
attr_writer :widget_lookup_scope
|
14
|
-
|
15
|
-
def widget_class(name)
|
16
|
-
WidgetName.new(name).to_class(widget_lookup_scope)
|
17
|
-
end
|
18
|
-
|
19
|
-
def widget_lookup_scope
|
20
|
-
@widget_lookup_scope || self.class
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|