Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansi escape sequences formatting #806

Open
delatrie opened this issue Apr 10, 2024 · 1 comment
Open

ansi escape sequences formatting #806

delatrie opened this issue Apr 10, 2024 · 1 comment
Labels
task:improvement Change that improves some user experience but can't be considered a new feature theme:pytest theme:pytest-bdd

Comments

@delatrie
Copy link
Contributor

Discussed in https://github.com/orgs/allure-framework/discussions/2485

Originally posted by kuerbisbeule33 April 8, 2024
If I generate the Allure report, I notice that the raw ANSI escape sequences appear in the stdout section of the report (Execution -> Test Body -> Stdout). Consequently, I can see the escape sequences but not their formatting. Is there a way to replicate the same formatting (colors) in the Allure report as seen in the actual console output?
raw_ansi_escapes

@delatrie delatrie added theme:pytest theme:pytest-bdd task:improvement Change that improves some user experience but can't be considered a new feature labels Apr 10, 2024
@sarzamas
Copy link

sarzamas commented May 17, 2024

vote for this bug!

same problem with color coded ANSI-colored strings in allure report... but I found it in attachment!

Monosnap Allure Report - Google Chrome 2024-05-18

in terminal same colored log strings look like this

Monosnap auto-tests

code to reproduce:

@pytest.fixture()
def log_delimiter(request):
    test_name = request.function.__name__
    test_title = f"{(' ' + test_name + ' '):-^79}"
    if request.config.option.color == 'yes':
        test_title = '\033[1m%s\033[0m' % test_title
    logger.info(f"{os.linesep}{test_title}")

Monosnap Allure Report - Google Chrome 2024-05-18_

Element:
pre class "attachment__text"

here is the attachment example with problematic ANSI-colored strings

432d516d-35f4-4650-812c-f4612fe782ca-attachment.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task:improvement Change that improves some user experience but can't be considered a new feature theme:pytest theme:pytest-bdd
Projects
None yet
Development

No branches or pull requests

2 participants