summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2016-05-04 11:30:51 +0300
committerIlia Motornyi <elmot@vaadin.com>2016-06-23 11:39:23 +0000
commitf27a8a9314ba1919c049bad4986f28f77c9ba1af (patch)
treea378897c33bd2be3d68e17b9335b38bc54cae5be /uitest
parentca6d679ccb274602c15ada2f450ff74a5e54c738 (diff)
downloadvaadin-framework-f27a8a9314ba1919c049bad4986f28f77c9ba1af.tar.gz
vaadin-framework-f27a8a9314ba1919c049bad4986f28f77c9ba1af.zip
Compare against references also if no version specified
Change-Id: I40c088db6ea7ca17b4cd111f2416c85ae36e3e27
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java18
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;
}
}