Archetypes

tapir provides Maven Archetypes in order to setup modules in no time. You can either run the archetypes from Eclipse or from command-line.

Using an archetype

Eclipse

Eclipse’s Maven integration m2e provides a wizard to creates modules based on Maven archetypes.

  1. Select File | New | Project …
  2. Select Maven | Maven Project and click Next >
  3. Leave the defaults of the first wizard page by clicking Next >
  4. Select Add Archetype… and enter these coordinates:
    • Archetype Group Id: {desired-tapir-archetype-groupId}
    • Archetype Artifact Id: {desired-tapir-archetype-artifactId}
    • Archetype Version: {desired-tapir-archetype-version}
  5. Ensure the tapir archetype is selected and click Next >:
  6. Eclipse asks you to specify the following properties:
    • groupId: The GroupId of your test project
    • artifactId: The ArtifactId of your test project
    • version: The version of your test project
    • package: The base package of your test project
    • moduleName: The name of your test project. The name should start with an upper case letter and shouldn’t contain spaces.
  7. After clicking Finish the module is available in your workspace as an Eclipse project.

Command line

> mvn archetype:generate -DarchetypeGroupId=de.bmiag.tapir -DarchetypeArtifactId={desired-tapir-archetype} -DarchetypeVersion=3.6.2

Maven asks you to specify the following properties:

  • groupId: The GroupId of your test project
  • artifactId: The ArtifactId of your test project
  • version: The version of your test project
  • package: The base package of your test project
  • moduleName: The name of your test project. The name should start with an upper case letter and shouldn’t contain spaces.

After confirming the properties the new Maven module is generated into a subfolder which is named like your artifactId.

Predefined archetypes

tapir-extensions-archetype

This archteype can be used for tapir bootstrap modules. It provides a basic @ModuleConfiguration annotated class.

Coordinates

<dependency>
  <groupId>io.tapir-test</groupId>
  <artifactId>tapir-extensions-archetype</artifactId>
  <version>1.3.0</version>
</dependency>

Properties

Property Description Incompatible properties   Default Value
moduleName The name of the module which has to fulfill this pattern: [A-Z][A-Za-z0-9]+ - -  
useTapirExecution Use the tapir execution model useUnitTest true  
useUnitTest Write plain unit tests. useTapirExecution false  
useSelenium Selenium 4 - true  
useJUnit4 JUnit 4 useJUnit5 false  
useJUnit5 JUnit 5 useJUnit4 true  
useAllure1 Allure 1 useAllure2 false  
useAllure2 Allure 2 useAllure1 true  
useExcelReporting Excel Reporting - false  
useDataSource Data Injection - false  
useConditionalExecution Conditional - false  
useProductLineTesting Configuration management / Variant management - false  

tapir-module-archetype

This archetype can be used for arbitrary tapir modules. It provides a basic @ModuleConfiguration annotated class and inherits from tapir-starter-module which provides a couple of presets.

Coordinates

<dependency>
  <groupId>de.bmiag.tapir</groupId>
  <artifactId>tapir-module-archetype</artifactId>
  <version>3.6.2</version>
</dependency>

Properties

Property Description
moduleName The name of the module which has to fulfill this pattern: [A-Z][A-Za-z0-9]+
autoConfigurationOrder The AutoConfigurationOrder. The default value is 0.

tapir-bootstrap-archetype

Deprecated
This archetype is superseded by tapir-extensions-archetype.

This archteype can be used for tapir bootstrap modules. This module inherits from tapir-starter-selenium-allure. It provides a basic @BootstrapConfiguration annotated class and an executable test based on the Google website.

Coordinates

<dependency>
  <groupId>de.bmiag.tapir</groupId>
  <artifactId>tapir-bootstrap-archetype</artifactId>
  <version>3.6.2</version>
</dependency>

Properties

Property Description
moduleName The name of the module which has to fulfill this pattern: [A-Z][A-Za-z0-9]+