From 85889010e8737b81784196bd632e4121e9da8651 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 21 Feb 2013 22:56:32 +0100 Subject: [PATCH] Added browser test for preferences. --- test/browser/prefereces.rb | 96 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 test/browser/prefereces.rb diff --git a/test/browser/prefereces.rb b/test/browser/prefereces.rb new file mode 100644 index 000000000..d57bf6ad5 --- /dev/null +++ b/test/browser/prefereces.rb @@ -0,0 +1,96 @@ +# encoding: utf-8 +require 'browser_test_helper' + +class Preferences < ActiveSupport::TestCase + test 'preferences' do + tests = [ + { + :name => 'preferences', + :action => [ + { + :execute => 'click', + :element => :link, + :href => '#current_user', + }, + { + :execute => 'click', + :element => :link, + :href => '#profile', + }, + { + :execute => 'wait', + :value => 1, + }, + { + :execute => 'click', + :element => :link, + :href => '#profile/language', + }, + { + :execute => 'wait', + :value => 1, + }, + { + :execute => 'check', + :element => :div, + :id => 'language', + :result => true, + }, + { + :execute => 'wait', + :value => 2, + }, + { + :execute => 'select', + :element => :select_list, + :name => 'locale', + :value => 'Deutsch', + }, + { + :execute => 'click', + :element => :button, + :type => 'submit', + }, + { + :execute => 'wait', + :value => 5, + }, + { + :execute => 'check', + :element => :form, + :id => 'login', + :result => false, + }, + { + :execute => 'match', + :element => :body, + :value => 'Sprache', + :match_result => true, + }, + { + :execute => 'select', + :element => :select_list, + :name => 'locale', + :value => 'English (United States)', + }, + { + :execute => 'click', + :element => :button, + :type => 'submit', + }, + { + :execute => 'wait', + :value => 5, + }, + { + :execute => 'match', + :element => :body, + :value => 'Language', + :match_result => true, + }, + ], + }, + ] + browser_signle_test_with_login(tests) + end +end