Package org.apache.tapestry5.test

Examples of org.apache.tapestry5.test.PageTester


    public void prefix_method() throws Exception
    {
        // REFACTOR this happens in a bunch of places
        String appPackage = "org.apache.tapestry5.integration.app2";
        String appName = "";
        tester = new PageTester(appPackage, appName, PageTester.DEFAULT_CONTEXT_PATH, LocaleAppModule.class);
        Document doc = tester.renderPage("TestPrefixMethod");

        // make sure you can use on methods that have injected fields
        assertEquals(doc.getElementById("value2").getChildMarkup(), "42");
        assertEquals(doc.getElementById("value3").getChildMarkup(), "1");
View Full Code Here


    @Test
    public void submit_aso()
    {
        String appPackage = "org.apache.tapestry5.integration.app2";
        String appName = "";
        tester = new PageTester(appPackage, appName);
        Document doc = tester.renderPage("TestPageForASO");
        assertTrue(doc.toString().contains("bar"));
    }
View Full Code Here

    @Test
    public void submit_context_asset()
    {
        String appPackage = "org.apache.tapestry5.integration.app2";
        String appName = "";
        tester = new PageTester(appPackage, appName, "src/test/app2");
        Document doc = tester.renderPage("TestPageForAsset");
        assertTrue(doc.toString().contains("test.css"));
    }
View Full Code Here

    public void before()
    {
        String appPackage = "org.apache.tapestry5.integration.app2";
        // LocaleAppModule.java has configured support for a certain locales.
        String appName = "LocaleApp";
        tester = new PageTester(appPackage, appName);
    }
View Full Code Here

    @Test
    public void click_link()
    {
        String appPackage = "org.apache.tapestry5.integration.app2";
        String appName = "";
        tester = new PageTester(appPackage, appName);
        Document doc = tester.renderPage("TestPageForActionLink");
        Element link = doc.getElementById("link1");
        doc = tester.clickLink(link);
        assertTrue(doc.toString().contains("You chose: 123"));
    }
View Full Code Here

    @Test
    public void display()
    {
        String appPackage = "org.apache.tapestry5.integration.app2";
        String appName = "";
        tester = new PageTester(appPackage, appName);
        Document doc = tester.renderPage("TestPageForHead");
        assertTrue(doc.toString().contains("OK"));
    }
View Full Code Here

    @Test(dataProvider = "dtd_page_provider")
    public void verify_correct_dtds(String pageName, String expectedDTD, String checkText)
    {
        String appPackage = "org.apache.tapestry5.integration.app2";
        String appName = "";
        PageTester tester = new PageTester(appPackage, appName);
        Document doc = tester.renderPage(pageName);
        String txt = doc.toString();
        // use startsWith to make sure the DTD is getting into the right spot.
        assertTrue(txt.startsWith(expectedDTD));
        // we should also make sure that the other DTD's don't appear anywhere else...
        checkOtherDTD(txt, expectedDTD);
View Full Code Here

    @Test
    public void render()
    {
        String appPackage = "org.apache.tapestry5.integration.app2";
        String appName = "";
        tester = new PageTester(appPackage, appName);
        Document doc = tester.renderPage("TestPageForLoop");
        assertTrue(doc.toString().contains("abcabcabc"));
        assertEquals(doc.getElementById("1").getChildMarkup(), "xyz");
    }
View Full Code Here

    @Test
    public void submit_form()
    {
        String appPackage = "org.apache.tapestry5.integration.app2";
        String appName = "";
        tester = new PageTester(appPackage, appName);
        Document doc = tester.renderPage("TestPageForForm");
        Element form = doc.getElementById("form1");
        Map<String, String> fieldValues = CollectionFactory.newMap();
        fieldValues.put("t1", "hello");
        doc = tester.submitForm(form, fieldValues);
View Full Code Here

        MarkupWriter writer = factory.newPartialMarkupWriter(contentType);

        generateResponseMarkup(writer, matchesHolder.get());

        return new TextStreamResponse(contentType.toString(), writer.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.test.PageTester

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.