nakal 0.0.3 → 0.0.4

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: 349b5621c8020a4fc34861ab0bc1470e3dfee797
4
- data.tar.gz: 104716ae574916807e8e2d2cc0a6fb3134046fde
3
+ metadata.gz: 57fb38e50fd2d1f8cff07e6326fd59ece40eecac
4
+ data.tar.gz: 575d91957f8cc24412853536b138259061074081
5
5
  SHA512:
6
- metadata.gz: c19da8aee46ff92a2fc46506fda33b8a061c985899b8fcd53d4f1f97b99c04adfc937a15e28aab713ae8ec56b1d44c6ff872aaa8283d3e577a3fda0aee08f262
7
- data.tar.gz: 162d379fda6bde1f8ee4a3951827c09e58bf19d1bf1c7383d83b35b7a67b2a6c47183d6c88ec1daabf144c89b263d65bd8a02b60313616557da49fbcf8c06601
6
+ metadata.gz: 204b21a725f2a03a87039162c4269b29876a8ef19082b82e160ed8dbe99f0a41ba25c8d26d6beede645b5a004e12fe81f967d546039c76847a84e9b87b20b7f4
7
+ data.tar.gz: bf954bffc84010a6f6bf2aa521620f015b4a4d03216044de6bc49dfee65c20a31ddcd871952ff266addf2b9dc35df4de70d99e6d51788daa27de7daa7cc581fd
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  Automated visual testing of Android/iOS applications
4
4
 
5
5
  ## Installation
6
+ You need to install [imagemagick](http://www.imagemagick.org/script/index.php) on your machine
6
7
 
7
8
  Add this line to your application's Gemfile:
8
9
 
@@ -22,18 +23,30 @@ If you are using cucumber, include following Lines in your env.rb
22
23
 
23
24
  require "nakal/cucumber"
24
25
  Nakal.platform = :android
25
- Nakal.directory= "<your_project_dir>/baseline_images/droid"
26
- Nakal.device_name = "samsung_galaxy_s3"
26
+
27
+ for ios, set:
28
+
29
+ Nakal.platform = :ios
30
+
27
31
 
28
32
  and then put this line in your automation code, at all places where a new screen loads:
29
33
 
30
- diff = nakal_execute("current_screen_name")
34
+ diff_metric = nakal_execute("current_screen_name")
31
35
 
32
- Now, execute your test by passing env variable NAKAL_MODE=build to build the baseline images
36
+ Now, execute your test by passing env variable NAKAL_MODE=build to build the baseline images. All baseline images will be stored in baseline_images folder in current directory
33
37
 
34
38
  once baseline is built, next execution onwards, start using environment variable NAKAL_MODE=compare to compare against baseline.
35
39
  any difference will be put in the same directory with image file named "current_screen_name_diff.png"
36
40
 
41
+ ## Important
42
+
43
+ * This works best when your tests are running against mocked data
44
+ * If test data keeps changing for each test, use diff_metric (output of nakal_execute method above) to determine if the change is acceptable.
45
+
46
+ For setting custom directory, use:
47
+
48
+ Nakal.directory= "<desired_directory>"
49
+ Nakal.device_name = "nexus7"
37
50
 
38
51
  For cropping the notification bar OR scroll bar, create a config/nakal.yml file in execution directory
39
52
 
@@ -14,10 +14,10 @@ module Nakal
14
14
 
15
15
  def capture
16
16
  `#{CAPTURE_SCRIPT}`
17
- sleep 0.5
17
+ sleep 1
18
+ Dir.glob(File.expand_path('~/Desktop/iOS\\ Simulator\\ Screen\\ Shot - Apple\\ Watch*')).each{|f| FileUtils.rm(f)}
18
19
  latest_file = Dir.glob(File.expand_path('~/Desktop/iOS\\ Simulator\\ Screen\\ Shot*')).max_by { |f| File.mtime(f) }
19
- `mv #{Shellwords.shellescape(latest_file)} #{Nakal.image_location}`
20
- `mv #{Nakal.image_location}/iOS\\ Simulator\\ Screen\\ Shot* #{Nakal.image_location}/#{@name}.png`
20
+ File.rename(latest_file,"#{Nakal.image_location}/#{@name}.png")
21
21
  end
22
22
 
23
23
  end
data/lib/nakal/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nakal
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
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.3
4
+ version: 0.0.4
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-01 00:00:00.000000000 Z
11
+ date: 2015-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick