Creating tests using SIDE Eyes
This article provides an overview of all the available SIDE Eyes commands that you can use in a Selenium IDE script. Note that some configuration is done via setup menus and not using script commands. See Setting up tests with SIDE Eyes for details.
All the Eyes commands start with eyes. You can add the Eyes commands to the scripts while building a script manually using the IDE in the same way as all other IDE commands. When you are recording a test, you can also click on the at the top of the browser, and then you can select any of the available commands from a menu. Some commands prompt you for a parameter, for example, to select an element to check. In other commands, SIDE Eyes puts a default value in the script, and you need to go to the script when the recording is complete and type in the value that you require.
The SIDE Eyes commands can broadly be split into two groups. Commands that are used to set properties and commands that are used to add checkpoints. Each of these is described in the sections that follow, click on the command name link for a more detailed description.
Commands to set up properties.
- Set viewport size
- The viewport size describes the rectangular area in the browser window that contains application content. Since the viewport size can impact the page layout, it is one of the properties that Eyes uses to determine which baseline reference images it uses for the test. In most cases, when you set the viewport size, you are doing two things - changing the browser window size, and determining which baseline will be used. You must set the viewport size before the first call to eyes check.
- set match level
- The match level determines the sensitivity of the matching algorithm used by Eyes. For example, a match level of Strict checks that both text and graphics are visually identical. A match level of Layout is more lenient, checking that graphic areas and image areas are positioned similarly in the checkpoint and baseline image, but allowing the actual text or image to be different. You can change this property during the test, so that different checkpoints, can be tested with different match levels.
- Set timeout
- You can use the eyes set match timeout command if page rendering takes more time than is allowed for by default, and as a result, an image is captured before the render is complete. Increasing the timeout is sometimes necessary when the page content includes an animation when it starts, or if it is generated by a lengthy JavaScript program.
- set baseline envname
-
When a test runs, the execution environment it runs on is defined by three properties - the operating system it ran (OS), the application platform (typically the browser) and the viewport size. Together with the application and test names, these 5 properties identify the specific baseline Defines the sequence of images to which the sequence of images captured at checkpoints will be compared. A test can have multiple baselines, each of which is characterized by the execution environment it ran on (operating system, browser and viewport size). A baseline can have instances in multiple branches. used as a reference when matching checkpoint images to baseline images.
Eyes Test Manager allows you to assign a name to a specific execution environment, and then in the test to set the baseline environment name to this name before the first call to eyes check. Eyes then uses the baseline defined by the environment name instead of the actual test execution environment. For more information on using execution environments see Running cross-environment tests.
Commands to add checkpoints
- eyes check window
- This command causes all of the browser content to be captured and sent to the Eyes server for matching.
- eyes check element
- This command causes a rectangular region associated with an HTML element you specify to be captured and sent to the Eyes server for matching.