Class | SeleniumController |
In: |
lib/controllers/selenium_controller.rb
|
Parent: | ActionController::Base |
# File lib/controllers/selenium_controller.rb, line 45 45: def record 46: @result = {} 47: for p in ['result', 'numTestFailures', 'numTestPasses', 'numCommandFailures', 'numCommandPasses', 'numCommandErrors', 'totalTime'] 48: @result[p] = params[p] 49: end 50: File.open(log_path(params[:logFile] || 'default.yml'), 'w') {|f| YAML.dump(@result, f)} 51: 52: render :file => view_path('record.rhtml'), :layout => layout_path 53: end
# File lib/controllers/selenium_controller.rb, line 5 5: def setup 6: unless params.has_key? :keep_session 7: reset_session 8: @session_wiped = true 9: end 10: @loaded_fixtures = load_fixtures params[:fixtures].to_s 11: render :file => view_path('setup.rhtml'), :layout => layout_path 12: end
# File lib/controllers/selenium_controller.rb, line 31 31: def support_file 32: if params[:filename].empty? 33: redirect_to :filename => 'TestRunner.html', :test => 'tests' 34: return 35: end 36: 37: filename = File.join selenium_path, params[:filename] 38: if File.file? filename 39: send_file filename, :type => 'text/html', :disposition => 'inline', :stream => false 40: else 41: render :text => 'Not found', :status => 404 42: end 43: end
# File lib/controllers/selenium_controller.rb, line 14 14: def test_file 15: params[:testname] = '' if params[:testname].to_s == 'TestSuite.html' 16: filename = File.join selenium_tests_path, params[:testname] 17: if File.directory? filename 18: @suite_path = filename 19: render :file => view_path('test_suite.rhtml'), :layout => layout_path 20: elsif File.readable? filename 21: render_test_case filename 22: else 23: if File.directory? selenium_tests_path 24: render :text => 'Not found', :status => 404 25: else 26: render :text => "Did not find the Selenium tests path (#{selenium_tests_path}). Run script/generate selenium", :status => 404 27: end 28: end 29: end