How do I run each stage of the Webdriver tests separately?

I want to be able to prepare the environment, bring up the test server, run the tests, and then bring down the server in four separate steps because I want to do some additional customization between each step. To do so, I did the following (this is the 5.6-SNAPSHOT branch):

$ cd nuxeo-distribution-dm/ftest/webdriver
$ mvn test-compile
$ mvn org.nuxeo.build:nuxeo-distribution-tools:integration-test -Dtarget=prepare-tomcat
$ mvn org.nuxeo.build:nuxeo-distribution-tools:integration-test -Dtarget=start
$ mvn org.nuxeo.build:nuxeo-distribution-tools:integration-test -Dtarget=run-selenium

But the last step fails with the following output (in the below I renamed the nuxeo-distribution folder to nuxeo-dm-webdriver):

user-extensions:
     [echo] Replace url in prefs.js
     [copy] Copying 1 file to c:\Users\jnaous\AppData\Local\Temp\nuxeo-dm-webdriver\nuxeo-distribution-dm\ftest\webdriver\target\ffprofile
     [echo] java -jar c:\Users\jnaous\AppData\Local\Temp\nuxeo-dm-webdriver\nuxeo-distribution-dm\ftest\webdriver\target/selenium-server.jar -log c:\Users\jnaous\AppData\Local\Temp\nuxeo-dm-webdriver\nuxeo-distribution-dm\ftest\webdriver\target/selenium-debug.log -port 14440
     [echo]       -timeout 7200 -userExtensions c:\Users\jnaous\AppData\Local\Temp\nuxeo-dm-webdriver\nuxeo-distribution-dm\ftest\webdriver\target/user-extensions.js -htmlSuite *chrome http://localhost:8080/nuxeo/
     [echo]       tests/${suite}.html c:\Users\jnaous\AppData\Local\Temp\nuxeo-dm-webdriver\nuxeo-distribution-dm\ftest\webdriver\target/results/result-${suite}.html -firefoxProfileTemplate c:\Users\jnaous\AppData\Local\Temp\nuxeo-dm-webdriver\nuxeo-distribution-dm\ftest\webdriver\target/ffprofile
     [echo]       >c:\Users\jnaous\AppData\Local\Temp\nuxeo-dm-webdriver\nuxeo-distribution-dm\ftest\webdriver\target/selenium.log
     [echo]       with ${suite} in null
     [echo]
    [unzip] [INFO] Resolving org.nuxeo:nuxeo-ftest:zip:1.7.1-SNAPSHOT:compile ...
    [unzip] Expanding: C:\Users\jnaous\.m2\repository\org\nuxeo\nuxeo-ftest\1.7.1-SNAPSHOT\nuxeo-ftest-1.7.1-SNAPSHOT.zip int
o c:\Users\jnaous\AppData\Local\Temp\nuxeo-dm-webdriver\nuxeo-distribution-dm\ftest\webdriver\target

selenium-run-suite:
     [echo] Suite: null
     [exec] Result: 1

BUILD FAILED
c:\Users\jnaous\AppData\Local\Temp\nuxeo-dm-webdriver\nuxeo-distribution-dm\ftest\webdriver\target\nuxeo-ftest.xml:349: Suites in error:  null

Total time: 3 seconds
[ERROR] Error occurred while running c:\Users\jnaous\AppData\Local\Temp\nuxeo-dm-webdriver\nuxeo-distribution-dm\ftest\webdriver\itests.xml: Suites in error:  null
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Tue Jul 10 15:19:52 PDT 2012
[INFO] Final Memory: 31M/439M
[INFO] ------------------------------------------------------------------------

It seems to me that I should specify -Dsuites=x,y,z (from the ftest docs) but there is no tests directory, so I don't know what it should be.

0 votes

1 answers

2435 views

ANSWER



Just figured it out. For Webdriver tests, the steps are:

$ cd nuxeo-distribution-dm/ftest/webdriver
$ mvn test-compile
$ mvn org.nuxeo.build:nuxeo-distribution-tools:integration-test -Dtarget=prepare-tomcat
$ mvn org.nuxeo.build:nuxeo-distribution-tools:integration-test -Dtarget=start
$ mvn failsafe:integration-test
$ mvn org.nuxeo.build:nuxeo-distribution-tools:integration-test -Dtarget=stop

And for selenium tests:

$ cd nuxeo-distribution-dm/ftest/selenium
$ mvn test-compile
$ mvn org.nuxeo.build:nuxeo-distribution-tools:integration-test -Dtarget=prepare-tomcat
$ mvn org.nuxeo.build:nuxeo-distribution-tools:integration-test -Dtarget=start
$ mvn org.nuxeo.build:nuxeo-distribution-tools:integration-test -Dtarget=run-selenium
$ mvn org.nuxeo.build:nuxeo-distribution-tools:integration-test -Dtarget=stop
0 votes



Right. Thanks for the feedback for other users. Was it not clear enough in the documentation? Don't hesitate to contribute documentation (as commit to the Readme.md files or as comments on doc.nuxeo.com).
07/11/2012

For someone who is quite familiar with maven or ant the docs might have been sufficient. I didn't know whether there was anything else that needed to be done or what the stages were, or whether maven executes other targets while doing verify that aren't just the steps above. In particular, for the webdriver tests, you need to use the failsafe:integration-test goal to run the tests, but the documentation is only geared towards the selenium tests.
07/11/2012