You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2009/12/15 18:47:22 UTC

svn commit: r890910 - in /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration: ./ core/

Author: hlship
Date: Tue Dec 15 17:47:21 2009
New Revision: 890910

URL: http://svn.apache.org/viewvc?rev=890910&view=rev
Log:
More wholesale reorganizing of IntegrationTests into several seperate test cases

Added:
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/BeanEditorTests.java   (with props)
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java   (with props)
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java   (with props)
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/PaletteTests.java   (with props)
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTest.java   (with props)
Removed:
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/CoreBehaviorsTest.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java?rev=890910&r1=890909&r2=890910&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java Tue Dec 15 17:47:21 2009
@@ -139,4 +139,27 @@
         }
     }
 
+    protected final void waitForElementToAppear(String elementId)
+    {
+
+        String condition = String.format("window.$(\"%s\")", elementId);
+
+        waitForCondition(condition, PAGE_LOAD_TIMEOUT);
+    }
+
+    protected final void waitForElementToDisappear(String elementId)
+    {
+        String condition = String.format("window.$(\"%s\").hide()", elementId);
+
+        waitForCondition(condition, PAGE_LOAD_TIMEOUT);
+    }
+
+    protected final void assertBubbleMessage(String fieldId, String expected)
+    {
+        String popupId = fieldId + ":errorpopup";
+
+        waitForElementToAppear(popupId);
+
+        assertText(String.format("//div[@id='%s']/span", popupId), expected);
+    }
 }

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/BeanEditorTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/BeanEditorTests.java?rev=890910&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/BeanEditorTests.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/BeanEditorTests.java Tue Dec 15 17:47:21 2009
@@ -0,0 +1,100 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// 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 org.apache.tapestry5.integration.core;
+
+import org.apache.tapestry5.corelib.components.BeanEditForm;
+import org.apache.tapestry5.corelib.components.BeanEditor;
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.testng.annotations.Test;
+
+/**
+ * Tests for the {@link BeanEditor} component, often embedded inside
+ * a {@link BeanEditForm} component.
+ */
+public class BeanEditorTests extends TapestryCoreTestCase
+{
+    /**
+     * Tests the bean editor. Along the way, tests a bunch about validation,
+     * loops, blocks, and application state
+     * objects.
+     */
+    @Test
+    public void bean_editor()
+    {
+        clickThru("BeanEditor Demo", "Clear Data");
+
+        clickAndWait(SUBMIT);
+
+        // Part of the override for the firstName property
+
+        assertAttribute("//input[@id='firstName']/@size", "40");
+
+        // Check that the @Width annotation works
+
+        assertAttribute("//input[@id='birthYear']/@size", "4");
+
+        // Check override of the submit label
+
+        assertAttribute("//input[@type='submit']/@value", "Register");
+
+        type("firstName", "a");
+        type("lastName", "b");
+        type("birthYear", "");
+        select("sex", "label=Martian");
+        click("citizen");
+        type("password", "abracadabra");
+        type("notes", "line1\nline2\nline3");
+
+        clickAndWait(SUBMIT);
+
+        assertTextPresent("You must provide at least 3 characters for First Name.",
+                "You must provide at least 5 characters for Last Name.",
+                "You must provide a value for Year of Birth.");
+
+        type("firstName", "Howard");
+        type("lastName", "Lewis Ship");
+        type("birthYear", "1966");
+        type("password", "supersecret");
+
+        clickAndWait(SUBMIT);
+
+        // The XPath support is too weak for
+        // //div[@class='t-beandisplay-value'][%d], so we
+        // just look for the text itself.
+
+        assertTextPresent("Howard", "Lewis Ship", "1966", "Martian", "U.S. Citizen", "***********",
+                "line1", "line2", "line3");
+    }
+
+    @Test
+    public void bean_editor_property_reorder_remove()
+    {
+        clickThru("BeanEdit Remove/Reorder", "Clear Data");
+
+        // Looks like a bug in Selenium; we can see //label[1] but not
+        // //label[2].
+        // assertTextSeries("//label[%d]", 1, "Last Name", "First Name", "Sex",
+        // "U.S. Citizen");
+
+        type("firstName", "Howard");
+        type("lastName", "Lewis Ship");
+        type("password", "supersecret");
+        check("citizen");
+
+        clickAndWait("//input[@type=\'submit\']");
+
+        assertTextPresent("Howard", "Lewis Ship", "0", "100% He-Man", "U.S. Citizen");
+    }
+}

Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/BeanEditorTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/CoreBehaviorsTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/CoreBehaviorsTest.java?rev=890910&r1=890909&r2=890910&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/CoreBehaviorsTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/CoreBehaviorsTest.java Tue Dec 15 17:47:21 2009
@@ -23,6 +23,45 @@
 {
 
     @Test
+    public void access_to_page_name()
+    {
+        openBaseURL();
+
+        assertText("activePageName", "Index");
+
+        clickAndWait("link=Grid Demo");
+
+        assertText("activePageName", "GridDemo");
+    }
+
+    /**
+     * also verifies the use of meta data to set the default strategy.
+     */
+    @Test
+    public void flash_persistence()
+    {
+        clickThru("FlashDemo");
+
+        assertTextPresent("[]");
+
+        clickAndWait("link=show the message");
+
+        assertTextPresent("[You clicked the link!]");
+
+        clickAndWait("link=refresh the page");
+
+        assertTextPresent("[]");
+    }
+
+    @Test
+    public void component_parameter_default_from_method() throws Exception
+    {
+        clickThru("ParameterDefault");
+
+        assertTextPresent("Echo component default: [ParameterDefault:echo]");
+    }
+
+    @Test
     public void embedded_components()
     {
         clickThru("Countdown Page");
@@ -1167,4 +1206,31 @@
                 "An unexpected application exception has occurred",
                 "Failure creating embedded component 'componentwithnotype' of org.apache.tapestry5.integration.app1.pages.MissingComponentClassException: You must specify the type via t:type, the element, or @Component");
     }
+
+    @Test
+    public void session_attribute()
+    {
+        clickThru("SessionAttribute Demo");
+
+        assertTextPresent("Foo");
+        assertTextPresent("Bar");
+
+        clickAndWait("link=Read SessionAttribute");
+
+        assertTextPresent("read Foo");
+        assertTextPresent("read Bar");
+    }
+
+    /** TAP5-815 */
+    @Test
+    public void testAssetProtection()
+    {
+        clickThru("Asset Protection Demo", "Unavailable File");
+
+        assertTextPresent("404");
+
+        clickThru("Asset Protection Demo", "Available File");
+
+        assertTextPresent("This file should be available to clients.");
+    }
 }

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java?rev=890910&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java Tue Dec 15 17:47:21 2009
@@ -0,0 +1,52 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// 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 org.apache.tapestry5.integration.core;
+
+import org.apache.tapestry5.corelib.components.Form;
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.testng.annotations.Test;
+
+/**
+ * Tests for the {@link Form} component as well as many form control components.
+ */
+public class FormTests extends TapestryCoreTestCase
+{
+
+    @Test
+    public void form_encoding_type()
+    {
+        clickThru("Form Encoding Type");
+
+        assertAttribute("//form/@enctype", "x-override");
+    }
+
+    @Test
+    public void page_context_in_form()
+    {
+        clickThru("Page Context in Form");
+
+        assertTextSeries("//li[%d]", 1, "betty", "wilma", "context with spaces",
+                "context/with/slashes");
+        assertFieldValue("t:ac",
+                "betty/wilma/context$0020with$0020spaces/context$002fwith$002fslashes");
+
+        clickAndWait(SUBMIT);
+
+        assertTextSeries("//li[%d]", 1, "betty", "wilma", "context with spaces",
+                "context/with/slashes");
+        assertFieldValue("t:ac",
+                "betty/wilma/context$0020with$0020spaces/context$002fwith$002fslashes");
+    }
+}

Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/FormTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java?rev=890910&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java Tue Dec 15 17:47:21 2009
@@ -0,0 +1,155 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// 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 org.apache.tapestry5.integration.core;
+
+import org.apache.tapestry5.corelib.components.Grid;
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.testng.annotations.Test;
+
+/**
+ * Tests for the {@link Grid} component.
+ */
+public class GridTests extends TapestryCoreTestCase
+{
+    /**
+     * Basic Grid rendering, with a column render override. Also tests sorting.
+     */
+    @Test
+    public void basic_grid()
+    {
+        clickThru("Grid Demo");
+
+        // "Sort Rating" via the header cell override (TAPESTRY-2081)
+
+        assertTextSeries("//th[%d]", 1, "Title", "Album", "Artist", "Genre", "Play Count",
+                "Sort Rating");
+
+        // Strange: I thought tr[1] was the header row ???
+
+        assertTextSeries("//tr[1]/td[%d]", 1, "Bug Juice", "Late Lounge (2 of 2)", "45 Dip",
+                "Electronica", "4", "-");
+
+        // Here were checking that the page splits are correct
+
+        clickAndWait("link=3");
+
+        // Last on page 3:
+        assertText("//tr[25]/td[1]", "Blood Red River");
+
+        clickAndWait("link=4");
+        assertText("//tr[1]/td[1]", "Devil Song");
+
+        clickAndWait("link=7");
+        clickAndWait("link=10");
+
+        // Here's one with a customized rating cell
+
+        assertTextSeries("//tr[25]/td[%d]", 1, "Smoked",
+                "London (Original Motion Picture Soundtrack)", "The Crystal Method", "Soundtrack",
+                "30", "****");
+
+        clickAndWait("link=69");
+
+        assertText("//tr[22]/td[1]", "radioioAmbient");
+
+        // Sort ascending (and we're on the last page, with the highest
+        // ratings).
+
+        clickAndWait("link=Sort Rating");
+
+        assertTextSeries("//tr[22]/td[%d]", 1, "Mona Lisa Overdrive", "Labyrinth", "Juno Reactor",
+                "Dance", "31", "*****");
+
+        // Toggle to sort descending
+
+        clickAndWait("link=Sort Rating");
+
+        assertTextSeries("//tr[1]/td[%d]", 1, "Hey Blondie", "Out from Out Where");
+
+        clickAndWait("link=Title");
+
+        // The lack of a leading slash indicates that the path was optimized,
+        // see TAPESTRY-1502
+
+        assertAttribute("//img[@class='t-sort-icon']/@src",
+                "/assets/tapestry/UNKNOWN/corelib/components/sort-asc.png");
+        assertAttribute("//img[@class='t-sort-icon']/@alt", "[Asc]");
+
+        clickAndWait("link=1");
+
+        assertText("//tr[1]/td[1]", "(untitled hidden track)");
+
+        clickAndWait("link=Title");
+
+        assertAttribute("//img[@class='t-sort-icon']/@src",
+                "/assets/tapestry/UNKNOWN/corelib/components/sort-desc.png");
+        assertAttribute("//img[@class='t-sort-icon']/@alt", "[Desc]");
+
+        clickAndWait("link=reset the Grid");
+
+        // Back to where we started.
+
+        assertTextSeries("//tr[1]/td[%d]", 1, "Bug Juice", "Late Lounge (2 of 2)", "45 Dip",
+                "Electronica", "4", "-");
+    }
+
+    @Test
+    public void grid_remove_reorder()
+    {
+        clickThru("Grid Remove/Reorder Demo");
+
+        assertTextSeries("//th[%d]", 1, "Rating", "Title", "Album", "Artist", "Genre");
+    }
+
+    @Test
+    public void grid_set() throws Exception
+    {
+        clickThru("Grid Set Demo");
+
+        assertFalse(isTextPresent("Exception"));
+
+        // Also check for TAPESTRY-2228
+
+        assertAttribute("//table/@informal", "supported");
+    }
+
+    @Test
+    public void grid_from_explicit_interface_model()
+    {
+        clickThru("SimpleTrack Grid Demo");
+
+        assertTextSeries("//th[%d]", 1, "Title", "Album", "Rating");
+
+        assertTextSeries("//tr[1]/td[%d]", 1, "Bug Juice", "Late Lounge (2 of 2)", "-");
+    }
+
+    @Test
+    public void grid_enum_display()
+    {
+        clickThru("Grid Enum Demo", "reset");
+
+        assertTextSeries("//tr[1]/td[%d]", 1, "End World Hunger", "Medium");
+        assertTextSeries("//tr[2]/td[%d]", 1, "Develop Faster-Than-Light Travel", "Ultra Important");
+        assertTextSeries("//tr[3]/td[%d]", 1, "Cure Common Cold", "Low");
+    }
+
+    @Test
+    public void null_grid() throws Exception
+    {
+        clickThru("Null Grid");
+
+        assertTextPresent("There is no data to display.");
+    }
+}

Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/GridTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/PaletteTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/PaletteTests.java?rev=890910&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/PaletteTests.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/PaletteTests.java Tue Dec 15 17:47:21 2009
@@ -0,0 +1,112 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// 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 org.apache.tapestry5.integration.core;
+
+import org.apache.tapestry5.corelib.components.Palette;
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.testng.annotations.Test;
+
+/**
+ * Tests for the {@link Palette} component.
+ */
+public class PaletteTests extends TapestryCoreTestCase
+{
+    @Test
+    public void palette_component()
+    {
+        clickThru("Palette Demo", "reset");
+
+        assertText("//div[@class='t-palette-available']/div[@class='t-palette-title']",
+                "Languages Offered");
+        assertText("//div[@class='t-palette-selected']/div[@class='t-palette-title']",
+                "Selected Languages");
+
+        addSelection("languages-avail", "label=Haskell");
+        addSelection("languages-avail", "label=Javascript");
+        click("languages-select");
+
+        clickAndWait(SUBMIT);
+        assertTextPresent("Selected Languages: [HASKELL, JAVASCRIPT]");
+
+        addSelection("languages", "label=Javascript");
+        click("languages-deselect");
+
+        addSelection("languages-avail", "label=Perl");
+        removeSelection("languages-avail", "label=Javascript");
+        addSelection("languages-avail", "label=Erlang");
+        addSelection("languages-avail", "label=Java");
+        addSelection("languages-avail", "label=Lisp");
+        addSelection("languages-avail", "label=Ml");
+        addSelection("languages-avail", "label=Python");
+        addSelection("languages-avail", "label=Ruby");
+
+        click("languages-select");
+
+        clickAndWait(SUBMIT);
+
+        assertTextPresent("[ERLANG, HASKELL, JAVA, LISP, ML, PERL, PYTHON, RUBY]");
+
+        check("reorder");
+        clickAndWait(SUBMIT);
+
+        assertText("//div[@class='t-palette-selected']/div[@class='t-palette-title']",
+                "Selected / Ranked Languages");
+
+        addSelection("languages", "label=Ruby");
+
+        for (int i = 0; i < 6; i++)
+            click("languages-up");
+
+        removeSelection("languages", "label=Ruby");
+        addSelection("languages", "label=Perl");
+
+        click("languages-down");
+
+        clickAndWait(SUBMIT);
+
+        assertTextPresent("[ERLANG, RUBY, HASKELL, JAVA, LISP, ML, PYTHON, PERL]");
+    }
+
+    /**
+     * TAP5-298
+     */
+    @Test
+    public void palette_component_disabled_options()
+    {
+        clickThru("Palette Demo", "reset");
+
+        /*
+         * force of the options to be disabled rather than creating the model
+         * with it disabled in the page.
+         * it is possible to get into this state by creating a model with
+         * disabled options.
+         */
+        getEval("this.browserbot.findElement('//select[@id=\"languages-avail\"]/option[1]').disabled = 'disabled';");
+
+        // causes an error in the js console but does not throw an exception
+        // here. optimally, this would make the test case fail.
+        doubleClick("//select[@id=\"languages-avail\"]/option[1]");
+    }
+
+    @Test
+    public void palette_component_client_validation()
+    {
+        clickThru("Palette Demo", "reset");
+
+        click(SUBMIT);
+
+        assertBubbleMessage("languages", "You must provide a value for Languages.");
+    }
+}

Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/PaletteTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTest.java?rev=890910&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTest.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTest.java Tue Dec 15 17:47:21 2009
@@ -0,0 +1,70 @@
+// Copyright 2009 The Apache Software Foundation
+//
+// 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 org.apache.tapestry5.integration.core;
+
+import org.apache.tapestry5.corelib.components.Zone;
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.testng.annotations.Test;
+
+/**
+ * Tests related to the {@link Zone} component.
+ */
+public class ZoneTest extends TapestryCoreTestCase
+{
+    /**
+     * TAP5-138
+     */
+    @Test
+    public void select_zone()
+    {
+        clickThru("Select Zone Demo");
+
+        type("carMaker", "BMW");
+
+        waitForElementToAppear("carModelContainer");
+
+        click(SUBMIT);
+
+        String condition = String.format("window.$$(\"%s\")", "t-error-popup");
+
+        waitForCondition(condition, PAGE_LOAD_TIMEOUT);
+
+        assertText(String.format("//div[@class='%s']/span", "t-error-popup"),
+                "You must provide a value for Car Model.");
+
+        type("carModel", "7 Series");
+
+        clickAndWait(SUBMIT);
+
+        assertTextPresent("Car Maker: BMW");
+
+        assertTextPresent("Car Model: 7 Series");
+
+        waitForElementToDisappear("carModelContainer");
+
+        type("carMaker", "MERCEDES");
+
+        waitForElementToAppear("carModelContainer");
+
+        type("carModel", "E-Class");
+
+        clickAndWait(SUBMIT);
+
+        assertTextPresent("Car Maker: MERCEDES");
+
+        assertTextPresent("Car Model: E-Class");
+    }
+
+}

Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/core/ZoneTest.java
------------------------------------------------------------------------------
    svn:eol-style = native