updates for chrome and ff win
This commit is contained in:
parent
823d7b8ab4
commit
4d048cb148
@ -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!
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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) }
|
||||
|
Loading…
Reference in New Issue
Block a user