# Шаги(step)

Первый и вероятно, самый важный аспект отчета Allure заключается в том, что он позволяет получить очень подробное пошаговое представление каждого запуска теста. Это стало возможным благодаря `@allure.step`декоратору, который добавляет в отчет вызов аннотированного метода или функции с предоставленными аргументами.

Аннотированные методы `@step`можно хранить отдельно от ваших тестов и просто импортировать при необходимости. Пошаговые методы могут иметь сколь угодно глубокую вложенную структуру.

Можно использовать в качестве декораторов. По умолчанию имя шага генерируется из имени метода:

```
import nose

@nose.allure.step
def make_test_data_foo():
    # do stuff

def test_foo():
    assert make_some_data_foo() is not None

@nose.allure.step('make_some_data_foo')
def make_some_data_bar():
    # do another stuff

def test_bar():
    assert make_some_data_bar() is not None
```

Чтобы разделить тест на этапы:

```
import nose

def test_foo():
    with nose.allure.step('step one'):
        # do stuff

    with nose.allure.step('step two'):
        # do more stuff
```

Ещё можно использовать без `nose`

```
import allure

def test_foo():
    with allure.step('step one'):
        # do stuff

    with allure.step('step two'):
        # do more stuff
```

Статус каждого шага отображается маленькой иконкой слева от названия. Вложенные шаги организованы в виде древовидной складной структуры.

![](https://2199266820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjLS7kUc1aR2S56nZreKO%2Fuploads%2Fm8nb8MyZnSrrD7EeOJYL%2Fimage.png?alt=media\&token=0d63c5d5-cb78-4b9c-9b73-65110e681217)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://igor-19.gitbook.io/qa/avtomatizaciya-testirovaniya/python/allure-python/dekoratory/shagi-step.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
