Running integration tests with FlexUnit4

Hey,

We just bumped into the following problem:

http://www.webappsolution.com/wordpress/tag/cookies/

We have a FlexUnit4 integration test which requires logging in into a tomcat server. For that it needs cookie support.
When running the test from Intellij or the maven is fails because the testrunner runs in the standalone flash player which doesn't have cookies.

So I followed the tip shown in the link above, but now Intellij doesn't shut down the test, it seems to hang forever. Debugging the test is broken also, probably because it can't connect to flashplayer anymore (now running in firefox).

Do you guys have any suggestions? How are we supposed to run integration tests with FlexUnit 4?

thx
Christian

3 comments
Comment actions Permalink

Hi, Christian,
IDEA doesn't launch Flash player explicitly. It only says to operating system that _flexunit.swf file must be launched and the way it is launched is chosen by OS.
So you are right, OS should be configured to launch browser instead of standalone Flash Player. The way for Macs is described at your link. On Windows it can be done by following command:

cmd /c ftype ShockwaveFlash.ShockwaveFlash=firefox.exe %1

Note that when Flash Player is launched as standalone it always resets this setting to itself. To check current settings use

cmd /c ftype ShockwaveFlash.ShockwaveFlash

So it is the answer about way to launch FlexUnit tests in a browser.

As for the test hanging forever. I suppose that the test doesn't hang really. It is finished and IDEA shows test results. But you see 'Terminating...' in the browser and browser is not closed. I'm afraid you always need to close browser manually because swf application doesn't have ability to do that. May be we should change 'Terminating...' message to 'Please close this page' or something like this.

Debugging FlexUnit launched in the browser is possible as well. Please check that Debugger version of Flash Player plugin is installed for the browser you use. The easiest way to check is to right-click in any running flash application in the browser. 'Show Redraw Regions' and 'Debugging' items presence in popup menu indicates that this is debugger version of plugin.

0
Comment actions Permalink

Ok thx!

For some reason the debugger works now, whereas previously it didn't. And indeed the IDEA testrunner quits normally when I close the browser window.

I wonder if there is a way to integrate this in Maven/FlexMojos. Our buildserver runs teamcity on a headless ubuntu. We've got some FU4 tests running already using flexmojos + xvfb but these don't require cookies.

Does anyone have such a setup?

0

Please sign in to leave a comment.