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: 8 additions & 0 deletions allure-behave/features/steps/dummy_steps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-

import allure
from behave import given

Expand Down Expand Up @@ -26,3 +28,9 @@ def step_impl(*args, **kwargs):
@given(u'{what} broken step {where}')
def step_impl(*args, **kwargs):
raise ZeroDivisionError()


@given(u'всегда будет <это>')
@given(u'всегда буду я')
def step_impl(*args, **kwargs):
pass
18 changes: 14 additions & 4 deletions allure-behave/features/unicode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ Feature: Language
Scenario: Use russian
Given feature definition ru
"""
Функционал: Язык
Функционал: Юникод

Сценарий: На русском
Допустим passed step
Структура сценария: Солнечный круг, небо вокруг
Пусть всегда будет <это>
Пусть всегда буду я
Примеры:
| это |
| солнце |
| небо |
| мама |
"""
When I run behave with allure formatter with options "--lang ru"
Then allure report has a scenario with name "На русском"
Then allure report has a scenario with name "Солнечный круг, небо вокруг"
And scenario contains step "Пусть всегда будет солнце"
And scenario contains step "Пусть всегда будет небо"
And scenario contains step "Пусть всегда будет мама"
And scenario contains step "Пусть всегда буду я"
3 changes: 2 additions & 1 deletion allure-behave/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from allure_commons.model2 import Status, Parameter, Label
from allure_commons.model2 import StatusDetails
from allure_commons.utils import md5
from allure_commons.utils import represent
import traceback

STATUS = {
Expand Down Expand Up @@ -82,7 +83,7 @@ def step_status(result):

def step_status_details(result):
if result.exception:
message = u','.join(map(str, result.exception.args))
message = u','.join(map(represent, result.exception.args))
message = u'{name}: {message}'.format(name=result.exception.__class__.__name__, message=message)
trace = u'\n'.join(traceback.format_tb(result.exc_traceback)) if result.exc_traceback else None
return StatusDetails(message=message, trace=trace)
Expand Down