functional-testing

Is it advisable to disable some helper methods in the test environment for rails?

I have an application helper which determines the css classes (selected or unselected) and link addresses for the navbar at the top of my application helper. When I test my controllers, I get a whole bunch of errors regarding the navbar (variables return nil). Since the navbar has nothing to do with each individual controller, and it ap...

Functional testing form with CSRF enabled in Symfony

What is the best way of creating functional tests to test forms with CSRF protection enabled in Symfony? Currently I have to add the following code before each form submittion: $form = new sfGuardFormSignin(); $token = $form->getCSRFToken(); $token_name = $form->getCSRFFieldName(); Then I add the $token and $token_name to form ...

Selenium vs. SimpleTest vs. WatiN

It seems there is very few comparison between Selenium / WatiN and SimpleTest (which has web testing features too). I tried Selenium and found the GUI great to create tests as you can see what's going on and record without typing all commands manually. As for running the tests, Selenium is way more complex than SimpleTest. For SimpleTe...

Rails Functional Test using Recaptcha

My UsersControllerTest currently fails because I use verify_recaptcha in UsersController#create. How can I write my tests such that a known good CAPTCHA response is passed with params[:user]? I am using reCAPTCHA, but I suppose the question would apply to any CAPTCHA implementation. Here is my UsersController#create def create @user ...

Rails belongs_to testing

I have a Proposal model that belongs to Project: class Proposal < ActiveRecord::Base belongs_to :project has_many :articles, :as => :document, :dependent => :destroy has_many :sections, :through => :articles # proposal has project - test/unit/proposal_test.rb validates_presence_of :project_id end The route I set up to show ...

In Rails, how do you functional test a Javascript response format?

If your controller action looks like this: respond_to do |format| format.html { raise 'Unsupported' } format.js # index.js.erb end and your functional test looks like this: test "javascript response..." do get :index end it will execute the HTML branch of the respond_to block. If you try this: test "javascript response..." ...

How to test for the appearance of a Toast message

Would anyone know how to test for the appearance of a Toast message on an Activity? I'm using code similar to what the OP posted on this question for testing my program flow from one activity to the next. I'd also like to be able to test for toast messages on particular activities. ...

Ruby on Rails testing: How can I test or at the very least see a form_for's error_messages_for?

I'm working on creating a tests, and I can't figure out why the creation of a model from a form_for is failing in the test but works in real browsers. Is there a straightforward way for me to see what the problems are in the model creation? Even better would be, is there a straightforward way for me to test the error outputs that I acc...

Rails Functional test assert_select javascript respond_to

Hello, I am currently trying to write functional tests for a charging form which gets loaded on to the page via AJAX(jQuery). It loads the form from the charge_form action which returns the consult_form.js.erb view. This all works, but I am having trouble with my testing. In the functional I can go to the action but I cannot use asse...

Good books and resources on user interface testing

I am looking for good books and articles on user-interface testing. What they should contain (one or more of): different test methods/strategies examples, use cases naming pros and cons for different methods testing functionality testing usability (less important for my me but still good) something important I might have forgotten :-) ...

Screen Resolutions

I am testing an application and need to test it with different screen resolutions with windows form applications. What is the common resolution tested for now days? ...

Function testing on Netbeans 6.8

While not a torrent, but some articles can be found on the net about function testing (particularly http://blogs.sun.com/geertjan/entry/gui_testing_on_the_netbeans). However the tools mentioned by them do not seem to be maintained, or don't have a plugin working with the most recent version of Netbeans (6.8). Do you have any function te...

How do you: Symfony functional test on a secure app?

Im trying to perform some function tests in symfony 1.4. My application is secure so the tests return 401 response codes not 200 as expected. I've tried creating a context and authentication the user prior to performing the test but to no avail. Any suggestions? Do I need to pass sfContext to the sfTestFunctional? Thanks include(dir...

Best Way to Run Functional Tests of a WSGI Application?

I'm writing a pair of simple WSGI applications to get a feel for the standard, and I'm to the point where I'd like to test that my applications are working as expected. Now I'm trying to figure out the best way start and stop a server hosting those applications. My first thought was to start up the SimpleServer from wsgiref in the setUp...

Rails functional testing without migrations

The name pretty much says it all. Does anyone know how to accomplish functional testing when you are not using migrations in Rails? I'd be open to any advice or third party libraries (if there are any). I thought of creating my own plugin to address this but it seems like a pretty big task and would rather not do this unless necessary. ...

Setting up functional Tests in Flex

I'm setting up a functional test suite for an application that loads an external configuration file. Right now, I'm using flexunit's addAsync function to load it and then again to test if the contents point to services that exist and can be accessed. The trouble with this is that having this kind of two (or more) stage method means tha...

RemoteWebDriver InternetExplorer navigate().to() timeout?

i was running a test remotely on internet explorer, and when using navigate().to() selenium returns me this: "12:13:58.770 INFO - WebDriver remote server: Exception: The driver reported that the command timed out. There may be several reasons for this. Check that the destinationsite is in IE's 'Trusted Sites' (accessed from Tools->Intern...

file upload functional testing in symfony without calling click()

I can't seem to perform functional test on file uploads through the sfTestFunctional's post() method. My action handling the HTTP post is able to get all parameters except the file upload field. Looking at Symfony 1.4's source codes, i think the sfBrowserBase only handle file upload through the click() method (specifically, the doClickE...

functional test for rails controller private method

I have a private method in my controller. which is used for some database update. this method i am calling from another controller method. and it works fine. But when i am trying to write a test case for that method then It is tripping on accessing (session variable and params) in my functional all other methods are working fine the pro...

How to enable page caching in a functional test in rails?

Is it possible to turn on page caching for a functional test? The following didn't work: class ArticlesControllerTest < ActionController::TestCase def setup ActionController::Base.public_class_method :page_cache_path ActionController::Base.perform_caching = true end end thanks in advance Deb ...