Skip to content

[Feature]: Make oiptional dumping aria snapshot when locator assertion fails #3088

@gladykov

Description

@gladykov

🚀 Feature Request

When locator assertion fails, I get now dump of whole page in aria snapshot:

 expect(self.get_locator(xpath)).to_be_visible()
E   AssertionError: Locator expected to be visible
E   Actual value: - complementary "Sidenav":
E     - list:
E       - listitem:
E         - img
E         - img
E       - listitem:
E         - img
E         - text: Final touch
(...)

It pollutes logs, and requieres custom wrapper around assertions. Also since I always look in videos / screenshots to understand failure, so looking into DOM structure is a last resort. I didn't find an option to disable it.

IMHO such heavy logging on assertion is overkill, and should have option to at least disable it. Even better option - enable only when tracing is explicitly enabled.

Example

No response

Motivation

Logs are polluted and hard to read, by dumping whole page structure on failed assertion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions