Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-14454

Some similar notifications are not grouped together

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 9.5, 9.6-rc-1
    • 9.5-rc-1
    • Notifications
    • 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

          Activity

            People

              gdelhumeau Guillaume Delhumeau
              gdelhumeau Guillaume Delhumeau
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: