fastlane-plugin-imagesgoldenrun 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20a22946efb606f17f8c598722aca6e7ed15a2f2
4
- data.tar.gz: 8672fa4c0927c28491b2ff11b33d76dae528078e
3
+ metadata.gz: 8d1227196a57d2b1d93d4279624c2b56f28f3391
4
+ data.tar.gz: 3adca88ccaec7e3a11f2c87b17d16a7eaf221aa7
5
5
  SHA512:
6
- metadata.gz: b7b7b1d048cb196aca08fbfe4db8fb803d6aaf7b516171fd6227318241aabad8886d93b77211f2bd10143a24b8c0bb56f589a847f65337f6fb2c3774d8d4e4bb
7
- data.tar.gz: 42827889bdecf9a7bd83757fbe836e7d26e67116ac000f1bb67f1611c93a5f8b6adb8fde406a5cff57b17d79605989bc757bf022c73fc73f273b19e7e82e6cb3
6
+ metadata.gz: b8f4bf426bbe0009bb6346fc9b8fec998ad303d10b457378f207fdeec1299436fc1e4937f64d6167b8ff8d514f87ecd87967f5c28b2095da5bf4fcaf002fba21
7
+ data.tar.gz: 070a2f5190f49f2908631514691f3b30e297668a72fc27be7e8d0b0e74d556998238cec1dd4a9d1ad857a8b41a0e0fdf475b8bc3fce21982bca7a56ea25a7dc8
@@ -18,9 +18,10 @@ module Fastlane
18
18
  end
19
19
 
20
20
  #html report
21
- goldenRunReport = "<html><body><htmlImages></body></html>"
21
+ goldenRunReport = "<html><body><h2>Images Gonden Run results<h2><p><htmlImages></body></html>"
22
22
  htmlImages = ""
23
23
  imgExtension = ".png"
24
+ hasDifferences = false
24
25
 
25
26
  goldenRunLoc = File.expand_path(File.join(Dir.pwd, params[:goldenRunLoc]))
26
27
  resultsLoc = File.expand_path(File.join(Dir.pwd, params[:resultLoc]))
@@ -40,6 +41,7 @@ module Fastlane
40
41
  res = Imatcher.compare(imgFullPathGolden, imgFullPathResult, exclude_rect: excludeArea)
41
42
  r = res.match?
42
43
  unless r
44
+ hasDifferences = true
43
45
  #save the result image
44
46
  imagesGoldenRunReportFullPath = "#{differencesPath}/#{imageName}"
45
47
  res.difference_image.save(imagesGoldenRunReportFullPath)
@@ -50,8 +52,13 @@ module Fastlane
50
52
  end
51
53
 
52
54
  #html report
53
- goldenRunReport.gsub!("<htmlImages>", htmlImages)
55
+ goldenRunReport.gsub!("<htmlImages>", hasDifferences ? htmlImages : "<h3>No differences found<h3>")
54
56
  File.open("#{differencesFolder}/report.html", "w") { |file| file.write(goldenRunReport) }
57
+
58
+ if hasDifferences
59
+ UI.message("Error: ".red + "Some differences found".red)
60
+ raise Exception
61
+ end
55
62
  end
56
63
 
57
64
  def self.description
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Imagesgoldenrun
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-imagesgoldenrun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luís Esteves