Archive

Archive for the ‘Flex’ Category

Automation testing with Flex Monkey (Reloaded) and Maven

August 8, 2011 Leave a comment

Lately there are lot of questions on the flex monkey forum running the functional testing with maven. However there are more questions related to converting the ant script into maven stuff.

Thought of posting the steps that we use to run the automated testing with maven.

Create a maven profile to run the automation tests only when you need that. This will obviously save some time when you dont need to run each time, since you are not running it part of the maven build lifecycle.  More information on build profiles can be found at this link

Maven-antrun-plugin provides the ability to run ant tasks from maven.

 <profile>
<id>automate</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>

<tasks unless=”maven.test.skip”>
<delete file=”${basedir}/automation/build.properties”/>
<copy file=”${basedir}/automation/build.local.properties”
tofile=”${basedir}/automation/build.properties”/>
<ant antfile=”${basedir}/automation/build.xml”>
</ant>
</tasks>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-optional</artifactId>
<version>1.5.3-1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-apache-xalan2</artifactId>
<version>1.8.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>

</build>
</profile>

If you see the above code, it runs the antfile “build.xml” which is in automation folder. The build.properties are the files which is needed for my application to set the channel end points ( channel Endpoint url are different for  development, scrum, qa and also for prod). The configurations can be used to override the properties file used by ant to change the channel configuration.

There are many ways to dymanically change the channel configuration run-time by loading xmls.., changing serverconfig data and also by changing the services-config url as well etc..,

The libraries which are added in dependency section are need to generate the Junitreport tasks.

If you run the build.xml within flex builder, it would run the “junitreport” task without any issue. Since it would use the built-in jar available within flash builder plugins sections. But when running with maven, you need the above dependencies artifacts (ant , ant-optional and ant-apache-xalan2) for the report generation to work.

Here is the core part of the build XML which is used to run the generated flex unit tests (either recorded ones as well by flex monkey)

    <target name=”execute_test” depends=”initTest”>
<echo>${build.dir}/${main}.swf</echo>
<flexunit
url=”file://${build.dir}/${main}.swf”
command=”${monkey.launch.app}”
toDir=”${report.dir}”
haltonfailure=”false”
verbose=”true” />

<echo message=”Flex Monkey reports are generated to ${report.dir}” />

<junitreport todir=”${report.dir}”>
<fileset dir=”${report.dir}” >
<include name=”TEST-*.xml”/>
</fileset>
<report format=”frames”  todir=”${report.dir}/html”/>
</junitreport>
</target>

Curious to know if there is any effective way to run automated testing for your flex apps. Please could you mention that in comments section.

Advertisements
Categories: Flex, Flex monkey, Testing

Label HtmlText in Flex

January 7, 2010 1 comment

While working on some stuffs with related to htmltext using some styles for Label, it seems to be not displaying the text.

Here were the some sample scripts denoting the error which i encountered

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml&#8221;
initialize=”init()”
layout=”vertical”>
<mx:Label>
<mx:htmlText>
<![CDATA[
Label text goes here
]]>
</mx:htmlText>
</mx:Label>

</mx:Application>

It might seems to be fine with the above code, but it wont display the text, since the text entered in the CDATA section is on the second line. While working on stuffs with various html tags inside the same line, it might be very hard to figure out this silly mistakes sometimes.

The working version of the above staments would need to be like this

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml&#8221;
initialize=”init()”
layout=”vertical”>
<mx:Label>
<mx:htmlText>
<![CDATA[Label text goes here]]>
</mx:htmlText>
</mx:Label>

</mx:Application>

I guess it should be a IDE enhancement stuff when using htmlText inside Label, the cursor should default to be on the first line of the CDATA section of the Label control.(The Label control is a noneditable single-line text label)

Categories: Components, Flex

Slider :: Flex Mobile Framework

November 16, 2009 1 comment

I was occupied with lot of stuffs for the past months or so. So didnt had enough time to browse through the max videos nor the adobe labs page. There were some cool stuffs for mobile via slider, Flex Mobile Framework. You can read the FAQ and whitepaper for more understanding.

Categories: Flex, Mobile

LiveDocs Code Files Download

July 18, 2009 Leave a comment

I was having this in a mind for sometime now. How about having all the example files(code snippets with the source )  of livedocs in a server, so that people can access all the files. I am not sure whether is there any place where i can get all the files of the adobe livedocs for Flex, Flash, AIR. Let me know your comments how worth it would be?

Categories: Flex, LiveDocs

Papervision +Flex 3D tutorials

July 16, 2009 Leave a comment

Jim has nice set of video tutorials involving papervision and flex 3d tutorials. It is worth to check out.

Categories: Flex, PaperVision, Tutorials

Flex Gumbo SDK setup with Flex Builder 3

September 17, 2008 Leave a comment

Peter deHaan has written a nice entry how to setup the environment for flex Gumbo SDK with flex builder 3. For setting up the environment you need to download the latest nightly build for the flex Gumbo SDK from the adobe opensource labs. Also you need to download the latest flash player 10 which is beta now (try installing the beta version only after uninstalling any previous version if you have already installed ) . Once the two downloads were at your local machine extract the flex SDK nightly build version. Target the Flex SDK version to the downloaded folder via windows->preferences->Flex->Installed Flex SDKs to your flex Gumbo SDK folder in your computer. Try setting the target environment of flash player to 10.

Happy flexing !!

Categories: Flex