-
1. Re: Use Arquillian with WebTest?
aslak Aug 22, 2011 5:06 AM (in response to kennardconsulting)1 of 1 people found this helpfulArquillian has two run modes, in container and as client. For WebTesting you normally want to be running as client.
https://docs.jboss.org/author/display/ARQ/Test+run+modes
Arquillian has a extension called Drone which is responsible for bootstreaping all WebTest related artifacts, e.g. HTMLUnit, Ajocado, Selenium, WebDriver etc..
https://docs.jboss.org/author/display/ARQ/Drone
Some examples can be found here:
https://github.com/arquillian/arquillian-showcase/tree/master/ui
-
2. Re: Use Arquillian with WebTest?
kennardconsulting Aug 22, 2011 5:17 AM (in response to aslak)Aslak,
Many thanks for your reply, and your work on Arquillian!
I apologise for not being clear: when I said WebTest, I actually meant Canoo WebTest (http://webtest.canoo.com). The Drone extension says it supports "Arquillian Ajocado, Selenium or WebDriver". The reason I like WebTest is that everything is configured in XML, with no Java code at all. I find this works well for testing XHTML output.
The Arquillian examples seem to involve writing a Java class? I was hoping to avoid this? Can Arquillian just start/deploy/stop the server from Maven? Are there any examples using Canoo WebTest? I found this jboss-maven-plugin which is close to my (simple) needs. Has Arquillian superseded this approach?
Regards,
Richard.
-
3. Re: Use Arquillian with WebTest?
aslak Aug 22, 2011 6:37 AM (in response to kennardconsulting)Arquillian has this: https://github.com/arquillian/arquillian-maven But i'm not sure it will actually help you much here.
It can be bound to DEPLOY or UNDEPLOY to a Remote container, but if you using something that is STARTED as part of the run, then this plugin will basically STOP it after DEPLOY, since the plugin holds on to the container instance. Your closest bet would be to use RUN, but RUN will block until you your self stop it, and i'm afraid other Maven plugins won't be able to execute whithin that time.
One possibility is to only write one TestClass that use Arquillian and defines your @Deployment, and whithin the @Test method simply start WebTester manually and point it to the XML files. Assuming WebTester support 'injection' of URLs, it could look something like this:
@RunWith(Arquillian.class) public class WebTestserTestCase { @Deployment(testable = false) public static WebArchive create() { return ShrinkWrap.create(WebbArchive.class) ....; } @ArquillianResource private URL baseURL; @Test public void shouldExecuteWebTesterSuite() throws Exception { new WebTester(xmlFile, baseURL).run(); } }
-
-
5. Re: Use Arquillian with WebTest?
aslak Aug 23, 2011 3:46 AM (in response to kennardconsulting)Could you provide a simple example of the setup you use today ?
-
6. Re: Use Arquillian with WebTest?
kennardconsulting Aug 23, 2011 8:09 AM (in response to aslak)Sure: I've updated the JIRA above.