From 4d048cb148527cdbf9afcd370faca022216da9cf Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 28 Feb 2012 11:31:05 -0500 Subject: [PATCH] updates for chrome and ff win --- README.md | 2 ++ bin/hollandaise | 30 ++++++++++++++++++++++++++++++ hollandaise.gemspec | 4 ++-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c5be1e5..c56875b 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ Currently have three browsers available: * `ie7` * `ie8` * `ie9` +* `chromewin` +* `ffwin10` Make more on the `Hollandaise::Browsers` module! All sorts of flavors! diff --git a/bin/hollandaise b/bin/hollandaise index dd5b29f..72dcb78 100755 --- a/bin/hollandaise +++ b/bin/hollandaise @@ -6,6 +6,14 @@ require 'thread' require 'builder' module Hollandaise + class << self + attr_accessor :url + + def configure + yield self + end + end + module Browsers class << self def for(browsers) @@ -23,13 +31,32 @@ module Hollandaise def ie9 [ 'iexplore', '9', 'Windows 2008' ] end + + def ffwin10 + [ 'firefox', '10', 'Windows 2008' ] + end + + def chromewin + [ 'chrome', '', 'Windows 2008' ] + end end end end +begin + load 'hollandaise.rb' +rescue LoadError => e +end + class Hollandaise::CLI < Thor desc "sauce URL BROWSER BROWSER...", "Take screenshots of a URL on Sauce Labs" + method_options :delay => 0 def sauce(url, *browsers) + if Hollandaise.url + browsers.unshift(url) + url = Hollandaise.url + end + threads = [] FileUtils.rm_rf(dir) if File.directory?(dir) @@ -52,8 +79,11 @@ class Hollandaise::CLI < Thor mutex.synchronize { puts "#{target}..." } + require 'sauce/selenium' + selenium = Sauce::Selenium2.new(Thread.current[:info]) selenium.navigate.to url + sleep options[:delay].to_i selenium.execute_script %{window.resizeTo(1280, 1024)} selenium.save_screenshot(target) diff --git a/hollandaise.gemspec b/hollandaise.gemspec index f465aec..657638c 100644 --- a/hollandaise.gemspec +++ b/hollandaise.gemspec @@ -4,8 +4,8 @@ require File.expand_path('../lib/hollandaise/version', __FILE__) Gem::Specification.new do |gem| gem.authors = ["John Bintz"] gem.email = ["john@coswellproductions.com"] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} + gem.description = %q{Get delicious screenshots from Sauce Labs, easily} + gem.summary = %q{Get delicious screenshots from Sauce Labs, easily} gem.homepage = "" gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }