Maven, FeatureSpec output

462 views
Skip to first unread message

Erik Peterson

unread,
Aug 19, 2011, 6:04:55 PM8/19/11
to scalate...@googlegroups.com
How can I get FeatureSpec output when using maven? All I get is...
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running eg.CanaryFeatureSpecTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 0.406 sec

Results :

Tests run: 3, Failures: 0, Errors: 0, Skipped: 2

Bill Venners

unread,
Aug 21, 2011, 12:43:18 PM8/21/11
to scalate...@googlegroups.com
Hi Erik,

Sorry for the delay getting back. I'm on vacation this week and was
offline for 24 hours. Surefire just gives you the JUnit XML output.
Sean Griffin been working to bring Jon Anders-Teigers olde ScalaTest
Maven plugin up to date. He's got it ready, but it hasn't been tested
out yet by real users. If you don't mind being on the bleeding edge
you can give it a try. I just tried building it and got an abstract
method error, which is probably because something is off with my
setup. But essentially this plugin is how you'll be able to use Maven
and get access to all the ScalaTest features.

The branch is here:

http://scalatest.googlecode.com/svn/branches/trenchguinea/maven-scalatest-plugin/

Start with:

svn checkout http://scalatest.googlecode.com/svn/branches/trenchguinea/maven-scalatest-plugin/

Then do a:

mvn install site

There's some documentation in there as well, but feel free to ask
questions on this list. If you get it working please let us know how
it went.

Thanks.

Bill

> --
> You received this message because you are subscribed to the Google
> Groups "scalatest-users" group.
> To post to this group, send email to scalate...@googlegroups.com
> To unsubscribe from this group, send email to
> scalatest-use...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/scalatest-users?hl=en
> ScalaTest itself, and documentation, is available here:
> http://www.artima.com/scalatest

--
Bill Venners
Artima, Inc.
http://www.artima.com

Erik Peterson

unread,
Aug 22, 2011, 10:43:43 AM8/22/11
to scalate...@googlegroups.com
Thanks Bill. It installed an ran without issue. Output looks good. If the plugin is made available in a maven repo, I may be able to work it through our build process on a new project for further testing.

Erik Peterson

unread,
Aug 22, 2011, 10:47:59 AM8/22/11
to scalate...@googlegroups.com
BTW, the proposed implementation sounds like a good idea to make integration "just work".

jpipas

unread,
Sep 19, 2011, 9:59:17 AM9/19/11
to scalate...@googlegroups.com
I'm a newbie to all of this Maven stuff, so I'm heavily relying on NetBeans, and tutorials I find online.

That being said, I too want to get the nice looking test output found in the FeatureSpec.

I'm using @RunWith(classOf[JUnitRunner]) so that JUnit runs the tests.

In my pom.xml I've got:

<build>
        <plugins>
            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <xmlreports>test-results</xmlreports>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

However my output looks only like this:


-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.entertainment.selenium.FeatureTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.515 sec


Results :

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0


Am I doomed?

Bill Venners

unread,
Sep 19, 2011, 11:32:18 AM9/19/11
to scalate...@googlegroups.com
Hi,

You're not doomed, just close to the bleeding edge. The answer is the
same as I gave to Erik Peterson, which is to use the Maven plugin that
Jon Anders-Teigers originally wrote and Sean Griffin recently did a
lot of work on. I'll repeat the email below.

I want to test and deploy this myself this week. So if that goes well
the process will be easier after a few days. But as of today, you'll
need to build it yourself from source.

On that subject, I don't know yet how to deploy a Maven plugin so that
people can use it. If anyone out there has some pointers, or can point
me to a webpage of instructions, that might save me some time
searching.

Thanks.

Bill

P.S. Here are the instructions on how to get it working today:

Surefire just gives you the JUnit XML output.
Sean Griffin been working to bring Jon Anders-Teigers olde ScalaTest
Maven plugin up to date. He's got it ready, but it hasn't been tested
out yet by real users. If you don't mind being on the bleeding edge
you can give it a try. I just tried building it and got an abstract
method error, which is probably because something is off with my
setup. But essentially this plugin is how you'll be able to use Maven
and get access to all the ScalaTest features.

The branch is here:

http://scalatest.googlecode.com/svn/branches/trenchguinea/maven-scalatest-plugin/

Start with:

svn checkout http://scalatest.googlecode.com/svn/branches/trenchguinea/maven-scalatest-plugin/

Then do a:

mvn install site

There's some documentation in there as well, but feel free to ask
questions on this list. If you get it working please let us know how
it went.

Jon-Anders Teigen

unread,
Sep 19, 2011, 12:19:44 PM9/19/11
to scalate...@googlegroups.com
How did I miss this...
Awesome work on reviving the plugin guys!

I have added a note on my github repository pointing users to this email thread and Seans fork.

/j

Michael Pilquist

unread,
Sep 20, 2011, 9:54:50 PM9/20/11
to scalate...@googlegroups.com
Hi,

I figured I'd share my experience getting this set up today.  Building from source worked without issue.  I created a test project using scala 2.9.1 and scalatest 1.6.1.  I wanted the output files to simulate the maven-surefire-plugin output as much as possible to simplify integration with existing tools (e.g., Bamboo, Sonar).  Below is the configuration I came up with.  Also, running "mvn scalatest:gui" is very nice!  Thanks to all who worked on this!

<?xml version="1.0"?>
    <modelVersion>4.0.0</modelVersion>
    <groupId>example</groupId>
    <artifactId>scalatest-plugin-example</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <repositories>
        <repository>
            <id>Scala-Tools</id>
            <name>Scala-Tools</name>
            <url>http://scala-tools.org/repo-releases/</url>
        </repository>
    </repositories>

    <build>
        <sourceDirectory>src/main/scala</sourceDirectory>
        <testSourceDirectory>src/test/scala</testSourceDirectory>

        <plugins>
            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <executions>
                    <execution>
                        <id>scala-compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>scala-test-compile</id>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>maven-scalatest-plugin</artifactId>
                <version>1.0-SNAPSHOT</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                            <xmlreports>.</xmlreports>
                            <filereports>WDF TestSuite.txt</filereports>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.9.1</version>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_2.9.1</artifactId>
            <version>1.6.1</version>
        </dependency>
    </dependencies>

</project>

Regards,
Michael

jpipas

unread,
Sep 21, 2011, 7:55:20 AM9/21/11
to scalatest-users
Bill,

Awesome, thanks for this... I'm on my way - as its now spitting out
the output as intended.

Now I just need to figure out how to get WebDriver PageObjects working
in my project, and I'm golden.
> http://scalatest.googlecode.com/svn/branches/trenchguinea/maven-scala...
>
> Start with:
>
> svn checkouthttp://scalatest.googlecode.com/svn/branches/trenchguinea/maven-scala...

Bill Venners

unread,
Sep 21, 2011, 11:42:28 AM9/21/11
to scalate...@googlegroups.com
Hi All,

I got the maven ScalaTest plugin working myself last night. I'm not
going to have time to deploy it proper until the week after next (when
we're giving another Scala workshop). But it seems to work very
nicely. Thanks to everyone who contributed.

Bill

Bill Barrington

unread,
May 22, 2012, 11:44:58 AM5/22/12
to scalate...@googlegroups.com
Hi Bill,

I guess I can discuss this with you in person this week, but I was just wondering what the status of this is. This most recent post (9/21/11) is fairly old, so perhaps another approach is underway?

I got the maven-scalatest-plugin working using Michael Pilquist's helpful post (thanks Michael).  So I'm good for now, but would like to have the plugin in a repo so you don't have to install it manually. I think I remember seeing somewhere that ScalaTest was going to be self-contained and would not require the plugin at some point?  Or did I make that up?

Anyway, thanks to everyone for all the helpful posts and for these great tools.

-Bill

>> > To post to this group, send email to scalatest-users@googlegroups.com


>> > To unsubscribe from this group, send email to


>> > For more options, visit this group at
>> >http://groups.google.com/group/scalatest-users?hl=en
>> > ScalaTest itself, and documentation, is available here:
>> >http://www.artima.com/scalatest
>>
>> --
>> Bill Venners
>> Artima, Inc.http://www.artima.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "scalatest-users" group.

> To post to this group, send email to scalatest-users@googlegroups.com


> To unsubscribe from this group, send email to


> For more options, visit this group at
> http://groups.google.com/group/scalatest-users?hl=en
> ScalaTest itself, and documentation, is available here:
> http://www.artima.com/scalatest
>

Bill Venners

unread,
May 22, 2012, 12:26:38 PM5/22/12
to scalate...@googlegroups.com
Hi Bill,

It is deployed here:

https://oss.sonatype.org/content/groups/public/org/scalatest/maven-scalatest-plugin/1.0-SNAPSHOT/

Sorry it is hard to figure that out from the scalatest.org website.
Next week after I release 1.8 I'll try and do the last tweak I wanted
to do (which was changing its name from maven-scalatest-plugin to
scalatest-maven-plugin, I think), and I'll put it on the running with
Maven page linked from the rest of the user guide. Right now you have
to know the secret hidden URL:

http://www.scalatest.org/user_guide/using_the_scalatest_maven_plugin

Bill
>> >> > To post to this group, send email to scalate...@googlegroups.com
>> >> > To unsubscribe from this group, send email to
>> >> > scalatest-use...@googlegroups.com
>> >> > For more options, visit this group at
>> >> >http://groups.google.com/group/scalatest-users?hl=en
>> >> > ScalaTest itself, and documentation, is available here:
>> >> >http://www.artima.com/scalatest
>> >>
>> >> --
>> >> Bill Venners
>> >> Artima, Inc.http://www.artima.com
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "scalatest-users" group.
>> > To post to this group, send email to scalate...@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > scalatest-use...@googlegroups.com
>> > For more options, visit this group at
>> > http://groups.google.com/group/scalatest-users?hl=en
>> > ScalaTest itself, and documentation, is available here:
>> > http://www.artima.com/scalatest
>> >
>>
>> --
>> Bill Venners
>> Artima, Inc.
>> http://www.artima.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "scalatest-users" group.
> To post to this group, send email to scalate...@googlegroups.com
> To unsubscribe from this group, send email to
> scalatest-use...@googlegroups.com

Bill Barrington

unread,
May 22, 2012, 1:00:43 PM5/22/12
to scalate...@googlegroups.com
Thanks Bill.  It works.  :-)
Reply all
Reply to author
Forward
0 new messages