Run your scenario
Now, in order to run your first scenario, you need to configure your project and build tool according to your preferences.
Chutney Kotlin DSL provides a JUnit 5 Runner with annotations.
It provides also a Launcher
class you can use the way you want. You are free to run your scenarios when and
anywhere you want (be it in a main
if you wish).
In the following sections :
- you will see how to use the JUnit 5 Runner and annotations.
- you will see how to use the
Launcher
in a standard test, attached to theintegration
phase and run using the maven failsafe plugin.
Using Chutney JUnit5 Engine🔗
When using the JUnit5 engine, we recommend you to use JSON files to declare your environments and targets.
Create a Kotlin file (ex. Junit5SearchFeat.kt
) with the following content :
SearchFeat.kt | |
---|---|
Using Chutney Launcher🔗
Under src/test/kotlin
create a package (ex. com.chutneytesting.getstart
) and create a Kotlin file (ex. SearchFeat.kt
) with the following content :
SearchFeat.kt | |
---|---|
Configure your build tool
Run it !🔗
Now you can simply run mvn verify
or ./gradlew test
.
If you are using Maven, the console will output the resulting execution :
- Scenario succeed and was run on environment "The World Wide Web"
- Step
I visit a search engine
succeed and was performed with thedefault
strategy - Step validation on the HTTP status succeed
- Information about which action was performed and with which parameters
- Information about the target on which the action was performed
Chutney Idea plugin🔗
You can run scenarios using our IntelliJ Idea plugin.