-
Notifications
You must be signed in to change notification settings - Fork 281
Initial setup
- Install and configure JDK 1.7
- Install and configure Apache Maven 3.3.1+
- Download and start latest Selenium standalone server
- Download the latest version of Eclipse and install TestNG plugin
The easiest way to initialize new project is to you Carina archetype, you will get correct project structure along with test samples. First clone archetype repo:
git clone https://github.com/qaprosoft/carina-archetype.git
Navigate to cloned repo and execute:
mvn install
Now go to folder where you need to generate new project and execute (do not forget to set groupId, artifactId, name, url, version):
mvn archetype:generate -DarchetypeGroupId=com.qaprosoft \
-DarchetypeArtifactId=carina \
-DarchetypeVersion=1.0 \
-DgroupId=<your_groupId> \
-DartifactId=<your_artifactId> \
-Dname="<you_proj_name>" \
-Durl=<your_proj_url> \
-Dversion=<your_proj_version>
The command should be executed without '' symbols on one line, leaving single white space between the attributes. If any attribute contains spaces, it should be set in quoted(e.g.: -Dname="Hello World"). In the Maven command listed above, you have to specify 5 attributes while the first 3 should be left unchanged. Let's go through these attributes:
Attribute | Meaning | Example |
---|---|---|
-DgroupId | Company domain in reverce order | com.qaprosoft |
-DartifactId | Java project name | carina-qa |
-Dname | Name with more details | "Carina Test Automation" |
-Durl | Company URL | http://qaprosoft.com |
-Dversion | Project version | 1.0 |
If generation finishes successfully, you should see a new project folder with a name equal to the artifactId attribute specified during generation, so navigate to that folder (where pom.xml is located) and execute the following Maven task:
mvn clean eclipse:eclipse
Using this command, Maven should resolve all dependencies, downloading required libraries to your local repository and generating Eclipse classpath. Before importing a new project to Eclipse, you must link your IDE with your Maven repository by executing the following task:
mvn -Dworkspace=<path_to_workspace> eclipse:configure-workspace
Here you have to specify the absolute path to the Eclipse workspace. After that, restart Eclipse IDE. Now you may import generated projects such as "Existing Java Project" into Eclipse IDE. Generate eclipse workspace using command:
mvn clean eclipse:eclipse
Now you are ready to import project into eclipse.