calabash-android 0.0.14 → 0.0.15
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/CHANGES.txt +3 -0
- data/lib/calabash-android/operations.rb +5 -2
- data/lib/calabash-android/version.rb +2 -2
- metadata +1 -1
data/CHANGES.txt
CHANGED
@@ -15,12 +15,15 @@ module Operations
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def take_screenshot
|
18
|
+
path = ENV["SCREENSHOT_PATH_PREFIX"] || "results"
|
19
|
+
FileUtils.mkdir_p path unless Dir.exists? path
|
20
|
+
filename_prefix = FeatureNameMemory.feature_name.gsub(/\s+/, '_').downcase
|
18
21
|
begin
|
19
22
|
Timeout.timeout(30) do
|
20
|
-
file_name = "#{
|
23
|
+
file_name = "#{path}/#{filename_prefix}_#{StepCounter.step_line}.png"
|
21
24
|
log "Taking screenshoot to #{file_name} from device: #{ENV['ADB_DEVICE_ARG']}"
|
22
25
|
system("java -jar #{File.dirname(__FILE__)}/lib/screenShotTaker.jar #{file_name} #{ENV['ADB_DEVICE_ARG']}")
|
23
|
-
log "Screenshot
|
26
|
+
log "Screenshot stored in: #{file_name}"
|
24
27
|
end
|
25
28
|
rescue Timeout::Error
|
26
29
|
raise Exception, "take_screenshot timed out"
|