Configuring Eyes using the SDK

Eyes provides a variety of ways to set up and change how it captures images and processes them. Some features are available interactively using the Eyes Test Manager, others are available programatically using one of the SDKs. In some cases, you can use either the Eyes Test Manager, or the SDK.

The article Configuring Eyes matching capabilities explains the various tools and whether they are available in the SDK, Eyes Test Manager, or both. This article focuses on the SDK. Often, you can configure the Eyes SDK in different ways. This article describes three patterns of SDK use, highlighting where each pattern is most useful.

Configurations can be classified into the following groups:

One time setup, common to all tests

Eyes provides a configuration object which is a container of configuration values. There is a method for setting each of the available configuration values. You can call these methods using a fluent style interface, as shown in the example below.


                                

You then apply all of these configuration values in one step by calling the method class$eyes$setconfiguration with the configuration object.

Typically, you will do this immediately after you create the eyes instance variable. Note that this sets all the configuration values. If there are values that you didn't set explicitly, then it will have a default value.


                                

Test-specific configuration

Sometimes, you need to configure Eyes with test-specific values. You can do this by first setting up the eyes instance with the global configuration object immediately after it is created. Then you can use either or both of the following two techniques:

  • Configuring the Eyes instance directly using the relevant eyes.setXXXX methods, if they are available in your SDK.
  • Obtain the current configuration value of the Eyes instance using the method class$eyes$getconfiguration to a temporary configuration object, change the value that you want to set, and then call class$eyes$setconfiguration.

    
                                            

    You may find this method more convenient than using the eyes.setXXXX methods if there are several values to set.

Checkpoint-specific configuration

You can also apply some configuration options specifically to a given checkpoint when you use the class$eyes$check method with fluent method support from the target and checksettings classes.

For more information see The Eyes SDK check Fluent API