take_screenshot
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7 (0)
- 5.2.3 (-7)
- 6.0.0 (1)
- 6.1.3.1 (38)
- 6.1.7.7 (0)
- 7.0.0 (11)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
take_screenshot()
public
Takes a screenshot of the current page in the browser.
take_screenshot can be used at any point in your system tests to take a screenshot of the current state. This can be useful for debugging or automating visual testing.
The screenshot will be displayed in your console, if supported.
You can set the RAILS_SYSTEM_TESTING_SCREENSHOT environment variable to control the output. Possible values are:
- inline (default)
-
display the screenshot in the terminal using the iTerm image protocol (http://iterm2.com/documentation-images.html).
- simple
-
only display the screenshot path. This is the default value if the CI environment variables is defined.
- artifact
-
display the screenshot in the terminal, using the terminal artifact format (http://buildkite.github.io/terminal/inline-images/).