Before creating a Squash-TA project, you need to ensure that all the required software components are installed on your workstation. The easiest way to do so is to download and install the Squash-TA toolbox, as described here.
Creating your Squash-TA project
The best way to create a new Squash-TA project is to use the Squash-TA project archetype. When you do so, Maven creates a new Squash-TA project for you. Later on, when you first run your tests, Maven will download the Squash-TA execution engine and its dependencies.
How you do this depends on your environment:
- The easiest way is to use Eclipse with the m2eclipse plugin. Both are packaged in the Squash-TA toolbox.
- Alternatively, you can create the Squash-TA project with a maven command-line, then import it into Eclipse, or your preferred IDE.
Option 1: create the project using Eclipse
Let's start the dedicated Eclipse instance by clicking on the 'Squash-TA Eclipse icon' on your desktop.
Confirm that you want to use your newly created workspace.
When Eclipse has started, we will create a new Squash-TA project as follows :
- Select 'File > New > Maven Project'
- In the "New Maven Project" dialog window that opens, click on 'Next'.
- Select the Squash-TA project maven archetype as follows :
- Click on the 'Add Archetype' button.
Enter the following values:
- Archetype Group ID: org.squashtest.ta
- Archetype Artifact ID: squash-ta-project-archetype
- Archetype Version: the last Squash-TA version (ex: 1.9.0-RELEASE)
- Repository URL: http://repo.squashtest.org/maven2/releases/
Confirm by clicking on the 'OK' button.
- Then, select the archetype (it has appeared in the archetype list) and uncheck the 'Show the last version of Archetype only' option. In the Catalog list at the top of the window, choose 'Default local'. Click on 'Next' to go to the next page.
- On the next screen, you are describing your new test project :
Now just launch project creation by clicking on the 'Finish' button.
- The 'Group Id' is the name of the broader software package your test automation project belongs to. In our example we will use 'org.squashtest.tutorial' as group Id.
- The 'Artifact Id' is the specific name of your test project. Let's use 'my.squash.ta.project' as artifact id.
- Finally, we will use the '1.0' version number, and ignore the field 'package' which is not relevant for squash TA projects.
- The newly created test project appears in the explorer.
Note: If you encounter some difficulties to create your new TA project through the Squash Ta project archetype in Eclipse, please try the command-line method described below.
Option 2: Create the project using a command-line, then import it into Eclipse
Open a Squash-TA shell window (Shortcut created during the installation of the Toolbox : 'Squash-TA Console'), then change to the location of your Squash-TA toolbox workspace.
In the following example, the Squash-TA workspace was created at the root of C:\
Note : Do not forget to replace the 'DarchetypeVersion=' with the last version of Squash-TA (e.g. '1.9.0-RELEASE').
- Execute the following command line.
- At the prompt, enter the desired 'groupId' (in our example, org.squashtest.tutorial)
- Next, enter the desired 'artifactId' (here, my.squash.ta.project)
- Next, enter the 'version' (here, 1.0)
- Skip the next, irrelevant, prompt about java packages and you can check the parameters and confirm them with 'y' if it's OK.
After execution of the archetype, you should have :
Now, you can close the shell window and import the project into Eclipse :
- Select menu 'File > Import...', then 'Maven > Existing Maven Projects'. Click on 'Browse' and go to the newly created project directory (in our example C:\Workspace\my.squash.ta.project)
- Click on 'OK', then 'Finish' to complete the project import operation.
- The newly created Test project appears now in the TA Navigator: