nakal 0.0.1
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.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/.rvmrc +2 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +22 -0
- data/README.md +46 -0
- data/Rakefile +1 -0
- data/lib/nakal.rb +40 -0
- data/lib/nakal/android/adb.rb +22 -0
- data/lib/nakal/android/screen.rb +16 -0
- data/lib/nakal/base_screen.rb +56 -0
- data/lib/nakal/cucumber.rb +13 -0
- data/lib/nakal/dsl.rb +40 -0
- data/lib/nakal/ios/screen.rb +13 -0
- data/lib/nakal/version.rb +3 -0
- data/nakal.gemspec +25 -0
- data/spec/nakal/android/screen_spec.rb +86 -0
- data/spec/resources/changed_home_screen.png +0 -0
- data/spec/resources/home_screen.png +0 -0
- data/spec/spec_helper.rb +97 -0
- metadata +125 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1b58e8fd157ff12dbc901782576a6c6712dbff0b
|
4
|
+
data.tar.gz: f2f11543cbf0490454a7237a36d6060e1068859b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f8b03d49e871bb584525fa755ee0e73399eafef017c780292c623d557b807c3525ea2085825fdca66576fa31cfea2f83eca532052878d761816f808aa75549f1
|
7
|
+
data.tar.gz: 4b5f096c624c6ce67ccec04d3c7f05e5b0704719679ec4be00ce923beee9ef5f360b0fe3449cd9def43050b0c548f544c862960199fb5d3c515fb04c63f5a378
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rvmrc
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Rajdeep
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# Nakal
|
2
|
+
|
3
|
+
Automated visual testing of Android/iOS applications
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'nakal'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install nakal
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
If you are using cucumber, include following Lines in your env.rb
|
22
|
+
|
23
|
+
require "nakal/cucumber"
|
24
|
+
|
25
|
+
Nakal.platform = :android
|
26
|
+
Nakal.directory= "baseline_images/droid"
|
27
|
+
Nakal.device_name = "samsung_galaxy_s3"
|
28
|
+
|
29
|
+
and then put this line in your code where you want comparison to begin:
|
30
|
+
|
31
|
+
nakal_execute("current_screen_name")
|
32
|
+
|
33
|
+
|
34
|
+
While executing, pass env variable NAKAL_MODE=build to build the baseline images
|
35
|
+
|
36
|
+
once baseline is built, next execution onwards, start using environment variable NAKAL_MODE=compare to compare against baseline
|
37
|
+
|
38
|
+
This is currently beta and implemented for android only. iOs is work in progress
|
39
|
+
|
40
|
+
## Contributing
|
41
|
+
|
42
|
+
1. Fork it ( http://github.com/<my-github-username>/nakal/fork )
|
43
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
44
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
45
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
46
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/nakal.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require "nakal/version"
|
2
|
+
require 'rmagick'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'yaml'
|
5
|
+
require_relative 'nakal/base_screen'
|
6
|
+
require_relative 'nakal/android/screen'
|
7
|
+
require_relative 'nakal/ios/screen'
|
8
|
+
|
9
|
+
module Nakal
|
10
|
+
|
11
|
+
class<<self
|
12
|
+
attr_accessor :device_name, :directory, :platform, :image_location, :img_dir_created, :default_crop_params
|
13
|
+
attr_accessor :diff_screens, :embed_screenshot
|
14
|
+
|
15
|
+
def configure
|
16
|
+
yield self
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_image_dir
|
20
|
+
unless @img_dir_created
|
21
|
+
@image_location ||= "#{@directory}/#{@device_name}"
|
22
|
+
FileUtils.mkdir_p @image_location unless File.directory?(@image_location)
|
23
|
+
@img_dir_created =true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def current_platform
|
28
|
+
Object.const_get("Nakal::#{Nakal.platform.capitalize}")
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
Nakal.configure do |config|
|
35
|
+
config.device_name = "default_device"
|
36
|
+
config.directory = "baseline_images"
|
37
|
+
config.default_crop_params = (YAML.load(File.open './config/nakal.yml') rescue {})
|
38
|
+
config.embed_screenshot = false
|
39
|
+
config.diff_screens = []
|
40
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Nakal
|
2
|
+
module Android
|
3
|
+
class ADB
|
4
|
+
class << self
|
5
|
+
attr_accessor :connected_devices
|
6
|
+
|
7
|
+
def connected_devices
|
8
|
+
@connected_devices ||= `adb devices`.scan(/\n(.*)\t/).flatten
|
9
|
+
end
|
10
|
+
|
11
|
+
def first_device
|
12
|
+
connected_devices.first
|
13
|
+
end
|
14
|
+
|
15
|
+
def multiple_devices_connected?
|
16
|
+
connected_devices.size > 1
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require_relative 'adb'
|
2
|
+
module Nakal
|
3
|
+
module Android
|
4
|
+
class Screen < Common::BaseScreen
|
5
|
+
|
6
|
+
private
|
7
|
+
|
8
|
+
def capture
|
9
|
+
device_arg = ADB.multiple_devices_connected? ? "-s #{ENV['ADB_DEVICE_ARG']}" : ""
|
10
|
+
`adb #{device_arg} shell screencap -p /sdcard/#{@name}.png`
|
11
|
+
`adb #{device_arg} pull /sdcard/#{@name}.png #{Nakal.image_location}`
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Nakal
|
2
|
+
module Common
|
3
|
+
class BaseScreen
|
4
|
+
|
5
|
+
attr_accessor :image, :name
|
6
|
+
|
7
|
+
def initialize file_name, mode = :load, image = nil
|
8
|
+
@name = file_name
|
9
|
+
if mode.eql?(:capture)
|
10
|
+
capture
|
11
|
+
load_image_from_file
|
12
|
+
elsif mode.eql?(:load)
|
13
|
+
load_image_from_file
|
14
|
+
else
|
15
|
+
@image=image
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def strip
|
20
|
+
crop_params = Nakal.default_crop_params[Nakal.device_name]
|
21
|
+
if crop_params.nil?
|
22
|
+
@image
|
23
|
+
else
|
24
|
+
width = @image.columns
|
25
|
+
height = @image.rows
|
26
|
+
x_start = crop_params["left"]
|
27
|
+
y_start = crop_params["top"]
|
28
|
+
width_to_consider = width-crop_params["right"]-x_start
|
29
|
+
height_to_consider = height-crop_params["bottom"]-y_start
|
30
|
+
@image.crop(x_start, y_start, width_to_consider, height_to_consider)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def compare screen
|
35
|
+
diff_img, diff_metric = self.strip.compare_channel(screen.strip, Magick::RootMeanSquaredErrorMetric)
|
36
|
+
diff_screen = Nakal.current_platform::Screen.new("#{@name}_diff", :none, diff_img)
|
37
|
+
return diff_screen, diff_metric
|
38
|
+
end
|
39
|
+
|
40
|
+
def delete!
|
41
|
+
FileUtils.rm "#{Nakal.image_location}/#{@name}.png"
|
42
|
+
end
|
43
|
+
|
44
|
+
def save
|
45
|
+
@image.write("#{Nakal.image_location}/#{@name}.png")
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def load_image_from_file
|
51
|
+
@image = Magick::Image.read("#{Nakal.image_location}/#{@name}.png")[0]
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/nakal/dsl.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'nakal'
|
2
|
+
|
3
|
+
module Nakal
|
4
|
+
module DSL
|
5
|
+
|
6
|
+
def current_screen_vs_base_image image_file_name
|
7
|
+
orignal_screen = Nakal.current_platform::Screen.new(image_file_name, :load)
|
8
|
+
current_screen = Nakal.current_platform::Screen.new("#{image_file_name}_current", :capture)
|
9
|
+
diff_screen, diff_metric = orignal_screen.compare(current_screen)
|
10
|
+
if diff_metric==0
|
11
|
+
current_screen.delete!
|
12
|
+
else
|
13
|
+
p "difference = #{diff_metric}"
|
14
|
+
diff_screen.save
|
15
|
+
Nakal.diff_screens << image_file_name
|
16
|
+
embed_screenshots image_file_name if Nakal.embed_screenshot == true
|
17
|
+
end
|
18
|
+
diff_metric
|
19
|
+
end
|
20
|
+
|
21
|
+
def embed_screenshots image_file_name
|
22
|
+
embed("#{image_file_name}.png", 'image/png', "#{image_file_name}")
|
23
|
+
embed("#{image_file_name}_current.png", 'image/png', "#{image_file_name}_current")
|
24
|
+
embed("#{image_file_name}_diff.png", 'image/png', "#{image_file_name}_diff")
|
25
|
+
end
|
26
|
+
|
27
|
+
def capture_screen image_name
|
28
|
+
Nakal.current_platform::Screen.new(image_name, :capture)
|
29
|
+
end
|
30
|
+
|
31
|
+
def nakal_execute image_name, params = {:delay => nil, :replace_baseline => false}
|
32
|
+
return if ENV['NAKAL_MODE'].nil?
|
33
|
+
Nakal.create_image_dir
|
34
|
+
sleep params[:delay] unless params[:delay].nil?
|
35
|
+
capture_screen(image_name) if (ENV['NAKAL_MODE'] == "build") || (params[:replace_baseline] == true)
|
36
|
+
current_screen_vs_base_image(image_name) if ENV['NAKAL_MODE'] == "compare" && params[:replace_baseline] != true
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
data/nakal.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'nakal/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "nakal"
|
8
|
+
spec.version = Nakal::VERSION
|
9
|
+
spec.authors = ["Rajdeep"]
|
10
|
+
spec.email = ["mail.rajvarma@gmail.com"]
|
11
|
+
spec.summary = "Visual regression testing of android and ios apps"
|
12
|
+
spec.description = spec.summary
|
13
|
+
spec.homepage = "https://github.com/rajdeepv/nakal"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'rmagick', "~>2.15.2"
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "rspec"
|
25
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'nakal'
|
3
|
+
|
4
|
+
`rm -rf spec/resources/droid`
|
5
|
+
Nakal.platform = :android
|
6
|
+
Nakal.directory= "spec/resources/droid"
|
7
|
+
Nakal.device_name = "samsung_galaxy_s3"
|
8
|
+
Nakal.create_image_dir
|
9
|
+
|
10
|
+
module Nakal::Android
|
11
|
+
class Screen
|
12
|
+
def capture
|
13
|
+
`cp spec/resources/*.png #{Nakal.image_location}`
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe Nakal::Android::Screen do
|
19
|
+
|
20
|
+
before(:all) do
|
21
|
+
@screen = Nakal::Android::Screen.new("home_screen", :capture)
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "#new" do
|
25
|
+
it "creates new screen by capturing it" do
|
26
|
+
expect(@screen).to be_an_instance_of Nakal::Android::Screen
|
27
|
+
end
|
28
|
+
|
29
|
+
it "creates new screen object using an image file" do
|
30
|
+
new_screen = Nakal::Android::Screen.new("home_screen", :load)
|
31
|
+
expect(new_screen.name).to eq "home_screen"
|
32
|
+
expect(new_screen.image).to be_an_instance_of Magick::Image
|
33
|
+
end
|
34
|
+
|
35
|
+
it "throws error if new screen is created using invalid file" do
|
36
|
+
expect { Nakal::Android::Screen.new("invalid_image", :load) }.to raise_error(Magick::ImageMagickError)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "#strip" do
|
41
|
+
it "does not crop image when no params are given" do
|
42
|
+
Nakal.default_crop_params = {}
|
43
|
+
expect(@screen.strip.rows).to eq 1280
|
44
|
+
expect(@screen.strip.columns).to eq 720
|
45
|
+
end
|
46
|
+
|
47
|
+
it "crops the image as per nakal.yml params" do
|
48
|
+
Nakal.default_crop_params = {"samsung_galaxy_s3" => {"top" => 50, "right" => 18, "left" => 12, "bottom" => 15},
|
49
|
+
"nexus7" => {"top" => 74, "right" => 20, "left" => 0, "bottom" => 0}}
|
50
|
+
|
51
|
+
device_params = Nakal.default_crop_params[Nakal.device_name]
|
52
|
+
expected_rows = @screen.image.rows - device_params["top"] - device_params["bottom"]
|
53
|
+
expected_columns = @screen.image.columns - device_params["left"] - device_params["right"]
|
54
|
+
expect(@screen.strip.rows).to eq (expected_rows)
|
55
|
+
expect(@screen.strip.columns).to eq (expected_columns)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe "#save,#delete" do
|
60
|
+
it "can create,save and delete a screen using image object" do
|
61
|
+
Nakal.default_crop_params = {"samsung_galaxy_s3" => {"top" => 450, "right" => 180, "left" => 12, "bottom" => 15}}
|
62
|
+
image = @screen.strip
|
63
|
+
new_screen = Nakal::Android::Screen.new("new_home_screen", nil, image)
|
64
|
+
new_screen.save
|
65
|
+
expect(File.exist?('./spec/resources/droid/samsung_galaxy_s3/new_home_screen.png')).to eq true
|
66
|
+
new_screen.delete!
|
67
|
+
expect(File.exist?('./spec/resources/droid/samsung_galaxy_s3/new_home_screen.png')).to eq false
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "#compare" do
|
72
|
+
it "compares two screens" do
|
73
|
+
Nakal.default_crop_params = {"samsung_galaxy_s3" => {"top" => 50, "right" => 0, "left" => 0, "bottom" => 0}}
|
74
|
+
changed_screen = Nakal::Android::Screen.new("changed_home_screen", :load)
|
75
|
+
diff_screen, diff_metric = @screen.compare(changed_screen)
|
76
|
+
expect(diff_metric.round(6)).to eq 0.062555
|
77
|
+
expect(diff_screen).to be_an_instance_of Nakal::Android::Screen
|
78
|
+
expect(diff_screen.name).to eql "home_screen_diff"
|
79
|
+
diff_screen.save
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
after(:all) do
|
84
|
+
`rm -rf #{Nakal.image_location}/*.png`
|
85
|
+
end
|
86
|
+
end
|
Binary file
|
Binary file
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'pry'
|
2
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
3
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
4
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
5
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
6
|
+
# files.
|
7
|
+
#
|
8
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
9
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
10
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
11
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
12
|
+
# a separate helper file that requires the additional dependencies and performs
|
13
|
+
# the additional setup, and require it from the spec files that actually need
|
14
|
+
# it.
|
15
|
+
#
|
16
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
17
|
+
# users commonly want.
|
18
|
+
#
|
19
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
20
|
+
RSpec.configure do |config|
|
21
|
+
# rspec-expectations config goes here. You can use an alternate
|
22
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
23
|
+
# assertions if you prefer.
|
24
|
+
config.expect_with :rspec do |expectations|
|
25
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
26
|
+
# and `failure_message` of custom matchers include text for helper methods
|
27
|
+
# defined using `chain`, e.g.:
|
28
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
29
|
+
# # => "be bigger than 2 and smaller than 4"
|
30
|
+
# ...rather than:
|
31
|
+
# # => "be bigger than 2"
|
32
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
33
|
+
end
|
34
|
+
|
35
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
36
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
37
|
+
config.mock_with :rspec do |mocks|
|
38
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
39
|
+
# a real object. This is generally recommended, and will default to
|
40
|
+
# `true` in RSpec 4.
|
41
|
+
mocks.verify_partial_doubles = true
|
42
|
+
end
|
43
|
+
|
44
|
+
# The settings below are suggested to provide a good initial experience
|
45
|
+
# with RSpec, but feel free to customize to your heart's content.
|
46
|
+
=begin
|
47
|
+
# These two settings work together to allow you to limit a spec run
|
48
|
+
# to individual examples or groups you care about by tagging them with
|
49
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
50
|
+
# get run.
|
51
|
+
config.filter_run :focus
|
52
|
+
config.run_all_when_everything_filtered = true
|
53
|
+
|
54
|
+
# Allows RSpec to persist some state between runs in order to support
|
55
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
56
|
+
# you configure your source control system to ignore this file.
|
57
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
58
|
+
|
59
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
60
|
+
# recommended. For more details, see:
|
61
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
62
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
63
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
64
|
+
config.disable_monkey_patching!
|
65
|
+
|
66
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
67
|
+
# be too noisy due to issues in dependencies.
|
68
|
+
config.warnings = true
|
69
|
+
|
70
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
71
|
+
# file, and it's useful to allow more verbose output when running an
|
72
|
+
# individual spec file.
|
73
|
+
if config.files_to_run.one?
|
74
|
+
# Use the documentation formatter for detailed output,
|
75
|
+
# unless a formatter has already been configured
|
76
|
+
# (e.g. via a command-line flag).
|
77
|
+
config.default_formatter = 'doc'
|
78
|
+
end
|
79
|
+
|
80
|
+
# Print the 10 slowest examples and example groups at the
|
81
|
+
# end of the spec run, to help surface which specs are running
|
82
|
+
# particularly slow.
|
83
|
+
config.profile_examples = 10
|
84
|
+
|
85
|
+
# Run specs in random order to surface order dependencies. If you find an
|
86
|
+
# order dependency and want to debug it, you can fix the order by providing
|
87
|
+
# the seed, which is printed after each run.
|
88
|
+
# --seed 1234
|
89
|
+
config.order = :random
|
90
|
+
|
91
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
92
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
93
|
+
# test failures related to randomization by passing the same `--seed` value
|
94
|
+
# as the one that triggered the failure.
|
95
|
+
Kernel.srand config.seed
|
96
|
+
=end
|
97
|
+
end
|
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nakal
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rajdeep
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rmagick
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.15.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.15.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.5'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Visual regression testing of android and ios apps
|
70
|
+
email:
|
71
|
+
- mail.rajvarma@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- ".rvmrc"
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- lib/nakal.rb
|
84
|
+
- lib/nakal/android/adb.rb
|
85
|
+
- lib/nakal/android/screen.rb
|
86
|
+
- lib/nakal/base_screen.rb
|
87
|
+
- lib/nakal/cucumber.rb
|
88
|
+
- lib/nakal/dsl.rb
|
89
|
+
- lib/nakal/ios/screen.rb
|
90
|
+
- lib/nakal/version.rb
|
91
|
+
- nakal.gemspec
|
92
|
+
- spec/nakal/android/screen_spec.rb
|
93
|
+
- spec/resources/changed_home_screen.png
|
94
|
+
- spec/resources/home_screen.png
|
95
|
+
- spec/spec_helper.rb
|
96
|
+
homepage: https://github.com/rajdeepv/nakal
|
97
|
+
licenses:
|
98
|
+
- MIT
|
99
|
+
metadata: {}
|
100
|
+
post_install_message:
|
101
|
+
rdoc_options: []
|
102
|
+
require_paths:
|
103
|
+
- lib
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
requirements: []
|
115
|
+
rubyforge_project:
|
116
|
+
rubygems_version: 2.2.2
|
117
|
+
signing_key:
|
118
|
+
specification_version: 4
|
119
|
+
summary: Visual regression testing of android and ios apps
|
120
|
+
test_files:
|
121
|
+
- spec/nakal/android/screen_spec.rb
|
122
|
+
- spec/resources/changed_home_screen.png
|
123
|
+
- spec/resources/home_screen.png
|
124
|
+
- spec/spec_helper.rb
|
125
|
+
has_rdoc:
|