We are developing a web application using Java on the internal interface and Angular for the user interface, with Maven as the build system.
I am trying to set up automatic integration testing using Protractor, and after the Googling / StackOverflowing loads still cannot figure out how to configure the end of the second end.
Node.js / NPM installation (failure)
I tried using the frontend-maven-plugin to process Node.js and install NPM, but since we are behind the corporate firewall, it is not possible to download anything directly. It could download Node from our Artifactory, but then it was not possible to download NPM (I donβt understand why it even loads it as part of the Node package). In any case, I abandoned this idea and decided to use Node locally.
Launch Tomcat
Starting / stopping a Tomcat instance for e2e testing is done using
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <url>${tomcat.manager.url}</url> <path>/</path> <server>Tomcat</server> </configuration> <executions> <execution> <id>start-tomcat</id> <phase>pre-integration-test</phase> <goals> <goal>run</goal> </goals> <configuration> <fork>true</fork> <port>${tomcat.port}</port> <systemProperties> <spring.profiles.active>e2e</spring.profiles.active> </systemProperties> </configuration> </execution> <execution> <id>stop-tomcat</id> <phase>post-integration-test</phase> <goals> <goal>shutdown</goal> </goals> </execution> </executions> </plugin>
Using WebDriver (failed)
I managed to start WebDriver, but the problem is that it blocks further execution:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <id>start-webdriver</id> <phase>pre-integration-test</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>webdriver-manager</executable> <arguments> <argument>start</argument> </arguments> </configuration> </execution> </executions> </plugin>
Protractor Launch
Given that Node.js is installed and WebDriver is running, this should not be a problem. But since I was unable to start WebDriver so that it continued to run, this is blocked.
Any tips on managing WebDriver (started / stopped)?
source share