Skip to content

Commit

Permalink
try installing chrome this way on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
shmargum committed Oct 31, 2017
1 parent 3df1918 commit 005c2b5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 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: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
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
1 change: 1 addition & 0 deletions spec/_helpers.rb
Original file line number Diff line number Diff line change
@@ -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)
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 005c2b5

Please sign in to comment.