diff --git a/app/models/locale.rb b/app/models/locale.rb index 5635f7ae6..6381e3b9f 100644 --- a/app/models/locale.rb +++ b/app/models/locale.rb @@ -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 diff --git a/script/local_browser_tests.sh b/script/local_browser_tests.sh index 1591b48fa..5e00b6a98 100755 --- a/script/local_browser_tests.sh +++ b/script/local_browser_tests.sh @@ -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"] diff --git a/test/browser/agent_ticket_overview_level0_test.rb b/test/browser/agent_ticket_overview_level0_test.rb index d2824bde8..4120eaeda 100644 --- a/test/browser/agent_ticket_overview_level0_test.rb +++ b/test/browser/agent_ticket_overview_level0_test.rb @@ -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#', ) diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 3defb2aa9..a4d89f6aa 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -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