Check out the following in the near term if you're in the same camp:
Your Main MXML document should extend FlexRunner (not TestRunner), and
then call 'runner.setPrinter', instead of just 'setPrinter'.
The FlexRunner is just a simple wrapper that extends Application and
composes a TestRunner. This will allow you to instantiate Components
properly.
I just tried this locally, and it seems that Flex applications
interact with the Flex debugger differently than regular ActionScript
aplications and our FDB helper isn't really working properly.
For the short term, you'll need to break out (and remove) the existing
cruise task helper into actual build tasks so that you can configure
FDB to wait for the extra frame full of actions that MXML projects have.
Replace 'SomeProject' with your project name.
---------------------------------------
output_file = 'bin/SomeProjectXMLRunner.swf'
# This is the FDB task - if you remove the second continue
# You can interact with the Flex Shell Debugger (breakpoints/etc)
fdb "run_#{output_file}" => output_file do |t|
t.file = output_file
t.kill_on_fault = true
t.run
t.continue
t.sleep_until(/fdb/)
t.continue
end
# Configure this with your libraries and source paths
# as it will not pick up configuration from your ProjectModel
mxmlc output_file do |t|
t.input 'src/SomeProjectXMLRunner.as'
t.source_path << 'test'
t.source_path << 'lib/asunit3'
end
desc "Compile and run CI build"
task :cruise => "run_#{output_file}"
---------------------------------------
Thanks!
Luke