wx-nobbie 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,59 @@
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
+ assert_equal 'text_ctrl', text(component('text_ctrl'))
7
+ type '123', :in => 'text_ctrl'
8
+ assert_equal '123', text(component('text_ctrl'))
9
+ assert_events ['text_ctrl: ', 'text_ctrl: 1', 'text_ctrl: 12', 'text_ctrl: 123']
10
+ end
11
+
12
+ def test_type_with_combo_box
13
+ #todo: this doesnt seem to work in osx .. but it should ... see KNOWN ISSUES
14
+ assert_equal 'combo_box', text(component('combo_box'))
15
+ type '456', :in => 'combo_box'
16
+ assert_equal '456', text(component('combo_box'))
17
+ assert_events ['combo_box: ', 'combo_box: 4', 'combo_box: 45', 'combo_box: 456']
18
+ end
19
+
20
+ def test_type_with_empty_string
21
+ type 'a', :in => 'text_ctrl'
22
+ clear_events
23
+ type '', :in => 'text_ctrl'
24
+ assert_equal '', text(component('text_ctrl'))
25
+ assert_events 'text_ctrl: '
26
+ end
27
+
28
+ def test_type_with_readonly_text_ctrl
29
+ assert_exception ComponentReadOnlyException do type 'readonly_text_ctrl_value', :in => 'readonly_text_ctrl' end
30
+ assert_equal 'readonly_text_ctrl', text(component('readonly_text_ctrl'))
31
+ end
32
+
33
+ def test_type_with_readonly_combo_box
34
+ #todo: this won't currently work on windows ... see KNOWN ISSUES
35
+ assert_exception ComponentReadOnlyException do type 'readonly_combo_box_value', :in => 'readonly_combo_box' end
36
+ assert_equal 'readonly_combo_box', text(component('readonly_combo_box'))
37
+ end
38
+
39
+ def test_type_with_disabled_text_ctrl
40
+ assert_equal 'disabled_text_ctrl', text(component('disabled_text_ctrl'))
41
+ assert_exception ComponentDisabledException do type 'disabled_text_ctrl_value', :in => 'disabled_text_ctrl' end
42
+ assert_equal 'disabled_text_ctrl', text(component('disabled_text_ctrl'))
43
+ end
44
+
45
+ def test_type_with_disabled_combo_box
46
+ #todo: this doesnt seem to work in osx .. but it should ... see KNOWN ISSUES
47
+ assert_equal 'disabled_combo_box', text(component('disabled_combo_box'))
48
+ assert_exception ComponentDisabledException do type 'disabled_combo_box_value', :in => 'disabled_combo_box' end
49
+ assert_equal 'disabled_combo_box', text(component('disabled_combo_box'))
50
+ end
51
+
52
+ def test_type_with_component_not_found
53
+ assert_exception ComponentNotFoundException do type 'missing_value', :in => 'missing' end
54
+ end
55
+
56
+ def test_type_with_unsupported_operation_for_component
57
+ assert_exception UnsupportedOperationForComponentException do type 'button_value', :in => 'button' end
58
+ end
59
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.2
3
+ specification_version: 1
4
+ name: wx-nobbie
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.0.2
7
+ date: 2007-08-30 00:00:00 +01:00
8
+ summary: An implementation of the Nobbie GUI Driving API for WxRuby2
9
+ require_paths:
10
+ - lib
11
+ email: ""
12
+ homepage: ""
13
+ rubyforge_project:
14
+ description:
15
+ autorequire: nobbie/wx/acceptance_test
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Paul Allton
31
+ files:
32
+ - lib/nobbie
33
+ - lib/nobbie/wx
34
+ - lib/nobbie/wx/acceptance_test.rb
35
+ - lib/nobbie/wx/command
36
+ - lib/nobbie/wx/command.rb
37
+ - lib/nobbie/wx/command_executor.rb
38
+ - lib/nobbie/wx/command_factory.rb
39
+ - lib/nobbie/wx/driven.rb
40
+ - lib/nobbie/wx/impl
41
+ - lib/nobbie/wx/launcher.rb
42
+ - lib/nobbie/wx/operation
43
+ - lib/nobbie/wx/operations.rb
44
+ - lib/nobbie/wx/platform.rb
45
+ - lib/nobbie/wx/command/choose.rb
46
+ - lib/nobbie/wx/command/click_on.rb
47
+ - lib/nobbie/wx/command/get_component.rb
48
+ - lib/nobbie/wx/command/get_options.rb
49
+ - lib/nobbie/wx/command/get_selected_values.rb
50
+ - lib/nobbie/wx/command/is_chosen.rb
51
+ - lib/nobbie/wx/command/is_enabled.rb
52
+ - lib/nobbie/wx/command/select.rb
53
+ - lib/nobbie/wx/command/type_into.rb
54
+ - lib/nobbie/wx/impl/element
55
+ - lib/nobbie/wx/impl/operation
56
+ - lib/nobbie/wx/impl/element/element_path_builder.rb
57
+ - lib/nobbie/wx/impl/operation/choosable.rb
58
+ - lib/nobbie/wx/impl/operation/select.rb
59
+ - test/all_tests.rb
60
+ - test/suite
61
+ - test/suite/app.rb
62
+ - test/suite/nobbie_test_case.rb
63
+ - test/suite/test_choose.rb
64
+ - test/suite/test_click.rb
65
+ - test/suite/test_enabled.rb
66
+ - test/suite/test_launcher.rb
67
+ - test/suite/test_operations.rb
68
+ - test/suite/test_selection.rb
69
+ - test/suite/test_type.rb
70
+ - README
71
+ - KNOWN ISSUES
72
+ test_files: []
73
+
74
+ rdoc_options: []
75
+
76
+ extra_rdoc_files:
77
+ - README
78
+ - KNOWN ISSUES
79
+ executables: []
80
+
81
+ extensions: []
82
+
83
+ requirements: []
84
+
85
+ dependencies:
86
+ - !ruby/object:Gem::Dependency
87
+ name: wx_sugar
88
+ version_requirement:
89
+ version_requirements: !ruby/object:Gem::Version::Requirement
90
+ requirements:
91
+ - - "="
92
+ - !ruby/object:Gem::Version
93
+ version: 0.1.15
94
+ version: