Access Keys:
Skip to content (Access Key - 0)
Log in (Access Key - 5)



Toggle Sidebar

Maven

Latest version for all Maven Plugins:

Stable version 1.0.1
SNAPSHOT version 1.0.2-SNAPSHOT

Download

The Molybdenum maven repository for plugins and artifacts is: https://www.molyb.org/maven-repo/.

To get the plugins and artifacts directly, add the following to your POM or configure your Maven proxy appropriate:

<repositories>
  <repository>
    <id>molybdenum</id>
    <name>Molybdenum Artifact Maven Repository</name>
    <url>http://molyb.org/maven-repo/</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </repository>
</repositories>
<pluginRepositories>
  <pluginRepository>
    <id>molybdenum</id>
    <name>Molybdenum Plugin Maven Repository</name>
    <url>http://molyb.org/maven-repo/</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </pluginRepository>
</pluginRepositories>

molybdenum-maven-plugin

Changed groupid!

With release 1.0.0 of the Molybdenum Maven plugins the groupid has changed from org.molyb.maven to org.molyb.automation.maven.

Executes Molybdenum with a specified Firefox Profile. Additional extensions and files can be put into the profile.
Molybdenum log and report writing can be controlled and an autostart argument can be passed to Molybdenum.

Goals overview

There is only one goal: test.
The plugin is by default bound to the test lifecycle phase.

Properties

Name Type Default Required Description
profilename String   yes The name of the Firefox profile to be used to start Molybdenum
firefoxexec File   yes The path to the Firefox executable to be used to start Molybdenum
testsuitefile File   either testsuitefile or testsuiteurl has to be set The path to the Molybdenum suite to be loaded
testsuiteurl String   either testsuitefile or testsuiteurl has to be set The url to the Molybdenum suite to be loaded
report File   no If a report should be written, the path to the report html file to be written. Additional files will be copied in a directory beside the report html file.
Only passed on to molybdenum if testsuite is provided.
argument String   no The value of the Molybdenum variable autostartArgument. This variable is globally available via ${autostartArgument}
Only passed on to molybdenum if testsuite is provided.
headless boolean false no If set, several UI actions are suppressed to speed up the test execution. This is can be used if Molybdenum is executed in an automatic build environment.
Only passed on to molybdenum if testsuite is provided.
dontrun boolean false no If set to true, Molybdenum will not start the testrun automatically.
Only passed on to molybdenum if testsuite is provided.
consolelogging boolean false no If set to true, the output of the firefox error console will be redirected to standard out.
log File   no If specified, all log output of Molybdenum will be written to that file. Does not work under Windows. Use additionalFirefoxParams='-console' as a workaround.
cloginclude String .* no Regular Expression for filtering firefox error console, e.g. "JavaScript.*(myhost.org)"
Only relevant, if consolelogging=true.
clogexclude String null no Regular Expression for filtering firefox error console
Only relevant, if consolelogging=true.
additionalFirefoxParams String   No Any additional command line parameters to pass on to firefox, e.g. "-console"
resourcedir File   no If set, the content of the directory will be copied to the Firefox profile directory. Can for example be used to influence the Firefox configuration via the user.js file.
extensions List   no This is a list of extension elements describing extensions to be installed in the Firefox profile
extensionlinks List   no This is a list of extensionlink elements describing to be linked into the Firefox profile.
skip boolean ${maven.test.skip} no Set it to true to skip Molybdenum execution
skipTests boolean ${skipTests} no Set it to true to skip Molybdenum execution (but schedule building will be executed if configured in your pom)
testFailureIgnore boolean ${maven.test.failure.ignore} no Normally used in the site lifecycle by maven itself.

Inner elements

extension
Name Type Default Required Description
xpi File   yes The path to an XPI file to be installed.

extensionlink
Name Type Default Required Description
linktarget File   yes The path to a extension directory to be linked as extension. Usually used for extension development

Examples

...
<plugin>
  <groupId>org.molyb.automation.maven</groupId>
  <artifactId>molybdenum-maven-plugin</artifactId>
  <configuration>
    <profilename>molybdenum-test</profilename>
    <firefoxexec>/usr/bin/firefox</firefoxexec>
    <testsuitefile>src/main/resources/suite.xml</testsuitefile>
    <report>target/moly-reports/report.html</report>
    <argument></argument>
    <headless>false</headless> 
    <dontrun>false</dontrun>
    <consolelogging>true</consolelogging>
    <log>target/molybdenum.log</log>
    <resourcedir>target/molybdenum-test</resourcedir>
    <extensions>
      <extension>
        <xpi>/home/user/molybdenum-0.7.0.xpi</xpi>
      </extension>
    </extensions>
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>test</goal>
      </goals>
    </execution>
  </executions>
</plugin>
...

molybdenum-report-maven-plugin

Links a previously generated Molybdenum report into a maven site.

Properties

Name Type Default Required Description
name String Molybdenum Report no The name of the report used in the site navigation and as link name
description String Report generated by Molybdenum test run including screenshots and rerun capabilities. no Will be shown on the report overview page.
base String molybdenum-report no name of the directory inside the site dir used to store all the report resources
filename String report.html no The name of the file targeted by the site link. each name can be used except index.html

Examples

Simply do the default job

...
<reporting>
  <plugins>
    <plugin>
      <groupId>org.molyb.automation.maven</groupId>
      <artifactId>molybdenum-report-maven-plugin</artifactId>
    </plugin>
  </plugins>
</reporting>
...

Configure, what is configurable.

...
<reporting>
  <plugins>
    <plugin>
      <groupId>org.molyb.automation.maven</groupId>
      <artifactId>molybdenum-report-maven-plugin</artifactId>
      <version>1.0-SNAPSHOT</version>
      <configuration>
      	<name>Smoke UI Tests</name>
      	<description>Test the main flows of the application only</description>
      	<base>molybdenum-smoke</base>
       	<filename>smoke-report.html</filename>
      </configuration>
    </plugin>
  </plugins>
</reporting>
...

schedulebuilder-maven-plugin

Build a schedule based on include and exclude patterns.

Goals overview

There is one goal: build.
The plugin is by default bound to the process-test-resources lifecycle phase.

Properties

Name Type Default Required Description
includes List   no, default is include all ANT like patterns for files to be included in the schedule.
excludes List   no, per default nothing is excluded ANT like patterns for files to be excluded from the schedule.
schedule File   yes The path to the schedule file to be written. Pathes of suites referenced by this schedule are build relative to the schedule file itself
label String   no The label of the schedule passed to the report
relocateto String no relocation will be applied no If the report should have rerun links accessing the suite from a remote server (i.e. over http) the location of the schedule on this server could be passed here. The schedule itself hasn't to be exeist on the server, the location is used only to calculate the pathes for the rerun links.
skip boolean ${maven.test.skip} no Set it to true to skip schedule generation
includetags String   no, empty or left out property means: include all. A comma separated list of test tags where test should be included in the schedule.
excludetags String   no, empty or left out property means: exclude nothing. A comma separated list of test tags where test should be excluded from the schedule.

Examples

Create the schedule in the directory target/schedule, name the file schedule.xml.
Include all files with extension .xml and starting with suite laying in the directory target/schedule and its subdirectories.
Exclude the file with name suite-exclude.xml whereever found.
Pass the label myLabel to the report,
Relocate the rerun links to http://molyb.org/schedule.xml For instance the file target/schedule/suite1.xml will end up in arerun link of http://molyb.org/suite1.xml.

...
<plugin>
  <groupId>org.molyb.automation.maven</groupId>
  <artifactId>schedulebuilder-maven-plugin</artifactId>
  <configuration>
    <schedule>target/schedule/schedule.xml</schedule>
    <label>myLabel</label>
    <relocateto>http://molyb.org/schedule.xml</relocateto>
    <includes>
      <include>**/suite*.xml</include>
    </includes>
    <excludes>
      <exclude>**/suite-exclude.xml</exclude>
    </excludes>
  </configuration>
  <executions>
    <execution>
      <goals>
         <goal>build</goal>
      </goals>
    </execution>
  </executions>
</plugin>
...

cleanffprofile-maven-plugin

It is used to cleanup a Firefox user profile by deleting the directory and removing the appropriate entry in the profile registry. If the profile is non existant, the plugin does nothing.

Goals Overview

There is only one goal: clean
By default, the plugin is bound to the clean phase.

Examples

Cleanup the profile named my_profile.

<plugins>
  ...
  <plugin>
    <groupId>org.molyb.automation.maven</groupId>
    <artifactId>cleanffprofile-maven-plugin</artifactId>
    <configuration>
      <profilename>my-profile</profilename>
    </configuration>
    <executions>
        <execution>
           <goals>
              <goal>clean</goal>
           </goals>
        </execution>
    </executions>
  </plugin>
  ...
</plugins>

Typical Usage

  • Repository access without proxy
  • getting the Molybdenum XPI from Maven repository
  • prepare user.js for automatic test execution
  • suites layed in src/test/molybdenum and named *-suite.xml
  • log written to the target/molybdenum.log
  • report bound into the site navigation
...

<repositories>
  <repository>
    <id>molybdenum</id>
    <name>Molybdenum Artifact Maven Repository</name>
    <url>http://molyb.org/maven-repo/</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </repository>
</repositories>
<pluginRepositories>
  <pluginRepository>
    <id>molybdenum</id>
    <name>Molybdenum Plugin Maven Repository</name>
    <url>http://molyb.org/maven-repo/</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </pluginRepository>
</pluginRepositories>

...

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <executions>
    <execution>
      <id>copy</id>
      <phase>process-resources</phase>
      <goals>
        <goal>copy</goal>
      </goals>
      <configuration>
        <artifactItems>
          <!-- get and unpack the Molybdenum XPI -->
          <artifactItem>
            <groupId>molybdenum</groupId>
            <artifactId>molybdenum-xpi</artifactId>
            <type>jar</type>
            <overWrite>true</overWrite>
            <outputDirectory>${project.build.directory}</outputDirectory>
            <destFileName>molybdenum.xpi</destFileName>
          </artifactItem>
        </artifactItems>
        <overWriteReleases>false</overWriteReleases>
        <overWriteSnapshots>true</overWriteSnapshots>
      </configuration>
    </execution>
  </executions>
</plugin>

...

last edited on Nov 24, 2009 15:35
Adaptavist Theme Builder Powered by Atlassian Confluence