6. Launch test suite without test-script¶
Artos test project can be executed in multiple different ways
- Launch project jar using command-line
- Launch Maven project via command-line
- Launch Runner via IDE (Eclipse, IntelliJ etc..)
6.1. Launch project jar (Windows command-line)¶
- Step 1: Note down Runners fully qualified class-path (Example:
com.tests.feature1.FeatureRunner) - Step 2: Build Artos test project jar (Example:
artos-test-project-0.0.1.jar) - Step 3: Create a directory called
libat the location whereartos-test-project-0.0.1.jaris situated. - Step 4: Copy artos jar downloaded from maven repository inside
libdirectory. - Step 5: Create a directory called
confat the location whereartos-test-project-0.0.1.jaris situated. - Step 6: Copy artos configuration to
confdirectory. - Step 7: Create a directory called
scriptat the location whereartos-test-project-0.0.1.jaris situated.
- Step 9: Open command line prompt or PowerShell.
- Step 10: change directory location to the same directory where artos-test-project-0.0.1.jar is present using
cdcommand. - Step 11: Execute below command line argument to execute the Artos test project.
1 | java -cp "artos-test-project-0.0.1.jar;.\lib\artos-0.0.12.jar" com.tests.feature1.FeatureRunner --profile="dev"
|
Important
- By default
devprofiled configuration is used from framework_configuration.xml file. - If a user has separate configurations for
devandproductionenvironment ORWindowandLinuxenvironments then they should pass appropriate profile name via command-line arguments.
6.2. Launch Maven project as unit test framework¶
Note
Artos sample project can be downloaded from Artos website.
Below example explains how to launch Artos Maven test project in both the environments (Windows or Linux). Artos sample project POM file is pre-configured to launch Artos test project at compile time like a unit test framework:
exec-maven-pluginis used to executeRun_ARTOS.batfor Windows andRun_ARTOS.shfor Linux.exec-maven-pluginis configured to execute script at unit level by setting<phase>test</phase>.<profiles></profiles>feature is used to select correct extension of the files based on platform.
Run_ARTOS.bat and Run_ARTOS.sh script content is specified below.
1 2 3 4 5 @echo off set mypath=%cd% @echo %mypath% mvn exec:java -D"exec.mainClass"="com.tests.FeatureRunner" -Dexec.args="-v -p=dev" pause
1 2 3 #!/bin/sh #echo off mvn exec:java -Dexec.mainClass="com.tests.FeatureRunner" -Dexec.args="-v -p=dev"
6.3. Runner launch using test script (Eclipse IDE)¶
- Right-click on Runner. Go to Run As => Run Configurations…