isa 1.0.0 → 1.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 +4 -4
- data/LICENSE +21 -0
- data/README.md +65 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f48456a28ed03e4a3e7d59f0650e5c526ae0d198
|
4
|
+
data.tar.gz: 131762bcb5e0125aaa482735183e060676bac776
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a1e6f81330cf525b6321178d3952f361769c4c8e5dc524d8ff64c5bd927e2cffe7b5016ed5c7291a38970012570419303befd06b68a0489a73f249475932dc
|
7
|
+
data.tar.gz: f87f6c24fcd76230d38d058788f6d8614920656c65c12e43ec800ae42ca3bb84111dc0ee68dd3553873dff0c378d2444a225a7704552686ab9075a72935b9e78
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 BBC
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
#ISA -- Image Session Analyzer
|
2
|
+
|
3
|
+
Helpers for grabbing screenshots over a time period, analyzing them, and
|
4
|
+
stitching them together for later playback.
|
5
|
+
|
6
|
+
We largely use ISA for checking video playback on our device tests.
|
7
|
+
|
8
|
+
## Why would you use it?
|
9
|
+
|
10
|
+
We run a lot of tests that capture screenshots. Often we'll take several
|
11
|
+
screenshots over the duration of a test and we wanted some way of comparing
|
12
|
+
the captures over the test run in order to determine if video playback is
|
13
|
+
working.
|
14
|
+
|
15
|
+
ISA performs a diff between screenshots and returns an integer representing
|
16
|
+
the amount of change between screenshots. A value of zero indicates the
|
17
|
+
screenshots are identical. Wheras a value in the thousands indicates a large
|
18
|
+
differential between the images. We find this diff technique gives us a
|
19
|
+
good indication that video is playing in our tests, and will also spot
|
20
|
+
buffering problems and crashes (the diff value drops significantly).
|
21
|
+
|
22
|
+
ISA also stitches together the screenshots its taken over a session to create
|
23
|
+
an animated gif that is a handy reference for checking why a particular test
|
24
|
+
failed.
|
25
|
+
|
26
|
+
## Dependencies
|
27
|
+
|
28
|
+
The gem is very simple and doesn't do any capture itself -- you'll need to
|
29
|
+
have some mechanism for doing that yourself. We use the device_api gem for
|
30
|
+
grabbing screenshots from physical android and ios devices.
|
31
|
+
|
32
|
+
The gem uses [ImageMagick](http://www.imagemagick.org/) to perform the
|
33
|
+
screenshot comparisons -- you will need to install this dependency first.
|
34
|
+
|
35
|
+
## Usage example
|
36
|
+
|
37
|
+
You first need to define a lambda for creating a screenshot. For example,
|
38
|
+
using the device_api we might do:
|
39
|
+
|
40
|
+
take_screenshot = ->(filename) {
|
41
|
+
device.screenshot(:filename => filename)
|
42
|
+
}
|
43
|
+
|
44
|
+
You can then use that lambda with ISA to establish a capture session,
|
45
|
+
giving it a directory where you want the screen shots.
|
46
|
+
|
47
|
+
session = ISA::Session.new( :name => 'test-01', :capture => take_screenshot, :dir => 'captures' )
|
48
|
+
|
49
|
+
# Call capture for the initial screenshot
|
50
|
+
frame = session.capture
|
51
|
+
|
52
|
+
# session.diff performs a screenshot and does the diff
|
53
|
+
10.times do
|
54
|
+
puts session.diff
|
55
|
+
end
|
56
|
+
|
57
|
+
# Finish the session and create the composite
|
58
|
+
file = session.end( './composite.gif' )
|
59
|
+
|
60
|
+
## License
|
61
|
+
|
62
|
+
ISA is available to everyone under the terms of the MIT open source licence. Take a look at the LICENSE file in the code.
|
63
|
+
|
64
|
+
Copyright (c) 2015 BBC
|
65
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Buckhurst
|
@@ -30,6 +30,8 @@ executables: []
|
|
30
30
|
extensions: []
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
|
+
- LICENSE
|
34
|
+
- README.md
|
33
35
|
- lib/isa/session.rb
|
34
36
|
homepage: https://github.com/bbc-test/isa
|
35
37
|
licenses:
|
@@ -51,8 +53,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
53
|
version: '0'
|
52
54
|
requirements: []
|
53
55
|
rubyforge_project:
|
54
|
-
rubygems_version: 2.
|
56
|
+
rubygems_version: 2.4.5
|
55
57
|
signing_key:
|
56
58
|
specification_version: 4
|
57
59
|
summary: Image Session Analyzer
|
58
60
|
test_files: []
|
61
|
+
has_rdoc:
|