Browse Source

Converted TestUIWidgetset test to TB3 and fixed wrong text in assertion.

Change-Id: Ie1d5374280381f9ff81415ce9d9d82773718800c
tags/7.1.10
John Ahlroos 10 years ago
parent
commit
3595685b81

uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java → uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java View File

@@ -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

+ 41
- 0
uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java View File

@@ -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());
}
}

uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java → uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetset.java View File

@@ -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

+ 42
- 0
uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java View File

@@ -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."));

}
}

+ 0
- 36
uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.html View File

@@ -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>

Loading…
Cancel
Save