MatchTimeout defines the default amount of time (either in milliseconds or in seconds - you can check according to your SDK) that Eyes will wait for an image to stabilize to a point that it is similar to the baseline image (the default value is 2 seconds). It works as follows:
- When running a new test for the first time, checkWindow will wait 2 seconds (the default value of matchTimeout) for the image to stabilize before capturing the screenshot in order to ensure that the baseline represents a stable state.
- In future runs of the test, eyes.checkWindow will try to capture a screenshot immediately and compare it with the baseline. In case the image matches the baseline, it will continue to the next step immediately without waiting, while if there is a mismatch, it will retry several time until the image stabilizes to a point where it is similar to the baseline or until the timeout is reached.
- In case there is a mismatch, all the next checkWindows in the test will wait matchTimeout before capturing the screenshot in order to ensure that the captured images are of stable pages (so you can easily accept the new images without re-running the test).
- There is also an option to override the default matchTimeout for specific steps (can be used in cases where some of the pages take longer than others to load and you don’t want to change the timeout for the entire test and avoid slowing the test in case of mismatches). It works with a similar logic to the default matchTimeout. Here is an example of the syntax:
eyes.checkWindow(int matchTimeout, string tag);