Change-Id: Ida4550689387c048c0eee95420851dc72620ad65tags/7.2.4
@@ -1,47 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |||
<head profile="http://selenium-ide.openqa.org/profiles/test-case"> | |||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |||
<link rel="selenium.base" href="" /> | |||
<title>GridLayoutWidthChange</title> | |||
</head> | |||
<body> | |||
<table cellpadding="1" cellspacing="1" border="1"> | |||
<thead> | |||
<tr><td rowspan="1" colspan="3">GridLayoutWidthChange</td></tr> | |||
</thead><tbody> | |||
<tr> | |||
<td>open</td> | |||
<td>/run/com.vaadin.tests.layouts.GridLayoutWidthChange</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td>waitForVaadin</td> | |||
<td></td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td>screenCapture</td> | |||
<td></td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td>click</td> | |||
<td>vaadin=runcomvaadintestslayoutsGridLayoutWidthChange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td>waitForVaadin</td> | |||
<td></td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td>screenCapture</td> | |||
<td></td> | |||
<td></td> | |||
</tr> | |||
</tbody></table> | |||
</body> | |||
</html> |
@@ -1,5 +1,7 @@ | |||
package com.vaadin.tests.layouts; | |||
package com.vaadin.tests.layouts.gridlayout; | |||
import com.vaadin.server.VaadinRequest; | |||
import com.vaadin.tests.components.AbstractTestUI; | |||
import com.vaadin.tests.components.TestBase; | |||
import com.vaadin.ui.Button; | |||
import com.vaadin.ui.Button.ClickEvent; | |||
@@ -9,7 +11,7 @@ import com.vaadin.ui.NativeButton; | |||
import com.vaadin.ui.TextField; | |||
import com.vaadin.ui.VerticalLayout; | |||
public class GridLayoutWidthChange extends TestBase { | |||
public class GridLayoutWidthChange extends AbstractTestUI { | |||
private GridLayout generateLayout() { | |||
VerticalLayout fields1 = new VerticalLayout(); | |||
@@ -34,7 +36,7 @@ public class GridLayoutWidthChange extends TestBase { | |||
} | |||
@Override | |||
protected void setup() { | |||
protected void setup(VaadinRequest request) { | |||
final GridLayout layout1 = generateLayout(); | |||
final CustomComponent cc = new CustomComponent(layout1); | |||
cc.setWidth("500px"); | |||
@@ -45,7 +47,7 @@ public class GridLayoutWidthChange extends TestBase { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
cc.setWidth((cc.getWidth() - 10) + "px"); | |||
cc.setWidth((cc.getWidth() - 100) + "px"); | |||
} | |||
}); | |||
@@ -53,7 +55,7 @@ public class GridLayoutWidthChange extends TestBase { | |||
} | |||
@Override | |||
protected String getDescription() { | |||
protected String getTestDescription() { | |||
return "A 100% wide GridLayout is wrapped inside a CustomComponent. When the width of the CustomComponent is reduced, the size of the GridLayout should be reduced accordingly. The Buttons should stay in place vertically and just move closer to each other horizontally."; | |||
} | |||
@@ -0,0 +1,24 @@ | |||
package com.vaadin.tests.layouts.gridlayout; | |||
import com.vaadin.testbench.elements.ButtonElement; | |||
import com.vaadin.tests.tb3.AbstractTB3Test; | |||
import com.vaadin.tests.tb3.MultiBrowserTest; | |||
import org.junit.Test; | |||
import java.io.IOException; | |||
import static org.junit.Assert.*; | |||
public class GridLayoutWidthChangeTest extends MultiBrowserTest { | |||
@Test | |||
public void layoutIsReduced() throws IOException { | |||
openTestURL(); | |||
compareScreen("initial"); | |||
$(ButtonElement.class).caption("Reduce GridLayout parent width").first().click(); | |||
compareScreen("buttonMoved"); | |||
} | |||
} |