Package io.karatelabs.gatling
Class KarateFeatureBuilder
java.lang.Object
io.karatelabs.gatling.KarateFeatureBuilder
- All Implemented Interfaces:
io.gatling.javaapi.core.ActionBuilder,io.gatling.javaapi.core.exec.Executable
public final class KarateFeatureBuilder
extends Object
implements io.gatling.javaapi.core.ActionBuilder
Builder for creating Karate feature execution actions.
Provides a fluent API for configuring a feature path, tags, and silent mode.
Example usage:
// Basic usage
karateFeature("classpath:features/cats.feature")
// With tag selector (positional, matches v1 API)
karateFeature("classpath:features/cats.feature", "@smoke")
// With multiple tag selectors (AND-ed)
karateFeature("classpath:features/cats.feature", "@smoke", "~@slow")
// Silent mode for warm-up
karateFeature("classpath:features/cats.feature").silent()
To run multiple features in sequence, chain .exec(...) calls
on the Gatling scenario rather than passing multiple paths here.
-
Constructor Summary
ConstructorsConstructorDescriptionKarateFeatureBuilder(String path, String... tags) Create a builder for the given feature path with optional tag selectors. -
Method Summary
Modifier and TypeMethodDescriptionio.gatling.core.action.builder.ActionBuilderasScala()protocol(KarateProtocol protocol) Set the protocol for URI pattern matching and name resolution.silent()Enable silent mode.Add tag filter expressions.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.gatling.javaapi.core.ActionBuilder
toChainBuilder
-
Constructor Details
-
KarateFeatureBuilder
Create a builder for the given feature path with optional tag selectors.- Parameters:
path- feature file path (e.g., "classpath:features/cats.feature")tags- tag selector expressions (e.g., "@smoke", "~@slow") — varargs; multiple values are AND-ed together, commas within a value are OR
-
-
Method Details
-
tags
Add tag filter expressions. Equivalent to passing tags to the constructor; additional calls append to the existing tag list (all AND-ed together).- Parameters:
tagExpressions- tag expressions like "@smoke", "~@slow"- Returns:
- this builder
-
silent
Enable silent mode. In silent mode, results are not reported to Gatling's StatsEngine. Use this for warm-up scenarios.- Returns:
- this builder
-
protocol
Set the protocol for URI pattern matching and name resolution. This is typically called internally by the DSL.- Parameters:
protocol- the KarateProtocol- Returns:
- this builder
-
asScala
public io.gatling.core.action.builder.ActionBuilder asScala()- Specified by:
asScalain interfaceio.gatling.javaapi.core.ActionBuilder
-