-
Notifications
You must be signed in to change notification settings - Fork 11
Advanced Screenshots
The normal screenshots provided by Selenide sometimes do not show everything that is needed to analyze a bug. Therefore Neodymium offers the option to use advanced screenshots.
To enable the use of advanced Screenshots one has to simply enable it in the properties.
neodymium.screenshots.enableAdvancedScreenshots = true
On default this will take normal screenshots of the viewport visible at the moment of failure. Only difference being that the screenshots are now stored in separate folders for each test class. As test class names can be similar for different areas you want to test, the folder names also contain the entire name of the package it is in.
For example the screenshots for test class BrowseTest
which is in smoke
sub-package would be stored like this:
They will also have a name containing the calling test method name, used browser profil, provided data set and a timestamp.
With bigger Testsuites this folder structure could get quite confusing, as there will be a lot of folders with similar names. So in order to keep track of all the Screenshots. You have the option of automatically generating a folder tree structure. So for the example above this would look like this:
To activate this enable the neodymium.screenshots.enableTreeDirectoryStructure
property.
With CSS-selectors it is sometimes not clear which of the elements of a given website was handled last (and if it even was the correct element). For this Neodymium provides the option to highlight the last element that was evaluated or manipulated.
By enabling the neodymium.screenshots.highlightLastElement
property you will add highlighting to your screenshots.
The default color can be changed. With the neodymium.screenshots.highlightColor
property you can change the color to any RBG color you think fits your testreports the best. The color has to be given in a hexadecimal format. So for example:
neodymium.screenshots.highlightColor = #0000FF
will make your screenshot look like this:
Sometimes only seeing the viewport does not tell the entire story of a failure. Neodymium enables you to get fullpage screenshots with the neodymium.screenshots.fullpagecapture.enable
property.
To still be able to now were the current viewport was you can enable neodymium.screenshots.fullpagecapture.highlightViewport
. So your screenshot can look like this:
Again the color of the highlighting can be changed to any RBG color using the neodymium.screenshots.fullpagecapture.highlightColor
proprety.
Overview
Neodymium features
- Neodymium configuration properties
- Neodymium context
- Utility classes
- Test data provider
- Test Environments
- Multi browser support
- Applitools Plugin
- Localization
- Highlight and Wait
- Advanced Screenshots
- Seperate Browser Sessions for Setup and Cleanup
Best practices and used frameworks
Special