diff options
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java b/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java index 1c24720075..d94e05efdb 100644 --- a/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java @@ -311,14 +311,18 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test { String browserVersion = capabilities.getVersion(); + // compare against screenshots for this version and older + // default such that if no particular version is requested, compare with + // any version + int maxVersion = 100; if (browserVersion.matches("\\d+")) { - for (int version = Integer.parseInt(browserVersion); version > 0; version--) { - String fileName = getScreenshotReferenceName(identifier, - version); - File oldVersionFile = new File(fileName); - if (oldVersionFile.exists()) { - return oldVersionFile; - } + maxVersion = Integer.parseInt(browserVersion); + } + for (int version = maxVersion; version > 0; version--) { + String fileName = getScreenshotReferenceName(identifier, version); + File oldVersionFile = new File(fileName); + if (oldVersionFile.exists()) { + return oldVersionFile; } } |