CLI Reference

Complete command line interface reference for TestFlowKit

CLI Reference

Complete reference for TestFlowKit command line interface (CLI) commands and options.

Basic Usage

tkit [command] [options]

Commands

run

Execute test scenarios.

tkit run [options]

Options

OptionShortDescriptionDefault
--location-lPath to Gherkin feature files
--config-cPath to configuration fileconfig.yml
--tags-tTags filter (e.g. @smoke and not @wip)all
--headlessRun browser in headless modetrue
--timeoutTimeout duration (Go duration: 10s, 1m, 2h)
--env-filePath to environment variables YAML file

Examples

# Run all tests
tkit run

# Run with specific config
tkit run --config staging.yml

# Run tagged tests
tkit run --tags @smoke
tkit run --tags "@login and not @slow"

# Run against a different environment
tkit run --env-file .env.staging.yml
tkit run --env-file .env.production.yml

# Run with specific location
tkit run --location e2e/features

# Increase timeout
tkit run --timeout 2m

init

Initialize a new TestFlowKit project.

tkit init [options]

Options

OptionDescription
--nameProject name
--templateTemplate to use (basic, full)

Examples

# Interactive initialization
tkit init

# With options
tkit init --name my-tests --template full

validate

Validate configuration and feature files.

tkit validate [options]

Options

OptionShortDescription
--location-lPath to Gherkin feature files
--config-cPath to configuration file
--tags-tTags filter

Examples

# Validate default configuration
tkit validate

# Validate specific config
tkit validate --config production.yml

# Validate specific features
tkit validate --features tests/e2e

version

Display version information.

tkit version

Output:

TestFlowKit version 2.0.0
Build: abc123
Go version: go1.21

Global Options

OptionShortDescription
--version-vShow version information
--help-hDisplay help and exit

help

Display help information.

tkit help [command]

Examples

# General help
tkit help

# Command-specific help
tkit help run
tkit help validate

Tag Expressions

Tags allow you to filter which scenarios to run. TestFlowKit supports boolean expressions.

Basic Tags

# Run scenarios tagged @smoke
tkit run --tags @smoke

# Run scenarios tagged @login
tkit run --tags @login

Boolean Expressions

# AND - both tags required
tkit run --tags "@smoke and @login"

# OR - either tag
tkit run --tags "@smoke or @regression"

# NOT - exclude tag
tkit run --tags "not @slow"

# Combined
tkit run --tags "@smoke and not @wip"
tkit run --tags "(@login or @signup) and not @slow"

Environment Variables

Environment variable overrides are not currently provided by the CLI. Use command-line flags (--config, --location, --tags, --env, --timeout, --headless) or set values in your config.yml instead.

Exit Codes

CodeMeaning
0All tests passed
1One or more tests failed
2Configuration error
3Invalid arguments

CI/CD Integration

GitHub Actions

- name: Run Tests
  run: |
    chmod +x ./tkit
    ./tkit run --headless --tags "@smoke"

GitLab CI

test:
  script:
    - chmod +x ./tkit
    - ./tkit run --headless
  artifacts:
    paths:
      - reports/

Jenkins

sh './tkit run --headless --config ci.yml'

Best Practices

1. Use Configuration Files for Environments

# Development
tkit run --config config.dev.yml

# Staging
tkit run --config config.staging.yml

# Production (read-only tests)
tkit run --config config.prod.yml --tags "@readonly"

2. Organize Tags Strategically

@smoke @critical
Scenario: Critical user flow

@regression @slow
Scenario: Full data validation
# Quick validation
tkit run --tags @smoke

# Full regression
tkit run --tags @regression

3. Use Verbose Mode for Debugging

tkit run --verbose --slow-motion 200

Next Steps