Merge branch 'develop' of github.com:martini/zammad into develop

This commit is contained in:
Martin Edenhofer 2015-07-16 15:42:48 +02:00
commit ba7eda1ff5
4 changed files with 31 additions and 5 deletions

View file

@ -13,6 +13,7 @@ class Locale < ApplicationModel
} }
) )
fail "Can't load locales from #{url}" if !result
fail "Can't load locales from #{url}: #{result.error}" if !result.success? fail "Can't load locales from #{url}: #{result.error}" if !result.success?
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do

View file

@ -50,6 +50,15 @@ sleep 15
#export REMOTE_URL='http://192.168.178.32:4444/wd/hub' #export REMOTE_URL='http://192.168.178.32:4444/wd/hub'
#export REMOTE_URL='http://192.168.178.45:4444/wd/hub' #export REMOTE_URL='http://192.168.178.45:4444/wd/hub'
export RAILS_ENV=test
echo "rake db:drop"
time rake db:drop
echo "rake db:create"
time rake db:create
echo "rake db:migrate"
time rake db:migrate
rake test:browser["BROWSER_URL=http://localhost:4444"] rake test:browser["BROWSER_URL=http://localhost:4444"]
#rake test:browser["BROWSER_URL=http://localhost:4444 BROWSER=chrome"] #rake test:browser["BROWSER_URL=http://localhost:4444 BROWSER=chrome"]
#rake test:browser["BROWSER_URL=http://192.168.178.28:4444"] #rake test:browser["BROWSER_URL=http://192.168.178.28:4444"]

View file

@ -104,11 +104,11 @@ class AgentTicketOverviewLevel0Test < TestCase
# check if number and article count is shown # check if number and article count is shown
match( match(
css: '.active table th:nth-child(3)', css: '.active table th:nth-child(7)',
value: '#', value: '#',
) )
match( match(
css: '.active table th:nth-child(8)', css: '.active table th:nth-child(4)',
value: 'Article#', value: 'Article#',
) )
@ -118,11 +118,11 @@ class AgentTicketOverviewLevel0Test < TestCase
# check if number and article count is shown # check if number and article count is shown
match( match(
css: '.active table th:nth-child(3)', css: '.active table th:nth-child(7)',
value: '#', value: '#',
) )
match( match(
css: '.active table th:nth-child(8)', css: '.active table th:nth-child(4)',
value: 'Article#', value: 'Article#',
) )

View file

@ -9,6 +9,22 @@ class TestCase < Test::Unit::TestCase
ENV['BROWSER'] || 'firefox' ENV['BROWSER'] || 'firefox'
end end
def profile
browser_profile = nil
if browser == 'firefox'
browser_profile = Selenium::WebDriver::Firefox::Profile.new
browser_profile['intl.locale.matchOS'] = false
browser_profile['intl.accept_languages'] = 'en-US'
browser_profile['general.useragent.locale'] = 'en-US'
elsif browser == 'chrome'
browser_profile = Selenium::WebDriver::Chrome::Profile.new
browser_profile["intl.accept_languages"] = "en"
end
browser_profile
end
def browser_support_cookies def browser_support_cookies
if browser =~ /(internet_explorer|ie)/i if browser =~ /(internet_explorer|ie)/i
return false return false
@ -25,7 +41,7 @@ class TestCase < Test::Unit::TestCase
@browsers = {} @browsers = {}
end end
if !ENV['REMOTE_URL'] || ENV['REMOTE_URL'].empty? if !ENV['REMOTE_URL'] || ENV['REMOTE_URL'].empty?
local_browser = Selenium::WebDriver.for( browser.to_sym ) local_browser = Selenium::WebDriver.for( browser.to_sym, profile: profile )
browser_instance_preferences(local_browser) browser_instance_preferences(local_browser)
@browsers[local_browser.hash] = local_browser @browsers[local_browser.hash] = local_browser
return local_browser return local_browser