* @param testName
* @return the reference file name to use for the given browser, as
* described by {@literal capabilities}, and identifier
*/
private File getScreenshotReferenceFile(String identifier) {
DesiredCapabilities capabilities = getDesiredCapabilities();
String originalName = getScreenshotReferenceName(identifier);
File exactVersionFile = new File(originalName);
if (exactVersionFile.exists()) {
return exactVersionFile;
}
String browserVersion = capabilities.getVersion();
if (browserVersion.matches("\\d+")) {
for (int version = Integer.parseInt(browserVersion); version > 0; version--) {
String fileName = getScreenshotReferenceName(identifier,
version);