nakal 0.0.2 → 0.0.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: ae2f95fd7f77548345f830f2648e3cc539d4e14c
4
- data.tar.gz: c376aa9408cd1742d7bfd0776cc5d9177ccab08f
3
+ metadata.gz: 349b5621c8020a4fc34861ab0bc1470e3dfee797
4
+ data.tar.gz: 104716ae574916807e8e2d2cc0a6fb3134046fde
5
5
  SHA512:
6
- metadata.gz: 6943f113f416613f5b58a79415bbfb289e7b53f0c66bd4eef4e519682bbaef8fd47f2e312ac9c302eca0f1b0a737e331632ca1173cfee70f8ace4b1f2eaa63b7
7
- data.tar.gz: f0c10353e4748936c40b132571ff6876d89c8aa452c8b11896378b8a75409c8045ca2534172f95a2ffb88bd4b23c667582e2edc73c001042722672d63714f162
6
+ metadata.gz: c19da8aee46ff92a2fc46506fda33b8a061c985899b8fcd53d4f1f97b99c04adfc937a15e28aab713ae8ec56b1d44c6ff872aaa8283d3e577a3fda0aee08f262
7
+ data.tar.gz: 162d379fda6bde1f8ee4a3951827c09e58bf19d1bf1c7383d83b35b7a67b2a6c47183d6c88ec1daabf144c89b263d65bd8a02b60313616557da49fbcf8c06601
data/README.md CHANGED
@@ -20,22 +20,19 @@ Or install it yourself as:
20
20
 
21
21
  If you are using cucumber, include following Lines in your env.rb
22
22
 
23
- require "nakal/cucumber"
23
+ require "nakal/cucumber"
24
+ Nakal.platform = :android
25
+ Nakal.directory= "<your_project_dir>/baseline_images/droid"
26
+ Nakal.device_name = "samsung_galaxy_s3"
24
27
 
25
- Nakal.platform = :android
28
+ and then put this line in your automation code, at all places where a new screen loads:
26
29
 
27
- Nakal.directory= "baseline_images/droid"
30
+ diff = nakal_execute("current_screen_name")
28
31
 
29
- Nakal.device_name = "samsung_galaxy_s3"
32
+ Now, execute your test by passing env variable NAKAL_MODE=build to build the baseline images
30
33
 
31
- and then put this line in your code where you want comparison to begin:
32
-
33
- diff = nakal_execute("current_screen_name")
34
-
35
-
36
- While executing first time, pass env variable NAKAL_MODE=build to build the baseline images
37
-
38
- once baseline is built, next execution onwards, start using environment variable NAKAL_MODE=compare to compare against baseline
34
+ once baseline is built, next execution onwards, start using environment variable NAKAL_MODE=compare to compare against baseline.
35
+ any difference will be put in the same directory with image file named "current_screen_name_diff.png"
39
36
 
40
37
 
41
38
  For cropping the notification bar OR scroll bar, create a config/nakal.yml file in execution directory
@@ -44,27 +41,25 @@ eg:
44
41
 
45
42
  put these contents in your nakal.yml file inside config/nakal.yml
46
43
 
47
- samsung_galaxy_s3:
48
-
49
- top: 50
50
-
51
- right: 18
52
-
53
- left: 0
54
-
55
- bottom: 0
56
-
57
- nexus7:
58
-
59
- top: 74
60
-
61
- right: 20
62
-
63
- left: 0
64
-
65
- bottom: 0
66
-
67
-
44
+ samsung_galaxy_s3:
45
+ top: 50
46
+ right: 18
47
+ left: 0
48
+ bottom: 0
49
+
50
+ nexus7:
51
+ top: 74
52
+ right: 20
53
+ left: 0
54
+ bottom: 0
55
+
56
+ iPhone_5s:
57
+ top: 30
58
+ right: 6
59
+ left: 0
60
+ bottom: 0
61
+
62
+
68
63
  ## Contributing
69
64
 
70
65
  1. Fork it ( http://github.com/<my-github-username>/nakal/fork )
data/lib/nakal.rb CHANGED
@@ -1,10 +1,12 @@
1
- require "nakal/version"
2
1
  require 'rmagick'
3
2
  require 'fileutils'
4
3
  require 'yaml'
4
+ require 'pry'
5
+ require_relative "nakal/version"
5
6
  require_relative 'nakal/base_screen'
6
7
  require_relative 'nakal/android/screen'
7
8
  require_relative 'nakal/ios/screen'
9
+ require_relative 'nakal/dsl'
8
10
 
9
11
  module Nakal
10
12
 
@@ -5,6 +5,7 @@ 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
8
9
  @name = file_name
9
10
  @image = image
10
11
  capture if mode.eql?(:capture)
data/lib/nakal/dsl.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'nakal'
1
+ require_relative '../nakal'
2
2
 
3
3
  module Nakal
4
4
  module DSL
@@ -29,7 +29,6 @@ module Nakal
29
29
 
30
30
  def nakal_execute image_name, params = {:delay => nil, :replace_baseline => false}
31
31
  return if ENV['NAKAL_MODE'].nil?
32
- Nakal.create_image_dir
33
32
  sleep params[:delay] unless params[:delay].nil?
34
33
  capture_screen(image_name) if (ENV['NAKAL_MODE'] == "build") || (params[:replace_baseline] == true)
35
34
  current_screen_vs_base_image(image_name) if ENV['NAKAL_MODE'] == "compare" && params[:replace_baseline] != true
data/lib/nakal/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nakal
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajdeep
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-25 00:00:00.000000000 Z
11
+ date: 2015-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick