From f27a8a9314ba1919c049bad4986f28f77c9ba1af Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Wed, 4 May 2016 11:30:51 +0300 Subject: Compare against references also if no version specified Change-Id: I40c088db6ea7ca17b4cd111f2416c85ae36e3e27 --- uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'uitest') 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; } } -- cgit v1.2.3