hound v1.0.4 Hound.Helpers.Screenshot View Source

Provides helper function to take screenshots

Link to this section Summary

Functions

Takes screenshot of the current page. The screenshot is saved in the current working directory. It returns the path of the png file, to which the screenshot has been saved

Link to this section Functions

Link to this function take_screenshot(path \\ default_path()) View Source
take_screenshot(String.t) :: String.t

Takes screenshot of the current page. The screenshot is saved in the current working directory. It returns the path of the png file, to which the screenshot has been saved.

For Elixir mix projects, the saved screenshot can be found in the root of the project directory.

take_screenshot()

You can also pass a file path to which the screenshot must be saved to.

# Pass a full file path
take_screenshot("/media/screenshots/test.png")

# Or you can also pass a path relative to the current directory. take_screenshot("screenshot-test.png")