symilaa 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -106,10 +106,10 @@ module Symilaa
106
106
  def create_screenshot_filename sub_directory, unique_filename_required
107
107
  file_name = "#{browser_info.browser_name.capitalize.parameterize}#{version_if_required}_#{browser_info.platform.capitalize}_#{title}"
108
108
  if unique_filename_required
109
- get_unique_file_name "#{screenshots_generated_this_run_dir}/#{sub_directory}#{scenario_name}/#{file_name}", '.png'
109
+ get_unique_file_name "#{screenshots_generated_this_run_dir}/#{sub_directory}#{scenario_name}/#{file_name}", '.png'
110
110
  else
111
111
  get_file_name "#{screenshots_generated_this_run_dir}/#{sub_directory}#{scenario_name}/#{file_name}", '.png'
112
- end
112
+ end
113
113
  end
114
114
 
115
115
  def save_screenshot screenshot_path
@@ -120,7 +120,7 @@ module Symilaa
120
120
  "#{generated_screenshot_path}_difference.gif".gsub('screenshots_generated_this_run', 'differences_in_screenshots_this_run')
121
121
  end
122
122
 
123
- def check_screen_against_reference_shot target_sub_directory, unique_filename_required = true
123
+ def check_screen_against_reference_shot target_sub_directory, unique_filename_required = true, retries = 1
124
124
  create_directories %w[screenshots_generated_this_run differences_in_screenshots_this_run]
125
125
  create_screenshot_directory target_sub_directory
126
126
 
@@ -129,15 +129,15 @@ module Symilaa
129
129
  reference_path = File.join reference_screenshots, target_sub_directory, scenario_name, screenshot_name
130
130
  difference_file = difference_file_path generated_screenshot_path
131
131
 
132
- save_screenshot generated_screenshot_path
133
-
134
- unless same? reference_path, generated_screenshot_path
135
- FileUtils.mkdir_p File.dirname(difference_file)
136
-
137
- produce_gif_showing_the_difference_between reference_path, generated_screenshot_path, difference_file
138
-
139
- fail "Some of the screenshots did not match"
132
+ retries.times do
133
+ save_screenshot generated_screenshot_path
134
+ break if same? reference_path, generated_screenshot_path
135
+ sleep 1
140
136
  end
137
+ FileUtils.mkdir_p File.dirname(difference_file)
138
+ produce_gif_showing_the_difference_between reference_path, generated_screenshot_path, difference_file
139
+
140
+ fail "Some of the screenshots did not match"
141
141
  end
142
142
  end
143
143
  end
@@ -1,3 +1,3 @@
1
1
  module Symilaa
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symilaa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-30 00:00:00.000000000 Z
12
+ date: 2013-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &13040120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *13040120
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: guard-minitest
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &13039080 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '0'
38
33
  type: :development
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
35
+ version_requirements: *13039080
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: rake
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &13037780 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ! '>='
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: '0'
54
44
  type: :development
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
46
+ version_requirements: *13037780
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: rb-inotify
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &13036520 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ! '>='
@@ -69,15 +54,10 @@ dependencies:
69
54
  version: '0'
70
55
  type: :development
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
57
+ version_requirements: *13036520
78
58
  - !ruby/object:Gem::Dependency
79
59
  name: rmagick
80
- requirement: !ruby/object:Gem::Requirement
60
+ requirement: &13035900 !ruby/object:Gem::Requirement
81
61
  none: false
82
62
  requirements:
83
63
  - - ! '>='
@@ -85,15 +65,10 @@ dependencies:
85
65
  version: '0'
86
66
  type: :runtime
87
67
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
68
+ version_requirements: *13035900
94
69
  - !ruby/object:Gem::Dependency
95
70
  name: activesupport
96
- requirement: !ruby/object:Gem::Requirement
71
+ requirement: &13035220 !ruby/object:Gem::Requirement
97
72
  none: false
98
73
  requirements:
99
74
  - - ! '>='
@@ -101,12 +76,7 @@ dependencies:
101
76
  version: '0'
102
77
  type: :runtime
103
78
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
79
+ version_requirements: *13035220
110
80
  description: ! "Using the wonders of RMagick, this wonderful gem will produce a boolean
111
81
  result based on the computed similarity\n of the two images passed."
112
82
  email:
@@ -160,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
130
  version: '0'
161
131
  requirements: []
162
132
  rubyforge_project: symilaa
163
- rubygems_version: 1.8.24
133
+ rubygems_version: 1.8.10
164
134
  signing_key:
165
135
  specification_version: 3
166
136
  summary: Compares images for similarity. Amazebears.