From 4428c7dc83d31c7ff4413e3e6301f4588d59dba3 Mon Sep 17 00:00:00 2001 From: Denis Anisimov Date: Tue, 20 Jan 2015 09:20:29 +0200 Subject: Button icon 'icon-align-top' style correction (#15140). Change-Id: I16bc415596431340e4e4d1944b3927dc3fd6cd96 --- .../com/vaadin/tests/themes/valo/AlignTopIconInButtonTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/uitest/src/com/vaadin/tests/themes/valo/AlignTopIconInButtonTest.java b/uitest/src/com/vaadin/tests/themes/valo/AlignTopIconInButtonTest.java index 287e25d402..02ef886721 100644 --- a/uitest/src/com/vaadin/tests/themes/valo/AlignTopIconInButtonTest.java +++ b/uitest/src/com/vaadin/tests/themes/valo/AlignTopIconInButtonTest.java @@ -15,7 +15,10 @@ */ package com.vaadin.tests.themes.valo; -import org.junit.Assert; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.lessThanOrEqualTo; + import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; @@ -30,7 +33,7 @@ import com.vaadin.tests.tb3.MultiBrowserTest; public class AlignTopIconInButtonTest extends MultiBrowserTest { @Test - public void testIconPositioninButton() { + public void iconIsCenteredInsideButton() { openTestURL(); WebElement wrapper = findElement(By.className("v-button-wrap")); @@ -41,7 +44,6 @@ public class AlignTopIconInButtonTest extends MultiBrowserTest { + wrapper.getSize().getWidth() - icon.getLocation().getX() - icon.getSize().getWidth(); - Assert.assertTrue("Icon element is not centered inside button.", - Math.abs(rightSpace - leftSpace) <= 1); + assertThat(Math.abs(rightSpace - leftSpace), is(lessThanOrEqualTo(2))); } } -- cgit v1.2.3