Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed bad links due to copy-paste from cwiki-test

Integration

...

testing involves the testing of larger segments of your Tapestry module or web application, typically including the user interface.

Div
stylefloat:right
titleRelated Articles
classaui-label
Content by Label
showLabelsfalse
showSpacefalse
titleRelated Articles
cqllabel = "testing" and space = currentSpace()
Wiki Markup
{float:right|background=#eee} {contentbylabel:title=Related Articles|showLabels=false|showSpace=false|space=@self|labels=testing} {float}

The Tapestry Test Utilities is a small library to make it easier to build integration test suites around Selenium version 2.14.0.

The strategy is to start, in-process, a Selenimum Selenium Server (which, in turn, starts and manages a web browser), a Jetty instance (for the web browser to talk to), and a Selenium client (which talks to the server).

...

Note

Before Tapestry 5.2, your class should extend AbstractIntegrationTestSuite

Here's an example from one of the Tapestry modules:

Code Block
languagejava
titleYour Integration Test Class : SinglePersistenceUnitIntegrationTest.javajava

package org.apache.tapestry5.jpa.integration.app2;

import org.apache.tapestry5.test.SeleniumTestCase;
import org.testng.annotations.Test;

public class SinglePersistenceUnitIntegrationTest extends SeleniumTestCase
{

    @Test
    public void persist_entities()
    {
        open("/persistitem");
        assertEquals(getText("//span[@id='name']").length(), 0);

        clickAndWait("link=create item");
        assertText("//span[@id='name']", "name");
    }
}

...

Here's an example :

Code Block
languagexml
titletestng.xmlxml

<suite name="Selenium Tests Suite" annotations="1.5">
  <test name="Integration Tests" enabled="true">
    <parameter name="tapestry.browser-start-command" value="*googlechrome" />
    <parameter name="tapestry.port" value="9091" />

    <classes>
      <class name="com.example.newapp.SeleniumTest"></class>
    </classes>
  </test>
</suite>

...