functional-testing

Functional test "get" requests and the https protocol

I'm trying to write a functional test for an action that must run over https. I'm not testing the HTTPS redirect - I already know that works from another test. What I'm trying to do is: get :new, :protocol => "https://" assert_redirected_to :root But this does not issue the request over https. Is there a "get" option that will allow ...

In Rails 3, I'm getting a NoMethodError for the recycle! method during testing

Hello, I've got a functional test that's using fixtures. I also am using fixtures in my Unit tests, but they work without flaw. When running the functional tests, I get a: NoMethodError: undefined method 'recycle!' for #<Response:0x10346be10> /test/functional/responses_controller_test.rb:10:in 'test_testing' My functional tests, at ...

Rails functional test not catching/getting exceptions

When running one of my app's functional tests the other day I hit a bug in my code that was causing a RoutingError. My functional test was loading a page and in that page it was creating a link to a page that had no valid route to it. The specific cause of the exception is not the point though - the problem was that this exception was ...

Maven 2 multi module pom

I have recently started migrating my project from ant to maven. I have two module in my application which I am able to build using maven. Now I have automated tests project which use Web Driver for testing UI functionality. What I am trying to do using maven is to build both module wars and deploy them on to tomcat. Then run automation...

Testing the View in a WPF MVMM application

Hi All I'm just getting started in the exciting world of WPF development, having been a C++ developer for many years. Testing applications with rich user interfaces has of course, always been hard. One of the problems compounding this has traditionally been that in most Windows apps, the UI, the UI logic and the App logic are all comp...

Symfony -- How to write a functional test with user authentication?

I am writing a functional test for a page that requires user authentication. I am using the sfDoctrineGuard plugin. How do I authenticate a user in my test? Do I have to enter every test through the sign in screen? Here is my incorrect code: $b->post('/sfGuardAuth/signin', array('signin[password]' => 'password', '...

"Wrong number of arguments (1 for 0)" in the "create" action

I've got a functional test that errors on the following method, saying that the first "Quality.create!(..." statement has too many arguments, which doesn't make any sense to me at all. Running Ruby 1.8, Rails 2.3.5 def reset_quality_lut Quality.delete_all Quality.create!(:value => 1, :name => "Scrap", :extended_na...

Are there problems with ActivityInstrumentationTestCase2 in Android 2.1?

After I have set up all the unit test cases for my android application I now also want to do functional testing. But I encouter one problem. As I am developping for the HTC Legend I can, by now, only use android platforms up to 2.1. But in some way it seems that the ActivityInstrumentationTestCase2 won't work. public SupplierSelectoinT...

What is a good way to write functional tests for website email functionality?

Websites involve email functions, such as sending registration information, password reminders, etc. I try to routinely run functional tests of complete websites from outside the website, and need a way to receive these test emails from an httplib based test script. Previously, I have used anonymous email services, where the email cont...

Error in sample functional tests with Yii

Recently I've discovered Yii framework and started learning it. I've generated app skeleton using yiic tool, installed PHPUnit, SeleniumRC and attempted to run functional tests provided by skeleton app (I didn't change anything). > phpunit functional/SiteTest.php Report said following: There was 1 error: 1) SiteTest::testLoginLog...

Selenium Page Object Reuse

I really like how selenium 2 by convention pushes you towards using PageObjects as POJOs, and then simply using the PageFactory to instantiate the fields in this class. What I am finding limiting is that we reuse a lot of elements on many different pages. The big problem is that these reused components do not have the same id / name wh...

Rails Functional Test - excluding method from setup

This should be simple but I can't find any examples. I have standard functional tests in my rails 3 application (descending from ActionController::TestCase) that look like: test "see if 1+1=2" do .... end and at the top I have a setup method: setup do ...... end How do I exclude a method? I.e. setup :except => "see if 1+1=2" do...

Rails mock_model returning TrueClass?!

Trying to test a controller in Rspec. (Rails 2.3.8, Ruby 1.8.7, Rspec 1.3.1, Rspec-Rails 1.3.3) I'm trying to post a create but I get this error message: ActiveRecord::AssociationTypeMismatch in 'ProjectsController with appropriate parameters while logged in: should create project' User(#2171994580) expected, got TrueClass(#214825...

Testing tutorial and interview questions

Can anyone provide me Tutorial documents for Testing and interview questions for Testing based on Fresher level and experience level ? ...

Assumptions when deciding on Equivalence Partitions for Black Box Testing

Hi All I'd be interested in people's thoughts on what assumptions are reasonable when deciding on equivalence partions for black box test inputs. To keep things simple, let's say we have a command line app, and it can do five tasks. Upon running the app, the user selects which task he wants to perform by entering 1,2,3,4 or 5. Once the...

Has anyone used Minitest::Spec withing a Rails functional test?

The spec library in Minitest is great. I've been able to use it within Rails unit tests no problem. However, Rails functional test inherit from ActionController::TestCase which provides instance variables like @controller in it's setup. Has anyone been using the Minitest::Spec lib for their Rails functional tests? If not, I'm conside...