nhsuk / ui-test-core

Python package which helps with writing UI tests by providing a wrapper around Selenium and other useful functions
MIT License
12 stars 6 forks source link

[BUG] Saving screenshots with "/" in the name does not work #13

Closed Phil-87 closed 5 years ago

Phil-87 commented 5 years ago

Describe the bug When trying to save a screenshot with a "/" in the file name, the screenshot is not saved and no errors are reported.

To Reproduce Call BrowserHandler.take_screenshot passing in a description with a "/" in it e.g. a URL.

Code snippet

BrowserHandler.take_screenshot(self.driver, "Element not visible on page https://www.website.com")

Expected behavior The "/" in the file name should be replaced with underscores and the screenshot saved. Also if the take_screenshot should return a boolean to represent whether the screenshot was saved, so that any errors can be handled in test code.