Package org.xwiki.test.ui.po

Examples of org.xwiki.test.ui.po.ViewPage


    {
        getUtil().deletePage("Test", "BacklinkTargetTest");
        getUtil().deletePage("Test", "BacklinkSourceTest");

        // Create page listing backlinks leading to it.
        ViewPage vp = getUtil().createPage("Test", "BacklinkTargetTest", backlinkListCode, null, syntaxId);
        // No backlinks at this stage
        Assert.assertEquals("", vp.getContent());

        // Create page pointing to the page listing the backlinks.
        getUtil().createPage("Test", "BacklinkSourceTest", backlinkLink, null, syntaxId);

        vp = getUtil().gotoPage("Test", "BacklinkTargetTest");
        Assert.assertEquals("Test.BacklinkSourceTest", vp.getContent());
    }
View Full Code Here


                "section test in " + syntaxId, syntaxId);
        } else {
            throw new RuntimeException("Unhandled syntax [" + syntaxId + "]");
        }

        return new ViewPage();
    }
View Full Code Here

    @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
    })
    public void testSectionEditInEditorWhenSyntax10()
    {
        ViewPage vp = createTestPages("xwiki/1.0");

        // Edit the second section in the wysiwyg editor
        WYSIWYGEditPage wysiwygEditPage = vp.editSection(2);
        Assert.assertEquals("Section2\nContent2\nSection3\nContent3", wysiwygEditPage.getContent());

        // Edit the second section in the wiki editor
        WikiEditPage wikiEditPage = wysiwygEditPage.editWiki();
        Assert.assertEquals("1 Section2 Content2 1.1 Section3 Content3",
            wikiEditPage.getContent());
        wikiEditPage.clickCancel();

        // Edit the third section in the wiki editor
        Assert.assertEquals("1.1 Section3 Content3",
            vp.editSection(3).editWiki().getContent());
        wikiEditPage.clickCancel();

        // Edit the fourth section in the wiki editor
        Assert.assertEquals("1 Section4 Content4",
            vp.editSection(4).editWiki().getContent());
    }
View Full Code Here

        testSectionEditInWikiEditorWhenSyntax2x("xwiki/2.1");
    }

    private void testSectionEditInWikiEditorWhenSyntax2x(String syntaxId)
    {
        ViewPage vp = createTestPages(syntaxId);

        // Edit the second section in the wysiwyg editor
        WYSIWYGEditPage wysiwygEditPage = vp.editSection(2);
        wysiwygEditPage.waitUntilPageIsLoaded();
        Assert.assertEquals("Section2\nContent2\nSection3\nContent3\nSection4\nContent4\nSection5\nContent5\n"
            + "Section6\nContent6", wysiwygEditPage.getContent());

        // Edit the second section in the wiki editor
        WikiEditPage wikiEditPage = wysiwygEditPage.editWiki();
        Assert.assertEquals("= Section2 = Content2 == Section3 == Content3 "
            + "{{include document=\"Test.SectionEditingIncluded\"/}}", wikiEditPage.getContent());
        vp = wikiEditPage.clickCancel();

        // Edit the third section in the wiki editor
        wikiEditPage = vp.editSection(3).editWiki();
        Assert.assertEquals("== Section3 == Content3 {{include document=\"Test.SectionEditingIncluded\"/}}",
            wikiEditPage.getContent());
        vp = wikiEditPage.clickCancel();

        // Edit the fourth section in the wiki editor
        // Note: we prove that included documents don't generate editable sections by checking that the fourth section
        // is "Section7".
        wikiEditPage = vp.editSection(4).editWiki();
        Assert.assertEquals("= Section7 = Content7", wikiEditPage.getContent());
    }
View Full Code Here

    @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
    })
    public void testSectionSaveDoesNotOverwriteTheWholeContentWhenSyntax10()
    {
        ViewPage vp = createTestPages("xwiki/1.0");
        vp.editSection(3).editWiki().clickSaveAndView();
        WikiEditPage wep = vp.editWiki();
        Assert.assertEquals("1 Section1 Content1 1 Section2 Content2 1.1 Section3 Content3 1 Section4 Content4",
            wep.getContent());
    }
View Full Code Here

    @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
    })
    public void testSectionSaveDoesNotOverwriteTheWholeContentWhenSyntax20()
    {
        ViewPage vp = createTestPages("xwiki/2.0");
        vp.editSection(4).editWiki().clickSaveAndView();
        WikiEditPage wep = vp.editWiki();
        Assert.assertEquals("= Section1 = Content1 = Section2 = Content2 == Section3 == Content3 "
            + "{{include document=\"Test.SectionEditingIncluded\"/}} = Section7 = Content7", wep.getContent());
    }
View Full Code Here

    {
        WikiEditPage edit = WikiEditPage.gotoPage("Test", "LanguageTest");
        edit.setContent("{{velocity}}context = ($xcontext.language), doc = ($doc.language), "
            + "default = ($doc.defaultLanguage), tdoc = ($tdoc.language), "
            + "tdocdefault = ($tdoc.defaultLanguage){{/velocity}}");
        ViewPage vp = edit.clickSaveAndView();

        // Current language must be "en"
        Assert.assertEquals("Invalid content", vp.getContent(),
            "context = (en), doc = (), default = (en), tdoc = (), tdocdefault = (en)");

        // Change default language to "fr"
        AdministrationPage adminPage = AdministrationPage.gotoPage();
        LocalizationAdministrationSectionPage sectionPage = adminPage.clickLocalizationSection();
        sectionPage.setDefaultLanguage("fr");
        sectionPage.clickSave();

        // Now language must be "fr"
        vp = getUtil().gotoPage("Test", "LanguageTest");
        Assert.assertTrue("Page not in French!", isPageInFrench());
        Assert.assertEquals("Invalid content", vp.getContent(),
            "context = (fr), doc = (), default = (en), tdoc = (), tdocdefault = (en)");
    }
View Full Code Here

    {
        WebElement html = getDriver().findElement(By.tagName("html"));
        Assert.assertEquals(language, html.getAttribute("lang"));
        Assert.assertEquals(language, html.getAttribute("xml:lang"));

        ViewPage vp = new ViewPage();
        Assert.assertEquals("locale=" + language, vp.getMetaDataValue("gwt:property"));
        // For retro-compatibility only
        Assert.assertEquals(language, vp.getMetaDataValue("language"));

        String content = getDriver().getPageSource();
        Assert.assertTrue(content.contains("language=" + language));
    }
View Full Code Here

        // Verify the document space in the metadata
        Assert.assertEquals("\u0219", editPage.getMetaDataValue("space"));

        // Save the space to verify it can be saved with a non-ascii name
        ViewPage savedPage = editPage.clickSaveAndView();
        Assert.assertEquals("\u0219", savedPage.getMetaDataValue("space"));
    }
View Full Code Here

        // Verify the document name in the metadata
        Assert.assertEquals("\u0219", editPage.getMetaDataValue("page"));

        // Save the page to verify it can be saved with a non-ascii name
        ViewPage savedPage = editPage.clickSaveAndView();
        Assert.assertEquals("\u0219", savedPage.getMetaDataValue("page"));
    }
View Full Code Here

TOP

Related Classes of org.xwiki.test.ui.po.ViewPage

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.