Hi catalin,
I've checked and yes the selenium plugin we're using is too old. That
xvfb support has been added recently. Actually the selenium plugin
has been completely rewritten recently (it was in java it's now in
groovy... first time I see a maven plugin in groovy). BTW it now
supports running HTML selenium tests.
I've set up our CI with Raffaello on
http://teamcity.xwiki.org and
I've discussed the need for an X display. Raffaello is setting up a
vncserver which will act as an X server. He prefers this over xvfb as
he's more experienced with it and knows it works for sure. I guess we
could do the same locally if we wanted. I think the steps are:
1- set up the DISPLAY env variable
2- start vncserver
3- start the selenium RC server
4- launch the browser
5- execute the tests
I guess we could integrate steps 1 and 2 in the m2 build in a profile.
Of course I think the best solution is
http://www.realityqa.com/
realityview.jsp (which I'm working on getting - I've asked Patrick if
it's ready to be used) but this vncserver solution would be a nice
backup solution in case the realityqa server is down or in offline mode.
WDYT?
Thanks
-Vincent
PS: I'm copying the xwiki dev list so that others know what we're
working on.
On Jun 23, 2007, at 12:30 PM, Catalin Hritcu wrote:
Hi Vincent,
I was not able to run the tests in headless mode, because I'm getting
a strange error. When you have some time maybe you can have a look.
So what I did was modify Step 3 in the
xwiki-product-enterprise/distribution-test/pom.xml as documented here:
http://mojo.codehaus.org/selenium-maven-plugin/examples/headless-
with-xvfb.html
Now that part looks like this:
<!-- Step 3: Start Selenium -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>1.0-beta-2-SNAPSHOT</version>
<executions>
<execution>
<id>xvfb</id>
<phase>pre-integration-test</phase>
<goals>
<goal>xvfb</goal>
</goals>
</execution>
<execution>
<id>start-selenium</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<background>true</background>
</configuration>
</execution>
</executions>
<configuration>
<background>true</background>
<multiWindow>true</multiWindow>
</configuration>
</plugin>
The error I get is as follows:
catalin-4:~/JavaApps/xwiki-trunks-devs/xwiki-product-enterprise/
distribution-test
hritcu$ mvn install
[INFO] Scanning for projects...
[INFO]
----------------------------------------------------------------------
------
[INFO] Building XWiki Products - Enterprise - Functional Tests
[INFO] task-segment: [install]
[INFO]
----------------------------------------------------------------------
------
[INFO]
----------------------------------------------------------------------
--
[ERROR] BUILD ERROR
[INFO]
----------------------------------------------------------------------
--
[INFO] Failed to construct build plan for:
com.xpn.xwiki.products:xwiki-enterprise-test:pom:1.1-SNAPSHOT (
task-segment: [install] ). Reason: Mojo: xvfb does not exist in
plugin: org.codehaus.mojo:selenium-maven-plugin:1.0-beta-2-SNAPSHOT.
[INFO]
----------------------------------------------------------------------
--
[INFO] For more information, run Maven with the -e switch
[INFO]
----------------------------------------------------------------------
--
[INFO] Total time: 1 second
[INFO] Finished at: Sat Jun 23 12:22:06 CEST 2007
[INFO] Final Memory: 6M/11M
[INFO]
----------------------------------------------------------------------
--
[INFO]
----------------------------------------------------------------------
--
[INFO] BUILD SUCCESSFUL
[INFO]
----------------------------------------------------------------------
--
[INFO] Total time: 1 second
[INFO] Finished at: Sat Jun 23 12:22:06 CEST 2007
[INFO] Final Memory: 6M/11M
[INFO]
----------------------------------------------------------------------
--
catalin-4:~/JavaApps/xwiki-trunks-devs/xwiki-product-enterprise/
distribution-test
hritcu$
However the documentation says this mojo exists
http://mojo.codehaus.org/selenium-maven-plugin/xvfb-mojo.html
So this is really strange for me.
I tried deleting the selenium-maven-plugin from the local repository
and the usual stuff but without any result. It gets downloaded again
from the XWiki(!) repository:
[INFO] snapshot
org.codehaus.mojo:selenium-maven-plugin:1.0-beta-2-SNAPSHOT: checking
for updates from xwiki.plugin.snapshot
[INFO] snapshot
org.codehaus.mojo:selenium-maven-plugin:1.0-beta-2-SNAPSHOT: checking
for updates from xwiki.plugins
[INFO] snapshot
org.codehaus.mojo:selenium-maven-plugin:1.0-beta-2-SNAPSHOT: checking
for updates from xwiki
[INFO] snapshot
org.codehaus.mojo:selenium-maven-plugin:1.0-beta-2-SNAPSHOT: checking
for updates from
openqa.org
Downloading:
http://maven.xwiki.org/org/codehaus/mojo/selenium-
maven-plugin/1.0-beta-2-SNAPSHOT/selenium-maven-plugin-1.0-beta-2-
SNAPSHOT.pom
8K downloaded
Downloading:
http://maven.xwiki.org/org/codehaus/mojo/selenium-
maven-plugin/1.0-beta-2-SNAPSHOT/selenium-maven-plugin-1.0-beta-2-
SNAPSHOT.jar
12K downloaded
Is it possible that the snapshot in the xwiki repository is too old?
Otherwise how do I force it to download from the "official"
repository?
Regards,
Catalin