testdevlab / Py-TestUI

Apache License 2.0
17 stars 1 forks source link

Add include_stacktrace and include_screenshot params for testui_error() #11

Closed aleksslitvinovs closed 3 years ago

aleksslitvinovs commented 3 years ago

ATM testui_error() in testui.elements.testui_element creates screenshot and includes full stacktrace for all errors but this behavior should be changeable. For this reason, function's signature has been updated to:

def testui_error(
    driver: TestUIDriver,
    exception: str,
    include_stacktrace: bool = True,
    include_screenshot: bool = True
) -> None:

By default include_stacktrace and include_screenshot are True due to backward-compatibility but IMO it should be False since additional log verbosity usually is optional. This is up to maintainers to decide what is the default behavior 😉

Also updated example tests to remove the unnecessary wrapping class and updated .gitignore to exclude files as per this.