Package io.karatelabs.core
Class Runner
java.lang.Object
io.karatelabs.core.Runner
Main entry point for running Karate tests programmatically.
Example usage:
SuiteResult result = Runner.path("src/test/resources")
.tags("@smoke")
.karateEnv("dev")
.parallel(5);
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Runner.Builderbuilder()Get a new builder instance.static Runner.BuilderStart building a test run with Feature objects.static Runner.BuilderStart building a test run with one or more paths.static Runner.BuilderStart building a test run with a list of paths.static FeatureResultrunFeature(String path, Map<String, Object> arg) Execute a single feature with pre-defined variables.static FeatureResultRun a single feature file with arguments and optional PerfHook.
-
Method Details
-
path
Start building a test run with one or more paths. Paths can be directories or individual .feature files. -
path
Start building a test run with a list of paths. -
features
Start building a test run with Feature objects. -
builder
Get a new builder instance. -
runFeature
Execute a single feature with pre-defined variables. This is called by karate-gatling for running features with Gatling session variables.- Parameters:
path- the feature path (can be classpath: prefixed)arg- variables to inject into the feature (available as top-level variables)- Returns:
- the feature result
-
runFeature
Run a single feature file with arguments and optional PerfHook.This method is primarily used by Gatling integration for running features with performance metric collection.
- Parameters:
path- the feature path (can be classpath: prefixed)arg- variables to inject into the feature (available as top-level variables)perfHook- optional PerfHook for performance metric collection (Gatling)- Returns:
- the feature result
-