aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-03-16 22:10:43 +0200
committerVaadin Code Review <review@vaadin.com>2014-03-31 16:55:57 +0000
commit99de80ae526d507d1fb0f90a27d1e401f3f76850 (patch)
treef7a3d7b6364d481fd7e6653c1d31babc5b02c22f /uitest/src/com
parent353a1a1c3073975ddc6d0f25d8d2b21b9df94343 (diff)
downloadvaadin-framework-99de80ae526d507d1fb0f90a27d1e401f3f76850.tar.gz
vaadin-framework-99de80ae526d507d1fb0f90a27d1e401f3f76850.zip
Bring window to front on window header click (#13445).
Change-Id: I3322dcff0199125f49cc48afdc467516b420e845
Diffstat (limited to 'uitest/src/com')
-rw-r--r--uitest/src/com/vaadin/tests/components/window/MoveToTop.java57
-rw-r--r--uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java53
2 files changed, 110 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/window/MoveToTop.java b/uitest/src/com/vaadin/tests/components/window/MoveToTop.java
new file mode 100644
index 0000000000..4fd748183a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/window/MoveToTop.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.window;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Window;
+
+/**
+ *
+ * @author Vaadin Ltd
+ */
+public class MoveToTop extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Window window = new Window("one");
+ window.addStyleName("first-window");
+ window.setWidth(200, Unit.PIXELS);
+ window.setHeight(100, Unit.PIXELS);
+ window.setPositionX(100);
+ window.setPositionY(100);
+ addWindow(window);
+
+ window = new Window("two");
+ window.setWidth(200, Unit.PIXELS);
+ window.setHeight(100, Unit.PIXELS);
+ window.setPositionX(150);
+ window.setPositionY(150);
+ window.addStyleName("second-window");
+ addWindow(window);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Bring to front window on click it's header";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 13445;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java b/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java
new file mode 100644
index 0000000000..26d7a06531
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.window;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.By;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ *
+ * @author Vaadin Ltd
+ */
+public class MoveToTopTest extends MultiBrowserTest {
+
+ @Test
+ public void testBringToFrontViaHeader() throws IOException {
+ openTestURL();
+
+ WebElement firstWindow = driver.findElement(By
+ .className("first-window"));
+
+ WebElement secondWindow = driver.findElement(By
+ .className("second-window"));
+
+ secondWindow.click();
+
+ compareScreen("second-window-over-first");
+
+ WebElement headerFirst = firstWindow.findElement(By
+ .className("v-window-outerheader"));
+ headerFirst.click();
+
+ compareScreen("first-window-over-second");
+ }
+
+}