Skip to content

Commit

Permalink
Merge pull request #2 from shmargum/chromedriver-travis
Browse files Browse the repository at this point in the history
Chromedriver travis
  • Loading branch information
shmargum committed Oct 31, 2017
2 parents 0d56640 + afe6948 commit 6face53
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.3
2.4.1
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
sudo: false
addons:
chrome: stable
apt:
packages:
- google-chrome-stable

language: ruby
rvm:
- 2.3.3
before_install:
- gem update
- gem --version
script: bundle exec rspec
- 2.4.1
script:
- bundle exec rspec
notifications:
email:
recipients:
Expand Down
1 change: 1 addition & 0 deletions lib/wraith/save_images.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def get_driver
options.add_argument('--device-scale-factor=1') # have to change cropping for 2x. also this is faster
options.add_argument('--force-device-scale-factor')
options.add_argument("--window-size=1200,1500") # resize later so we can reuse drivers
options.add_argument("--hide-scrollbars") # hide scrollbars from screenshots
Selenium::WebDriver.for :chrome, options: options
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/before_capture_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def run_js_then_capture(config)
def run_js_then_capture_chrome(config)
saving = Wraith::SaveImages.new(config_chrome)
generated_image = "shots_chrome/test/temporary_jsified_image.png"
saving.capture_image_selenium('320x320', 'http://www.bbc.com/afrique', generated_image, selector, config[:global_js], config[:path_js])
saving.capture_image_selenium('320', 'http://www.bbc.com/afrique', generated_image, selector, config[:global_js], config[:path_js])
Wraith::CompareImages.new(config_chrome).compare_task(generated_image, config[:output_should_look_like], "shots/test/test_diff.png", "shots/test/test.txt")
diff = File.open("shots/test/test.txt", "rb").read
expect(diff).to eq "0.0"
Expand Down Expand Up @@ -87,7 +87,7 @@ def run_js_then_capture_chrome(config)
end

# @TODO - we need tests determining the path to "path-level before_capture hooks"
# @TODO - uncomment and figure out why broken
# @TODO - uncomment and figure out why broken OR deprecate
# describe "When hooking into before_capture (CasperJS)" do
# it "Executes the global JS before capturing" do
# run_js_then_capture(
Expand Down

0 comments on commit 6face53

Please sign in to comment.