Run a scenario
Now, in order to run your first scenario locally, you need to configure your project and build tool according to your preferences.
Here, you will see how to run your scenario as an integration test with the maven failsafe plugin.
Chutney provides two ways for doing this
- A JUnit 5 Engine with annotations.
- A specific
Launcher
class.
Launcher
The specific Launcher
class could be used anywhere you need it (let it be a main
for example).
Other ways to run a scenario
-
Web interface : After defining an environment and your scenario (via synchronization), you could use the web interface to launch an execution.
-
IntelliJ plugin : The idea plugin provides a way to execute a scenario from its JSON representation.
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 | |
---|---|
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 | |
---|---|
Run it !🔗
Configure your build tool
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