diff options
author | Henri Sara <hesara@vaadin.com> | 2016-05-04 11:30:51 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-05-04 11:03:58 +0000 |
commit | 08bdb4829aed95d3a09819f1eb367fc9d5e8b966 (patch) | |
tree | 8ecc4e4fab55488f5f8b46c33f2b71af0c3ae61a | |
parent | e3de7b43bb0be25be60d2f5ac8dafc8be9993b02 (diff) | |
download | vaadin-framework-08bdb4829aed95d3a09819f1eb367fc9d5e8b966.tar.gz vaadin-framework-08bdb4829aed95d3a09819f1eb367fc9d5e8b966.zip |
Compare against references also if no version specified
Change-Id: I4396f456770aab470a98b19c5474f1a74e72f141
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java b/uitest/src/test/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java index 1c24720075..d94e05efdb 100644 --- a/uitest/src/test/java/com/vaadin/tests/tb3/ScreenshotTB3Test.java +++ b/uitest/src/test/java/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; } } |