Allure becomes truly powerful when you enrich results with steps, attachments and labels that reflect how users and teams think about the system. Instead of a flat list of tests, you get structured narratives and groupings that guide debugging.
Using Steps, Attachments and Labels in Allure
Steps describe the actions within a test, attachments store extra context like screenshots or request/response bodies, and labels tag tests with metadata such as feature, story, severity or owner. Framework plugins usually expose decorators or helper functions to add this information.
# Example: pytest with Allure steps and attachments
import allure
@allure.feature("Checkout")
@allure.severity(allure.severity_level.CRITICAL)
def test_checkout_happy_path(api_client):
with allure.step("Create test user"):
user = api_client.create_user()
with allure.step("Add item to cart"):
api_client.add_to_cart(user, sku="SKU-123")
with allure.step("Submit order"):
response = api_client.checkout(user)
allure.attach(str(response.json()), name="checkout_response", attachment_type=allure.attachment_type.JSON)
assert response.status_code == 200
@allure.feature and @allure.severity allow stakeholders to filter reports by business area or impact.With thoughtful use of these features, a failing test in Allure reads like a short story that explains what happened, not just a stack trace.
Common Mistakes
Mistake 1 โ Using generic or misleading labels
This reduces value.
โ Wrong: Tagging everything with a single feature name or leaving severity as the default.
โ Correct: Choose labels that reflect real modules, journeys and risk levels.
Mistake 2 โ Attaching massive logs without limits
This hurts performance.
โ Wrong: Dumping entire logs or database snapshots into attachments.
โ Correct: Attach focused evidence (key responses, screenshots) that helps debug typical failures.