summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2014-06-19 09:12:59 +0300
committerVaadin Code Review <review@vaadin.com>2014-06-19 07:48:58 +0000
commit2da9b502f0b76020ca6bd094e5d53c77d1acd9fb (patch)
tree5228941c221e33c6940b0bf1d88fda61685c7565
parent3e925629ae50281dcbf4af00b0bbe3cfa05164ae (diff)
downloadvaadin-framework-2da9b502f0b76020ca6bd094e5d53c77d1acd9fb.tar.gz
vaadin-framework-2da9b502f0b76020ca6bd094e5d53c77d1acd9fb.zip
Converted GridLayoutWidthChangeTest to TB4. (#8855)
Change-Id: Ida4550689387c048c0eee95420851dc72620ad65
-rw-r--r--uitest/src/com/vaadin/tests/layouts/GridLayoutWidthChange.html47
-rw-r--r--uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChange.java (renamed from uitest/src/com/vaadin/tests/layouts/GridLayoutWidthChange.java)12
-rw-r--r--uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChangeTest.java24
3 files changed, 31 insertions, 52 deletions
diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutWidthChange.html b/uitest/src/com/vaadin/tests/layouts/GridLayoutWidthChange.html
deleted file mode 100644
index f01a1a7026..0000000000
--- a/uitest/src/com/vaadin/tests/layouts/GridLayoutWidthChange.html
+++ /dev/null
@@ -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>
diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutWidthChange.java b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChange.java
index c0e6b27c7d..96091bdab5 100644
--- a/uitest/src/com/vaadin/tests/layouts/GridLayoutWidthChange.java
+++ b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChange.java
@@ -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.";
}
diff --git a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChangeTest.java b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChangeTest.java
new file mode 100644
index 0000000000..52ea5f4f8e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutWidthChangeTest.java
@@ -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");
+ }
+} \ No newline at end of file