Skip to content

Commit adb17f2

Browse files
committed
metadata devices
1 parent 7b03489 commit adb17f2

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

lib/kraken-mobile/helpers/devices_helper/adb_helper.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ def device_screen_size device_id
2929
`adb -s #{device_id} shell wm size`
3030
end
3131

32+
def device_sdk_version device_id
33+
`adb -s #{device_id} shell getprop ro.build.version.sdk`
34+
end
35+
3236
def device_orientation device_id
3337
`adb -s #{device_id} shell dumpsys input | grep 'SurfaceOrientation' | awk '{ print $2 }'`
3438
end
@@ -118,6 +122,14 @@ def screen_size device_id
118122
end
119123
end
120124

125+
def sdk_version device_id
126+
begin
127+
return device_sdk_version device_id
128+
rescue
129+
return "N/A"
130+
end
131+
end
132+
121133
def orientation device_id
122134
begin
123135
adb_orientation = device_orientation(device_id).strip!

lib/kraken-mobile/helpers/reporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def feature_duration feature
223223
def scenario_duration scenario
224224
how_long = 0
225225
scenario["steps"].each do |step|
226-
how_long += step["result"]["duration"] if step["result"]
226+
how_long += step["result"]["duration"] if step["result"] && step["result"]["duration"]
227227
end
228228
how_long
229229
end

lib/kraken-mobile/runners/calabash/android/android_runner.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ def before_all
3131
Dir.mkdir("#{KrakenMobile::Constants::REPORT_PATH}/#{@execution_id}")
3232
devices_id_list = []
3333
@devices_manager.connected_devices.each_with_index do |device, index|
34-
devices_id_list << { user: (index+1), id: device.id, model: device.model }
34+
height, width = @adb_helper.screen_size device.id
35+
sdk_version = @adb_helper.sdk_version device.id
36+
devices_id_list << { user: (index+1), id: device.id, model: device.model, screen_height: height, screen_width: width, sdk: sdk_version }
3537
Dir.mkdir("#{KrakenMobile::Constants::REPORT_PATH}/#{@execution_id}/#{device.id}")
3638
end
3739
file = open("#{KrakenMobile::Constants::REPORT_PATH}/#{@execution_id}/#{KrakenMobile::Constants::REPORT_DEVICES_FILE_NAME}.json", 'w')

reporter/index.html.erb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,8 @@
603603
</div>
604604
<div class="row device-title"><%= device['model'] %></div>
605605
<div class="row device-info">ID - <%= device['id'] %></div>
606-
<div class="row device-info">Android Version - 141244</div>
607-
<div class="row device-info">Screen Size - 200x200</div>
606+
<div class="row device-info">SDK Version - <%= device['sdk'] %></div>
607+
<div class="row device-info">Screen Size - <%= "#{device['screen_height']}x#{device['screen_width']}" %></div>
608608
<div class="row device-info result-btn">
609609
<a href='<%= "./#{device['id']}/feature_report.html" %>'>See Results</a>
610610
</div>
@@ -700,6 +700,7 @@
700700
.style('fill', function(d) {
701701
return c20c(devicesHash[d]);
702702
})
703+
.style('opacity', .2)
703704

704705
legend.append('text')
705706
.attr('x', legendRectSize + 5)

0 commit comments

Comments
 (0)