File a jira for it.... but I don't know how I feel about that.... flexmojos default test runner was never meant to run visual tests... it is kinda design flaw... Also they need to be compatible with Flex3.... any thoughts on that?
You could also use a custom test runner or even put that on your test class.... just some random ideas... On Jul 11, 8:53 am, Antoine <[email protected]> wrote: > I was running into a problem when trying to run some kind of unit > tests which need to component under test to be actually added to the > stage in order for the test to succeed. The tests would pass with my > FluintTestRunner.mxml, but not when run through flexmojos (3.7.1). > > The solution I found is to modify FluintListener.as as follows: > > ... > public function runTests():int > { > var testRunner:TestRunner=new TestRunner(_testMonitor); > testRunner.testEnvironment = new TestEnvironment(); > + // Add testEnvironment to Application, to be able to test > graphical components > + var app:Application = FlexGlobals.topLevelApplication as > Application; > + app.addChild(testRunner.testEnvironment); > testRunner.startTests(_testSuite); > testRunner.addEventListener(TestRunner.TESTS_COMPLETE, > handleTestsComplete); > return testRunner.getTestCount(); > } > ... > > As described in fluint ASDoc, "the TestEnvironment is a singleton > class that allows tests to have visual components. The TestCase has a > series of fascade methods such as addChild() and removeChild() which > actually call those methods on this class." > > However, the TestEnvironment cannot play its role if it is not added > to the Application, as above. > > I hope that this fix can be included in a future release of flexmojos. > > (I should better have filed a JIRA issue, but I am not sure how to > specify all the details...) -- You received this message because you are subscribed to the Google Groups "Flex Mojos" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex-mojos http://flexmojos.sonatype.org/
