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?
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.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 BROWSER=chrome"]
#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
match(
css: '.active table th:nth-child(3)',
css: '.active table th:nth-child(7)',
value: '#',
)
match(
css: '.active table th:nth-child(8)',
css: '.active table th:nth-child(4)',
value: 'Article#',
)
@ -118,11 +118,11 @@ class AgentTicketOverviewLevel0Test < TestCase
# check if number and article count is shown
match(
css: '.active table th:nth-child(3)',
css: '.active table th:nth-child(7)',
value: '#',
)
match(
css: '.active table th:nth-child(8)',
css: '.active table th:nth-child(4)',
value: 'Article#',
)

View file

@ -9,6 +9,22 @@ class TestCase < Test::Unit::TestCase
ENV['BROWSER'] || 'firefox'
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
if browser =~ /(internet_explorer|ie)/i
return false
@ -25,7 +41,7 @@ class TestCase < Test::Unit::TestCase
@browsers = {}
end
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)
@browsers[local_browser.hash] = local_browser
return local_browser