Skip to content

Screenshot for setup and teardown failure #3790

Closed
@smanenti

Description

@smanenti

Hi!

While SeleniumBase is properly taking screenshot when a test is failing, it is not taking a screenshot when a fixture used for setup and teardown - which is called by the test - is failing.
We are using SB inside fixture for example to create user prior a test, and then delete that user after the test.
This is super useful, as if the test is failing due to an error in the fixture, we could then have a screenshot to help troubleshooting.

We wrote a workaround by defining a hook in pytest make report function, and by checking if report.when is "setup" or "teardown" + has failed. Then, we are calling SB to take a screenshot.

While this is working fine now, I was wondering if this is done on purpose (screenshot only for tests), or if we are missing a configuration of SB.

I've tried looking into GitHub for existing topic, but I've found nothing.

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionSomeone is looking for answers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions