testability-driver 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tdriver/base/behaviour/factory.rb +82 -51
- data/lib/tdriver/base/sut/controller.rb +33 -24
- data/lib/tdriver/base/sut/factory.rb +24 -21
- data/lib/tdriver/base/sut/generic/behaviours/application.rb +103 -34
- data/lib/tdriver/base/sut/generic/behaviours/sut.rb +56 -2
- data/lib/tdriver/base/sut/generic/commands/application.rb +248 -4
- data/lib/tdriver/base/sut/generic/plugin.rb +1 -1
- data/lib/tdriver/base/test_object/adapter.rb +67 -16
- data/lib/tdriver/base/test_object/behaviours/test_object.rb +14 -4
- data/lib/tdriver/loader.rb +1 -3
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery.rb +6 -5
- data/lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb +9 -1
- data/lib/tdriver/report/report.rb +3 -0
- data/lib/tdriver/report/report_api.rb +29 -23
- data/lib/tdriver/report/report_crash_file_capture.rb +2 -0
- data/lib/tdriver/report/report_creator.rb +74 -46
- data/lib/tdriver/report/report_test_case_run.rb +86 -68
- data/lib/tdriver/report/report_test_run.rb +46 -2
- data/lib/tdriver/report/report_writer.rb +35 -13
- data/lib/tdriver/tdriver.rb +3 -0
- data/lib/tdriver/util/plugin/service.rb +168 -76
- data/lib/tdriver/util/recorder/scripter.rb +76 -40
- data/lib/tdriver/version.rb +1 -1
- data/xml/templates/generic.xml +6 -1
- metadata +2 -2
@@ -51,44 +51,84 @@ module MobyUtil
|
|
51
51
|
mouse_status = 0
|
52
52
|
previous_time = nil
|
53
53
|
event = nil
|
54
|
+
|
55
|
+
# mouse_status:
|
56
|
+
# 0 = no press or release
|
57
|
+
# 1 = press, no release [ will only happen if recording stoped before mouse release]
|
58
|
+
# 2 = release, no press [ will only happen if recording started after mouse press]
|
59
|
+
# 3 = press and release
|
60
|
+
|
61
|
+
# COLLECT ALL MOUSE EVENTS
|
62
|
+
mouse_moves = []
|
63
|
+
mouse_press_events = []
|
64
|
+
mouse_release_events = []
|
65
|
+
|
66
|
+
begin
|
67
|
+
mouse_moves = xml_as_object.children(:type =>'event', :name=>'MouseMove')
|
68
|
+
rescue MobyBase::TestObjectNotFoundError
|
69
|
+
end
|
70
|
+
|
71
|
+
begin
|
72
|
+
mouse_press_events = xml_as_object.children(:type =>'event', :name=>'MouseButtonPress')
|
73
|
+
rescue MobyBase::TestObjectNotFoundError
|
74
|
+
end
|
75
|
+
|
76
|
+
begin
|
77
|
+
mouse_release_events = xml_as_object.children(:type =>'event', :name=>'MouseButtonRelease')
|
78
|
+
rescue MobyBase::TestObjectNotFoundError
|
79
|
+
end
|
80
|
+
|
81
|
+
# STORE MOVE POINTS
|
82
|
+
move_points = []
|
83
|
+
mouse_moves.each do |point|
|
84
|
+
timestamp = point.attribute('timeStamp').to_i
|
85
|
+
previous_timestamp = ( move_points[-1].nil? ) ? timestamp : move_points[-1]['timestamp'].to_i
|
86
|
+
interval = get_duration(previous_timestamp, timestamp)
|
87
|
+
move_points.push({'x' => point.attribute('windowX'), 'y' => point.attribute('windowY'), 'interval' => interval, 'timestamp' => timestamp, 'id' => point.id} )
|
88
|
+
end
|
89
|
+
|
90
|
+
# STORE RELEASE EVENTS
|
91
|
+
release_events = []
|
92
|
+
mouse_release_events.each do |event|
|
93
|
+
release_events.push({'id' => event.id})
|
94
|
+
end
|
54
95
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
if
|
63
|
-
|
64
|
-
|
65
|
-
|
96
|
+
# FOREACH MouseButtonPress
|
97
|
+
mouse_press_events.each_index do |index|
|
98
|
+
active_target = get_target_details( mouse_press_events[index].child(:id => mouse_press_events[index].id) )
|
99
|
+
|
100
|
+
# COLLECT MouseMove points until MouseButtonRelease
|
101
|
+
# If no more MouseButtonRelease or MouseButtonPress then last MoveMouse point id
|
102
|
+
first_point_index = mouse_press_events[index].id.to_i
|
103
|
+
if ( !move_points.empty? )
|
104
|
+
next_mouse_press_index = ( mouse_press_events[ index + 1 ].nil? ) ? move_points.last['id'].to_i : mouse_press_events[ index + 1 ].id.to_i
|
105
|
+
next_mouse_release = release_events.select{ |event| event['id'].to_i < next_mouse_press_index }
|
106
|
+
next_mouse_release_index = next_mouse_release.first['id'].to_i unless next_mouse_release.empty?
|
107
|
+
last_point_index = ( next_mouse_release_index.nil? ) ? next_mouse_press_index : next_mouse_release_index
|
108
|
+
else
|
109
|
+
if ( !release_events.empty? )
|
110
|
+
next_mouse_press_index = ( mouse_press_events[ index + 1 ].nil? ) ? 0 : mouse_press_events[ index + 1 ].id.to_i
|
111
|
+
next_mouse_release = ( next_mouse_press_index == 0 ) ? [ release_events.last ] : release_events.select{ |event| event['id'].to_i < next_mouse_press_index }
|
112
|
+
last_point_index = next_mouse_release.first['id'].to_i unless ( next_mouse_release.nil? or next_mouse_release.empty? )
|
113
|
+
else
|
114
|
+
last_point_index = 0
|
115
|
+
end
|
66
116
|
end
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
mouse_status =
|
80
|
-
script << generate_command(active_target, points, mouse_status) << "\n"
|
81
|
-
points.clear
|
82
|
-
active_target = nil
|
83
|
-
scripting = false
|
84
|
-
|
117
|
+
|
118
|
+
|
119
|
+
points = move_points.select{ |point| point['id'].to_i > first_point_index and point['id'].to_i <= last_point_index }
|
120
|
+
points.first['interval'] = 0.to_f unless points.empty? # set first interval to 0
|
121
|
+
|
122
|
+
# PROCESS gesture at MouseButtonRelease unless we hit last point and there is no release
|
123
|
+
last_processed_event_id = ( move_points.empty? ) ? 0 : move_points.last['id'].to_i
|
124
|
+
if ( last_point_index != last_processed_event_id )
|
125
|
+
script << generate_command(active_target, points, mouse_status = 3 ) << "\n"
|
126
|
+
|
127
|
+
# END EVENTS, MouseButtonRelease truncated or second press without release witch would not make sense
|
128
|
+
else
|
129
|
+
script << generate_command(active_target, points, mouse_status = 1 ) << "\n"
|
85
130
|
end
|
86
|
-
|
87
|
-
|
88
|
-
if scripting and event
|
89
|
-
|
90
|
-
script << generate_command(active_target, points, mouse_status) << "\n"
|
91
|
-
|
131
|
+
|
92
132
|
end
|
93
133
|
|
94
134
|
script << "\n"
|
@@ -151,11 +191,7 @@ module MobyUtil
|
|
151
191
|
target
|
152
192
|
end
|
153
193
|
|
154
|
-
|
155
|
-
# 0 = no press or release
|
156
|
-
# 1 = press, no release
|
157
|
-
# 2 = release, no press
|
158
|
-
# 3 = press and release
|
194
|
+
|
159
195
|
def generate_command(target_details, points, mouse_status)
|
160
196
|
|
161
197
|
command = "@app."
|
data/lib/tdriver/version.rb
CHANGED
data/xml/templates/generic.xml
CHANGED
@@ -150,14 +150,19 @@
|
|
150
150
|
|
151
151
|
<!-- default parameters for reporting settings -->
|
152
152
|
<template name="reporting" inherits="error_recovery">
|
153
|
-
|
153
|
+
<!-- parameter for reporter modules enable disable enabled by default -->
|
154
|
+
<parameter name="enable_reporter" value="true" />
|
155
|
+
<parameter name="report_short_folders" value="false" />
|
156
|
+
|
154
157
|
<!-- Parameters for report crash file monitoring -->
|
155
158
|
<parameter name="report_crash_file_monitor" value="false" />
|
159
|
+
<parameter name="report_crash_file_monitor_crash_file_cleanup" value="false" />
|
156
160
|
<parameter name="report_crash_file_monitored_sut_ids" value="s60,qt_sut" />
|
157
161
|
<parameter name="report_crash_file_locations" value="C:,c:\data,E:,F:" /> <!-- posix="..." -->
|
158
162
|
<parameter name="report_crash_file_names" value="MobileCrash" />
|
159
163
|
<parameter name="report_disconnect_connected_devices" value="false" />
|
160
164
|
|
165
|
+
|
161
166
|
<!-- Parameters for report details -->
|
162
167
|
<parameter name="report_outputter_path" value="tdriver_reports/" />
|
163
168
|
<parameter name="behaviour_logging" value="true" />
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testability-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Testability Driver team
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin/
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-04-12 00:00:00 +03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|