Commit 460178ad authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Benjamin Neff

Fix the screenshot tool

closes #7605
parent ddaa6df0
......@@ -12,8 +12,8 @@ module ScreenshotCukeHelpers
sleep 0.5
browser.manage.window.resize_to(1280, 1024)
browser.save_screenshot(pic)
page.driver.resize(1280, 1024)
save_screenshot(pic)
end
def take_screenshots_without_login
......@@ -29,16 +29,15 @@ module ScreenshotCukeHelpers
def take_screenshots_with_login
pages = {
'stream' => 'stream',
'activity' => 'activity_stream',
'mentions' => 'mentioned_stream',
'aspects' => 'aspects_stream',
'tags' => 'followed_tags_stream',
'contacts' => 'contacts',
'settings' => 'edit_user',
'notifications' => 'notifications',
'conversations' => 'conversations',
'logout' => 'destroy_user_session'
"stream" => "stream",
"activity" => "activity_stream",
"mentions" => "mentioned_stream",
"aspects" => "aspects_stream",
"tags" => "followed_tags_stream",
"contacts" => "contacts",
"settings" => "edit_user",
"notifications" => "notifications",
"conversations" => "conversations"
}
pages.each do |name, path|
......
......@@ -15,7 +15,6 @@ namespace :screenshots do
desc 'Generate "flicker" images for easy comparison (requires RMagick)'
task :flicker do
require 'RMagick'
screen_dir = Rails.root.join('tmp', 'screenshots')
ref_dir = screen_dir.join('reference')
......@@ -28,10 +27,12 @@ namespace :screenshots do
raise "the comparison screenshot for #{filename} doesn't exist!"
end
img_list = Magick::ImageList.new(ref_dir.join(filename), cur_dir.join(filename))
img_list.delay = 65 # number of ticks between flicker img change (100 ticks/second)
img_list.iterations = 0 # -> endless loop
img_list.write(screen_dir.join("#{filename}.gif"))
MiniMagick::Tool::Convert.new do |convert|
convert.merge! ["-delay", "65", "-loop", "0"]
convert << ref_dir.join(filename)
convert << cur_dir.join(filename)
convert << screen_dir.join("#{filename}.gif")
end
end
puts %Q(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment