diff --git a/.ruby-version b/.ruby-version index 0bee604d..005119ba 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.3 +2.4.1 diff --git a/.travis.yml b/.travis.yml index 72c73536..66d760d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,14 @@ -sudo: required +sudo: false addons: apt: - sources: - - google-chrome 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: diff --git a/lib/wraith/save_images.rb b/lib/wraith/save_images.rb index e6b3764f..bf76426b 100644 --- a/lib/wraith/save_images.rb +++ b/lib/wraith/save_images.rb @@ -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 diff --git a/spec/_helpers.rb b/spec/_helpers.rb index 15786d92..a8340232 100644 --- a/spec/_helpers.rb +++ b/spec/_helpers.rb @@ -1,5 +1,6 @@ require "rspec" require "./lib/wraith/cli" +require "pry" def create_diff_image capture_image = saving.construct_command(320, test_url1, test_image1, selector, false, false) diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 0b38120b..e01a5346 100644 --- a/spec/before_capture_spec.rb +++ b/spec/before_capture_spec.rb @@ -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" @@ -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(