bryan-ash-wx-nobbie 0.0.3.5 → 0.0.4
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.
- data/{README.txt → README.rdoc} +20 -24
- data/Rakefile +59 -0
- data/features/acceptance_test.feature +39 -4
- data/features/step_definitions/acceptance_test_steps.rb +41 -4
- data/features/support/env.rb +5 -8
- data/lib/nobbie/wx.rb +5 -0
- data/lib/nobbie/wx/application_launcher.rb +12 -10
- data/lib/nobbie/wx/command.rb +0 -6
- data/lib/nobbie/wx/command/console_reporter.rb +30 -0
- data/lib/nobbie/wx/command/executor.rb +25 -0
- data/lib/nobbie/wx/command/reporter.rb +17 -0
- data/lib/nobbie/wx/command/select.rb +12 -13
- data/lib/nobbie/wx/command_factory.rb +12 -14
- data/lib/nobbie/wx/impl/element/element_path_builder.rb +7 -6
- data/lib/nobbie/wx/impl/operation/choosable.rb +2 -9
- data/lib/nobbie/wx/impl/operation/select.rb +3 -10
- data/lib/nobbie/wx/operations.rb +13 -7
- data/spec/application_launcher_spec.rb +7 -1
- data/spec/console_reporter_spec.rb +32 -0
- data/spec/executor_spec.rb +54 -0
- data/spec/reporter_spec.rb +20 -0
- data/test/all_tests.rb +11 -4
- data/test/suite/example_app.rb +111 -105
- data/test/suite/nobbie_test_case.rb +2 -11
- data/test/suite/test_type.rb +10 -10
- metadata +12 -5
- data/lib/nobbie/wx/acceptance_test.rb +0 -19
- data/lib/nobbie/wx/command_executor.rb +0 -25
- data/lib/nobbie/wx/driven.rb +0 -7
@@ -2,7 +2,6 @@ module NobbieTestCase
|
|
2
2
|
include Nobbie::Wx
|
3
3
|
|
4
4
|
def setup
|
5
|
-
puts "\n[Started: #{name}]"
|
6
5
|
begin
|
7
6
|
select_tab_for_test
|
8
7
|
rescue ValueNotFoundException
|
@@ -10,10 +9,6 @@ module NobbieTestCase
|
|
10
9
|
end
|
11
10
|
end
|
12
11
|
|
13
|
-
def teardown
|
14
|
-
puts "\n[Finished: #{name}]"
|
15
|
-
end
|
16
|
-
|
17
12
|
def select_tab_for_test
|
18
13
|
clear_events
|
19
14
|
tab = self.class.name.gsub('Test', '').downcase
|
@@ -21,10 +16,6 @@ module NobbieTestCase
|
|
21
16
|
assert_equal tab, selection(:in => 'test_notebook').selected_value
|
22
17
|
end
|
23
18
|
|
24
|
-
def text(component)
|
25
|
-
component.nil? ? nil : component.value
|
26
|
-
end
|
27
|
-
|
28
19
|
def clear_events
|
29
20
|
log.clear
|
30
21
|
end
|
@@ -36,11 +27,11 @@ module NobbieTestCase
|
|
36
27
|
|
37
28
|
def assert_events(expected_items=[])
|
38
29
|
expected_items = [expected_items] unless expected_items.is_a?(Array)
|
39
|
-
actual_items = text(log).split("\n")
|
30
|
+
actual_items = text('log').split("\n")
|
40
31
|
assert_equal expected_items, actual_items
|
41
32
|
end
|
42
33
|
|
43
34
|
def log
|
44
35
|
component 'log'
|
45
36
|
end
|
46
|
-
end
|
37
|
+
end
|
data/test/suite/test_type.rb
CHANGED
@@ -4,15 +4,15 @@ class TestType < Test::Unit::TestCase
|
|
4
4
|
def test_type_with_text_ctrl
|
5
5
|
#todo: this doesnt seem to work in windows or osx .. but it should ... see KNOWN ISSUES
|
6
6
|
type '123', :in => 'text_ctrl'
|
7
|
-
assert_equal '123', text(
|
7
|
+
assert_equal '123', text('text_ctrl')
|
8
8
|
assert_events ['text_ctrl: ', 'text_ctrl: 1', 'text_ctrl: 12', 'text_ctrl: 123']
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_type_with_combo_box
|
12
12
|
#todo: this doesnt seem to work in osx .. but it should ... see KNOWN ISSUES
|
13
|
-
assert_equal 'combo_box', text(
|
13
|
+
assert_equal 'combo_box', text('combo_box')
|
14
14
|
type '456', :in => 'combo_box'
|
15
|
-
assert_equal '456', text(
|
15
|
+
assert_equal '456', text('combo_box')
|
16
16
|
assert_events ['combo_box: ', 'combo_box: 4', 'combo_box: 45', 'combo_box: 456']
|
17
17
|
end
|
18
18
|
|
@@ -20,32 +20,32 @@ class TestType < Test::Unit::TestCase
|
|
20
20
|
type 'a', :in => 'text_ctrl'
|
21
21
|
clear_events
|
22
22
|
type '', :in => 'text_ctrl'
|
23
|
-
assert_equal '', text(
|
23
|
+
assert_equal '', text('text_ctrl')
|
24
24
|
assert_events 'text_ctrl: '
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_type_with_readonly_text_ctrl
|
28
28
|
assert_exception ComponentReadOnlyException do type 'readonly_text_ctrl_value', :in => 'readonly_text_ctrl' end
|
29
|
-
assert_equal 'readonly_text_ctrl', text(
|
29
|
+
assert_equal 'readonly_text_ctrl', text('readonly_text_ctrl')
|
30
30
|
end
|
31
31
|
|
32
32
|
def test_type_with_readonly_combo_box
|
33
33
|
#todo: this won't currently work on windows ... see KNOWN ISSUES
|
34
34
|
assert_exception ComponentReadOnlyException do type 'readonly_combo_box_value', :in => 'readonly_combo_box' end
|
35
|
-
assert_equal 'readonly_combo_box', text(
|
35
|
+
assert_equal 'readonly_combo_box', text('readonly_combo_box')
|
36
36
|
end
|
37
37
|
|
38
38
|
def test_type_with_disabled_text_ctrl
|
39
|
-
assert_equal 'disabled_text_ctrl', text(
|
39
|
+
assert_equal 'disabled_text_ctrl', text('disabled_text_ctrl')
|
40
40
|
assert_exception ComponentDisabledException do type 'disabled_text_ctrl_value', :in => 'disabled_text_ctrl' end
|
41
|
-
assert_equal 'disabled_text_ctrl', text(
|
41
|
+
assert_equal 'disabled_text_ctrl', text('disabled_text_ctrl')
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_type_with_disabled_combo_box
|
45
45
|
#todo: this doesnt seem to work in osx .. but it should ... see KNOWN ISSUES
|
46
|
-
assert_equal 'disabled_combo_box', text(
|
46
|
+
assert_equal 'disabled_combo_box', text('disabled_combo_box')
|
47
47
|
assert_exception ComponentDisabledException do type 'disabled_combo_box_value', :in => 'disabled_combo_box' end
|
48
|
-
assert_equal 'disabled_combo_box', text(
|
48
|
+
assert_equal 'disabled_combo_box', text('disabled_combo_box')
|
49
49
|
end
|
50
50
|
|
51
51
|
def test_type_with_component_not_found
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bryan-ash-wx-nobbie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Alton
|
@@ -15,6 +15,7 @@ default_executable:
|
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: wxruby
|
18
|
+
type: :runtime
|
18
19
|
version_requirement:
|
19
20
|
version_requirements: !ruby/object:Gem::Requirement
|
20
21
|
requirements:
|
@@ -24,6 +25,7 @@ dependencies:
|
|
24
25
|
version:
|
25
26
|
- !ruby/object:Gem::Dependency
|
26
27
|
name: wx_sugar
|
28
|
+
type: :runtime
|
27
29
|
version_requirement:
|
28
30
|
version_requirements: !ruby/object:Gem::Requirement
|
29
31
|
requirements:
|
@@ -41,22 +43,24 @@ extra_rdoc_files: []
|
|
41
43
|
|
42
44
|
files:
|
43
45
|
- KNOWN_ISSUES
|
44
|
-
-
|
45
|
-
-
|
46
|
+
- Rakefile
|
47
|
+
- README.rdoc
|
48
|
+
- lib/nobbie/wx.rb
|
46
49
|
- lib/nobbie/wx/application_launcher.rb
|
47
50
|
- lib/nobbie/wx/command.rb
|
48
|
-
- lib/nobbie/wx/command_executor.rb
|
49
51
|
- lib/nobbie/wx/command_factory.rb
|
50
|
-
- lib/nobbie/wx/driven.rb
|
51
52
|
- lib/nobbie/wx/operations.rb
|
52
53
|
- lib/nobbie/wx/platform.rb
|
53
54
|
- lib/nobbie/wx/command/choose.rb
|
54
55
|
- lib/nobbie/wx/command/click_on.rb
|
56
|
+
- lib/nobbie/wx/command/console_reporter.rb
|
57
|
+
- lib/nobbie/wx/command/executor.rb
|
55
58
|
- lib/nobbie/wx/command/get_component.rb
|
56
59
|
- lib/nobbie/wx/command/get_options.rb
|
57
60
|
- lib/nobbie/wx/command/get_selected_values.rb
|
58
61
|
- lib/nobbie/wx/command/is_chosen.rb
|
59
62
|
- lib/nobbie/wx/command/is_enabled.rb
|
63
|
+
- lib/nobbie/wx/command/reporter.rb
|
60
64
|
- lib/nobbie/wx/command/select.rb
|
61
65
|
- lib/nobbie/wx/command/type_into.rb
|
62
66
|
- lib/nobbie/wx/impl/element/element_path_builder.rb
|
@@ -68,6 +72,9 @@ files:
|
|
68
72
|
- features/step_definitions/acceptance_test_steps.rb
|
69
73
|
- features/support/env.rb
|
70
74
|
- spec/application_launcher_spec.rb
|
75
|
+
- spec/console_reporter_spec.rb
|
76
|
+
- spec/executor_spec.rb
|
77
|
+
- spec/reporter_spec.rb
|
71
78
|
- spec/spec.opts
|
72
79
|
- spec/spec_helper.rb
|
73
80
|
- test/all_tests.rb
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require 'nobbie/wx/operations'
|
3
|
-
|
4
|
-
def require_all_in_directory(dir)
|
5
|
-
Dir.glob("#{dir}/**/*.rb") {|f| require "#{f}" }
|
6
|
-
end
|
7
|
-
|
8
|
-
class Test::Unit::TestCase
|
9
|
-
include Nobbie::Wx::Operations
|
10
|
-
end
|
11
|
-
|
12
|
-
Test::Unit.run = false
|
13
|
-
|
14
|
-
#todo: how the hell does this work(/not work as expected) on OSX?
|
15
|
-
at_exit do
|
16
|
-
unless $! || Test::Unit.run?
|
17
|
-
exit = Nobbie::Wx::ApplicationLauncher.new(APPLICATION_UNDER_TEST).with_application { Thread.pass }
|
18
|
-
end
|
19
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Nobbie
|
2
|
-
module Wx
|
3
|
-
module Command
|
4
|
-
|
5
|
-
class Executor #:nodoc:
|
6
|
-
def execute(command)
|
7
|
-
puts "\n> #{command.describe}"
|
8
|
-
result = command.execute
|
9
|
-
puts "< #{render(result)}"
|
10
|
-
result
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def render(component)
|
16
|
-
#todo: this needs improving to support other components
|
17
|
-
return '' if component.nil?
|
18
|
-
return component.value if component.respond_to?(:get_value)
|
19
|
-
return component.inspect
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|