nakal 0.0.5 → 0.0.6

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: 603f8e5e57e5fc787158a15f759094694bf42bf2
4
- data.tar.gz: 4c0fefbe3e9c609c241be9b4e2a1def0bf7df7a7
3
+ metadata.gz: 0a01cc7bd79b9ac7512ae4f2c008e2d8556c345c
4
+ data.tar.gz: 05f9d78a964c8f761f3e4f416bccf341d98ce75f
5
5
  SHA512:
6
- metadata.gz: 3a8ee79783ec53479625b944931d7c4671dd3ad98322a6c078e00df1daa835ca05abd55ace2e3080026b05b2835ca69f4116f293057040fbbcd219e9ec81125b
7
- data.tar.gz: eb38fe37a9221967f2211808787cdab87c8fc52526aac0d7a3ed9da04b09f2715d1c4bbdc2d9359f39bed97595932284e03065066a23eea5b9ff5929ac194e52
6
+ metadata.gz: 5318227b7de689716fe438e90f2819ddd166bacb0fd81291aa4773aad87cfd2ea32edd01f8c8285cbc1759a808e2b71fb2ae958932b60582eb03a2c7e263f0fc
7
+ data.tar.gz: 75bcbc15f5b663026af2e52abbd75bfa23bc5c4e8f91c7b156a57f4f7721a79e36f71815cdf7c41465489ba66810f98dcd04de3dc1e1630bf45e7a0e2ffc7708
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Nakal
2
2
 
3
- Automated visual testing of Android/iOS applications
3
+ Automated visual testing of Android/iOS applications.
4
+
5
+ Nakal is used to add visual validations in your existing test framework (using appium or calabash etc).
4
6
 
5
7
  ## Installation
6
8
  You need to install [imagemagick](http://www.imagemagick.org/script/index.php) on your machine
data/lib/nakal.rb CHANGED
@@ -11,19 +11,16 @@ require_relative 'nakal/dsl'
11
11
  module Nakal
12
12
 
13
13
  class<<self
14
- attr_accessor :device_name, :directory, :platform, :image_location, :img_dir_created, :default_crop_params
14
+ attr_accessor :device_name, :directory, :platform, :image_location, :default_crop_params
15
15
  attr_accessor :diff_screens, :embed_screenshot, :timeout
16
16
 
17
17
  def configure
18
18
  yield self
19
19
  end
20
20
 
21
- def create_image_dir
22
- unless @img_dir_created
23
- @image_location ||= "#{@directory}/#{@device_name}"
24
- FileUtils.mkdir_p @image_location unless File.directory?(@image_location)
25
- @img_dir_created =true
26
- end
21
+ def create_image_dir dir
22
+ @image_location = "#{@directory}/#{@device_name}/#{dir}"
23
+ FileUtils.mkdir_p @image_location unless File.directory?(@image_location)
27
24
  end
28
25
 
29
26
  def current_platform
@@ -5,7 +5,6 @@ module Nakal
5
5
  attr_accessor :image, :name
6
6
 
7
7
  def initialize file_name, mode = :load, image = nil
8
- Nakal.create_image_dir
9
8
  @name = file_name
10
9
  @image = image
11
10
  capture if mode.eql?(:capture)
data/lib/nakal/dsl.rb CHANGED
@@ -37,11 +37,13 @@ module Nakal
37
37
  Nakal.current_platform::Screen.new(image_name, :capture)
38
38
  end
39
39
 
40
- def nakal_execute image_name, params = {:delay => nil, :replace_baseline => false}
40
+ def nakal_execute relative_location, params = {:delay => nil, :replace_baseline => false}
41
41
  return if ENV['NAKAL_MODE'].nil?
42
+ Nakal.create_image_dir File.dirname(relative_location)
43
+ screen_name = File.basename(relative_location)
42
44
  sleep params[:delay] unless params[:delay].nil?
43
- capture_screen(image_name) if (ENV['NAKAL_MODE'] == "build") || (params[:replace_baseline] == true)
44
- current_screen_vs_base_image(image_name) if ENV['NAKAL_MODE'] == "compare" && params[:replace_baseline] != true
45
+ capture_screen(screen_name) if (ENV['NAKAL_MODE'] == "build") || (params[:replace_baseline] == true)
46
+ current_screen_vs_base_image(screen_name) if ENV['NAKAL_MODE'] == "compare" && params[:replace_baseline] != true
45
47
  end
46
48
  end
47
49
 
data/lib/nakal/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nakal
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/nakal.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Nakal::VERSION
9
9
  spec.authors = ["Rajdeep"]
10
10
  spec.email = ["mail.rajvarma@gmail.com"]
11
- spec.summary = "Visual regression testing of android and ios apps"
11
+ spec.summary = "Automated visual regression testing of android and ios apps with appoum/calabash or any other tool"
12
12
  spec.description = spec.summary
13
13
  spec.homepage = "https://github.com/rajdeepv/nakal"
14
14
  spec.license = "MIT"
@@ -5,7 +5,7 @@ require 'nakal'
5
5
  Nakal.platform = :android
6
6
  Nakal.directory= "spec/resources/droid"
7
7
  Nakal.device_name = "samsung_galaxy_s3"
8
- Nakal.create_image_dir
8
+ Nakal.create_image_dir "xx"
9
9
 
10
10
  module Nakal::Android
11
11
  class Screen
@@ -62,9 +62,9 @@ describe Nakal::Android::Screen do
62
62
  image = @screen.strip
63
63
  new_screen = Nakal::Android::Screen.new("new_home_screen", nil, image)
64
64
  new_screen.save
65
- expect(File.exist?('./spec/resources/droid/samsung_galaxy_s3/new_home_screen.png')).to eq true
65
+ expect(File.exist?("#{Nakal.image_location}/new_home_screen.png")).to eq true
66
66
  new_screen.delete!
67
- expect(File.exist?('./spec/resources/droid/samsung_galaxy_s3/new_home_screen.png')).to eq false
67
+ expect(File.exist?("#{Nakal.image_location}/new_home_screen.png")).to eq false
68
68
  end
69
69
  end
70
70
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nakal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajdeep
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-16 00:00:00.000000000 Z
11
+ date: 2015-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick
@@ -66,7 +66,8 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: Visual regression testing of android and ios apps
69
+ description: Automated visual regression testing of android and ios apps with appoum/calabash
70
+ or any other tool
70
71
  email:
71
72
  - mail.rajvarma@gmail.com
72
73
  executables: []
@@ -116,7 +117,8 @@ rubyforge_project:
116
117
  rubygems_version: 2.2.2
117
118
  signing_key:
118
119
  specification_version: 4
119
- summary: Visual regression testing of android and ios apps
120
+ summary: Automated visual regression testing of android and ios apps with appoum/calabash
121
+ or any other tool
120
122
  test_files:
121
123
  - spec/nakal/android/screen_spec.rb
122
124
  - spec/resources/changed_home_screen.png