Hi Vincent,
I managed to get a built of the selenium plugin
(
http://tinyurl.com/ypha8d). With this new plugin build the tests work
fine (no more errors when starting Xvfb). The "only problem" is that
for native Aqua applications (like Firefox) setting the DISPLAY
variable does not have any effect, so the same windows still pop up
even when a Xvfb instance is up and running. I don't think there is
even a way to run a native aqua application in a normal X server. What
I tried and it kind of worked was to run a version of konqueror built
for X. This did not pop up any windows at least.
On 6/25/07, Vincent Massol <vincent(a)massol.net> wrote:
On Jun 25, 2007, at 7:58 PM, Catalin Hritcu wrote:
Hi Vincent,
On 6/25/07, Vincent Massol <vincent(a)massol.net> wrote:
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.
Is there a new version of the plugin available? If not could you
please update the snapshot we are using? I would really like to try
using xvfb on my own machine at least ... it should be very easy once
using a newer version of the selenium plugin. I would like to give it
a try.
Sure. I tried but it doesn't build. Someone needs to report it to the
maven dev team and see what they say...
They suggested I try a 2.0.x version of maven and the build worked
under 2.0.7. I uploaded a new snapshot here
http://tinyurl.com/ypha8d
[snip]
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.
Well, I would personally still prefer xvfb. For one it comes with the
X server (which means it's present on about every UNIX machine, on the
Mac it needs the X server installed ...
I'm not sure. The machine where our CI runs is a linux machine and it
doesn't have xvfb installed.
If this is easier for you then you should definitely do it this way.
Let me know if I can help in any way.
but that's
still on the MacOSX
installation CD and does not require third-party software). I'm still
trying to find a vnc server for the mac ... suggestions welcome.
For vncserver on the mac I use Vine Server (
http://sourceforge.net/
projects/osxvnc/) which works fine enough.
But this is a GUI application. Is there a way I can give it the usual
arguments you give to vncserver ?
Second, the
support for xvfb is built into the selenium maven plugin
(latest version), so it should be really easy to set up -- regardless
of ones abilities or experience.
True but starting a vncserver isn't harder than starting xvfb (maybe
it's easier actually as xvfb requires - seems optional though - xauth
which is also not available by default on neither the linux server
nor OSX)
Don't think xauth is needed unless you have another version of X
running at the same time (this should not be the case for a server
anyway).
I would really
like to try if this is
so. Promise I won't waste much time on this if it turns out to be hard
to do.
:)
Oh that's fine. We can then pick whatever works best.
Tried it. Doesn't really work. Anyway, it seems more like an oddity of
the platform (Mac OS X) rather than a problem with Xvfb or the
selenium plugin which uses it.
Regards,
Catalin
> 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
>
>