Metadata-Version: 2.4
Name: robotframework-okw-kafka
Version: 0.1.1
Summary: Robot Framework keyword library for Apache Kafka integration testing — produce, consume, and verify messages using the OKW keyword pattern.
Author-email: Zoltan Hrabovszki <hrabovszki@googlemail.com>
License-Expression: AGPL-3.0-only
Project-URL: Homepage, https://github.com/Hrabovszki1023/robotframework-okw-kafka
Project-URL: Repository, https://github.com/Hrabovszki1023/robotframework-okw-kafka
Project-URL: Documentation, https://hrabovszki1023.github.io/robotframework-okw-kafka/
Project-URL: Keyword Documentation, https://hrabovszki1023.github.io/robotframework-okw-kafka/
Project-URL: Runnable Examples, https://github.com/Hrabovszki1023/okw-examples/tree/main/kafka/
Keywords: robotframework,kafka,testing,okw,keyword-driven
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Robot Framework
Classifier: Framework :: Robot Framework :: Library
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: robotframework>=6.0
Requires-Dist: confluent-kafka>=2.0
Requires-Dist: okw-contract-utils>=0.2.0
Requires-Dist: PyYAML>=6.0
Dynamic: license-file

# robotframework-okw-kafka

[![PyPI](https://img.shields.io/pypi/v/robotframework-okw-kafka.svg)](https://pypi.org/project/robotframework-okw-kafka/)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

Robot Framework keyword library for Apache Kafka integration testing —
produce, consume, and verify messages using the OKW keyword pattern.

> Deutsche Version: [README_de.md](README_de.md)

## Signal vs. NOISE

| Signal (your test) | NOISE (hidden in YAML) |
|---|---|
| `KafkaSetValue $.action create` | Bootstrap servers, serializers |
| `KafkaConsume order-events TIMEOUT=30` | Consumer group, offset config |
| `KafkaVerifyValue $.status completed` | SSL, authentication, partitions |

## Install

```bash
pip install robotframework-okw-kafka
```

## Minimal Example

```robot
*** Settings ***
Library    okw_kafka.library.OkwKafkaLibrary

*** Test Cases ***
Order Event Roundtrip
    KafkaStart          kafka-local
    KafkaSetTopic       order-commands
    KafkaSetValue       $.action       create
    KafkaSetValue       $.item         Widget-42
    KafkaProduce

    KafkaConsume        order-events    FILTER=$.item=Widget-42    TIMEOUT=30
    KafkaVerifyValue    $.status        created
    KafkaMemorizeValue  $.orderId       ORDER_ID

    KafkaStop
```

## Keyword Pattern

The same pattern across all OKW technologies:

| Phase | GUI | REST | SSH | Kafka |
|---|---|---|---|---|
| Scope | `SelectWindow` | `RESTSelectEndpoint` | `Open Remote Session` | `KafkaSetTopic` |
| Input | `SetValue` | `RESTSetValue` | `Set Remote` | `KafkaSetValue` |
| Action | `ClickOn` | `RESTSendRequest` | `Execute Remote` | `KafkaProduce` |
| Verify | `VerifyValue` | `RESTVerifyValue` | `Verify Remote Response` | `KafkaVerifyValue` |

## YAML Configuration

```yaml
# configs/kafka-local.yaml
bootstrap_servers: "localhost:9092"
consumer_group: "okw-test"
auto_offset_reset: "latest"
value_serializer: "json"
value_deserializer: "json"
```

## Keywords

### Session
- `KafkaStart` / `KafkaStop`

### Produce
- `KafkaSetTopic`, `KafkaSetValue`, `KafkaSetValueAsString`
- `KafkaSetHeader`, `KafkaSetKey`, `KafkaProduce`

### Consume
- `KafkaConsume` (timeout-based polling, optional JSONPath filter)
- `KafkaConsumeLatest`

### Verify
- `KafkaVerifyValue` / `KafkaVerifyValueWCM` / `KafkaVerifyValueREGX`
- `KafkaVerifyHeader`, `KafkaVerifyKey`

### Memorize
- `KafkaMemorizeValue`, `KafkaMemorizeKey`

### Admin
- `KafkaVerifyTopicExists`, `KafkaVerifyPartitionCount`, `KafkaLogTopics`

## Keyword Documentation

[Libdoc (GitHub Pages)](https://hrabovszki1023.github.io/robotframework-okw-kafka/)

## Runnable Examples

[okw-examples/kafka/](https://github.com/Hrabovszki1023/okw-examples/tree/main/kafka/)

## License

AGPL-3.0 — see [LICENSE](LICENSE).
