nakal 0.0.3 → 0.0.4
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 +4 -4
- data/README.md +17 -4
- data/lib/nakal/ios/screen.rb +3 -3
- data/lib/nakal/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57fb38e50fd2d1f8cff07e6326fd59ece40eecac
|
4
|
+
data.tar.gz: 575d91957f8cc24412853536b138259061074081
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
26
|
-
|
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
|
-
|
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
|
|
data/lib/nakal/ios/screen.rb
CHANGED
@@ -14,10 +14,10 @@ module Nakal
|
|
14
14
|
|
15
15
|
def capture
|
16
16
|
`#{CAPTURE_SCRIPT}`
|
17
|
-
sleep
|
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
|
-
|
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
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.
|
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-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|