Details
-
Bug
-
Resolution: Fixed
-
Major
-
9.5-rc-1
-
None
-
Unknown
-
N/A
-
N/A
-
Description
Code to add to the existing functional test:
@Test
public void testCompositeNotifications() throws Exception
{
NotificationsUserProfilePage p;
NotificationsTrayPage tray;
// Now we enable "create", "update" and "comment" for user 2
getUtil().login(SECOND_USER_NAME, SECOND_USER_PASSWORD);
p = NotificationsUserProfilePage.gotoPage(SECOND_USER_NAME);
p.setPageCreated(true);
p.setPageUpdated(true);
p.setPageCommented(true);
// Create a page, edit it twice, and finally add a comment
getUtil().login(FIRST_USER_NAME, FIRST_USER_PASSWORD);
getUtil().createPage(getTestClassName(), "Linux", "Simple content", "Simple title");
ViewPage page = getUtil().gotoPage(getTestClassName(), "Linux");
page.edit();
WikiEditPage edit = new WikiEditPage();
edit.setContent("Linux is a part of GNU/Linux");
edit.clickSaveAndContinue(true);
edit.setContent("Linux is a part of GNU/Linux - it's the kernel");
edit.clickSaveAndView(true);
page = getUtil().gotoPage(getTestClassName(), "Linux");
CommentsTab commentsTab = page.openCommentsDocExtraPane();
commentsTab.postComment("Linux is a great OS", true);
// Check that events have been grouped together (see: https://jira.xwiki.org/browse/XWIKI-14114)
getUtil().login(SECOND_USER_NAME, SECOND_USER_PASSWORD);
getUtil().gotoPage(getTestClassName(), "WebHome");
tray = new NotificationsTrayPage();
assertEquals(2, tray.getNotificationsCount());
assertEquals("The document Simple title has been commented by user1.",
tray.getNotificationContent(0));
assertEquals("[create]", tray.getNotificationType(1));
tray.clearAllNotifications();
}
Hint: on the current unit tests, events come in chronological order, meanwhile in reality it's the opposite.
Attachments
Issue Links
- relates to
-
XWIKI-14114 Do not show similar notifications several times
-
- Closed
-