functional-testing

Automating Integration Tests: Use xUnit?

I'm looking into how best to automate integration tests (by which I mean complete use cases entirely within our application) The questions Correct Approach for Unit Testing Complex Interactions What are the pros and cons of automated Unit Tests vs automated Integration tests? cover the "why" and "what" aspects very well. The questi...

Is this scenario considered functional-testing, or some other form of testing?

I'm writing tests that check that an external service is providing inventory data (on their test server) that I can check out with, and also cancel. This testing is in the travel/hotel world, and I need to place test reservations, then cancel them. I take the following steps : 1) search for inventory(a hotel room) 90 days in the future ...

How do I setup a functional test to authenticate openid with authlogic?

I have a functional test that is supposed to call ROTS (Ruby Openid Test Server) to act as an identity. In my UsersControllerTest, I have the following: test "creating a user" do get :create, :user => { :username => "woot", :email => "[email protected]", ...

Is it okay to run for loops in functional test methods?

Is it okay (conceptually) to run for loops in test methods? I'd like to test a range of parameter values into a controller, to determine if the different inputs return the correct values. test "logged in user - add something - 0 qty" do @app = Factory.create(:app) (0..5).each do |t| @qty = t login(:user) ge...

How to fake out a subdomain lookup in Rails tests?

I have the following filter defined: # application_controller.rb class ApplicationController < ActionController::Base before_filter :find_account private def find_account @current_account = Account.find_by_subdomain!(request.subdomains.first) end end and in my test: # users_controller_test.rb class UsersController...

Does it make sense to test ui components seperately?

I'm working on a webform that has about 15 user controls, separated by context (comments, locations, members/leaders, etc).   If each control can render individually (using real or test data), does it make sense to have a seperate "functional" test page to test them in isolation or is there a better way? ...

Functional testing of output files, when output is non-deterministic (or with low control)

A long time ago, I had to test a program generating a postscript file image. One quick way to figure out if the program was producing the correct, expected output was to do an md5 of the result to compare against the md5 of a "known good" output I checked beforehand. Unfortunately, Postscript contains the current time within the file. T...

Functional Testing of Authorization In Rails

I know how to run functional/integration tests in Rails, this question is about best practices. Let's say authorization is performed using four distinct user roles: basic editor admin super This means that for each action there are up to five different behaviors possible (4 roles + unauthenticated/anonymous). One approach I've taken ...

In functional testing, should I compare all tabular data rendered in the browser with the one coming from the DB?

I'm working on a test plan for a website where some tests are taking the following path: Hit the requested URI and get the data rendered inside some table(20 rows per page). Make a database query to get the data that is supposed to be rendered in that table. Compare the 2 data row by row, they should match. Is that a correct way of d...

test cases of a form filling workflow

a software called livecycle has got forms with different fields in which data is to be filled. on submitting the form the data is stored in the mysql database. the user fills the form partially at his level and there is an assign to field . the user assigns this form to another user. using the workflow of the livecycle software the other...

How do I mix nested resources with multiple post values when testing Rails controllers?

I have a model called "Post" which is a nested resource under a model called "Project" and I'm trying to test the controller. The code works find in my browser, but I can't get it to work in the test. Here's the test context "on POST to :edit" do setup do post( :edit, :project_id => @project1.to_param, :id => @post1...

how to omit something from an rspec controller test?

In my RSpec controller test, I'm trying to test a particular action that makes a call to a subfunction. But I don't want the test to include the call to that subfunction. (it'll raise an error that simply cannot be fixed in my dev environment) What's the best way to omit this subfunction call from this controller action while I'm ru...

Fitnesse- Should tests talk to the database?

We are trying to use Fitnesse for our Functional test. Should i be mocking dependencies or should it be testing against the database? What are the Pros/Cons of either of the approach? The whole issue of testing against the DB is setting up data which is huge dependency. If we mock then is it real functional test? Thanks ...

Does MS Expression Web SuperPreview have an automation API?

I'm really interested in whether it's possible to use SuperPreview as the browser-target for browser-automation tests written in, for example, Telerik-WebAii, WatiN or Selenium (or anything else for that matter). Anyone know whether this is possible, and if so, how? While I do want to do rendering-comparison testing, I also want to be ...

Rails functional tests, routing error

I'm new to testing, and I'm having some difficulties trying to run a functional test. I've a messages_controller, and a user_controller here. in the routes, I've defined that the users resources has_many message resources. Now I'm trying to run a simple test in the messages controller: def test_index get :index, { :user_id => 1 } ...

Unit Testing or Functional Testing?

I have recently heard of Functional Testing over Unit Testing. I understand that Unit Testing tests each of the possibilities of a given piece of code from its most atomic form. But what about Functional Testing? This sounds to me like only testing if the code works, but is it as reliable as Unit Testing? I've been told there was two ...

How can I test windows programs in the cloud?

I'm working on a project that makes heavy use of shell extensions. I want to test it in as any versions of windows as possible. Is there a service designed for this? Almost like a VPS host but with OS images for retail XP, XP SP1, XP SP2, etc ...

Is it possible to test wait time for page access with Selenium IDE?

I want Selenium IDE to fail a test if the time to access a page is more than 60 seconds and log the time it took to access the page. Is it possible to do that? ...

At what point in a sprint should a functional testing resource be involved?

Our scrum team of three developers has a dedicated tester. At the moment the tester is ostensibly waiting for something to test for most of the first week of our 2-week sprint. We typically do our first release of the sprint deliverable around the Thurs or Fri of sprint week 1. At this point our tester can "test" the embryonic software. ...

Rails: Factories and Associations in Functional Tests

I'm trying to figure out why this doesn't work. Let's say you three models, User, Foo and Bar. In order for a bar to be created the user must first create and validate a foo object. Class User #snip! has_many :foos has_many :bars Class Foo #snip! belongs_to :user has_many :bars Class Bar #snip! belongs_to :user belongs_to :foo I'm ...