From 8ecf9ecc332f396e5356b2d98dcfbd9b93cac3fd Mon Sep 17 00:00:00 2001 From: Sauli Tähkäpää Date: Thu, 2 Oct 2014 22:19:05 +0300 Subject: Implement HasEnabled in VPopupView. (#14797) Change-Id: I7384fb6312a921330d8b57193e53c235213dcf00 --- .../components/popupview/DisabledPopupView.java | 23 ++++++++++++++++++++++ .../popupview/DisabledPopupViewTest.java | 20 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/popupview/DisabledPopupView.java create mode 100644 uitest/src/com/vaadin/tests/components/popupview/DisabledPopupViewTest.java (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/components/popupview/DisabledPopupView.java b/uitest/src/com/vaadin/tests/components/popupview/DisabledPopupView.java new file mode 100644 index 0000000000..ecce1781a5 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/DisabledPopupView.java @@ -0,0 +1,23 @@ +package com.vaadin.tests.components.popupview; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.PopupView; + +public class DisabledPopupView extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + PopupView popupView = new PopupView("Disabled Popup", new Button("Hi!")); + + popupView.setEnabled(false); + + addComponent(popupView); + } + + @Override + protected Integer getTicketNumber() { + return 14797; + } +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/DisabledPopupViewTest.java b/uitest/src/com/vaadin/tests/components/popupview/DisabledPopupViewTest.java new file mode 100644 index 0000000000..be9345d588 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/DisabledPopupViewTest.java @@ -0,0 +1,20 @@ +package com.vaadin.tests.components.popupview; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.PopupViewElement; +import com.vaadin.tests.tb3.MultiBrowserTest; +import org.junit.Test; + +import static org.junit.Assert.assertFalse; + +public class DisabledPopupViewTest extends MultiBrowserTest { + + @Test + public void disabledPopupDoesNotOpen() { + openTestURL(); + + $(PopupViewElement.class).first().click(); + + assertFalse($(ButtonElement.class).exists()); + } +} \ No newline at end of file -- cgit v1.2.3