Notice
You should load the test application in the browser (IE or Safari) once. If not the test might fail because the Flex application uses to long time to load.Howto add Flex code and tests
I have not been able to automate the process of adding components and tests for the test application. But automatically adding Ruby scripts to a server might not be the best idea anyway.
But I have added both the test application and the folder containing the tests to svn (FunFX svn at Rubyforge), so you can easily checkout this and update with new functionality or tests. I have also created an email address that can be used to send a flex component and/or tests to and I will add them as soon as I can.funfx.tests (at) gmail.com
(Please add the word FunFX in the subject so I can sort the mail efficiently.)
Example
This example is created with the use of Test::Unit, but you can use any other testing tool that supports Ruby.
require 'test/unit'
require 'funfx'
class ButtonTest < Test::Unit::TestCase
def setup
@ie = Funfx.instance
@ie.start(true)
@ie.speed = 1
@ie.goto("http://location.of.application")
end
def test_control
assert_not_nil(@ie.button("nameOfButton"))
@ie.button("nameOfButton").click
assert_equal("Text", @ie.label("nameOfLabel").text)
end
end