summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-07-19 09:18:58 +0300
committerHenri Sara <henri.sara@gmail.com>2017-07-19 09:18:58 +0300
commit7b288aeb663f89bdac8cbf7eb20877681b4b49a6 (patch)
tree9526a5a1707291f896c6ff67ca8369f040763319 /uitest
parenta108a7e8da24d5f38e5e3f34e4a0e95c1cb6b56e (diff)
downloadvaadin-framework-7b288aeb663f89bdac8cbf7eb20877681b4b49a6.tar.gz
vaadin-framework-7b288aeb663f89bdac8cbf7eb20877681b4b49a6.zip
Add styling for ComponentRenderer wrapper div (#9691)
Fixes #9170
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java1
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java16
2 files changed, 17 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java
index a48c8400c1..6398ef1055 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridComponents.java
@@ -35,6 +35,7 @@ public class GridComponents extends AbstractTestUIWithLog {
TextField textField = new TextField();
textField.setValue(string);
+ textField.setWidth("100%");
// Make sure all changes are sent immediately
textField.setValueChangeMode(ValueChangeMode.EAGER);
textField.addValueChangeListener(e -> {
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java
index af985aad9a..295f06e4ce 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java
@@ -7,6 +7,7 @@ import org.openqa.selenium.WebElement;
import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
import com.vaadin.testbench.elements.GridElement.GridRowElement;
import com.vaadin.testbench.elements.NotificationElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
@@ -55,6 +56,21 @@ public class GridComponentsTest extends MultiBrowserTest {
assertRowExists(5, "Row 1005");
}
+ @Test
+ public void testTextFieldSize() {
+ openTestURL();
+ GridCellElement cell = $(GridElement.class).first().getCell(0, 1);
+ int cellWidth = cell.getSize().getWidth();
+ int fieldWidth = cell.findElement(By.tagName("input")).getSize()
+ .getWidth();
+ // padding left and right, +1 to fix sub pixel issues
+ int padding = 18 * 2 + 1;
+
+ int extraSpace = Math.abs(fieldWidth - cellWidth);
+ Assert.assertTrue("Too much unused space in cell. Expected: " + padding
+ + " Actual: " + extraSpace, extraSpace <= padding);
+ }
+
private void editTextFieldInCell(GridElement grid, int row, int col) {
WebElement textField = grid.getCell(row, col)
.findElement(By.tagName("input"));