Question

I'm trying to automate a unit test for one of our products. It is ActionScript based but we do not have FlashBuilder. We use Jenkins to do all of our automated output and I can get everything working fine with the file up to and creating and rendering the testMovie of the AS Unit tests FLA file. Doing this will output to the trace output panel the results of the test. I run this flash file using JSFL simlar to

var folderPath = path/to/folder/file.fla
if (fl.fileExists(folderPath))
{
    fl.openDocument(folderPath);
    fl.getDocumentDOM().testMovie;
    fl.getDocumentDOM().close(false);
    fl.outputPanel.save("file:///C:/testJSFL/output.txt");
}

Unfortunately the outputPanel.save runs before the testMovie output is placed as a trace action and I have yet found a way through many Google searches as to how to make the system wait till the movie has run to save this file. I even tried opening and closing the file multiple times. Any help would be appreciated.

Was it helpful?

Solution

Make sure testMovie is called as a function and Save the output before closing:

var folderPath = path/to/folder/file.fla
if (fl.fileExists(folderPath))
{
    fl.openDocument(folderPath);
    fl.getDocumentDOM().testMovie();
    fl.outputPanel.save("file:///C:/testJSFL/output.txt");
    fl.getDocumentDOM().close(false);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top