Search in sources :

Example 1 with AnnotatableViewPage

use of org.xwiki.annotation.test.po.AnnotatableViewPage in project xwiki-platform by xwiki.

the class AnnotationsTest method addAndDeleteAnnotations.

@Test
@IgnoreBrowsers({ @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146"), @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See https://jira.xwiki.org/browse/XE-1177") })
public void addAndDeleteAnnotations() {
    getUtil().deletePage(getTestClassName(), getTestMethodName());
    AnnotatableViewPage annotatableViewPage = new AnnotatableViewPage(getUtil().createPage(getTestClassName(), getTestMethodName(), CONTENT, null));
    annotatableViewPage.addAnnotation(ANNOTATED_TEXT_1, ANNOTATION_TEXT_1);
    Assert.assertEquals(ANNOTATION_TEXT_1, annotatableViewPage.getAnnotationContentByText(ANNOTATED_TEXT_1));
    annotatableViewPage.addAnnotation(ANNOTATED_TEXT_2, ANNOTATION_TEXT_2);
    Assert.assertEquals(ANNOTATION_TEXT_2, annotatableViewPage.getAnnotationContentByText(ANNOTATED_TEXT_2));
    annotatableViewPage.addAnnotation(ANNOTATED_TEXT_3, ANNOTATION_TEXT_3);
    Assert.assertEquals(ANNOTATION_TEXT_3, annotatableViewPage.getAnnotationContentByText(ANNOTATED_TEXT_3));
    annotatableViewPage.addAnnotation(ANNOTATED_TEXT_4, ANNOTATION_TEXT_4);
    Assert.assertEquals(ANNOTATION_TEXT_4, annotatableViewPage.getAnnotationContentByText(ANNOTATED_TEXT_4));
    // It seems that there are some issues refreshing content while this tab is not open. This might be a bug in the
    // Annotations Application
    annotatableViewPage.showAnnotationsPane();
    annotatableViewPage.deleteAnnotationByText(ANNOTATED_TEXT_1);
    annotatableViewPage.deleteAnnotationByText(ANNOTATED_TEXT_2);
    annotatableViewPage.deleteAnnotationByText(ANNOTATED_TEXT_3);
    annotatableViewPage.deleteAnnotationByText(ANNOTATED_TEXT_4);
}
Also used : AnnotatableViewPage(org.xwiki.annotation.test.po.AnnotatableViewPage) IgnoreBrowsers(org.xwiki.test.ui.browser.IgnoreBrowsers) AbstractTest(org.xwiki.test.ui.AbstractTest) Test(org.junit.Test)

Example 2 with AnnotatableViewPage

use of org.xwiki.annotation.test.po.AnnotatableViewPage in project xwiki-platform by xwiki.

the class AnnotationsTest method annotationsShouldNotBeShownInXWiki10Syntax.

/**
 * This test creates a XWiki 1.0 syntax page, and tries to add annotations to it, and checks if the warning messages
 * are shown This test is against XAANNOTATIONS-17
 */
@Test
@IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See https://jira.xwiki.org/browse/XE-1177")
public void annotationsShouldNotBeShownInXWiki10Syntax() {
    getUtil().deletePage(getTestClassName(), getTestMethodName());
    // Note: Make sure Annotations and Comments are merged (this is not the default ATM!) by setting the
    // $showannotation velocity variable to false in the page content
    AnnotatableViewPage annotatableViewPage = new AnnotatableViewPage(getUtil().createPage(getTestClassName(), getTestMethodName(), "#set ($showannotations = false)\nSome content", "AnnotationsTest in XWiki 1.0 Syntax", "xwiki/1.0"));
    annotatableViewPage.showAnnotationsPane();
    // Annotations are disabled in 1.0 Pages. This element should no be here
    Assert.assertTrue(annotatableViewPage.checkIfAnnotationsAreDisabled());
    annotatableViewPage.simulateCTRL_M();
    annotatableViewPage.waitforAnnotationWarningNotification();
}
Also used : AnnotatableViewPage(org.xwiki.annotation.test.po.AnnotatableViewPage) AbstractTest(org.xwiki.test.ui.AbstractTest) Test(org.junit.Test) IgnoreBrowser(org.xwiki.test.ui.browser.IgnoreBrowser)

Aggregations

Test (org.junit.Test)2 AnnotatableViewPage (org.xwiki.annotation.test.po.AnnotatableViewPage)2 AbstractTest (org.xwiki.test.ui.AbstractTest)2 IgnoreBrowser (org.xwiki.test.ui.browser.IgnoreBrowser)1 IgnoreBrowsers (org.xwiki.test.ui.browser.IgnoreBrowsers)1