...
When working with a supported framework , - for example, JUnit or TestNG , - you can add the Sealights test listener as a javaagent which will capture Java agent that automatically captures the test information automatically.
Code Block |
---|
|
export SEALIGHTS_OPTS="-javaagent:/path/to/sl-test-listener.jar -Dsl.tags=testNG -tokenfile -Dsl.tokenFile=/path/to/sltoken.txt -Dsl.labid <Lab ID> -Dsl.testStage \"Functional Tests\" "
java $SEALIGHTS_OPTS -cp <CLASSPATH> org.testng.TestNG -testclass com.my.test |
In the sample command above, the javaagent
is declared via a dedicated SEALIGHTS_OPTS
environment variable, but you can also declare it via standard JVM variables, like JAVA_OPTS
or JAVA_TOOL_OPTIONS
for example. This is useful for testing frameworks like Cucumber for Java, which relies on JUnit or TestNG behind the scenes.
Expand |
---|
title | Using Build Session ID |
---|
|
If the BuildSessionId needs to be passed explicitly, you should use a command similar to the one below |
...
export SEALIGHTS_OPTS="-javaagent:/path/to/sl-test-listener.jar -Dsl.tags=testNG -tokenfile -Dsl.tokenFile=/path/to/sltoken.txt -Dsl.buildSessionIdFile=buildSessionId.txt -Dsl.labid <Lab ID> -Dsl.testStage \"Functional Tests\" "
java $SEALIGHTS_OPTS -cp <CLASSPATH> org.testng.TestNG -testclass com.my.test |
|
Working without a supported framework
...