bryan-ash-wx-nobbie 0.0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,138 @@
1
+ class TestSelection < Test::Unit::TestCase
2
+ include NobbieTestCase
3
+
4
+ def test_choose_with_notebook_page
5
+ assert_equal 'notebook_page1', selection('notebook').selected_value
6
+ selection('notebook').choose 'notebook_page2'
7
+ assert_equal 'notebook_page2', selection('notebook').selected_value
8
+ #todo: improve event detail
9
+ assert_events 'notebook: '
10
+ end
11
+
12
+ def test_choose_with_menu_item
13
+ selection('&File').choose '&New...'
14
+ #todo: improve event detail
15
+ assert_events 'file_new'
16
+ end
17
+
18
+ def test_choose_with_combo_box
19
+ assert_equal '', selection('combo_box_with_items').selected_value
20
+ selection('combo_box_with_items').choose 'combo_box_item'
21
+ assert_equal 'combo_box_item', selection('combo_box_with_items').selected_value
22
+ assert_events 'combo_box_with_items: '
23
+ end
24
+
25
+ def test_choose_with_list_box
26
+ assert_equal '', selection('list_box_with_items').selected_value
27
+ selection('list_box_with_items').choose 'list_box_item'
28
+ assert_equal 'list_box_item', selection('list_box_with_items').selected_value
29
+ assert_events 'list_box_with_items: list_box_item'
30
+ end
31
+
32
+ def test_choose_with_choice
33
+ assert_equal '', selection('choice_with_items').selected_value
34
+ selection('choice_with_items').choose 'choice_item'
35
+ assert_equal 'choice_item', selection('choice_with_items').selected_value
36
+ assert_events 'choice_with_items: choice_item'
37
+ end
38
+
39
+ def test_options_with_notebook
40
+ assert_equal ['notebook_page1', 'notebook_page2'] , selection('notebook').options
41
+ end
42
+
43
+ def test_options_with_combo_box
44
+ assert_equal ["combo_box_item"], selection('combo_box_with_items').options
45
+ end
46
+
47
+ def test_options_with_list_box
48
+ assert_equal ["list_box_item"], selection('list_box_with_items').options
49
+ end
50
+
51
+ def test_options_with_choice
52
+ assert_equal ["choice_item"], selection('choice_with_items').options
53
+ end
54
+
55
+ #todo: options with component not found
56
+ #todo: options with component not supported
57
+
58
+ #not found
59
+
60
+ def test_choose_with_value_not_found_notebook
61
+ assert_exception ValueNotFoundException do selection('notebook').choose 'missing' end
62
+ end
63
+
64
+ def test_choose_with_value_not_found_menu
65
+ assert_exception ValueNotFoundException do selection('&File').choose 'missing' end
66
+ end
67
+
68
+ def test_choose_with_value_not_found_list_box
69
+ assert_exception ValueNotFoundException do selection('list_box_with_items').choose 'missing' end
70
+ end
71
+
72
+ def test_choose_with_value_not_found_combo_box
73
+ assert_exception ValueNotFoundException do selection('combo_box_with_items').choose 'missing' end
74
+ end
75
+
76
+ def test_choose_with_value_not_found_combo_box
77
+ assert_exception ValueNotFoundException do selection('choice_with_items').choose 'missing' end
78
+ end
79
+
80
+ #disabled
81
+
82
+ def test_choose_with_component_disabled_menu
83
+ assert_exception ComponentDisabledException do selection('&File').choose '&disabled' end
84
+ end
85
+
86
+ def test_choose_with_component_disabled_notebook
87
+ assert_equal 'disabled_notebook_page1', selection('disabled_notebook').selected_value
88
+ assert_exception ComponentDisabledException do selection('disabled_notebook').choose 'disabled_notebook_page2' end
89
+ assert_equal 'disabled_notebook_page1', selection('disabled_notebook').selected_value
90
+ end
91
+
92
+ def test_choose_with_component_disabled_list_box
93
+ assert_exception ComponentDisabledException do selection('disabled_list_box_with_items').choose 'disabled_list_box_item2' end
94
+ end
95
+
96
+ def test_choose_with_component_disabled_combo_box
97
+ assert_exception ComponentDisabledException do selection('disabled_combo_box_with_items').choose 'disabled_combo_box_item2' end
98
+ end
99
+
100
+ def test_choose_with_component_disabled_choice
101
+ assert_exception ComponentDisabledException do selection('disabled_choice_with_items').choose 'disabled_choice_item2' end
102
+ end
103
+
104
+ #not found etc ...
105
+
106
+ def test_choose_with_component_not_found
107
+ assert_exception ComponentNotFoundException do selection('missing').choose 'missing' end
108
+ end
109
+
110
+ def test_choose_with_unsupported_operation_for_component
111
+ assert_exception UnsupportedOperationForComponentException do selection('button').choose 'value' end
112
+ end
113
+
114
+ def test_selected_value_unsupported_operation_for_menu
115
+ assert_exception UnsupportedOperationForComponentException do selection('&File').selected_value end
116
+ end
117
+
118
+ def test_selected_value_with_unsupported_operation_for_component
119
+ assert_exception UnsupportedOperationForComponentException do selection('button').selected_value end
120
+ end
121
+
122
+ def test_selected_value_with_component_not_found
123
+ assert_exception ComponentNotFoundException do selection('missing').selected_value end
124
+ end
125
+
126
+ def test_options_with_component_not_found
127
+ assert_exception ComponentNotFoundException do selection('missing').options end
128
+ end
129
+
130
+ def test_options_unsupported_operation_for_menu
131
+ assert_exception UnsupportedOperationForComponentException do selection('&File').options end
132
+ end
133
+
134
+ def test_options_with_unsupported_operation_for_component
135
+ assert_exception UnsupportedOperationForComponentException do selection('button').options end
136
+ end
137
+ end
138
+
@@ -0,0 +1,58 @@
1
+ class TestType < Test::Unit::TestCase
2
+ include NobbieTestCase
3
+
4
+ def test_type_with_text_ctrl
5
+ #todo: this doesnt seem to work in windows or osx .. but it should ... see KNOWN ISSUES
6
+ type '123', :in => 'text_ctrl'
7
+ assert_equal '123', text(component('text_ctrl'))
8
+ assert_events ['text_ctrl: ', 'text_ctrl: 1', 'text_ctrl: 12', 'text_ctrl: 123']
9
+ end
10
+
11
+ def test_type_with_combo_box
12
+ #todo: this doesnt seem to work in osx .. but it should ... see KNOWN ISSUES
13
+ assert_equal 'combo_box', text(component('combo_box'))
14
+ type '456', :in => 'combo_box'
15
+ assert_equal '456', text(component('combo_box'))
16
+ assert_events ['combo_box: ', 'combo_box: 4', 'combo_box: 45', 'combo_box: 456']
17
+ end
18
+
19
+ def test_type_with_empty_string
20
+ type 'a', :in => 'text_ctrl'
21
+ clear_events
22
+ type '', :in => 'text_ctrl'
23
+ assert_equal '', text(component('text_ctrl'))
24
+ assert_events 'text_ctrl: '
25
+ end
26
+
27
+ def test_type_with_readonly_text_ctrl
28
+ assert_exception ComponentReadOnlyException do type 'readonly_text_ctrl_value', :in => 'readonly_text_ctrl' end
29
+ assert_equal 'readonly_text_ctrl', text(component('readonly_text_ctrl'))
30
+ end
31
+
32
+ def test_type_with_readonly_combo_box
33
+ #todo: this won't currently work on windows ... see KNOWN ISSUES
34
+ assert_exception ComponentReadOnlyException do type 'readonly_combo_box_value', :in => 'readonly_combo_box' end
35
+ assert_equal 'readonly_combo_box', text(component('readonly_combo_box'))
36
+ end
37
+
38
+ def test_type_with_disabled_text_ctrl
39
+ assert_equal 'disabled_text_ctrl', text(component('disabled_text_ctrl'))
40
+ assert_exception ComponentDisabledException do type 'disabled_text_ctrl_value', :in => 'disabled_text_ctrl' end
41
+ assert_equal 'disabled_text_ctrl', text(component('disabled_text_ctrl'))
42
+ end
43
+
44
+ def test_type_with_disabled_combo_box
45
+ #todo: this doesnt seem to work in osx .. but it should ... see KNOWN ISSUES
46
+ assert_equal 'disabled_combo_box', text(component('disabled_combo_box'))
47
+ assert_exception ComponentDisabledException do type 'disabled_combo_box_value', :in => 'disabled_combo_box' end
48
+ assert_equal 'disabled_combo_box', text(component('disabled_combo_box'))
49
+ end
50
+
51
+ def test_type_with_component_not_found
52
+ assert_exception ComponentNotFoundException do type 'missing_value', :in => 'missing' end
53
+ end
54
+
55
+ def test_type_with_unsupported_operation_for_component
56
+ assert_exception UnsupportedOperationForComponentException do type 'button_value', :in => 'button' end
57
+ end
58
+ end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bryan-ash-wx-nobbie
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3.2
5
+ platform: ruby
6
+ authors:
7
+ - Paul Alton
8
+ - Bryan Ash
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-02-08 00:00:00 -08:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: wxruby
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.9.9
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: wx_sugar
27
+ version_requirement:
28
+ version_requirements: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.1.21
33
+ version:
34
+ description: wx-Nobbie is a simple interface for driving wxRuby application development.
35
+ email: bryan.a.ash@gmail.com
36
+ executables: []
37
+
38
+ extensions: []
39
+
40
+ extra_rdoc_files: []
41
+
42
+ files:
43
+ - KNOWN_ISSUES
44
+ - README
45
+ - lib/nobbie/wx/acceptance_test.rb
46
+ - lib/nobbie/wx/command.rb
47
+ - lib/nobbie/wx/command_executor.rb
48
+ - lib/nobbie/wx/command_factory.rb
49
+ - lib/nobbie/wx/driven.rb
50
+ - lib/nobbie/wx/launcher.rb
51
+ - lib/nobbie/wx/operations.rb
52
+ - lib/nobbie/wx/platform.rb
53
+ - lib/nobbie/wx/command/choose.rb
54
+ - lib/nobbie/wx/command/click_on.rb
55
+ - lib/nobbie/wx/command/get_component.rb
56
+ - lib/nobbie/wx/command/get_options.rb
57
+ - lib/nobbie/wx/command/get_selected_values.rb
58
+ - lib/nobbie/wx/command/is_chosen.rb
59
+ - lib/nobbie/wx/command/is_enabled.rb
60
+ - lib/nobbie/wx/command/select.rb
61
+ - lib/nobbie/wx/command/type_into.rb
62
+ - lib/nobbie/wx/impl/element/element_path_builder.rb
63
+ - lib/nobbie/wx/impl/operation/choosable.rb
64
+ - lib/nobbie/wx/impl/operation/select.rb
65
+ - test/all_tests.rb
66
+ - test/suite/app.rb
67
+ - test/suite/nobbie_test_case.rb
68
+ - test/suite/test_choose.rb
69
+ - test/suite/test_click.rb
70
+ - test/suite/test_enabled.rb
71
+ - test/suite/test_launcher.rb
72
+ - test/suite/test_operations.rb
73
+ - test/suite/test_selection.rb
74
+ - test/suite/test_type.rb
75
+ has_rdoc: true
76
+ homepage: http://github.com/bryan-ash/wx-nobbie
77
+ post_install_message:
78
+ rdoc_options:
79
+ - --main
80
+ - README.txt
81
+ - --inline-source
82
+ - --charset=UTF-8
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: "0"
90
+ version:
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: "0"
96
+ version:
97
+ requirements: []
98
+
99
+ rubyforge_project: wxextras
100
+ rubygems_version: 1.2.0
101
+ signing_key:
102
+ specification_version: 2
103
+ summary: wx-Nobbie is a simple interface for driving wxRuby application development.
104
+ test_files: []
105
+