integration-testing

Integration testing with random outcomes

I'd like to write some integration tests for a card game I'm creating. However, it's based on a shuffle. The only solution I can think of to get predictable results to test is stubbing the shuffle, however I'm uncomfortable doing any stubbing in an integration test. Are there any alternative strategies? ...

Testing a .Net C# WPF MVVM application from an external application

Hi I have a largish application that uses MVVM. The Model is mostly in a C++ DLL. The ViewModel is in C#, and I've tied my WPF controls to the ViewModel in the usual way. The app is ready for integration testing. I can drive tests from within the application, but I'd like to move testing out into another process so I can minimize pollu...

Running custom SQL to prepare Rails integration test

I am trying to run some custom SQL during the setup of my Rails integration tests to prepare a legacy database (e.g., to create its tables, create any required views, etc.), which is not part of my schema.rb (nor do any migrations for it exist). Are there any best practices for doing so? Googling has not been very enlightening so far ;-...

Tests dependent on commonly used functionality with NUnit

Hi, I have some initialization code to use my API. The initialization may fail and I´d like to test it in an NUnit test. After the initialization the API may be used. I´m testing the API too, but all my test methods will use the same, common, initialization code. What I would ideally like is if this behavior: The Initialization test...

Is it common to write integration tests before writing unit tests?

Is it common to write integration tests before writing unit tests? Is it conventional, a good idea, or best practice? It just seems like a logical thing to do in my mind, especially when working with some 3rd-party API for the first time: You need to know how to use the 3rd-party software before you can test your own code for proper in...

Is it wise to defer unit-testing until integration tests pass in scenarios where behavior of a 3rd-party API is largely unknown?

I don't mean defer all unit-testing until an integration test passes. The unit tests I'm referring to are those that verify that the SUT interacts with the 3rd-party mystery API correctly. The rationale for deferring these unit tests is that they verify something that is unknown. If I don't know how the 3rd-party mystery API works, ho...

What's the best way to unit test code that generates images?

What is the best way to unit test code that generates images? Say, for example, a class that generates a plot or a chart? ...

Cucumber Help in Rails 3

I am very new to cucumber and rspec, but do have some rails and ruby understanding. The gems in question are: Devise, Declarative_Authorization, and role_model Rails 3 is what I am using and ruby 1.9.2-rc2 remember I do NOT know what I am doing I have written a Feature: Feature: As the administrator of the site give me quick access ...

How can I clear the database (domains) between easyb scenarios in Grails Integration Testing?

I am running an Integration Test for a Grails application. I am using the easyb plugin. The problem is that the database doesn't seem to get cleared out between Scenarios. My When I run standard Grails Integration Tests, the persistence context is cleared between each test. The easyb Stories are in the Integration folder, but the Gr...

jwebunit: how to assert that some row in a table contains the actual values

Hi, My web page displays the following table( in an html format, but simplified here) Item# Item_Description Price Status 100 COOKIE $68.00 Eligible 123 RADIO $94.00 Eligible 300 DIAPERS $54.00 Returned How do I use jwebunit to make an assertion that there is some row in this table with Item#=300 and status = "Returned"...

Running only part of the set of all tests with MSTest

I'd like to know if there is any simple way of running with MSTests a certain category of tests. I currently have some Unit and Integration tests. Generally, I just want to run Unit-Tests. I know you can tag each test method with a category, but from what I've seen it seems like it is only useful if you want to create different tests li...

grails integration test case preserve data for investigation

We were used to running our grails integration test against in memory HSQLDB database, but at the failure point it was difficult to investigate as the data was lost. We migrated to running the test against the physical database(postgres) and all is well when the tests passes. At any point if the tests fail we want the data to be committe...

Good practices for Integration Tests for my rails app external endpoints?

I'll keep it short, I've got a rails app which communicate with other apps, some using SOAP (non-rails apps of course...) and others with REST. I'm making integration tests to ensure that my endpoint wrapper classes have correct mappings and setup. However, they are executed by default by rake test which makes it slow and fragile. I wish...

Integration Testing a ViewModel that calls WCF Services asynchronously in a WPF MVVM Application

The Silverlight Toolkit contains Unit Testing Functionality that allows to test classes such as the ViewModels in a MVVM application that invoke remote Services asynchronously. I would like to be able to perform my ViewModel Integration Tests against the actual services instead of mocked instances. Is there any support for asynchrono...

Cucumber and Capybara, clicking a non-link or button element

I am trying to test an inplace editor using Cucumber/Capybara/Selenium stack, but my problem is that the editor is activated by clicking a div and not a link or button. I can not seem to figure out how to get Capybara to do this. Is there a way of doing this? ...

Set RAILS_ENV for Custom Test Environment

I have created a custom Rails integration environment that i use to run Selenium tests. The tests run fine in this new environment, however the problem is that within the test code, the RAILS_ENV variable is set to test. I have a test helper class which is similar to the default rails test_helper class, and defines ENV["RAILS_ENV"] = "...

Grails integration testsuite suite

Hello All, We have a set of integration test which depend upon same set of static data. Since the amount of data is huge we dont want to set it up per test level. Is it possible to setup data at the start, run group of test and rollback the data at the end of test. What we effectively want is the rollback at test suite level rather tha...

Unit tests must locate in the same package?

A JUnit book says " protected method ... this is one reason the test classes are located in the same package as the classes they are testing" Can someone share their experience on how to organize the unit tests and integration tests (package/directory wise)? ...

Grails Integration testing: problems with get

Hi, I'm trying to write a simple integration test, but having some trouble with Domain Objects. I've read on unit testing but can't figure it out. This is my simple test: User user = User.get(1) controller.params.userid = "1" controller.session.user = user controller.save(); The error message is: groovy.lang.Mis...

How to integrate Sikuli scripts into Selenium?

I'm extensively using Selenium for integration testing. Works great for all normal stuff (HTML/AJAX), but no go when I'm trying to test third party ActiveX, Java applets and Flash components. The solution I've found for this is Sikuli. Works great locally, but how can I integrate that into Selenium? btw. if that's relevant, for Seleni...