chromedriver-screenshot 0.1.0
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 +7 -0
- data/.gitignore +35 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +17 -0
- data/chromedriver-screenshot.gemspec +21 -0
- data/lib/chromedriver-screenshot.rb +25 -0
- data/lib/chromedriver-screenshot/page.rb +44 -0
- data/lib/chromedriver-screenshot/platforms.rb +50 -0
- data/lib/chromedriver-screenshot/row.rb +51 -0
- data/lib/chromedriver-screenshot/tile.rb +41 -0
- data/lib/chromedriver-screenshot/version.rb +3 -0
- data/spec/chromedriver-screenshot/page_spec.rb +49 -0
- data/spec/chromedriver-screenshot/tile_spec.rb +56 -0
- data/spec/spec_helper.rb +94 -0
- data/spec/support/fixtures/cropped_smiley_face.png +0 -0
- data/spec/support/fixtures/offset_cropped_smiley_face.png +0 -0
- data/spec/support/fixtures/offset_smiley_face.png +0 -0
- data/spec/support/fixtures/smiley_face.png +0 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e8949dcc7abef43f974d2e8dd41c40bef9de894c
|
4
|
+
data.tar.gz: 6dad23dcb2761771d2d2521a6f473c8773102e19
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b652922889a53a17ac7af928a5856fdf6e59057789bf0e9f2a5537e1f7afb52c2bd821a946dbd0699517d6936ca548c162098fb2b98a43d389cc0afab493ed7b
|
7
|
+
data.tar.gz: 3e0253c1cc6cc8812424031ef05cad4b86b26bc40279c5fdc3753b6a8a5c64230c60ed0705c70d0194829b979e8cac9a01e911af200a21264a1e603466d84f12
|
data/.gitignore
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/test/tmp/
|
9
|
+
/test/version_tmp/
|
10
|
+
/tmp/
|
11
|
+
|
12
|
+
## Specific to RubyMotion:
|
13
|
+
.dat*
|
14
|
+
.repl_history
|
15
|
+
build/
|
16
|
+
|
17
|
+
## Documentation cache and generated files:
|
18
|
+
/.yardoc/
|
19
|
+
/_yardoc/
|
20
|
+
/doc/
|
21
|
+
/rdoc/
|
22
|
+
|
23
|
+
## Environment normalisation:
|
24
|
+
/.bundle/
|
25
|
+
/vendor/bundle
|
26
|
+
/lib/bundler/man/
|
27
|
+
|
28
|
+
# for a library or gem, you might want to ignore these files since the code is
|
29
|
+
# intended to run in multiple environments; otherwise, check them in:
|
30
|
+
# Gemfile.lock
|
31
|
+
# .ruby-version
|
32
|
+
# .ruby-gemset
|
33
|
+
|
34
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
35
|
+
.rvmrc
|
data/.rspec
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Sean MacGahan
|
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.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# chromedriver-screenshot
|
2
|
+
Full page screenshots for Chrome in Selenium WebDriver
|
3
|
+
|
4
|
+
# Usage
|
5
|
+
Simply require the gem after requiring selenium-webdriver or any dependent DSL (ex. watir)
|
6
|
+
chromedriver-screenshot will snip the page into separate sections, take screenshots of each individual section, and then stitch them together to create a screenshot of the page in its entirety.
|
7
|
+
|
8
|
+
# Known issues:
|
9
|
+
0. Screenshots on Retina displays quadruple in size because Apple is a piece of shit. As a result, screenshots are cropped incorrectly.
|
10
|
+
|
11
|
+
# TODO:
|
12
|
+
0. Better inheritance/monkeypatching
|
13
|
+
0. Find a solution to the Retina bullshit
|
14
|
+
0. Refactor singleton platforms class
|
15
|
+
0. Refactor ChunkyPNG method
|
16
|
+
0. Add e2e tests
|
17
|
+
0. Finish unit tests
|
@@ -0,0 +1,21 @@
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
2
|
+
require "chromedriver-screenshot/version"
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "chromedriver-screenshot"
|
6
|
+
s.version = ChromedriverScreenshot::VERSION
|
7
|
+
s.authors = "Sean MacGahan"
|
8
|
+
s.email = "smacgaha@gmail.com"
|
9
|
+
s.homepage = "http://github.com/smacgaha/chromedriver-screenshot"
|
10
|
+
s.summary = "Full-page screenshots for Chromedriver"
|
11
|
+
s.description = "Full-page screenshots for Chrome in Selenium WebDriver"
|
12
|
+
s.license = "MIT"
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- spec/*`.split("\n")
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
|
18
|
+
s.add_dependency "oily_png", "~> 1.2"
|
19
|
+
|
20
|
+
s.add_development_dependency "rspec", "~> 3.2"
|
21
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'chromedriver-screenshot/page'
|
2
|
+
require 'chromedriver-screenshot/row'
|
3
|
+
require 'chromedriver-screenshot/tile'
|
4
|
+
require 'chromedriver-screenshot/platforms'
|
5
|
+
require "oily_png"
|
6
|
+
|
7
|
+
# really bad monkeypatching. fix this.
|
8
|
+
module Selenium
|
9
|
+
module WebDriver
|
10
|
+
module Remote
|
11
|
+
class Bridge
|
12
|
+
alias_method :window_screenshot, :getScreenshot
|
13
|
+
def getScreenshot
|
14
|
+
if browser == :chrome
|
15
|
+
ChromedriverScreenshot::Platforms.create_platform(self)
|
16
|
+
page = ChromedriverScreenshot::Page.new
|
17
|
+
page.full_screenshot
|
18
|
+
else
|
19
|
+
window_screenshot
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module ChromedriverScreenshot
|
2
|
+
class Page
|
3
|
+
def initialize
|
4
|
+
bounds = row_boundaries
|
5
|
+
@rows = Row.from_boundaries(bounds)
|
6
|
+
end
|
7
|
+
|
8
|
+
def full_screenshot
|
9
|
+
rows = @rows.map { |row| row.screenshot }
|
10
|
+
page_height = rows.inject(0) do |height, row|
|
11
|
+
height += row.height
|
12
|
+
end
|
13
|
+
page_width = rows.first.width # assume all rows have same width
|
14
|
+
screenshot = ChunkyPNG::Image.new(page_width, page_height)
|
15
|
+
|
16
|
+
image_row = 0
|
17
|
+
rows.each do |row|
|
18
|
+
row_height = row.height - 1
|
19
|
+
(0..row.height - 1).each do |row_y|
|
20
|
+
new_image_row = row.row(row_y)
|
21
|
+
screenshot.replace_row!(image_row + row_y, new_image_row)
|
22
|
+
end
|
23
|
+
image_row += row.height
|
24
|
+
end
|
25
|
+
|
26
|
+
Base64::encode64(screenshot.to_blob)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def row_boundaries
|
32
|
+
row_boundary_ary = []
|
33
|
+
|
34
|
+
platform = ChromedriverScreenshot::Platforms.platform
|
35
|
+
|
36
|
+
new_boundary = platform.window_height
|
37
|
+
while new_boundary < platform.page_height
|
38
|
+
row_boundary_ary << new_boundary
|
39
|
+
new_boundary += platform.window_height
|
40
|
+
end
|
41
|
+
row_boundary_ary << platform.page_height
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module ChromedriverScreenshot
|
2
|
+
class Platforms
|
3
|
+
def self.platform
|
4
|
+
@platform
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.create_platform(bridge)
|
8
|
+
@platform = new(bridge)
|
9
|
+
end
|
10
|
+
|
11
|
+
def page_width
|
12
|
+
@page_width ||= @bridge.executeScript("return document.body.scrollWidth")
|
13
|
+
end
|
14
|
+
|
15
|
+
def page_height
|
16
|
+
@page_height ||= @bridge.executeScript("return document.body.scrollHeight")
|
17
|
+
end
|
18
|
+
|
19
|
+
def window_width
|
20
|
+
@window_width ||= @bridge.executeScript("return window.innerWidth")
|
21
|
+
end
|
22
|
+
|
23
|
+
def window_height
|
24
|
+
@window_height ||= @bridge.executeScript("return window.innerHeight")
|
25
|
+
end
|
26
|
+
|
27
|
+
def window_x
|
28
|
+
@bridge.executeScript("return window.scrollX")
|
29
|
+
end
|
30
|
+
|
31
|
+
def window_y
|
32
|
+
@bridge.executeScript("return window.scrollY")
|
33
|
+
end
|
34
|
+
|
35
|
+
def screenshot
|
36
|
+
@bridge.window_screenshot.unpack("m")[0]
|
37
|
+
end
|
38
|
+
|
39
|
+
def scroll_to(x, y)
|
40
|
+
@bridge.executeScript("window.scrollTo(#{x}, #{y})")
|
41
|
+
sleep 1 # don't know why this is necessary
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def initialize(bridge)
|
47
|
+
@bridge = bridge
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module ChromedriverScreenshot
|
2
|
+
class Row
|
3
|
+
def self.from_boundaries(boundaries)
|
4
|
+
row_ary = []
|
5
|
+
boundaries.inject(0) do |row_top, row_bottom|
|
6
|
+
row_ary << new(row_top, row_bottom)
|
7
|
+
row_bottom
|
8
|
+
end
|
9
|
+
row_ary
|
10
|
+
end
|
11
|
+
|
12
|
+
def screenshot
|
13
|
+
tiles = @tiles.map { |tile| tile.screenshot }
|
14
|
+
|
15
|
+
row_width = tiles.inject(0) do |width, tile|
|
16
|
+
width += tile.width
|
17
|
+
end
|
18
|
+
row_height = tiles.first.height # assume all tiles have same height
|
19
|
+
screenshot = ChunkyPNG::Image.new(row_width, row_height)
|
20
|
+
|
21
|
+
(1..row_height).each do |row|
|
22
|
+
new_row = tiles.inject([]) do |concatenated_row, tile|
|
23
|
+
concatenated_row += tile.row(row - 1)
|
24
|
+
end
|
25
|
+
screenshot.replace_row!(row - 1, new_row)
|
26
|
+
end
|
27
|
+
|
28
|
+
screenshot
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def initialize(row_top, row_bottom)
|
34
|
+
bounds = column_boundaries
|
35
|
+
@tiles = Tile.from_boundaries(row_top, row_bottom, column_boundaries)
|
36
|
+
end
|
37
|
+
|
38
|
+
def column_boundaries
|
39
|
+
column_boundary_ary = []
|
40
|
+
|
41
|
+
platform = ChromedriverScreenshot::Platforms.platform
|
42
|
+
|
43
|
+
new_boundary = platform.window_width
|
44
|
+
while new_boundary < platform.window_width
|
45
|
+
column_boundary_ary << new_boundary
|
46
|
+
new_boundary += platform.window_width
|
47
|
+
end
|
48
|
+
column_boundary_ary << platform.page_width
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module ChromedriverScreenshot
|
2
|
+
class Tile
|
3
|
+
def self.from_boundaries(row_top, row_bottom, boundaries)
|
4
|
+
tile_ary = []
|
5
|
+
boundaries.inject(0) do |column_left, column_right|
|
6
|
+
tile_ary << new([column_left, row_top], [column_right, row_bottom])
|
7
|
+
column_right
|
8
|
+
end
|
9
|
+
tile_ary
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize(top_left, bot_right)
|
13
|
+
@x, @y = top_left
|
14
|
+
@width = bot_right[0] - @x
|
15
|
+
@height = bot_right[1] - @y
|
16
|
+
end
|
17
|
+
|
18
|
+
def screenshot
|
19
|
+
screenshot_blob = get_screenshot
|
20
|
+
offset_x, offset_y = get_offset
|
21
|
+
screenshot = ChunkyPNG::Image.from_blob(screenshot_blob)
|
22
|
+
screenshot.crop(offset_x, offset_y, @width, @height)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def get_screenshot
|
28
|
+
platform = ChromedriverScreenshot::Platforms.platform
|
29
|
+
platform.scroll_to @x, @y
|
30
|
+
platform.screenshot
|
31
|
+
end
|
32
|
+
|
33
|
+
# can't scroll past ends of page, so sometimes position won't be accurate
|
34
|
+
def get_offset
|
35
|
+
platform = ChromedriverScreenshot::Platforms.platform
|
36
|
+
offset_x = @x - platform.window_x
|
37
|
+
offset_y = @y - platform.window_y
|
38
|
+
[offset_x, offset_y]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ChromedriverScreenshot::Page do
|
4
|
+
context "#initialize" do
|
5
|
+
subject { ChromedriverScreenshot::Page.new }
|
6
|
+
|
7
|
+
before(:example) do
|
8
|
+
platform = double("platform", page_height: 100, window_height: window_height)
|
9
|
+
allow(ChromedriverScreenshot::Platforms).to receive(:platform).and_return(platform)
|
10
|
+
expect(ChromedriverScreenshot::Row).to receive(:from_boundaries).with(expected_ary)
|
11
|
+
end
|
12
|
+
|
13
|
+
context "page height is a multiple of window height" do
|
14
|
+
let(:window_height) { 20 }
|
15
|
+
let(:expected_ary) { [20, 40, 60, 80, 100] }
|
16
|
+
|
17
|
+
it "returns even boundaries" do
|
18
|
+
subject
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context "page height is not a multiple of window height" do
|
23
|
+
let(:window_height) { 30 }
|
24
|
+
let(:expected_ary) { [30, 60, 90, 100] }
|
25
|
+
|
26
|
+
it "returns partial boundaries" do
|
27
|
+
subject
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context "page height is equal to window height" do
|
32
|
+
let(:window_height) { 100 }
|
33
|
+
let(:expected_ary) { [100] }
|
34
|
+
|
35
|
+
it "returns single even boundary" do
|
36
|
+
subject
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "page height is smaller than window height" do
|
41
|
+
let(:window_height) { 200 }
|
42
|
+
let(:expected_ary) { [100] }
|
43
|
+
|
44
|
+
it "returns single partial boundary" do
|
45
|
+
subject
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ChromedriverScreenshot::Tile do
|
4
|
+
context "#screenshot" do
|
5
|
+
subject { new_tile.screenshot }
|
6
|
+
before(:each) do
|
7
|
+
image_blob = ChunkyPNG::Image.from_file("spec/support/fixtures/smiley_face.png").to_blob
|
8
|
+
allow_any_instance_of(described_class).to receive(:get_screenshot).and_return(image_blob)
|
9
|
+
allow_any_instance_of(described_class).to receive(:get_offset).and_return(offset)
|
10
|
+
end
|
11
|
+
|
12
|
+
context "window without offset" do
|
13
|
+
let(:offset) { [0, 0] }
|
14
|
+
|
15
|
+
context "full screen shot" do
|
16
|
+
let(:new_tile) { described_class.new([0, 0], [180, 180]) }
|
17
|
+
|
18
|
+
it "isn't cropped" do
|
19
|
+
expected = ChunkyPNG::Image.from_file("spec/support/fixtures/smiley_face.png")
|
20
|
+
expect(subject <=> expected).to be 0
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context "partial screenshot" do
|
25
|
+
let(:new_tile) { described_class.new([0, 0], [120, 90]) }
|
26
|
+
|
27
|
+
it "is cropped" do
|
28
|
+
expected = ChunkyPNG::Image.from_file("spec/support/fixtures/cropped_smiley_face.png")
|
29
|
+
expect(subject <=> expected).to be 0
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context "window with offset" do
|
35
|
+
let(:offset) { [20, 40] }
|
36
|
+
|
37
|
+
context "full screenshot" do
|
38
|
+
let(:new_tile) { described_class.new([0, 0], [160, 140]) }
|
39
|
+
|
40
|
+
it "is cropped" do
|
41
|
+
expected = ChunkyPNG::Image.from_file("spec/support/fixtures/offset_smiley_face.png")
|
42
|
+
expect(subject <=> expected).to be 0
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context "partial screenshot" do
|
47
|
+
let(:new_tile) { described_class.new([0, 0], [120, 90]) }
|
48
|
+
|
49
|
+
it "is cropped" do
|
50
|
+
expected = ChunkyPNG::Image.from_file("spec/support/fixtures/offset_cropped_smiley_face.png")
|
51
|
+
expect(subject <=> expected).to be 0
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
require "selenium-webdriver" # result of bad monkeypatching
|
2
|
+
require_relative "../lib/chromedriver-screenshot"
|
3
|
+
|
4
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
5
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
6
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
7
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
8
|
+
# files.
|
9
|
+
#
|
10
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
11
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
12
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
13
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
14
|
+
# a separate helper file that requires the additional dependencies and performs
|
15
|
+
# the additional setup, and require it from the spec files that actually need
|
16
|
+
# it.
|
17
|
+
#
|
18
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
19
|
+
# users commonly want.
|
20
|
+
#
|
21
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
22
|
+
RSpec.configure do |config|
|
23
|
+
# rspec-expectations config goes here. You can use an alternate
|
24
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
25
|
+
# assertions if you prefer.
|
26
|
+
config.expect_with :rspec do |expectations|
|
27
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
28
|
+
# and `failure_message` of custom matchers include text for helper methods
|
29
|
+
# defined using `chain`, e.g.:
|
30
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
31
|
+
# # => "be bigger than 2 and smaller than 4"
|
32
|
+
# ...rather than:
|
33
|
+
# # => "be bigger than 2"
|
34
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
35
|
+
end
|
36
|
+
|
37
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
38
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
39
|
+
config.mock_with :rspec do |mocks|
|
40
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
41
|
+
# a real object. This is generally recommended, and will default to
|
42
|
+
# `true` in RSpec 4.
|
43
|
+
mocks.verify_partial_doubles = true
|
44
|
+
end
|
45
|
+
|
46
|
+
# The settings below are suggested to provide a good initial experience
|
47
|
+
# with RSpec, but feel free to customize to your heart's content.
|
48
|
+
=begin
|
49
|
+
# These two settings work together to allow you to limit a spec run
|
50
|
+
# to individual examples or groups you care about by tagging them with
|
51
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
52
|
+
# get run.
|
53
|
+
config.filter_run :focus
|
54
|
+
config.run_all_when_everything_filtered = true
|
55
|
+
|
56
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
57
|
+
# recommended. For more details, see:
|
58
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
59
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
60
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
61
|
+
config.disable_monkey_patching!
|
62
|
+
|
63
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
64
|
+
# be too noisy due to issues in dependencies.
|
65
|
+
config.warnings = true
|
66
|
+
|
67
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
68
|
+
# file, and it's useful to allow more verbose output when running an
|
69
|
+
# individual spec file.
|
70
|
+
if config.files_to_run.one?
|
71
|
+
# Use the documentation formatter for detailed output,
|
72
|
+
# unless a formatter has already been configured
|
73
|
+
# (e.g. via a command-line flag).
|
74
|
+
config.default_formatter = 'doc'
|
75
|
+
end
|
76
|
+
|
77
|
+
# Print the 10 slowest examples and example groups at the
|
78
|
+
# end of the spec run, to help surface which specs are running
|
79
|
+
# particularly slow.
|
80
|
+
config.profile_examples = 10
|
81
|
+
|
82
|
+
# Run specs in random order to surface order dependencies. If you find an
|
83
|
+
# order dependency and want to debug it, you can fix the order by providing
|
84
|
+
# the seed, which is printed after each run.
|
85
|
+
# --seed 1234
|
86
|
+
config.order = :random
|
87
|
+
|
88
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
89
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
90
|
+
# test failures related to randomization by passing the same `--seed` value
|
91
|
+
# as the one that triggered the failure.
|
92
|
+
Kernel.srand config.seed
|
93
|
+
=end
|
94
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: chromedriver-screenshot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sean MacGahan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: oily_png
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.2'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.2'
|
41
|
+
description: Full-page screenshots for Chrome in Selenium WebDriver
|
42
|
+
email: smacgaha@gmail.com
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- ".gitignore"
|
48
|
+
- ".rspec"
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE
|
51
|
+
- README.md
|
52
|
+
- chromedriver-screenshot.gemspec
|
53
|
+
- lib/chromedriver-screenshot.rb
|
54
|
+
- lib/chromedriver-screenshot/page.rb
|
55
|
+
- lib/chromedriver-screenshot/platforms.rb
|
56
|
+
- lib/chromedriver-screenshot/row.rb
|
57
|
+
- lib/chromedriver-screenshot/tile.rb
|
58
|
+
- lib/chromedriver-screenshot/version.rb
|
59
|
+
- spec/chromedriver-screenshot/page_spec.rb
|
60
|
+
- spec/chromedriver-screenshot/tile_spec.rb
|
61
|
+
- spec/spec_helper.rb
|
62
|
+
- spec/support/fixtures/cropped_smiley_face.png
|
63
|
+
- spec/support/fixtures/offset_cropped_smiley_face.png
|
64
|
+
- spec/support/fixtures/offset_smiley_face.png
|
65
|
+
- spec/support/fixtures/smiley_face.png
|
66
|
+
homepage: http://github.com/smacgaha/chromedriver-screenshot
|
67
|
+
licenses:
|
68
|
+
- MIT
|
69
|
+
metadata: {}
|
70
|
+
post_install_message:
|
71
|
+
rdoc_options: []
|
72
|
+
require_paths:
|
73
|
+
- lib
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
requirements: []
|
85
|
+
rubyforge_project:
|
86
|
+
rubygems_version: 2.4.6
|
87
|
+
signing_key:
|
88
|
+
specification_version: 4
|
89
|
+
summary: Full-page screenshots for Chromedriver
|
90
|
+
test_files:
|
91
|
+
- spec/chromedriver-screenshot/page_spec.rb
|
92
|
+
- spec/chromedriver-screenshot/tile_spec.rb
|
93
|
+
- spec/spec_helper.rb
|
94
|
+
- spec/support/fixtures/cropped_smiley_face.png
|
95
|
+
- spec/support/fixtures/offset_cropped_smiley_face.png
|
96
|
+
- spec/support/fixtures/offset_smiley_face.png
|
97
|
+
- spec/support/fixtures/smiley_face.png
|