Package io.karatelabs.cli
Class RunCommand
java.lang.Object
io.karatelabs.cli.RunCommand
The 'run' subcommand for executing Karate tests.
Usage examples:
# Run all tests (uses karate-pom.json if present) karate run # Run specific paths (inherits other settings from karate-pom.json) karate run src/test/resources # Run with specific tags and environment karate run -t @smoke -e dev src/test/resources # Run with custom pom file karate run -p custom-pom.json # Run ignoring karate-pom.json karate run --no-pom src/test/resources
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()getEnv()getPaths()getTags()isDryRun()static booleanisFormatEnabled(List<String> formats, String format, boolean defaultValue) Check if a format is enabled based on the -f/--format flag.runWithPaths(List<String> legacyPaths) Run with paths provided externally (for legacy command handling).
-
Field Details
-
DEFAULT_POM_FILE
- See Also:
-
-
Constructor Details
-
RunCommand
public RunCommand()
-
-
Method Details
-
call
-
isFormatEnabled
Check if a format is enabled based on the -f/--format flag. Supports negation with ~ prefix (e.g., ~html disables html). Reused byKarateOptionsHandlerwhen parsing thekarate.optionssystem property.- Parameters:
formats- the parsed formats list (may be null)format- the format name (e.g., "html", "cucumber:json")defaultValue- the default value if format not mentioned- Returns:
- true if format is enabled
-
runWithPaths
Run with paths provided externally (for legacy command handling).- Parameters:
legacyPaths- paths from legacy command invocation- Returns:
- exit code
-
getPaths
-
getTags
-
getThreads
-
getEnv
-
getScenarioName
-
getOutputDir
-
getConfigDir
-
isDryRun
-
getPomFile
-
getWorkingDir
-
getPathOptions
-
getFormats
-
getLogReport
-
getLogConsole
-