spec/compare_spec.rb in patternfly-sass-3.6.0 vs spec/compare_spec.rb in patternfly-sass-3.7.0
- old
+ new
@@ -5,12 +5,13 @@
RSpec.describe "compare SASS with LESS screenshots" do
BASEURL = "http://localhost:9000"
RESOLUTIONS = [[320, 480], [768, 1024], [1280, 1024]]
CONTEXTS = %w(less sass)
TOLERANCE = ENV['TOLERANCE'].to_f || 0.00
+ BROWSER = (ENV['BROWSER'] || :chrome).to_sym
- before(:all) { @browser = Selenium::WebDriver.for(:firefox) }
+ before(:all) { @browser = Selenium::WebDriver.for(BROWSER) }
puts "Starting tests with TOLERANCE=#{TOLERANCE}"
html = File.read('spec/html/index.html')
document = Nokogiri::HTML(html)
@@ -20,13 +21,13 @@
title = file.sub('.html', '')
RESOLUTIONS.each do |w, h|
it "#{w}x#{h}" do
@browser.manage.window.resize_to(w, h)
CONTEXTS.each do |ctx|
- @browser.navigate.to("#{BASEURL}/#{ctx}/patternfly/#{file}")
+ @browser.navigate.to("#{BASEURL}/#{ctx}/pages/patternfly/#{file}")
@browser.execute_script("
var style = document.createElement('style');
- style.innerHTML = '* { -moz-animation: none !important; -moz-transition: none !important;';
+ style.innerHTML = '* { -moz-animation: none !important; -moz-transition: none !important; -webkit-animation: none !important; -webkit-transition: none !important; }';
document.body.appendChild(style);
")
sleep(1)
@browser.save_screenshot("spec/results/#{ctx}/#{title}-#{w}x#{h}.png")
end