Revision: 4023
Author: KariHusa
Date: Wed Sep 1 01:14:03 2010
Log: Created wiki page through web user interface.
http://code.google.com/p/robotframework/source/detail?r=4023
Added:
/wiki/MavenIntegration.wiki
=======================================
--- /dev/null
+++ /wiki/MavenIntegration.wiki Wed Sep 1 01:14:03 2010
@@ -0,0 +1,105 @@
+#summary Running Robot Framework tests as a part of Maven build.
+
+<wiki:toc/>
+
+= Introduction =
+
+Here's a quick example of using Robot Framework from
[http://maven.apache.org/ Maven] builds.
+
+= 1. Create a project =
+
+{{{
+mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes
-DgroupId=com.mycompany.app -DartifactId=my-app
+}}}
+
+= 2. Create a directory for robot tests =
+
+{{{
+cd my-app
+mkdir src/test/resources
+mkdir src/test/resources/robot-tests
+}}}
+
+= 3. Create a robot test =
+
+{{{
+vim src/test/resources/robot-tests/test.txt
+}}}
+{{{
+*** Test Cases ***
+Hello World
+ Log Hello, World!
+}}}
+
+= 4. Add Robot test execution to Maven pom.xml =
+{{{
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.mycompany.app</groupId>
+ <artifactId>my-app</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>my-app</name>
+ <url>http://maven.apache.org</url>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <executable>pybot</executable>
+ <workingDirectory>.</workingDirectory>
+ <arguments>
+ <argument>-d</argument>
+ <argument>target/robot</argument>
+ <argument>src/test/resources/robot-tests/test.txt</argument>
+ </arguments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+}}}
+
+= 5. Run Robot tests with Maven =
+
+{{{
+mvn integration-test
+}}}
+
+= 6. Enjoy reports and greeness =
+
+{{{
+target/robot/log.html
+}}}
+
+= Resources =
+
+[http://robotframework.googlecode.com/files/rf-mvn-example.zip The example
sources in a zip file]
+
+Please read more about the Maven Exec-plugin and its configuration at the
[http://mojo.codehaus.org/exec-maven-plugin/ Exec-plugin site].