microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.45k stars 3.63k forks source link

[Feature] Hide TestInfo. attach console logging #12154

Closed serembon closed 2 years ago

serembon commented 2 years ago

When using a TestInfo. attachments in a reporter, such as allure-playwright or html, after the tests are finished, attachments logs appear in the console. Such information is not very useful for the end-user.

  Running 5 tests using 5 workers

    1) tests/incomingPackage.test.ts:4:1 › Package monitoring ===

    Some test results data....

    attachment #1: allure-metadata.json (application/vnd.allure.metadata+json) ---------------------
    ------------------------------------------------------------------------------------------------

    attachment #2: allure-metadata.json (application/vnd.allure.metadata+json) ---------------------
    ------------------------------------------------------------------------------------------------

    attachment #3: screenshot (image/png) ----------------------------------------------------------
    allure-results/tests-monitoring-incomingPackage-Package-Monitoring/test-failed-1.png
    ------------------------------------------------------------------------------------------------

Propose to remove the output of information about attachments to the console.

dgozman commented 2 years ago

@serembon Why is allure-metadata.json an attachment and not an annotation? Would that work for you?

serembon commented 2 years ago

This type of content was suggested by Allur's maintainers during the merge request #408.

In addition, this type may be necessary for other products related to the Allure-report ecosystem, that can be used with allure-playwright, for example, Allure TestOps.

Can you provide an example of how this can be implemented with annotation?

dgozman commented 2 years ago

@pavelfeldman Perhaps we can hide attachments that do not have a file path nor the text content?