From 80e4c8b6c005611c409236e49e74fc1b0b77df52 Mon Sep 17 00:00:00 2001 From: shmargum Date: Mon, 30 Oct 2017 18:07:29 -0400 Subject: [PATCH 01/28] build travis From f1dfc69796f10ee4df57367cf63c71a1cd1d2ef6 Mon Sep 17 00:00:00 2001 From: shmargum Date: Mon, 30 Oct 2017 18:14:41 -0400 Subject: [PATCH 02/28] add some logging --- .travis.yml | 7 +++++-- lib/wraith/save_images.rb | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 57496489..d018a665 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,14 @@ rvm: before_install: - gem update - gem --version -script: bundle exec rspec +script: + - whereis google-chrome-stable + - whereis chromedriver + - bundle exec rspec notifications: email: recipients: - - chris.ashton@bbc.co.uk + - mivanov1@gmail.com on_failure: change on_success: never slack: diff --git a/lib/wraith/save_images.rb b/lib/wraith/save_images.rb index e6b3764f..ac097cde 100644 --- a/lib/wraith/save_images.rb +++ b/lib/wraith/save_images.rb @@ -94,13 +94,18 @@ def parallel_task(jobs) def get_driver case meta.engine when "chrome" + puts "got 'chrome'" options = Selenium::WebDriver::Chrome::Options.new + puts "options created" options.add_argument('--disable-gpu') options.add_argument('--headless') 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 - Selenium::WebDriver.for :chrome, options: options + puts "arguments added" + driver = Selenium::WebDriver.for :chrome, options: options + puts "driver created" + driver end end From fcb8d053c66fb67a346b12b857d3801cd6cb013e Mon Sep 17 00:00:00 2001 From: shmargum Date: Mon, 30 Oct 2017 18:21:59 -0400 Subject: [PATCH 03/28] travis --- .travis.yml | 5 +++-- lib/wraith/save_images.rb | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d018a665..8b5cae1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,11 +6,12 @@ language: ruby rvm: - 2.3.3 before_install: + - rvm list - gem update - gem --version script: - - whereis google-chrome-stable - - whereis chromedriver + - google-chrome-stable --version + - chromedriver --version - bundle exec rspec notifications: email: diff --git a/lib/wraith/save_images.rb b/lib/wraith/save_images.rb index ac097cde..f9cdb063 100644 --- a/lib/wraith/save_images.rb +++ b/lib/wraith/save_images.rb @@ -94,17 +94,13 @@ def parallel_task(jobs) def get_driver case meta.engine when "chrome" - puts "got 'chrome'" options = Selenium::WebDriver::Chrome::Options.new - puts "options created" options.add_argument('--disable-gpu') options.add_argument('--headless') 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 - puts "arguments added" driver = Selenium::WebDriver.for :chrome, options: options - puts "driver created" driver end end From 05feca8d1c16ca4a111cdb1545a56ef055d0f205 Mon Sep 17 00:00:00 2001 From: shmargum Date: Mon, 30 Oct 2017 18:42:52 -0400 Subject: [PATCH 04/28] more travis --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b5cae1c..fae88116 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,16 @@ sudo: false addons: - chrome: stable + apt: + packages: + - google-chrome-stable language: ruby rvm: -- 2.3.3 +- 2.4.1 before_install: - - rvm list - gem update - gem --version script: - - google-chrome-stable --version - - chromedriver --version - bundle exec rspec notifications: email: From ef7d6d5f63cdd381438d9eebed194ce838de345f Mon Sep 17 00:00:00 2001 From: shmargum Date: Mon, 30 Oct 2017 18:43:39 -0400 Subject: [PATCH 05/28] more travis --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 065a64aab8835e253aab852b8d392d4221b6119b Mon Sep 17 00:00:00 2001 From: shmargum Date: Mon, 30 Oct 2017 18:47:34 -0400 Subject: [PATCH 06/28] more travis --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index fae88116..f7cd0eb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,6 @@ addons: language: ruby rvm: - 2.4.1 -before_install: - - gem update - - gem --version script: - bundle exec rspec notifications: From 484a2689980febe384e8360380c21ec8c9e98b13 Mon Sep 17 00:00:00 2001 From: shmargum Date: Mon, 30 Oct 2017 19:04:40 -0400 Subject: [PATCH 07/28] log --- lib/wraith/save_images.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/wraith/save_images.rb b/lib/wraith/save_images.rb index f9cdb063..b10ad449 100644 --- a/lib/wraith/save_images.rb +++ b/lib/wraith/save_images.rb @@ -127,7 +127,10 @@ def capture_image_selenium(screen_sizes, url, file_name, selector, global_before new_file_name = file_name.sub('MULTI', screen_size) driver.manage.window.resize_to(width, height || 1500) driver.navigate.to url + if global_before_capture + puts File.read(global_before_capture) driver.execute_async_script(File.read(global_before_capture)) if global_before_capture + end driver.execute_async_script(File.read(path_before_capture)) if path_before_capture resize_to_fit_page(driver) unless height driver.save_screenshot(new_file_name) From 5cb464901442c693be51ff0623f5c032b8508fa6 Mon Sep 17 00:00:00 2001 From: shmargum Date: Mon, 30 Oct 2017 19:16:41 -0400 Subject: [PATCH 08/28] log --- lib/wraith/save_images.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/wraith/save_images.rb b/lib/wraith/save_images.rb index b10ad449..fbd32593 100644 --- a/lib/wraith/save_images.rb +++ b/lib/wraith/save_images.rb @@ -128,7 +128,8 @@ def capture_image_selenium(screen_sizes, url, file_name, selector, global_before driver.manage.window.resize_to(width, height || 1500) driver.navigate.to url if global_before_capture - puts File.read(global_before_capture) + el = driver.find_element(:css, 'body') + puts el.attribute('innerHTML') driver.execute_async_script(File.read(global_before_capture)) if global_before_capture end driver.execute_async_script(File.read(path_before_capture)) if path_before_capture From de671af387a1c7c96e7003329822bcb9493340be Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 11:55:15 -0400 Subject: [PATCH 09/28] puts --- .travis.yml | 2 ++ lib/wraith/save_images.rb | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f7cd0eb8..2be6620d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,13 @@ addons: apt: packages: - google-chrome-stable + - caca-utils language: ruby rvm: - 2.4.1 script: + - which img2txt - bundle exec rspec notifications: email: diff --git a/lib/wraith/save_images.rb b/lib/wraith/save_images.rb index fbd32593..9ad0ef0d 100644 --- a/lib/wraith/save_images.rb +++ b/lib/wraith/save_images.rb @@ -127,14 +127,14 @@ def capture_image_selenium(screen_sizes, url, file_name, selector, global_before new_file_name = file_name.sub('MULTI', screen_size) driver.manage.window.resize_to(width, height || 1500) driver.navigate.to url - if global_before_capture - el = driver.find_element(:css, 'body') - puts el.attribute('innerHTML') driver.execute_async_script(File.read(global_before_capture)) if global_before_capture - end driver.execute_async_script(File.read(path_before_capture)) if path_before_capture resize_to_fit_page(driver) unless height driver.save_screenshot(new_file_name) + # a = `pwd`.sub("\n","") + # puts new_file_name + b = `img2txt #{new_file_name}` + puts b crop_selector(driver, selector, new_file_name) if selector && selector.length > 0 end driver.quit From 3efe2c3eae8fab6a3e6b3e37c1e44c9f5167a439 Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 12:39:34 -0400 Subject: [PATCH 10/28] log img --- .travis.yml | 1 - lib/wraith/save_images.rb | 4 ---- spec/before_capture_spec.rb | 6 ++++++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2be6620d..2513e089 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ language: ruby rvm: - 2.4.1 script: - - which img2txt - bundle exec rspec notifications: email: diff --git a/lib/wraith/save_images.rb b/lib/wraith/save_images.rb index 9ad0ef0d..f9cdb063 100644 --- a/lib/wraith/save_images.rb +++ b/lib/wraith/save_images.rb @@ -131,10 +131,6 @@ def capture_image_selenium(screen_sizes, url, file_name, selector, global_before driver.execute_async_script(File.read(path_before_capture)) if path_before_capture resize_to_fit_page(driver) unless height driver.save_screenshot(new_file_name) - # a = `pwd`.sub("\n","") - # puts new_file_name - b = `img2txt #{new_file_name}` - puts b crop_selector(driver, selector, new_file_name) if selector && selector.length > 0 end driver.quit diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 0b38120b..0b07d7db 100644 --- a/spec/before_capture_spec.rb +++ b/spec/before_capture_spec.rb @@ -14,6 +14,12 @@ 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]) + puts "=== IMAGE 1===" + puts generated_image + puts `img2txt #{generated_image}` + puts "=== IMAGE 2===" + puts `img2txt shots/test/test_diff.png` + puts "=============" 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" From ecb002a1017cb5943dd1fb2ec627ce389c0fcd10 Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 12:47:09 -0400 Subject: [PATCH 11/28] more log --- spec/before_capture_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 0b07d7db..223171f9 100644 --- a/spec/before_capture_spec.rb +++ b/spec/before_capture_spec.rb @@ -18,9 +18,12 @@ def run_js_then_capture_chrome(config) puts generated_image puts `img2txt #{generated_image}` puts "=== IMAGE 2===" + puts config[:output_should_look_like] + puts `img2txt #{config[:output_should_look_like]}` + Wraith::CompareImages.new(config_chrome).compare_task(generated_image, config[:output_should_look_like], "shots/test/test_diff.png", "shots/test/test.txt") + puts "=== IMAGE DIFF===" puts `img2txt shots/test/test_diff.png` puts "=============" - 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" end From 4ea9b60c4c9592926bc8d8068e26e5e746465342 Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 12:57:20 -0400 Subject: [PATCH 12/28] use absolute path? --- .travis.yml | 2 +- lib/wraith/compare_images.rb | 4 +++- spec/before_capture_spec.rb | 12 ++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2513e089..8e6f11e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ language: ruby rvm: - 2.4.1 script: - - bundle exec rspec + - bundle exec rspec spec/before_capture_spec.rb notifications: email: recipients: diff --git a/lib/wraith/compare_images.rb b/lib/wraith/compare_images.rb index 2bd6684f..50502ab1 100644 --- a/lib/wraith/compare_images.rb +++ b/lib/wraith/compare_images.rb @@ -31,12 +31,14 @@ def percentage(img_size, px_value, info) end def compare_task(base, compare, output, info) - cmdline = "compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{base} #{compare.shellescape} #{output}" + cmdline = "compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{convert_to_absolute(base)} #{convert_to_absolute(compare.shellescape)} #{convert_to_absolute(output)}" + puts cmdline px_value = Open3.popen3(cmdline) { |_stdin, _stdout, stderr, _wait_thr| stderr.read }.to_f begin img_size = ImageSize.path(output).size.inject(:*) percentage(img_size, px_value, info) rescue + puts "rescuing" File.open(info, "w") { |file| file.write("invalid") } unless File.exist?(output) end end diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 223171f9..8c2f0e7a 100644 --- a/spec/before_capture_spec.rb +++ b/spec/before_capture_spec.rb @@ -14,12 +14,12 @@ 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]) - puts "=== IMAGE 1===" - puts generated_image - puts `img2txt #{generated_image}` - puts "=== IMAGE 2===" - puts config[:output_should_look_like] - puts `img2txt #{config[:output_should_look_like]}` + # puts "=== IMAGE 1===" + # puts generated_image + # puts `img2txt #{generated_image}` + # puts "=== IMAGE 2===" + # puts config[:output_should_look_like] + # puts `img2txt #{config[:output_should_look_like]}` Wraith::CompareImages.new(config_chrome).compare_task(generated_image, config[:output_should_look_like], "shots/test/test_diff.png", "shots/test/test.txt") puts "=== IMAGE DIFF===" puts `img2txt shots/test/test_diff.png` From a9332181e487e9dc980b64ade35a00702dc04592 Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 13:04:16 -0400 Subject: [PATCH 13/28] log --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 8e6f11e2..870ff874 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ language: ruby rvm: - 2.4.1 script: + - compare --version - bundle exec rspec spec/before_capture_spec.rb notifications: email: From fcfd9cf9abe6cbc7b812ce929a7a3c7e426859ce Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 13:18:05 -0400 Subject: [PATCH 14/28] travis --- .travis.yml | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 870ff874..9df607f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,55 @@ sudo: false +cache: + directories: + - "$HOME/opt" addons: apt: packages: - google-chrome-stable - caca-utils - + - libjpeg-dev + - libpng-dev + - libgif-dev +env: + global: + - IMAGEMAGICK_VERSION: '7.0.7-3' + - LIBWEBP_VERSION: '0.6.0' language: ruby rvm: - 2.4.1 + +# Install newer libwebp and imagemagick +before_install: + # Update PATH so that travis can find newer imagemagick + - export PATH=$HOME/opt/bin:$PATH + + # Checks if Imagemagick is already sufficient version + # If not installs it from the sources + - convert -version | grep $IMAGEMAGICK_VERSION || { + export CORES=$(nproc) && + echo "Using $CORES cores for compiling..." && + cd /tmp && + curl -O https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$LIBWEBP_VERSION.tar.gz && + tar xvzf libwebp-$LIBWEBP_VERSION.tar.gz && + cd libwebp-* && + ./configure --prefix=$HOME/opt && + make -j$CORES && + make install -j$CORES && + cd /tmp && + curl -O https://www.imagemagick.org/download/ImageMagick-$IMAGEMAGICK_VERSION.tar.gz && + tar xvzf ImageMagick-$IMAGEMAGICK_VERSION.tar.gz && + cd ImageMagick-* && + ./configure --prefix=$HOME/opt && + make -j$CORES && + make install -j$CORES && + $HOME/opt/bin/magick -version | grep $IMAGEMAGICK_VERSION && + cd $TRAVIS_BUILD_DIR; } + + # Update library paths for programs + - export LD_FLAGS=-L$HOME/opt/lib + - export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$HOME/opt/lib + - export CPATH=$CPATH:$HOME/opt/include + script: - compare --version - bundle exec rspec spec/before_capture_spec.rb From d5960f434ebe778cafe2f448945293364c9dcfaf Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 13:34:53 -0400 Subject: [PATCH 15/28] travis --- .travis.yml | 45 ++---------------------------------- lib/wraith/compare_images.rb | 2 -- 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9df607f3..0257bcf5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,55 +1,14 @@ sudo: false -cache: - directories: - - "$HOME/opt" addons: apt: packages: - google-chrome-stable - caca-utils - - libjpeg-dev - - libpng-dev - - libgif-dev -env: - global: - - IMAGEMAGICK_VERSION: '7.0.7-3' - - LIBWEBP_VERSION: '0.6.0' + - imagemagick + language: ruby rvm: - 2.4.1 - -# Install newer libwebp and imagemagick -before_install: - # Update PATH so that travis can find newer imagemagick - - export PATH=$HOME/opt/bin:$PATH - - # Checks if Imagemagick is already sufficient version - # If not installs it from the sources - - convert -version | grep $IMAGEMAGICK_VERSION || { - export CORES=$(nproc) && - echo "Using $CORES cores for compiling..." && - cd /tmp && - curl -O https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$LIBWEBP_VERSION.tar.gz && - tar xvzf libwebp-$LIBWEBP_VERSION.tar.gz && - cd libwebp-* && - ./configure --prefix=$HOME/opt && - make -j$CORES && - make install -j$CORES && - cd /tmp && - curl -O https://www.imagemagick.org/download/ImageMagick-$IMAGEMAGICK_VERSION.tar.gz && - tar xvzf ImageMagick-$IMAGEMAGICK_VERSION.tar.gz && - cd ImageMagick-* && - ./configure --prefix=$HOME/opt && - make -j$CORES && - make install -j$CORES && - $HOME/opt/bin/magick -version | grep $IMAGEMAGICK_VERSION && - cd $TRAVIS_BUILD_DIR; } - - # Update library paths for programs - - export LD_FLAGS=-L$HOME/opt/lib - - export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$HOME/opt/lib - - export CPATH=$CPATH:$HOME/opt/include - script: - compare --version - bundle exec rspec spec/before_capture_spec.rb diff --git a/lib/wraith/compare_images.rb b/lib/wraith/compare_images.rb index 50502ab1..c497f2d0 100644 --- a/lib/wraith/compare_images.rb +++ b/lib/wraith/compare_images.rb @@ -32,13 +32,11 @@ def percentage(img_size, px_value, info) def compare_task(base, compare, output, info) cmdline = "compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{convert_to_absolute(base)} #{convert_to_absolute(compare.shellescape)} #{convert_to_absolute(output)}" - puts cmdline px_value = Open3.popen3(cmdline) { |_stdin, _stdout, stderr, _wait_thr| stderr.read }.to_f begin img_size = ImageSize.path(output).size.inject(:*) percentage(img_size, px_value, info) rescue - puts "rescuing" File.open(info, "w") { |file| file.write("invalid") } unless File.exist?(output) end end From edeb2f8f998e4aefd88d8bf20090fd188d7a25eb Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 13:39:33 -0400 Subject: [PATCH 16/28] travis --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0257bcf5..2484aac6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,12 @@ addons: packages: - google-chrome-stable - caca-utils - - imagemagick language: ruby rvm: - 2.4.1 +before_install: + - sudo apt-get install imagemagick script: - compare --version - bundle exec rspec spec/before_capture_spec.rb From d8e3ddab476d01dd0ca64cb7ea91ff7f06fc7d75 Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 13:49:48 -0400 Subject: [PATCH 17/28] travis --- lib/wraith/compare_images.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/wraith/compare_images.rb b/lib/wraith/compare_images.rb index c497f2d0..1826bd08 100644 --- a/lib/wraith/compare_images.rb +++ b/lib/wraith/compare_images.rb @@ -32,6 +32,7 @@ def percentage(img_size, px_value, info) def compare_task(base, compare, output, info) cmdline = "compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{convert_to_absolute(base)} #{convert_to_absolute(compare.shellescape)} #{convert_to_absolute(output)}" + puts `compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{convert_to_absolute(base)} #{convert_to_absolute(compare.shellescape)} #{convert_to_absolute(output)}` px_value = Open3.popen3(cmdline) { |_stdin, _stdout, stderr, _wait_thr| stderr.read }.to_f begin img_size = ImageSize.path(output).size.inject(:*) From a1b0e6567e36919ddc10fb9725e0cb4ea44c8c7a Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 13:57:22 -0400 Subject: [PATCH 18/28] travis --- .travis.yml | 2 -- spec/before_capture_spec.rb | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2484aac6..870ff874 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,6 @@ addons: language: ruby rvm: - 2.4.1 -before_install: - - sudo apt-get install imagemagick script: - compare --version - bundle exec rspec spec/before_capture_spec.rb diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 8c2f0e7a..7df3debb 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('320x16', 'http://www.bbc.com/afrique', generated_image, selector, config[:global_js], config[:path_js]) # puts "=== IMAGE 1===" # puts generated_image # puts `img2txt #{generated_image}` From 6fe3f693264b679b8cf66844d455697a080c693c Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 14:04:19 -0400 Subject: [PATCH 19/28] travis --- spec/before_capture_spec.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 7df3debb..819dfac3 100644 --- a/spec/before_capture_spec.rb +++ b/spec/before_capture_spec.rb @@ -13,13 +13,15 @@ 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('320x16', 'http://www.bbc.com/afrique', generated_image, selector, config[:global_js], config[:path_js]) - # puts "=== IMAGE 1===" - # puts generated_image - # puts `img2txt #{generated_image}` - # puts "=== IMAGE 2===" - # puts config[:output_should_look_like] - # puts `img2txt #{config[:output_should_look_like]}` + saving.capture_image_selenium('320x320', 'http://www.bbc.com/afrique', generated_image, selector, config[:global_js], config[:path_js]) + puts "=== IMAGE 1===" + puts generated_image + puts `img2txt #{generated_image}` + puts `identify #{generated_image}` + puts "=== IMAGE 2===" + puts config[:output_should_look_like] + puts `img2txt #{config[:output_should_look_like]}` + puts `identify #{config[:output_should_look_like]}` Wraith::CompareImages.new(config_chrome).compare_task(generated_image, config[:output_should_look_like], "shots/test/test_diff.png", "shots/test/test.txt") puts "=== IMAGE DIFF===" puts `img2txt shots/test/test_diff.png` From 5c9a1a22670f2e77942aedc251b5827d8880494f Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 14:09:10 -0400 Subject: [PATCH 20/28] travis --- spec/before_capture_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 819dfac3..6f12da4b 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('320x16', 'http://www.bbc.com/afrique', generated_image, selector, config[:global_js], config[:path_js]) puts "=== IMAGE 1===" puts generated_image puts `img2txt #{generated_image}` From 83bfccea601d04b437242f6beb93d67faf35a7df Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 14:20:11 -0400 Subject: [PATCH 21/28] travis --- spec/before_capture_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 6f12da4b..9b35837c 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('320x16', '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]) puts "=== IMAGE 1===" puts generated_image puts `img2txt #{generated_image}` From b9daa9623a3ddbf5084a2a8024c302b956629ad8 Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 14:26:57 -0400 Subject: [PATCH 22/28] these? --- spec/before_capture_spec.rb | 2 +- spec/js/global--chrome.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 9b35837c..6f12da4b 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('320', 'http://www.bbc.com/afrique', generated_image, selector, config[:global_js], config[:path_js]) + saving.capture_image_selenium('320x16', 'http://www.bbc.com/afrique', generated_image, selector, config[:global_js], config[:path_js]) puts "=== IMAGE 1===" puts generated_image puts `img2txt #{generated_image}` diff --git a/spec/js/global--chrome.js b/spec/js/global--chrome.js index 5e93bd60..5d8418ee 100644 --- a/spec/js/global--chrome.js +++ b/spec/js/global--chrome.js @@ -1,4 +1,6 @@ var callback = arguments[arguments.length-1]; document.body.innerHTML = " "; document.body.style['background-color'] = 'red'; +document.body.style['height'] = '16px'; +document.body.style['width'] = '320px'; callback(); From d08a336b7783c9b90010c928edd63d464171045d Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 14:32:15 -0400 Subject: [PATCH 23/28] travis --- lib/wraith/save_images.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/wraith/save_images.rb b/lib/wraith/save_images.rb index f9cdb063..f889b1d4 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 driver = Selenium::WebDriver.for :chrome, options: options driver end From 7ff5dce6a7a3d032add5a31770b51db32156025e Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 14:59:43 -0400 Subject: [PATCH 24/28] travis --- spec/before_capture_spec.rb | 128 ++++++++++++++++++------------------ spec/js/global--chrome.js | 2 - 2 files changed, 64 insertions(+), 66 deletions(-) diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 6f12da4b..553d697e 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('320x16', '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]) puts "=== IMAGE 1===" puts generated_image puts `img2txt #{generated_image}` @@ -99,69 +99,69 @@ def run_js_then_capture_chrome(config) # @TODO - we need tests determining the path to "path-level before_capture hooks" # @TODO - uncomment and figure out why broken - # describe "When hooking into before_capture (CasperJS)" do - # it "Executes the global JS before capturing" do - # run_js_then_capture( - # :global_js => before_suite_js, - # :path_js => false, - # :output_should_look_like => "spec/base/global.png", - # :engine => "casperjs" - # ) - # end - - # it "Executes the path-level JS before capturing" do - # run_js_then_capture( - # :global_js => false, - # :path_js => before_capture_js, - # :output_should_look_like => "spec/base/path.png", - # :engine => "casperjs" - # ) - # end - - # it "Executes the global JS before the path-level JS" do - # run_js_then_capture( - # :global_js => before_suite_js, - # :path_js => before_capture_js, - # :output_should_look_like => "spec/base/path.png", - # :engine => "casperjs" - # ) - # end - # end + describe "When hooking into before_capture (CasperJS)" do + it "Executes the global JS before capturing" do + run_js_then_capture( + :global_js => before_suite_js, + :path_js => false, + :output_should_look_like => "spec/base/global.png", + :engine => "casperjs" + ) + end + + it "Executes the path-level JS before capturing" do + run_js_then_capture( + :global_js => false, + :path_js => before_capture_js, + :output_should_look_like => "spec/base/path.png", + :engine => "casperjs" + ) + end + + it "Executes the global JS before the path-level JS" do + run_js_then_capture( + :global_js => before_suite_js, + :path_js => before_capture_js, + :output_should_look_like => "spec/base/path.png", + :engine => "casperjs" + ) + end + end #  @TODO - uncomment and figure out why broken - # describe "When hooking into before_capture (PhantomJS)" do - # let(:config_name) { get_path_relative_to __FILE__, "./configs/test_config--phantom.yaml" } - # let(:saving) { Wraith::SaveImages.new(config_name) } - # let(:wraith) { Wraith::Wraith.new(config_name) } - # let(:selector) { "body" } - # let(:before_suite_js) { "../../spec/js/global.js" } - # let(:before_capture_js) { "../../spec/js/path.js" } - - # it "Executes the global JS before capturing" do - # run_js_then_capture( - # global_js: before_suite_js, - # path_js: 'false', - # output_should_look_like: 'spec/base/global.png', - # engine: 'phantomjs' - # ) - # end - - # it "Executes the path-level JS before capturing" do - # run_js_then_capture( - # global_js: 'false', - # path_js: before_capture_js, - # output_should_look_like: 'spec/base/path.png', - # engine: 'phantomjs' - # ) - # end - - # it "Executes the global JS before the path-level JS" do - # run_js_then_capture( - # global_js: before_suite_js, - # path_js: before_capture_js, - # output_should_look_like: 'spec/base/path.png', - # engine: 'phantomjs' - # ) - # end - # end + describe "When hooking into before_capture (PhantomJS)" do + let(:config_name) { get_path_relative_to __FILE__, "./configs/test_config--phantom.yaml" } + let(:saving) { Wraith::SaveImages.new(config_name) } + let(:wraith) { Wraith::Wraith.new(config_name) } + let(:selector) { "body" } + let(:before_suite_js) { "../../spec/js/global.js" } + let(:before_capture_js) { "../../spec/js/path.js" } + + it "Executes the global JS before capturing" do + run_js_then_capture( + global_js: before_suite_js, + path_js: 'false', + output_should_look_like: 'spec/base/global.png', + engine: 'phantomjs' + ) + end + + it "Executes the path-level JS before capturing" do + run_js_then_capture( + global_js: 'false', + path_js: before_capture_js, + output_should_look_like: 'spec/base/path.png', + engine: 'phantomjs' + ) + end + + it "Executes the global JS before the path-level JS" do + run_js_then_capture( + global_js: before_suite_js, + path_js: before_capture_js, + output_should_look_like: 'spec/base/path.png', + engine: 'phantomjs' + ) + end + end end diff --git a/spec/js/global--chrome.js b/spec/js/global--chrome.js index 5d8418ee..5e93bd60 100644 --- a/spec/js/global--chrome.js +++ b/spec/js/global--chrome.js @@ -1,6 +1,4 @@ var callback = arguments[arguments.length-1]; document.body.innerHTML = " "; document.body.style['background-color'] = 'red'; -document.body.style['height'] = '16px'; -document.body.style['width'] = '320px'; callback(); From ac09ad0b920dd81549b5496075b4afc441d20b10 Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 15:06:20 -0400 Subject: [PATCH 25/28] travis --- spec/before_capture_spec.rb | 93 ++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index 553d697e..ebd1e4e0 100644 --- a/spec/before_capture_spec.rb +++ b/spec/before_capture_spec.rb @@ -4,16 +4,6 @@ def run_js_then_capture(config) saving = Wraith::SaveImages.new(config_name) generated_image = "shots/test/temporary_jsified_image.png" capture_image = saving.construct_command(320, "http://www.bbc.com/afrique", generated_image, selector, config[:global_js], config[:path_js]) - `#{capture_image}` - Wraith::CompareImages.new(config_name).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" -end - -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('320', 'http://www.bbc.com/afrique', generated_image, selector, config[:global_js], config[:path_js]) puts "=== IMAGE 1===" puts generated_image puts `img2txt #{generated_image}` @@ -22,7 +12,8 @@ def run_js_then_capture_chrome(config) puts config[:output_should_look_like] puts `img2txt #{config[:output_should_look_like]}` puts `identify #{config[:output_should_look_like]}` - Wraith::CompareImages.new(config_chrome).compare_task(generated_image, config[:output_should_look_like], "shots/test/test_diff.png", "shots/test/test.txt") + `#{capture_image}` + Wraith::CompareImages.new(config_name).compare_task(generated_image, config[:output_should_look_like], "shots/test/test_diff.png", "shots/test/test.txt") puts "=== IMAGE DIFF===" puts `img2txt shots/test/test_diff.png` puts "=============" @@ -30,6 +21,15 @@ def run_js_then_capture_chrome(config) expect(diff).to eq "0.0" end +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('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" +end + describe Wraith do let(:config_name) { get_path_relative_to __FILE__, "./configs/test_config--casper.yaml" } let(:config_chrome) { get_path_relative_to __FILE__, "./configs/test_config--chrome.yaml" } @@ -98,7 +98,6 @@ 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 describe "When hooking into before_capture (CasperJS)" do it "Executes the global JS before capturing" do run_js_then_capture( @@ -129,39 +128,39 @@ def run_js_then_capture_chrome(config) end #  @TODO - uncomment and figure out why broken - describe "When hooking into before_capture (PhantomJS)" do - let(:config_name) { get_path_relative_to __FILE__, "./configs/test_config--phantom.yaml" } - let(:saving) { Wraith::SaveImages.new(config_name) } - let(:wraith) { Wraith::Wraith.new(config_name) } - let(:selector) { "body" } - let(:before_suite_js) { "../../spec/js/global.js" } - let(:before_capture_js) { "../../spec/js/path.js" } - - it "Executes the global JS before capturing" do - run_js_then_capture( - global_js: before_suite_js, - path_js: 'false', - output_should_look_like: 'spec/base/global.png', - engine: 'phantomjs' - ) - end - - it "Executes the path-level JS before capturing" do - run_js_then_capture( - global_js: 'false', - path_js: before_capture_js, - output_should_look_like: 'spec/base/path.png', - engine: 'phantomjs' - ) - end - - it "Executes the global JS before the path-level JS" do - run_js_then_capture( - global_js: before_suite_js, - path_js: before_capture_js, - output_should_look_like: 'spec/base/path.png', - engine: 'phantomjs' - ) - end - end + # describe "When hooking into before_capture (PhantomJS)" do + # let(:config_name) { get_path_relative_to __FILE__, "./configs/test_config--phantom.yaml" } + # let(:saving) { Wraith::SaveImages.new(config_name) } + # let(:wraith) { Wraith::Wraith.new(config_name) } + # let(:selector) { "body" } + # let(:before_suite_js) { "../../spec/js/global.js" } + # let(:before_capture_js) { "../../spec/js/path.js" } + + # it "Executes the global JS before capturing" do + # run_js_then_capture( + # global_js: before_suite_js, + # path_js: 'false', + # output_should_look_like: 'spec/base/global.png', + # engine: 'phantomjs' + # ) + # end + + # it "Executes the path-level JS before capturing" do + # run_js_then_capture( + # global_js: 'false', + # path_js: before_capture_js, + # output_should_look_like: 'spec/base/path.png', + # engine: 'phantomjs' + # ) + # end + + # it "Executes the global JS before the path-level JS" do + # run_js_then_capture( + # global_js: before_suite_js, + # path_js: before_capture_js, + # output_should_look_like: 'spec/base/path.png', + # engine: 'phantomjs' + # ) + # end + # end end From 03460643d394856adbc1e8c10d410edebcdbecd0 Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 15:11:18 -0400 Subject: [PATCH 26/28] travis --- .travis.yml | 10 ++---- lib/wraith/compare_images.rb | 3 +- spec/before_capture_spec.rb | 64 +++++++++++++++--------------------- 3 files changed, 31 insertions(+), 46 deletions(-) diff --git a/.travis.yml b/.travis.yml index 870ff874..06629ae7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,16 @@ sudo: false addons: - apt: - packages: - - google-chrome-stable - - caca-utils + chrome: stable language: ruby rvm: - 2.4.1 script: - - compare --version - - bundle exec rspec spec/before_capture_spec.rb + - bundle exec rspec notifications: email: recipients: - - mivanov1@gmail.com + - chris.ashton@bbc.co.uk on_failure: change on_success: never slack: diff --git a/lib/wraith/compare_images.rb b/lib/wraith/compare_images.rb index 1826bd08..2bd6684f 100644 --- a/lib/wraith/compare_images.rb +++ b/lib/wraith/compare_images.rb @@ -31,8 +31,7 @@ def percentage(img_size, px_value, info) end def compare_task(base, compare, output, info) - cmdline = "compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{convert_to_absolute(base)} #{convert_to_absolute(compare.shellescape)} #{convert_to_absolute(output)}" - puts `compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{convert_to_absolute(base)} #{convert_to_absolute(compare.shellescape)} #{convert_to_absolute(output)}` + cmdline = "compare -dissimilarity-threshold 1 -fuzz #{wraith.fuzz} -metric AE -highlight-color #{wraith.highlight_color} #{base} #{compare.shellescape} #{output}" px_value = Open3.popen3(cmdline) { |_stdin, _stdout, stderr, _wait_thr| stderr.read }.to_f begin img_size = ImageSize.path(output).size.inject(:*) diff --git a/spec/before_capture_spec.rb b/spec/before_capture_spec.rb index ebd1e4e0..e01a5346 100644 --- a/spec/before_capture_spec.rb +++ b/spec/before_capture_spec.rb @@ -4,19 +4,8 @@ def run_js_then_capture(config) saving = Wraith::SaveImages.new(config_name) generated_image = "shots/test/temporary_jsified_image.png" capture_image = saving.construct_command(320, "http://www.bbc.com/afrique", generated_image, selector, config[:global_js], config[:path_js]) - puts "=== IMAGE 1===" - puts generated_image - puts `img2txt #{generated_image}` - puts `identify #{generated_image}` - puts "=== IMAGE 2===" - puts config[:output_should_look_like] - puts `img2txt #{config[:output_should_look_like]}` - puts `identify #{config[:output_should_look_like]}` `#{capture_image}` Wraith::CompareImages.new(config_name).compare_task(generated_image, config[:output_should_look_like], "shots/test/test_diff.png", "shots/test/test.txt") - puts "=== IMAGE DIFF===" - puts `img2txt shots/test/test_diff.png` - puts "=============" diff = File.open("shots/test/test.txt", "rb").read expect(diff).to eq "0.0" end @@ -98,34 +87,35 @@ def run_js_then_capture_chrome(config) end # @TODO - we need tests determining the path to "path-level before_capture hooks" - describe "When hooking into before_capture (CasperJS)" do - it "Executes the global JS before capturing" do - run_js_then_capture( - :global_js => before_suite_js, - :path_js => false, - :output_should_look_like => "spec/base/global.png", - :engine => "casperjs" - ) - end + # @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( + # :global_js => before_suite_js, + # :path_js => false, + # :output_should_look_like => "spec/base/global.png", + # :engine => "casperjs" + # ) + # end - it "Executes the path-level JS before capturing" do - run_js_then_capture( - :global_js => false, - :path_js => before_capture_js, - :output_should_look_like => "spec/base/path.png", - :engine => "casperjs" - ) - end + # it "Executes the path-level JS before capturing" do + # run_js_then_capture( + # :global_js => false, + # :path_js => before_capture_js, + # :output_should_look_like => "spec/base/path.png", + # :engine => "casperjs" + # ) + # end - it "Executes the global JS before the path-level JS" do - run_js_then_capture( - :global_js => before_suite_js, - :path_js => before_capture_js, - :output_should_look_like => "spec/base/path.png", - :engine => "casperjs" - ) - end - end + # it "Executes the global JS before the path-level JS" do + # run_js_then_capture( + # :global_js => before_suite_js, + # :path_js => before_capture_js, + # :output_should_look_like => "spec/base/path.png", + # :engine => "casperjs" + # ) + # end + # end #  @TODO - uncomment and figure out why broken # describe "When hooking into before_capture (PhantomJS)" do From 281bdecc82b2a07d3a8a6cda1d712936e781e28d Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 15:12:31 -0400 Subject: [PATCH 27/28] travis --- lib/wraith/save_images.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/wraith/save_images.rb b/lib/wraith/save_images.rb index f889b1d4..bf76426b 100644 --- a/lib/wraith/save_images.rb +++ b/lib/wraith/save_images.rb @@ -101,8 +101,7 @@ def get_driver 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 - driver = Selenium::WebDriver.for :chrome, options: options - driver + Selenium::WebDriver.for :chrome, options: options end end From afe69486b762b25e29e82b8f843bb8205282adbb Mon Sep 17 00:00:00 2001 From: shmargum Date: Tue, 31 Oct 2017 15:13:53 -0400 Subject: [PATCH 28/28] travis --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 06629ae7..66d760d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ sudo: false addons: - chrome: stable + apt: + packages: + - google-chrome-stable language: ruby rvm: