diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2014-06-13 10:45:40 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-06-18 08:24:38 +0000 |
commit | 5981b6e6b693eb2a4166c1954f96ab0f93c7f744 (patch) | |
tree | ba2326afc7e74cfed7b0d9832a87bcf203216591 /uitest | |
parent | 62e61aff013ea53e255bba0a633b162a74aade24 (diff) | |
download | vaadin-framework-5981b6e6b693eb2a4166c1954f96ab0f93c7f744.tar.gz vaadin-framework-5981b6e6b693eb2a4166c1954f96ab0f93c7f744.zip |
Convert GridLayoutMoveComponentTest to TB4. (#8855)
Change-Id: I4be636273b2fd8dae544a6f0b88d8fdb00c33826
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/layouts/GridLayoutMoveComponent.html | 57 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponent.java (renamed from uitest/src/com/vaadin/tests/layouts/GridLayoutMoveComponent.java) | 11 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponentTest.java | 31 |
3 files changed, 38 insertions, 61 deletions
diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutMoveComponent.html b/uitest/src/com/vaadin/tests/layouts/GridLayoutMoveComponent.html deleted file mode 100644 index 77a17263f8..0000000000 --- a/uitest/src/com/vaadin/tests/layouts/GridLayoutMoveComponent.html +++ /dev/null @@ -1,57 +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>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.layouts.GridLayoutMoveComponent?restartApplication</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>all-left</td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestslayoutsGridLayoutMoveComponent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>label-right</td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestslayoutsGridLayoutMoveComponent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>label-button-right</td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestslayoutsGridLayoutMoveComponent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>label-button-textfield-right</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/layouts/GridLayoutMoveComponent.java b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponent.java index efd1277653..cd86fbcf3c 100644 --- a/uitest/src/com/vaadin/tests/layouts/GridLayoutMoveComponent.java +++ b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponent.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; @@ -7,10 +9,10 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.TextField; -public class GridLayoutMoveComponent extends TestBase { +public class GridLayoutMoveComponent extends AbstractTestUI { @Override - protected void setup() { + protected void setup(VaadinRequest request) { final GridLayout grid = new GridLayout(2, 3); grid.setCaption("Fixed size grid"); grid.setWidth("300px"); @@ -51,13 +53,14 @@ public class GridLayoutMoveComponent extends TestBase { @Override public void buttonClick(ClickEvent event) { grid.removeComponent(tf); + grid.addComponent(new Label("I'm on left"), 0, 2); grid.addComponent(tf, 1, 2); } })); } @Override - protected String getDescription() { + protected String getTestDescription() { return "Click the buttons below the GridLayout to move the components to the right. Should definitely work no matter what."; } diff --git a/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponentTest.java b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponentTest.java new file mode 100644 index 0000000000..0fab64989a --- /dev/null +++ b/uitest/src/com/vaadin/tests/layouts/gridlayout/GridLayoutMoveComponentTest.java @@ -0,0 +1,31 @@ +package com.vaadin.tests.layouts.gridlayout; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.tests.tb3.MultiBrowserTest; +import org.junit.Test; + +import java.io.IOException; + +public class GridLayoutMoveComponentTest extends MultiBrowserTest { + + @Test + public void componentsShouldMoveRight() throws IOException { + openTestURL(); + + compareScreen("all-left"); + + clickButtonWithCaption("Shift label right"); + compareScreen("label-right"); + + clickButtonWithCaption("Shift button right"); + compareScreen("label-button-right"); + + clickButtonWithCaption("Shift text field right"); + compareScreen("label-button-textfield-right"); + } + + private void clickButtonWithCaption(String caption) { + $(ButtonElement.class).caption(caption).first().click(); + } + +}
\ No newline at end of file |