zucchini-ios 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/lib/zucchini/config.rb +2 -2
  2. data/lib/zucchini/version.rb +1 -1
  3. data/zucchini-ios.gemspec +3 -4
  4. metadata +5 -62
  5. data/spec/lib/zucchini/compiler_spec.rb +0 -40
  6. data/spec/lib/zucchini/config_spec.rb +0 -46
  7. data/spec/lib/zucchini/detector_spec.rb +0 -52
  8. data/spec/lib/zucchini/feature_spec.rb +0 -45
  9. data/spec/lib/zucchini/generator_spec.rb +0 -27
  10. data/spec/lib/zucchini/report_spec.rb +0 -31
  11. data/spec/lib/zucchini/screenshot_spec.rb +0 -164
  12. data/spec/sample_screenshots/01_LandscapeLeft_Screenshot.png +0 -0
  13. data/spec/sample_screenshots/02_LandscapeRight_Screenshot.png +0 -0
  14. data/spec/sample_screenshots/03_PortraitUpsideDown_Screenshot.png +0 -0
  15. data/spec/sample_setup/feature_one/feature.zucchini +0 -1
  16. data/spec/sample_setup/feature_one/masks/retina_ios5/06_sign up_spinner.png +0 -0
  17. data/spec/sample_setup/feature_one/reference/retina_ios5/06_sign up_spinner.png +0 -0
  18. data/spec/sample_setup/feature_one/reference/retina_ios5/06_sign up_spinner_error.png +0 -0
  19. data/spec/sample_setup/feature_one/run_data/Run 1/06_splash-screen_sign up_spinner.png +0 -0
  20. data/spec/sample_setup/feature_three/feature.zucchini +0 -1
  21. data/spec/sample_setup/feature_two/feature.zucchini +0 -1
  22. data/spec/sample_setup/feature_two/masks/retina_ios5/06_sign up_spinner.png +0 -0
  23. data/spec/sample_setup/feature_two/reference/retina_ios5/06_sign up_spinner.png +0 -0
  24. data/spec/sample_setup/feature_two/reference/retina_ios5/06_sign up_spinner_error.png +0 -0
  25. data/spec/sample_setup/feature_two/run_data/Run 1/06_sign up_spinner.png +0 -0
  26. data/spec/sample_setup/support/config.yml +0 -16
  27. data/spec/sample_setup/support/lib/helpers.coffee +0 -3
  28. data/spec/sample_setup/support/masks/retina_ios5.png +0 -0
  29. data/spec/sample_setup/support/masks/splash.png +0 -0
  30. data/spec/sample_setup/support/screens/splash.coffee +0 -8
  31. data/spec/sample_setup_2/support/config.yml +0 -15
  32. data/spec/sample_setup_3/support/config.yml +0 -13
  33. data/spec/spec_helper.rb +0 -19
@@ -9,7 +9,7 @@ module Zucchini
9
9
 
10
10
  def self.base_path=(base_path)
11
11
  @@base_path = base_path
12
- @@config = YAML::load_file("#{base_path}/support/config.yml")
12
+ @@config = YAML::load(ERB::new(File::read("#{base_path}/support/config.yml")).result)
13
13
  @@default_device_name = nil
14
14
  devices.each do |device_name, device|
15
15
  if device['default']
@@ -42,7 +42,7 @@ module Zucchini
42
42
  @@default_device_name
43
43
  end
44
44
 
45
- def self.device(device_name)
45
+ def self.device(device_name = nil)
46
46
  device_name ||= @@default_device_name
47
47
  raise "Neither default device nor ZUCCHINI_DEVICE environment variable was set" unless device_name
48
48
  raise "Device '#{device_name}' not listed in config.yml" unless (device = devices[device_name])
@@ -1,3 +1,3 @@
1
1
  module Zucchini
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -7,10 +7,10 @@ Gem::Specification.new do |s|
7
7
  s.name = "zucchini-ios"
8
8
  s.version = Zucchini::VERSION
9
9
  s.authors = ["Vasily Mikhaylichenko", "Rajesh Kumar", "Kevin O'Neill"]
10
- s.license = "BSD"
10
+ s.licenses = %w{ BSD MIT }
11
11
  s.email = ["vaskas@zucchiniframework.org"]
12
12
  s.homepage = "http://www.zucchiniframework.org"
13
- s.summary = %q{Functional testing framework for iOS-powered devices}
13
+ s.summary = %q{A visual iOS testing framework}
14
14
  s.description = %q{Zucchini follows simple walkthrough scenarios for your iOS app, takes screenshots and compares them to the reference ones.}
15
15
 
16
16
  s.add_runtime_dependency 'clamp'
@@ -18,8 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.add_development_dependency 'simplecov'
19
19
  s.add_development_dependency 'coveralls'
20
20
 
21
- s.files = `git ls-files | grep -vE '(web|.watchr)'`.split("\n")
22
- s.test_files = `git ls-files -- spec/*`.split("\n")
21
+ s.files = `git ls-files | grep -v '^spec'`.split("\n")
23
22
  s.executables = %w(zucchini)
24
23
  s.require_paths = ["lib"]
25
24
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zucchini-ios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -119,35 +119,6 @@ files:
119
119
  - lib/zucchini/uia/screen.coffee
120
120
  - lib/zucchini/uia/zucchini.coffee
121
121
  - lib/zucchini/version.rb
122
- - spec/lib/zucchini/compiler_spec.rb
123
- - spec/lib/zucchini/config_spec.rb
124
- - spec/lib/zucchini/detector_spec.rb
125
- - spec/lib/zucchini/feature_spec.rb
126
- - spec/lib/zucchini/generator_spec.rb
127
- - spec/lib/zucchini/report_spec.rb
128
- - spec/lib/zucchini/screenshot_spec.rb
129
- - spec/sample_screenshots/01_LandscapeLeft_Screenshot.png
130
- - spec/sample_screenshots/02_LandscapeRight_Screenshot.png
131
- - spec/sample_screenshots/03_PortraitUpsideDown_Screenshot.png
132
- - spec/sample_setup/feature_one/feature.zucchini
133
- - spec/sample_setup/feature_one/masks/retina_ios5/06_sign up_spinner.png
134
- - spec/sample_setup/feature_one/reference/retina_ios5/06_sign up_spinner.png
135
- - spec/sample_setup/feature_one/reference/retina_ios5/06_sign up_spinner_error.png
136
- - spec/sample_setup/feature_one/run_data/Run 1/06_splash-screen_sign up_spinner.png
137
- - spec/sample_setup/feature_three/feature.zucchini
138
- - spec/sample_setup/feature_two/feature.zucchini
139
- - spec/sample_setup/feature_two/masks/retina_ios5/06_sign up_spinner.png
140
- - spec/sample_setup/feature_two/reference/retina_ios5/06_sign up_spinner.png
141
- - spec/sample_setup/feature_two/reference/retina_ios5/06_sign up_spinner_error.png
142
- - spec/sample_setup/feature_two/run_data/Run 1/06_sign up_spinner.png
143
- - spec/sample_setup/support/config.yml
144
- - spec/sample_setup/support/lib/helpers.coffee
145
- - spec/sample_setup/support/masks/retina_ios5.png
146
- - spec/sample_setup/support/masks/splash.png
147
- - spec/sample_setup/support/screens/splash.coffee
148
- - spec/sample_setup_2/support/config.yml
149
- - spec/sample_setup_3/support/config.yml
150
- - spec/spec_helper.rb
151
122
  - templates/feature/feature.zucchini
152
123
  - templates/feature/masks/retina_ios5/.gitkeep
153
124
  - templates/feature/pending/retina_ios5/.gitkeep
@@ -165,6 +136,7 @@ files:
165
136
  homepage: http://www.zucchiniframework.org
166
137
  licenses:
167
138
  - BSD
139
+ - MIT
168
140
  post_install_message:
169
141
  rdoc_options: []
170
142
  require_paths:
@@ -183,40 +155,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
155
  version: '0'
184
156
  segments:
185
157
  - 0
186
- hash: -3527198499352191037
158
+ hash: 1435969441614600881
187
159
  requirements: []
188
160
  rubyforge_project:
189
161
  rubygems_version: 1.8.23
190
162
  signing_key:
191
163
  specification_version: 3
192
- summary: Functional testing framework for iOS-powered devices
193
- test_files:
194
- - spec/lib/zucchini/compiler_spec.rb
195
- - spec/lib/zucchini/config_spec.rb
196
- - spec/lib/zucchini/detector_spec.rb
197
- - spec/lib/zucchini/feature_spec.rb
198
- - spec/lib/zucchini/generator_spec.rb
199
- - spec/lib/zucchini/report_spec.rb
200
- - spec/lib/zucchini/screenshot_spec.rb
201
- - spec/sample_screenshots/01_LandscapeLeft_Screenshot.png
202
- - spec/sample_screenshots/02_LandscapeRight_Screenshot.png
203
- - spec/sample_screenshots/03_PortraitUpsideDown_Screenshot.png
204
- - spec/sample_setup/feature_one/feature.zucchini
205
- - spec/sample_setup/feature_one/masks/retina_ios5/06_sign up_spinner.png
206
- - spec/sample_setup/feature_one/reference/retina_ios5/06_sign up_spinner.png
207
- - spec/sample_setup/feature_one/reference/retina_ios5/06_sign up_spinner_error.png
208
- - spec/sample_setup/feature_one/run_data/Run 1/06_splash-screen_sign up_spinner.png
209
- - spec/sample_setup/feature_three/feature.zucchini
210
- - spec/sample_setup/feature_two/feature.zucchini
211
- - spec/sample_setup/feature_two/masks/retina_ios5/06_sign up_spinner.png
212
- - spec/sample_setup/feature_two/reference/retina_ios5/06_sign up_spinner.png
213
- - spec/sample_setup/feature_two/reference/retina_ios5/06_sign up_spinner_error.png
214
- - spec/sample_setup/feature_two/run_data/Run 1/06_sign up_spinner.png
215
- - spec/sample_setup/support/config.yml
216
- - spec/sample_setup/support/lib/helpers.coffee
217
- - spec/sample_setup/support/masks/retina_ios5.png
218
- - spec/sample_setup/support/masks/splash.png
219
- - spec/sample_setup/support/screens/splash.coffee
220
- - spec/sample_setup_2/support/config.yml
221
- - spec/sample_setup_3/support/config.yml
222
- - spec/spec_helper.rb
164
+ summary: A visual iOS testing framework
165
+ test_files: []
@@ -1,40 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Zucchini::Compiler do
4
- let(:path) { './spec/sample_setup/feature_one' }
5
- let(:feature) { Zucchini::Feature.new(path) }
6
-
7
- after(:all) { FileUtils.rm_rf Dir.glob("#{path}/run_data/feature.*") }
8
-
9
- describe "#compile_js" do
10
- before { feature.compile_js 'landscape' }
11
-
12
- it "should strip comments from the feature file" do
13
- File.read("#{feature.run_data_path}/feature.coffee").index('#').should be_nil
14
- end
15
-
16
- describe "feature.js output" do
17
- subject { File.read("#{feature.run_data_path}/feature.js") }
18
-
19
- it "should include mechanic.js" do
20
- should match /mechanic\.js UIAutomation Library/
21
- end
22
-
23
- it "should include screen definitions" do
24
- should match /SplashScreen = \(function/
25
- end
26
-
27
- it "should include Zucchini runtime" do
28
- should match /Zucchini = function/
29
- end
30
-
31
- it "should include custom libraries from support/lib" do
32
- should match /Helpers.example = /
33
- end
34
-
35
- it "should include screen orientation" do
36
- should match /Zucchini\(.+\'landscape\'\)/
37
- end
38
- end
39
- end
40
- end
@@ -1,46 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Zucchini::Config do
4
- describe "app" do
5
- context "app environment variable" do
6
- before(:all) { ENV['ZUCCHINI_APP'] = 'foo.app' }
7
-
8
- it "should use environment variable if app not in config" do
9
- Zucchini::Config.base_path = "spec/sample_setup_3"
10
- Zucchini::Config.app.should include 'foo.app'
11
- end
12
-
13
- it "should not use environment variable if app in config" do
14
- Zucchini::Config.base_path = "spec/sample_setup"
15
- Zucchini::Config.app.should include 'MyApp.app'
16
- end
17
- end
18
- end
19
-
20
- describe "device" do
21
- before(:all) { Zucchini::Config.base_path = "spec/sample_setup" }
22
-
23
- context "device present in config.yml" do
24
- it "should return the device hash" do
25
- Zucchini::Config.device("My iDevice").should eq({:name =>"My iDevice", :udid =>"lolffb28d74a6fraj2156090784avasc50725dd0", :screen =>"ipad_ios5", :simulator=>nil, :orientation=> 'portrait'})
26
- end
27
- end
28
-
29
- context "device not present in config.yml" do
30
- it "should raise an error" do
31
- expect { Zucchini::Config.device("My Android Phone")}.to raise_error "Device 'My Android Phone' not listed in config.yml"
32
- end
33
- end
34
-
35
- context "default device" do
36
- it "should use default device if device name argument is nil" do
37
- Zucchini::Config.device(nil).should eq({:name =>"Default Device", :screen =>"low_ios5", :udid => nil, :simulator=>nil, :orientation=> 'portrait'})
38
- end
39
-
40
- it "should raise error if no default device provided" do
41
- Zucchini::Config.base_path = "spec/sample_setup_2"
42
- expect { Zucchini::Config.device(nil) }.to raise_error "Neither default device nor ZUCCHINI_DEVICE environment variable was set"
43
- end
44
- end
45
- end
46
- end
@@ -1,52 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Zucchini::Detector do
4
- before do
5
- detector.path = "spec/sample_setup/feature_one"
6
- ENV['ZUCCHINI_DEVICE'] = 'My iDevice'
7
- end
8
-
9
- let (:detector) { Zucchini::Detector.new(nil) }
10
-
11
- describe "execute" do
12
- subject { lambda { detector.execute } }
13
-
14
- context "feature directory doesn't exist" do
15
- before { detector.path = "spec/sample_setup/erroneous_feature" }
16
- it { should raise_error "Directory spec/sample_setup/erroneous_feature does not exist" }
17
- end
18
-
19
- context "device hasn't been found" do
20
- before { ENV['ZUCCHINI_DEVICE'] = 'My Android Phone' }
21
- it { should raise_error "Device 'My Android Phone' not listed in config.yml" }
22
- end
23
- end
24
-
25
- describe "detect features" do
26
- subject { lambda { detector.detect_features(@path) } }
27
-
28
- context "path to a single feature" do
29
- before { @path = "spec/sample_setup/feature_one" }
30
- it "should detect it" do
31
- subject.call[0].path.should eq @path
32
- end
33
- end
34
-
35
- context "path to a directory with features" do
36
- before { @path = File.expand_path("spec/sample_setup") }
37
- it "should detect all features in it" do
38
- subject.call.length.should eq 3
39
- end
40
- end
41
-
42
- context "path to a non-feature directory" do
43
- before do
44
- @path = File.expand_path("spec/sample_setup/bad_feature")
45
- FileUtils.mkdir(@path)
46
- end
47
-
48
- it { should raise_error }
49
- after { FileUtils.rmdir(@path) }
50
- end
51
- end
52
- end
@@ -1,45 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Zucchini::Feature do
4
- let(:path) { './spec/sample_setup/feature_one' }
5
- let(:feature) { Zucchini::Feature.new(path) }
6
-
7
- after(:all) { FileUtils.rm_rf Dir.glob("#{path}/run_data/feature.*") }
8
-
9
- describe "approve" do
10
- subject { lambda { feature.approve "reference" } }
11
-
12
- context "no previous run data" do
13
- before { feature.path = './spec/sample_setup/feature_three' }
14
- it { should raise_error "Directory ./spec/sample_setup/feature_three doesn't contain previous run data" }
15
- end
16
-
17
- context "copies screenshots to reference directory" do
18
- before do
19
- feature.path = './spec/sample_setup/feature_three'
20
- feature.device = {screen: 'retina_ios5'}
21
-
22
- # Copying some random image to run screenshots.
23
- @screenshot_path = "#{feature.path}/run_data/Run\ 1/screenshot.png"
24
- FileUtils.mkdir_p(File.dirname(@screenshot_path))
25
- FileUtils.copy_file("./spec/sample_setup/feature_one/reference/retina_ios5/06_sign up_spinner.png", @screenshot_path)
26
- end
27
-
28
- it "should copy screenshot to reference directory" do
29
- feature.approve "reference"
30
- (File.exists? "#{feature.path}/reference/retina_ios5/screenshot.png").should eq true
31
- end
32
-
33
- it "should copy screenshot to pending directory" do
34
- feature.approve "pending"
35
- (File.exists? "#{feature.path}/pending/retina_ios5/screenshot.png").should eq true
36
- end
37
-
38
- after do
39
- FileUtils.rm_rf("#{feature.path}/run_data")
40
- FileUtils.rm_rf("#{feature.path}/reference")
41
- FileUtils.rm_rf("#{feature.path}/pending")
42
- end
43
- end
44
- end
45
- end
@@ -1,27 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Zucchini::Generator do
4
- let(:project_path) { "/tmp/z_test_project" }
5
- let(:feature_path) { "#{project_path}/features/rspec_feature" }
6
- let(:generator) { Zucchini::Generator.new(nil) }
7
-
8
- after(:all) { FileUtils.rm_rf(project_path) }
9
-
10
- context "generate a project" do
11
- before { generator.path = project_path }
12
- it "should create a project directory" do
13
- generator.stub!(:project?).and_return(true)
14
- generator.execute
15
- File.exists?("#{project_path}/features/support/config.yml").should be_true
16
- end
17
- end
18
-
19
- context "generate a feature" do
20
- before { generator.path = feature_path }
21
- it "should create a feature directory" do
22
- generator.stub!(:feature?).and_return(true)
23
- generator.execute
24
- File.exists?("#{feature_path}/feature.zucchini").should be_true
25
- end
26
- end
27
- end
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Zucchini::Report do
4
- let (:device) { { :name => "iPad 2", :screen => "ipad_ios5", :udid => "rspec012345" } }
5
- let (:feature) do
6
- fake_screenshots = (1..7).to_a.map do |num|
7
- screenshot = Zucchini::Screenshot.new("#{num}.screen_#{num}.png", device)
8
- screenshot.diff = (num > 3) ? [:passed, nil] : [:failed, "120\n"]
9
- screenshot
10
- end
11
-
12
- feature = Zucchini::Feature.new("/my/sample/feature")
13
- feature.device = device
14
- feature.stub!(:screenshots).and_return(fake_screenshots)
15
- feature
16
- end
17
-
18
- let(:html_path) { '/tmp/zucchini_rspec_report.html' }
19
- after { FileUtils.rm(html_path) }
20
-
21
- subject { Zucchini::Report.new([feature], false, html_path) }
22
- before { Zucchini::Report.any_instance.stub(:log) }
23
-
24
- its(:text) { should eq "feature:\n4 passed, 3 failed, 0 pending\n\nFailed:\n 1.screen_1.png: 120\n 2.screen_2.png: 120\n 3.screen_3.png: 120\n" }
25
-
26
- it "should produce a a correct HTML report" do
27
- report = subject.html
28
- report.scan(/<dl class="passed.*screen/).length.should eq 4
29
- report.scan(/<dl class="failed.*screen/).length.should eq 3
30
- end
31
- end
@@ -1,164 +0,0 @@
1
- require 'spec_helper'
2
- require 'digest/md5'
3
- require 'tmpdir'
4
-
5
- def md5(blob)
6
- Digest::MD5.hexdigest(blob)
7
- end
8
-
9
- describe Zucchini::Screenshot do
10
- describe "general" do
11
- let (:device) { { :name => "iPhone 4S", :screen => "retina_ios5", :udid => "rspec987654" } }
12
- let (:screen) { "splash" }
13
- let (:base_path) { "spec/sample_setup/feature_one" }
14
- let (:original_path) { "#{base_path}/run_data/Run\ 1/06_splash-screen_sign\ up_spinner.png" }
15
-
16
- before do
17
- @screenshot = Zucchini::Screenshot.new(original_path, device)
18
- @screenshot.masked_paths = {
19
- :global => "#{base_path}/global_masked.png",
20
- :screen => "#{base_path}/screen_masked.png",
21
- :specific => "#{base_path}/specific_masked.png"
22
- }
23
- end
24
-
25
- after do
26
- FileUtils.mv(@screenshot.file_path, original_path) if File.exists?(@screenshot.file_path)
27
-
28
- @screenshot.masked_paths.each do |k, path|
29
- FileUtils.rm(path) if File.exists?(path)
30
- end
31
-
32
- FileUtils.rm_rf("#{base_path}/run_data/Masked")
33
- FileUtils.rm_rf(@screenshot.diff_path)
34
- end
35
-
36
- describe "mask" do
37
- let (:checksums) {
38
- checksums = {}
39
-
40
- checksums[:original] = md5(File.read(@screenshot.file_path))
41
-
42
- if File.exists?(@screenshot.masked_paths[:global])
43
- checksums[:global_masked] = md5(File.read(@screenshot.masked_paths[:global]))
44
- end
45
-
46
- if File.exists?(@screenshot.masked_paths[:screen])
47
- checksums[:screen_masked] = md5(File.read(@screenshot.masked_paths[:screen]))
48
- end
49
-
50
- if File.exists?(@screenshot.masked_paths[:specific])
51
- checksums[:specific_masked] = md5(File.read(@screenshot.masked_paths[:specific]))
52
- end
53
-
54
- checksums
55
- }
56
-
57
- it "should apply a standard global mask based on the device" do
58
- @screenshot.mask
59
- File.exists?(@screenshot.masked_paths[:global]).should be true
60
- checksums[:global_masked].should_not be_equal checksums[:original]
61
- end
62
-
63
- it "should apply a screen-specific mask if it exists" do
64
- @screenshot.mask
65
- File.exists?(@screenshot.masked_paths[:screen]).should be true
66
- checksums[:screen_masked].should_not be_equal checksums[:original]
67
- checksums[:specific_masked].should_not be_equal checksums[:global_masked]
68
- end
69
-
70
- it "should not apply a screen mask if it does not exist" do
71
- @screenshot.masks_paths[:screen] = nil
72
- @screenshot.mask
73
- File.exists?(@screenshot.masked_paths[:screen]).should_not be true
74
- checksums[:global_masked].should_not be_equal checksums[:original]
75
- end
76
-
77
- it "should not apply a specific mask if it does not exist" do
78
- @screenshot.masks_paths[:specific] = nil
79
- @screenshot.mask
80
- File.exists?(@screenshot.masked_paths[:specific]).should_not be true
81
- checksums[:global_masked].should_not be_equal checksums[:original]
82
- end
83
-
84
- it "should apply a screenshot-specific mask if it exists" do
85
- @screenshot.mask
86
- File.exists?(@screenshot.masked_paths[:specific]).should be true
87
- checksums[:specific_masked].should_not be_equal checksums[:original]
88
- checksums[:specific_masked].should_not be_equal checksums[:screen_masked]
89
- checksums[:specific_masked].should_not be_equal checksums[:global_masked]
90
- end
91
- end
92
-
93
- describe "compare" do
94
- context "images are identical" do
95
- it "should have a passed indicator in the diff" do
96
- @screenshot.mask
97
- @screenshot.compare
98
- @screenshot.diff.should eq [:passed, nil]
99
- end
100
- end
101
-
102
- context "images are different" do
103
- it "should have a failed indicator in the diff" do
104
- @screenshot.stub!(:mask_reference)
105
- @screenshot.test_path = "#{base_path}/reference/#{device[:screen]}/06_sign\ up_spinner_error.png"
106
- @screenshot.mask
107
- @screenshot.compare
108
- @screenshot.diff.should eq [:failed, "188162"]
109
- end
110
-
111
- it "should have a failed indicator in the diff with no screen mask" do
112
- @screenshot.stub!(:mask_reference)
113
- @screenshot.test_path = "#{base_path}/reference/#{device[:screen]}/06_sign\ up_spinner_error.png"
114
- @screenshot.masks_paths[:screen] = nil
115
- @screenshot.mask
116
- @screenshot.compare
117
- @screenshot.diff.should eq [:failed, "3017"]
118
- end
119
- end
120
- end
121
-
122
- describe "mask reference" do
123
- it "should create masked versions of reference screenshots" do
124
- @screenshot.mask
125
- @screenshot.mask_reference
126
-
127
- File.exists?(@screenshot.test_path).should be_true
128
- md5(File.read(@screenshot.test_path)).should_not be_equal md5(File.read("#{base_path}/reference/#{device[:screen]}/06_sign\ up_spinner.png"))
129
- end
130
- end
131
- end
132
-
133
- describe "rotate" do
134
- let (:sample_screenshots_path) { "spec/sample_screenshots" }
135
- let (:reference_screenshot_path) { File.join(sample_screenshots_path, "rotated/01_Screenshot.png") }
136
- let (:reference_md5) { md5(File.read(reference_screenshot_path)) }
137
- let (:temp_dir) { Dir.mktmpdir }
138
- before do
139
- `cp #{File.join(sample_screenshots_path, "*")} #{temp_dir}`
140
- end
141
-
142
- it "should rotate the landscape-left screenshot" do
143
- screenshot = Zucchini::Screenshot.new(File.join(temp_dir,'01_LandscapeLeft_Screenshot.png'), nil, true)
144
- File.exists?(File.join(temp_dir,'01_LandscapeLeft_Screenshot.png')).should be_false
145
- File.exists?(File.join(temp_dir,'01_Screenshot.png')).should be_true
146
- end
147
-
148
- it "should rotate the landscape-right screenshot" do
149
- screenshot = Zucchini::Screenshot.new(File.join(temp_dir,'02_LandscapeRight_Screenshot.png'), nil, true)
150
- File.exists?(File.join(temp_dir,'02_LandscapeRight_Screenshot.png')).should be_false
151
- File.exists?(File.join(temp_dir,'02_Screenshot.png')).should be_true
152
- end
153
-
154
- it "should rotate the upside-down screenshot" do
155
- screenshot = Zucchini::Screenshot.new(File.join(temp_dir,'03_PortraitUpsideDown_Screenshot.png'), nil, true)
156
- File.exists?(File.join(temp_dir,'02_PortraitUpsideDown_Screenshot.png')).should be_false
157
- File.exists?(File.join(temp_dir,'03_Screenshot.png')).should be_true
158
- end
159
-
160
- after do
161
- FileUtils.remove_entry temp_dir
162
- end
163
- end
164
- end
@@ -1 +0,0 @@
1
- # Start on the "Splash" screen
@@ -1 +0,0 @@
1
- # Start on the "Menu" screen
@@ -1 +0,0 @@
1
- # Start on the "Menu" screen
@@ -1,16 +0,0 @@
1
- app: MyApp.app
2
-
3
- devices:
4
- My iDevice:
5
- UDID : lolffb28d74a6fraj2156090784avasc50725dd0
6
- screen: ipad_ios5
7
-
8
- Default Device:
9
- screen : low_ios5
10
- default: true
11
-
12
-
13
- servers:
14
- backend:
15
- host: 192.168.1.2
16
- port: 8080
@@ -1,3 +0,0 @@
1
- class Helpers
2
- @example: ->
3
- puts "Helpers.example method is available in your screen classes"
@@ -1,8 +0,0 @@
1
- class SplashScreen extends Screen
2
- anchor: -> view.elements()["Welcome"]
3
-
4
- constructor: ->
5
- super 'splash'
6
-
7
- extend @elements,
8
- 'Go' : -> view.buttons()["Go"]
@@ -1,15 +0,0 @@
1
- app: MyApp.app
2
-
3
- devices:
4
- My iDevice:
5
- UDID : lolffb28d74a6fraj2156090784avasc50725dd0
6
- screen: ipad_ios5
7
-
8
- Default Device:
9
- screen : low_ios5
10
-
11
-
12
- servers:
13
- backend:
14
- host: 192.168.1.2
15
- port: 8080
@@ -1,13 +0,0 @@
1
- devices:
2
- My iDevice:
3
- UDID : lolffb28d74a6fraj2156090784avasc50725dd0
4
- screen: ipad_ios5
5
-
6
- Default Device:
7
- screen : low_ios5
8
- default: true
9
-
10
- servers:
11
- backend:
12
- host: 192.168.1.2
13
- port: 8080
@@ -1,19 +0,0 @@
1
- require 'coveralls'
2
- require 'simplecov'
3
-
4
- SimpleCov.start do
5
- add_filter "/spec/"
6
- end
7
- Coveralls.wear! if ENV['COVERAGE'] == 'coveralls'
8
-
9
- require 'clamp'
10
- require 'fileutils'
11
-
12
- $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..'))
13
- require 'lib/zucchini'
14
-
15
- RSpec.configure do |config|
16
- config.color_enabled = true
17
- config.tty = true
18
- config.formatter = :doc
19
- end