Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ steps:
Run it:

```bash
yatl
yatl .
```

That’s it!
Expand Down Expand Up @@ -94,12 +94,10 @@ steps:

```bash
# Run all `.yatl.yaml` files in a directory
yatl tests/
yatl .

# Run a single file
yatl myapi.yatl.yaml

# Run with 5 parallel workers
# Run with 5 parallel workers on `tests/` directory
yatl tests/ --workers 5
```

Expand Down
28 changes: 0 additions & 28 deletions docs/usage.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ YATL is a lightweight testing framework designed for API testing using YAML-base
6. [Templating with Jinja2](#templating-with-jinja2)
7. [Running Tests](#running-tests)
8. [Examples](#examples)
9. [Advanced Features](#advanced-features)

## Getting Started

Expand Down Expand Up @@ -430,40 +429,13 @@ steps:
text: "Hello"
```

## Advanced Features

### Conditional Steps

Currently, YATL does not support conditional steps natively, but you can achieve conditional logic by writing separate test files.

### Retry Logic

Not built-in; consider using external tools like `pytest` with retry decorators.

### Environment Variables

You can use environment variables in templates via Jinja2's `os.environ`:

```yaml
request:
url: {{ os.environ.get("API_BASE_URL") }}/endpoint
```

### Custom Validators

Extend the `ResponseValidator` class to add custom validation logic.

## Troubleshooting

### Common Errors

- **Header mismatch**: Ensure header values are normalized (e.g., `content-type` may include charset).
- **JSON extraction fails**: Verify the path exists in the response.
- **Templating errors**: Check that variables are defined in the context.

### Debugging

Enable verbose logging by modifying `run.py` or using the `print` statements already present.

## Contributing

Expand Down
29 changes: 0 additions & 29 deletions docs/usage.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ YATL — это легковесный фреймворк для тестиро
6. [Шаблонизация с Jinja2](#шаблонизация-с-jinja2)
7. [Запуск тестов](#запуск-тестов)
8. [Примеры](#примеры)
9. [Расширенные возможности](#расширенные-возможности)

## Начало работы

Expand Down Expand Up @@ -430,40 +429,12 @@ steps:
text: "Привет"
```

## Расширенные возможности

### Условные шаги

В настоящее время YATL не поддерживает условные шаги нативно, но вы можете реализовать условную логику, написав отдельные файлы тестов.

### Логика повторных попыток

Не встроена; рассмотрите использование внешних инструментов, таких как `pytest` с декораторами повторов.

### Переменные окружения

Вы можете использовать переменные окружения в шаблонах через `os.environ` Jinja2:

```yaml
request:
url: {{ os.environ.get("API_BASE_URL") }}/endpoint
```

### Пользовательские валидаторы

Расширьте класс `ResponseValidator`, чтобы добавить собственную логику валидации.

## Устранение неполадок

### Распространённые ошибки

- **Несоответствие заголовков**: убедитесь, что значения заголовков нормализованы (например, `content-type` может включать charset).
- **Ошибка извлечения JSON**: проверьте, существует ли указанный путь в ответе.
- **Ошибки шаблонизации**: проверьте, что переменные определены в контексте.

### Отладка

Включите подробное логирование, изменив `run.py` или используя уже присутствующие операторы `print`.

## Вклад в проект

Expand Down
2 changes: 1 addition & 1 deletion src/yatl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def create_context(test_spec: dict):


def search_files(base_path: str) -> list[str]:
"""Recursively searches for test files with a .test.yaml/.test.yml suffix.
"""Recursively searches for test files with a .yatl.yaml/.yatl.yml suffix.

Args:
base_path: Base directory for the search.
Expand Down
Loading