On 3/11/14 11:42 PM, "Erik de Bruin" <e...@ixsoftware.nl> wrote:

>Yes, we very much need to be able to test against various browsers (both
>old - IE8 comes to mind - and new). Any solution that doesn't allow
>automated testing against multiple browsers on multiple platforms seems a
>less optimal choice. The various JS, CSS and maybe SVG implementations
>just
>differ too much.
>
>I like the (M)XML option to define the test, as it will allow one test to
>be run against both outputs (SWF and release JS). So Mustella seems the
>logical choice for the SWF side, and for the browser side we can just take
>the (M)XML, parse it into something else and feed that to an established
>JS/HTML testing environment, like Selenium.
>
>This is what Marmottini was supposed to do, eventually. In it's current
>state, Marmottini is just a proof of concept, where the test is hard coded
>into Java. But, especially with the help of the Mustella Java code that I
>presume parses the MXML, it shouldn't be too hard to read in MXML,
>translate the input into Selenium tests and run those... Another option
>might be to use Mustella and add a code path that uses Selenium instead of
>the Flash Player to test JS and feed the output of that back into the
>Mustella reporting stuff.
The Mustella Java code doesn't do much with the MXML.  It just looks for
the testSWF attribute on the top tag and then compiles MXML file pointed
to by the testSWF and includes the test script MXML as a mixin.  The
compiler parses both MXML files.

So the key question is: is there some advantage of converting the test
script to Java or interpreting it in Java?  With the approach I'm heading
in, where each Mustella test step like DispatchMouseEvent or
AssertPropertyValue is an AS class and then will be ported to be a JS
"class", we will be running JS code in the browser to fake events and grab
objects and check their properties.  For the SWF, the output is captured
by trace() or sent over a socket.  How can we get information to Selenium?

The MXML test script should be valid XML, so it should be easily parsed by
Java code.  We have to figure out what to do with any fx:Script block, but
otherwise, maybe each MXML tag just runs a Java class?  For MXML event
handling code in AS, maybe that just gets passed to JS eval()?  Or
cross-compiled first by FalconJX?  I guess this approach would make bitmap
compares possible?  If so, maybe this approach would be less work.

Anyway, I'm packing it in for tonight.  I'll catch up on this thread in
about 6 hours.

-Alex

Reply via email to