diff options
author | John Ahlroos <john@vaadin.com> | 2014-01-09 10:34:26 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-01-13 09:27:33 +0000 |
commit | 3595685b81779e7c10fc3f2d9fe9b1e35d4f39d2 (patch) | |
tree | bdcad686d7ad298a1c25c0876ef254bbe93ae76b /uitest/src/com/vaadin/tests/components/ui | |
parent | c5515074b54f37c21d021ab910d2749a9a1bc24d (diff) | |
download | vaadin-framework-3595685b81779e7c10fc3f2d9fe9b1e35d4f39d2.tar.gz vaadin-framework-3595685b81779e7c10fc3f2d9fe9b1e35d4f39d2.zip |
Converted TestUIWidgetset test to TB3 and fixed wrong text in assertion.
Change-Id: Ie1d5374280381f9ff81415ce9d9d82773718800c
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/ui')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java (renamed from uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java) | 6 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java | 41 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetset.java (renamed from uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java) | 6 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java | 42 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.html | 36 |
5 files changed, 91 insertions, 40 deletions
diff --git a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java index e837321b56..f674567a2d 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java @@ -6,11 +6,13 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; @Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class TestUIWidgetset extends AbstractTestUI { +public class ComponentIncludedInCustomWidgetset extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - addComponent(new MissingFromDefaultWidgetsetComponent()); + MissingFromDefaultWidgetsetComponent component = new MissingFromDefaultWidgetsetComponent(); + component.setId("missing-component"); + addComponent(component); } @Override diff --git a/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java new file mode 100644 index 0000000000..f27ef5d789 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java @@ -0,0 +1,41 @@ +/* + * 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.ui; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests if a component is included in a custom widgetset + * (com.vaadin.tests.widgetset.TestingWidgetSet) + * + * @author Vaadin Ltd + */ +public class ComponentIncludedInCustomWidgetsetTest extends MultiBrowserTest { + + @Test + public void testComponentInTestingWidgetsetNotInDefaultWidgetset() { + openTestURL(); + WebElement component = vaadinElementById("missing-component"); + assertEquals( + "This component is available in TestingWidgetset, but not in DefaultWidgetset", + component.getText()); + } +} diff --git a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetset.java index a68cd91a5e..554a461c37 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetset.java @@ -4,11 +4,13 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; -public class TestUIWidgetset2 extends AbstractTestUI { +public class ComponentMissingFromDefaultWidgetset extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - addComponent(new MissingFromDefaultWidgetsetComponent()); + MissingFromDefaultWidgetsetComponent component = new MissingFromDefaultWidgetsetComponent(); + component.setId("missing-component"); + addComponent(component); } @Override diff --git a/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java new file mode 100644 index 0000000000..ec8add75e0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java @@ -0,0 +1,42 @@ +/* + * 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.ui; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for testing if a component is missing from a widgetset. + * + * @author Vaadin Ltd + */ +public class ComponentMissingFromDefaultWidgetsetTest extends MultiBrowserTest { + + @Test + public void testComponentInTestingWidgetset() { + openTestURL(); + WebElement component = vaadinElementById("missing-component"); + assertTrue(component + .getText() + .startsWith( + "Widgetset 'com.vaadin.DefaultWidgetSet' does not contain implementation for com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent.")); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.html b/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.html deleted file mode 100644 index 4c10dc4275..0000000000 --- a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.html +++ /dev/null @@ -1,36 +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>Ticket4607</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">Ticket4607</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.ui.TestUIWidgetset?restartApplication</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsuiTestUIWidgetset::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td> - <td>This component is available in TestingWidgetset, but not in DefaultWidgetset</td> -</tr> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.ui.TestUIWidgetset2?restartApplication</td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsuiTestUIWidgetset2::/VVerticalLayout[0]/VVerticalLayout[0]/VUnknownComponent[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> - <td>Widgetset does not contain implementation for com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent. Check its component connector's @Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.</td> -</tr> -</tbody></table> -</body> -</html> |