Beispiel #1
0
 def _sprint_backlog(self, sprint_name=None):
     sprint_backlog_config = BacklogConfiguration(self.env,
                                                  name='Sprint',
                                                  type=BacklogType.SPRINT)
     if not sprint_backlog_config.exists:
         sprint_backlog_config.save()
     return Backlog(self.env, name='Sprint', scope=sprint_name)
Beispiel #2
0
    def testBacklogPositionPersistence(self):
        """Tests the Backlog position persistence of items, after being saved and reloaded"""
        backlog = BacklogConfiguration(self.env, name="Global Backlog")
        backlog.ticket_types = [Type.REQUIREMENT]
        backlog.save()

        # Create some tickets and add them to the Backlog
        b = self.bmm.get(name="Global Backlog")
        b.add(
            self.teh.create_ticket(Type.REQUIREMENT,
                                   props={Key.BUSINESS_VALUE: '3000'}))
        b.add(
            self.teh.create_ticket(Type.REQUIREMENT,
                                   props={Key.BUSINESS_VALUE: '1200'}))
        b.add(
            self.teh.create_ticket(Type.REQUIREMENT,
                                   props={Key.BUSINESS_VALUE: '2000'}))
        # Now reload the backlog, move the item in pos 2 to 1, save and reload
        b1 = self.bmm.get(name="Global Backlog")
        self.assert_equals(3, len(b1))
        t1200 = b1[1]
        b1.insert(0, t1200)
        # reload the backlgo and verify that the item is in position 0
        b2 = self.bmm.get(name='Global Backlog')
        self.assert_equals(t1200.ticket.id, b2[0].ticket.id)
        self.assert_equals(0, b2[0].pos)
Beispiel #3
0
    def testScopedBacklogWithClosedTicket(self):
        """Tests if a scoped backlog loads also closed tickets"""

        sprint1 = self.teh.create_sprint("Sprint Scoped")
        sprint1.save()
        # Creates the Backlog bound to a scope (Sprint)
        backlog = BacklogConfiguration(self.env,
                                       name="Scoped-Backlog",
                                       type=BacklogType.SPRINT)
        backlog.ticket_types = [Type.USER_STORY, Type.TASK]
        backlog.save()
        # Create 1 ticket
        task = self.teh.create_ticket(Type.TASK,
                                      props={
                                          Key.REMAINING_TIME: '12',
                                          Key.SPRINT: sprint1.name
                                      })
        # Force reload
        backlog = self.bmm.get(name="Scoped-Backlog", scope=sprint1.name)
        self.assert_true(task in backlog)
        self.assert_equals(len(backlog), 1)
        task[Key.STATUS] = Status.CLOSED
        task.save_changes('tester', 'Changed Status')
        # Now should still be there even if closed, because the backlog is scoped
        self.assert_true(task in backlog)
        self.assert_equals(len(backlog), 1)
Beispiel #4
0
 def testProductBacklogItems(self):
     """Tests the creation of a Global Backlog and add some Items to it"""
     backlog = BacklogConfiguration(self.env, name="Global Backlog")
     backlog.ticket_types = [Type.REQUIREMENT]
     backlog.save()
     # Create some tickets and add them to the Backlog
     b = self.bmm.get(name="Global Backlog")
     b.add(
         self.teh.create_ticket(Type.REQUIREMENT,
                                props={Key.BUSINESS_VALUE: '3000'}))
     b.add(
         self.teh.create_ticket(Type.REQUIREMENT,
                                props={Key.BUSINESS_VALUE: '1200'}))
     b.add(
         self.teh.create_ticket(Type.REQUIREMENT,
                                props={Key.BUSINESS_VALUE: '2000'}))
     b.add(
         self.teh.create_ticket(Type.REQUIREMENT,
                                props={Key.BUSINESS_VALUE: '800'}))
     b.add(
         self.teh.create_ticket(Type.REQUIREMENT,
                                props={Key.BUSINESS_VALUE: '3000'}))
     # Now test that the ticket are sorted by the defined Key
     ref = 3000
     self.assert_equals(5, len(b), 'Wrong number of tickets in this (%s) Backlog!' % \
                                   len(b))
     # Now load it again, and verify that the order is still ok
     b1 = self.bmm.get(name="Global Backlog")
     self.assert_true(
         len(b1) > 0, 'There is no ticket associated to this Backlog!')
Beispiel #5
0
 def testMoveItemInBacklog(self):
     """Test the movement of an item into the backlog, change the position"""
     backlog = BacklogConfiguration(self.env, name="Global Backlog")
     backlog.ticket_types=[Type.REQUIREMENT]
     backlog.save()
     # Create some tickets and add them to the Backlog
     b = self.bmm.get(name="Global Backlog")
     b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '3000'}))
     b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '1200'}))
     b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '2000'}))
     b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '800'}))
     b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '3000'}))
     b1 = self.bmm.get(name="Global Backlog")
     t2000 = None
     for b in b1:
         #print "b: %s" % type(b)
         if int(b.ticket[Key.BUSINESS_VALUE]) == 2000:
             t2000 = b
             break
     self.assert_not_none(t2000)
     new_pos = b1.insert(0, t2000)
     self.assert_equals(new_pos, 0)
     # Now try to move a normal ticket and not a BacklogItem
     t2000 = self.teh.load_ticket(t_id=t2000.ticket.id)
     b1.insert(1, t2000)
     self.assert_equals(t2000, b1[1].ticket)
Beispiel #6
0
    def test_referenced_requirements_are_displayed_in_the_sprint_backlog(self):
        """Test that referenced requirements are shown in the sprint backlog 
        even if they are planned for a milestone."""
        milestone = self.teh.create_milestone('1.0')
        sprint = self.teh.create_sprint("First Sprint")
        backlog_name = 'My Backlog'
        my_backlog = BacklogConfiguration(self.env,
                                          name=backlog_name,
                                          type=BacklogType.SPRINT)
        my_backlog.ticket_types = [
            Type.USER_STORY, Type.TASK, Type.REQUIREMENT
        ]
        my_backlog.save()
        req = self.teh.create_ticket(Type.REQUIREMENT, {
            Key.SUMMARY: 'Requirement',
            Key.MILESTONE: milestone.name
        })
        story = self.teh.create_ticket(Type.USER_STORY, {
            Key.SUMMARY: 'Story',
            Key.SPRINT: sprint.name
        })
        req.link_to(story)

        backlog = self.bmm.get(name=backlog_name, scope=sprint.name)
        self.assert_length(2, backlog)
Beispiel #7
0
 def testLoadingReleaseBacklogWithQuotesInSprintNameDoesNotBlowUp(self):
     # This is a regression test for badly quoted SQL
     release_backlog = 'Release Backlog'
     self.teh.create_milestone('1.0')
     rb = BacklogConfiguration(self.env, release_backlog, type=BacklogType.MILESTONE)
     rb.save()
     Backlog(self.env, release_backlog, scope='1.0')
Beispiel #8
0
 def testBacklogWithHierarchicalItems(self):
     """Tests the Backlog with multiple hierarchical types"""
     # Create 2 requirements and link 2 stories each
     r1 = self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '2000'})
     self.assert_true(r1.link_to(self.teh.create_ticket(Type.USER_STORY, 
                                                       props={Key.STORY_PRIORITY: 'Linear'})))
     self.assert_true(r1.link_to(self.teh.create_ticket(Type.USER_STORY, 
                                                       props={Key.STORY_PRIORITY: 'Mandatory'})))
     r2 = self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '3000'})
     self.assert_true(r2.link_to(self.teh.create_ticket(Type.USER_STORY, 
                                                       props={Key.STORY_PRIORITY: 'Exciter'})))
     self.assert_true(r2.link_to(self.teh.create_ticket(Type.USER_STORY, 
                                                       props={Key.STORY_PRIORITY: 'Linear'})))
     # Now create a Backlog with both type and lets' verify that the tickets are there
     backlog = BacklogConfiguration(self.env, name="Global Backlog")
     backlog.ticket_types=[Type.REQUIREMENT, Type.USER_STORY]
     backlog.save()
     b = self.bmm.get(name="Global Backlog")
     self.assert_equals(6, len(b))
     self.assert_contains(r1, b)
     for at in r1.get_outgoing():
         self.assert_contains(at, b)
     self.assert_contains(r1, b)
     for at in r2.get_outgoing():
         self.assert_contains(at, b)
Beispiel #9
0
 def testBacklogCreation(self):
     """Tests the creation of a Backlog"""
     global_backlog = BacklogConfiguration(self.env, name="Global Backlog")
     global_backlog.ticket_types = [Type.REQUIREMENT]
     global_backlog.save()
     # Now reload the same backlog and check that the type and order are kept
     b1 = self.bmm.get(name="Global Backlog")
     self.assert_equals(b1.ticket_types, [Type.REQUIREMENT])
Beispiel #10
0
 def testBacklogCreation(self):
     """Tests the creation of a Backlog"""
     global_backlog = BacklogConfiguration(self.env, name="Global Backlog")
     global_backlog.ticket_types = [Type.REQUIREMENT]
     global_backlog.save()
     # Now reload the same backlog and check that the type and order are kept
     b1 = self.bmm.get(name="Global Backlog")
     self.assert_equals(b1.ticket_types, [Type.REQUIREMENT])
Beispiel #11
0
 def _global_backlog(self):
     global_backlog_config = BacklogConfiguration(self.env, name='Global')
     if not global_backlog_config.exists:
         global_backlog_config.ticket_types = [
             Type.REQUIREMENT, Type.USER_STORY
         ]
         global_backlog_config.save()
     return Backlog(self.env, name='Global')
Beispiel #12
0
 def testLoadingReleaseBacklogWithQuotesInMilestoneNameDoesNotBlowUp(self):
     # This is a regression test for badly quoted SQL
     release_backlog = 'Release Backlog'
     milestone = self.teh.create_milestone("It's me")
     self.assert_true(milestone.exists)
     backlog = BacklogConfiguration(self.env, name=release_backlog, type=BacklogType.MILESTONE)
     backlog.save()
     self.bmm.get(name=release_backlog, scope="It's me")
Beispiel #13
0
 def _milestone_backlog(self, milestone_name=None):
     milestone_backlog_config = BacklogConfiguration(
         self.env, name='Milestone', type=BacklogType.MILESTONE)
     if not milestone_backlog_config.exists:
         milestone_backlog_config.ticket_types = [
             Type.REQUIREMENT, Type.USER_STORY
         ]
         milestone_backlog_config.save()
     return Backlog(self.env, name='Milestone', scope=milestone_name)
Beispiel #14
0
 def setUp(self):
     self.super()
     self.tester.login_as(Usernames.admin)
     global_backlog_config = BacklogConfiguration(self.env,
                                                  name='Product Backlog')
     global_backlog_config.ticket_types = [
         Type.REQUIREMENT, Type.USER_STORY, Type.TASK
     ]
     global_backlog_config.save()
Beispiel #15
0
 def testLoadingReleaseBacklogWithQuotesInSprintNameDoesNotBlowUp(self):
     # This is a regression test for badly quoted SQL
     release_backlog = 'Release Backlog'
     self.teh.create_milestone('1.0')
     rb = BacklogConfiguration(self.env,
                               release_backlog,
                               type=BacklogType.MILESTONE)
     rb.save()
     Backlog(self.env, release_backlog, scope='1.0')
Beispiel #16
0
 def testLoadingReleaseBacklogWithQuotesInMilestoneNameDoesNotBlowUp(self):
     # This is a regression test for badly quoted SQL
     release_backlog = 'Release Backlog'
     milestone = self.teh.create_milestone("It's me")
     self.assert_true(milestone.exists)
     backlog = BacklogConfiguration(self.env,
                                    name=release_backlog,
                                    type=BacklogType.MILESTONE)
     backlog.save()
     self.bmm.get(name=release_backlog, scope="It's me")
 def setUp(self):
     self.super()
     
     global_backlog_config = BacklogConfiguration(self.env, name='Product Backlog')
     global_backlog_config.ticket_types = [Type.REQUIREMENT, Type.USER_STORY]
     global_backlog_config.include_planned_items = True
     global_backlog_config.save()
     
     self.tester.login_as(Usernames.admin)
     self.ids = self.tester.create_sprint_with_small_backlog()
Beispiel #18
0
    def test_create_new_backlog_with_description(self):
        expected_description = 'Some random text'
        backlog_config = BacklogConfiguration(self.env, name='MyBacklog')
        backlog_config.description = expected_description
        self.assert_false(backlog_config.exists)
        backlog_config.save()
        self.assert_true(backlog_config.exists)

        fetched_backlog_config = self._backlog_config('MyBacklog')
        self.assert_equals(expected_description,
                           fetched_backlog_config.description)
    def setUp(self):
        self.super()
        env = self.testenv.get_trac_environment()
        env.config.set('ticket-workflow', 'fnordify', '* -> fnord i fied')
        backlog_config = BacklogConfiguration(env, Key.SPRINT_BACKLOG)
        backlog_config.backlog_columns = [Key.STATUS,]
        env.config.save()

        self.tester.login_as(Usernames.admin)
        ids = self.tester.create_sprint_with_small_backlog()
        self.task_id = ids[2][0]
 def test_create_new_backlog_with_description(self):
     expected_description = 'Some random text'
     backlog_config = BacklogConfiguration(self.env, name='MyBacklog')
     backlog_config.description = expected_description
     self.assert_false(backlog_config.exists)
     backlog_config.save()
     self.assert_true(backlog_config.exists)
     
     fetched_backlog_config = self._backlog_config('MyBacklog')
     self.assert_equals(expected_description, 
                        fetched_backlog_config.description)
 def setUp(self):
     self.super()
     env = self.testenv.get_trac_environment()
     config = BacklogConfiguration(env, Key.PRODUCT_BACKLOG)
     config.backlog_columns = [Key.DESCRIPTION, Key.STATUS]
     config.save()
     
     self.tester.login_as(Usernames.admin)
     ticket_id = self.tester.create_new_agilo_userstory('Story without sprint',  sprint='')
     self.story = self.tester.navigate_to_ticket_page(ticket_id).ticket()
     self.backlog = [self.story]
Beispiel #22
0
 def testDeleteBacklog(self):
     """Tests the deletion of a Backlog"""
     backlog = BacklogConfiguration(self.env, name="Delete-Backlog")
     backlog.ticket_types = [Type.USER_STORY, Type.TASK]
     backlog.save()
     # Test that the backlog exists
     try:
         b2 = self.bmm.get(name="Delete-Backlog")
         self.assert_true(b2.delete())
     except Exception, e:
         print "Error: %s" % unicode(e)
         self.fail("Not able to load backlog!!!")
Beispiel #23
0
 def testDeleteBacklog(self):
     """Tests the deletion of a Backlog"""
     backlog = BacklogConfiguration(self.env, name="Delete-Backlog") 
     backlog.ticket_types=[Type.USER_STORY, Type.TASK]
     backlog.save()
     # Test that the backlog exists
     try:
         b2 = self.bmm.get(name="Delete-Backlog")
         self.assert_true(b2.delete())
     except Exception, e:
         print "Error: %s" % unicode(e)
         self.fail("Not able to load backlog!!!")
Beispiel #24
0
    def setUp(self):
        self.super()
        env = self.testenv.get_trac_environment()
        config = BacklogConfiguration(env, Key.PRODUCT_BACKLOG)
        config.backlog_columns = [Key.DESCRIPTION, Key.STATUS]
        config.save()

        self.tester.login_as(Usernames.admin)
        ticket_id = self.tester.create_new_agilo_userstory(
            'Story without sprint', sprint='')
        self.story = self.tester.navigate_to_ticket_page(ticket_id).ticket()
        self.backlog = [self.story]
Beispiel #25
0
    def setUp(self):
        self.super()
        env = self.testenv.get_trac_environment()
        env.config.set('ticket-workflow', 'fnordify', '* -> fnord i fied')
        backlog_config = BacklogConfiguration(env, Key.SPRINT_BACKLOG)
        backlog_config.backlog_columns = [
            Key.STATUS,
        ]
        env.config.save()

        self.tester.login_as(Usernames.admin)
        ids = self.tester.create_sprint_with_small_backlog()
        self.task_id = ids[2][0]
    def setUp(self):
        self.super()
        self.tester.login_as(Usernames.admin)

        global_backlog_config = BacklogConfiguration(self.env, name='Product Backlog')
        global_backlog_config.backlog_columns = ['total_remaining_time']
        global_backlog_config.save()
        self.assertTrue('task' not in global_backlog_config.ticket_types)
        
        self.expected_remaining_time = 3
        self.story_id = self.tester.create_new_agilo_ticket(Type.USER_STORY, "Story summary")
        self.task_id = self.tester.create_referenced_ticket(self.story_id, Type.TASK, 'Task summary', remaining_time=self.expected_remaining_time)
        self.task = self.teh.load_ticket(t_id=self.task_id)
Beispiel #27
0
 def testRemoveFromBacklogsWhenClosed(self):
     """Test the remove from a backlog when the ticket gets closed and the
     backlog is global"""
     s = self.teh.create_sprint('Test')
     t1 = self.teh.create_ticket(Type.USER_STORY, props={Key.STORY_POINTS: '8'})
     t2 = self.teh.create_ticket(Type.USER_STORY, props={Key.STORY_POINTS: '5', Key.SPRINT: s.name})
     b1 = BacklogConfiguration(self.env, name="Backlog")
     b1.ticket_types = [Type.USER_STORY]
     b1.save()
     b1 = self.bmm.get(name="Backlog")
     self.assert_equals(len(b1), 1)
     self.assert_true(t1 in b1)
     self.assert_false(t2 in b1)
     b2 = BacklogConfiguration(self.env, name="Scoped", type=BacklogType.SPRINT)
     b2.ticket_types = [Type.USER_STORY]
     b2.save()
     b2 = self.bmm.get(name="Scoped", scope=s.name)
     self.assert_equals(len(b2), 1)
     self.assert_true(t2 in b2)
     self.assert_false(t1 in b2)
     # Now close the tickets, should go away from the b1 and remain in b2
     t1[Key.STATUS] = t2[Key.STATUS] = Status.CLOSED
     t1.save_changes('tester', 'closed t1 ticket...')
     t2.save_changes('tester', 'closed t2 ticket...')
     self.assert_false(t1 in b1)
     self.assert_false(t2 in b1)
     self.assert_false(t1 in b2)
     self.assert_true(t2 in b2)
     # Now remove directly a BacklogItem
     for bi in b1:
         bi[Key.STATUS] = Status.CLOSED
         bi.save()
         self.assert_false(bi in b1, "Ticket %s still in backlog!!!" % bi)
Beispiel #28
0
 def test_referenced_requirements_are_displayed_in_the_sprint_backlog(self):
     """Test that referenced requirements are shown in the sprint backlog 
     even if they are planned for a milestone."""
     milestone = self.teh.create_milestone('1.0')
     sprint = self.teh.create_sprint("First Sprint")
     backlog_name = 'My Backlog'
     my_backlog = BacklogConfiguration(self.env, name=backlog_name, type=BacklogType.SPRINT)
     my_backlog.ticket_types=[Type.USER_STORY, Type.TASK, Type.REQUIREMENT]
     my_backlog.save()
     req = self.teh.create_ticket(Type.REQUIREMENT, {Key.SUMMARY: 'Requirement', Key.MILESTONE: milestone.name})
     story = self.teh.create_ticket(Type.USER_STORY, {Key.SUMMARY: 'Story', Key.SPRINT: sprint.name})
     req.link_to(story)
     
     backlog = self.bmm.get(name=backlog_name, scope=sprint.name)
     self.assert_length(2, backlog)
Beispiel #29
0
 def testBacklogWithItemNotAdded(self):
     """Tests the Backlog with Items that have not been explicitly added"""
     backlog = BacklogConfiguration(self.env, name="Global Backlog")
     backlog.ticket_types=[Type.REQUIREMENT]
     backlog.save()
     # Create some tickets and add them to the Backlog
     b = self.bmm.get(name="Global Backlog")
     t1 = self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '3000'})
     t_no = self.teh.create_ticket(Type.USER_STORY, props={Key.STORY_POINTS: '13'})
     t2 = self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '1200'})
     b1 = self.bmm.get(name="Global Backlog")
     # Test that a belonging ticket is really belonging
     self.assert_contains(t2, b1)
     # Test if the external ticket, has been loaded into the Backlog
     self.assert_contains(t1, b1)
     # Test that the t_no, User Story is also not in the Backlog
     self.assert_not_contains(t_no, b1)
Beispiel #30
0
 def testBacklogForMultipleSprint(self):
     """Tests a Backlog associated to a Sprint with multiple sprints"""
     # Creates a Milestone
     m = Milestone(self.env)
     m.name = "Milestone 1"
     m.insert()
     # Create 2 Sprints
     sprint1 = self.teh.create_sprint(
                      name="Sprint 1", 
                      start=to_datetime(t=None), 
                      duration=20,
                      milestone=m.name)
     sprint2 = self.teh.create_sprint( 
                      name="Sprint 2", 
                      start=to_datetime(t=None), 
                      duration=20,
                      milestone=m.name)
     # Create some tickets
     s1 = self.teh.create_ticket(Type.USER_STORY, 
                                 props={Key.STORY_POINTS: '3', 
                                        Key.SPRINT: sprint1.name})
     self.assert_true(s1.link_to(self.teh.create_ticket(Type.TASK, 
                                                        props={Key.REMAINING_TIME: '4',
                                                               Key.SPRINT: sprint1.name})))
     self.assert_true(s1.link_to(self.teh.create_ticket(Type.TASK,
                                                        props={Key.REMAINING_TIME: '8',
                                                               Key.SPRINT: sprint1.name})))
     self.assert_true(s1.link_to(self.teh.create_ticket(Type.TASK, 
                                                        props={Key.REMAINING_TIME: '4'})))
     s2 = self.teh.create_ticket(Type.USER_STORY, props={Key.STORY_POINTS: '5', 
                                                         Key.SPRINT: sprint2.name})
     self.assert_true(s2.link_to(self.teh.create_ticket(Type.TASK, 
                                                        props={Key.REMAINING_TIME: '2',
                                                               Key.SPRINT: sprint2.name})))
     self.assert_true(s2.link_to(self.teh.create_ticket(Type.TASK, 
                                                        props={Key.REMAINING_TIME: '3'})))
     # Creates the Backlog bound to the Sprint
     backlog = BacklogConfiguration(self.env, name="Sprint-Backlog", type=BacklogType.SPRINT)
     backlog.ticket_types = [Type.USER_STORY, Type.TASK]
     backlog.save()
     # The Backlog should contains only the items planned for the Sprint, and with parents
     # planned for the Sprint too
     backlog1 =  self.bmm.get(name="Sprint-Backlog", scope=sprint1.name)
     self.assert_length(3, backlog1)
     backlog2 =  self.bmm.get(name="Sprint-Backlog", scope=sprint2.name)
     self.assert_length(2, backlog2)
Beispiel #31
0
 def testProductBacklogItems(self):
     """Tests the creation of a Global Backlog and add some Items to it"""
     backlog = BacklogConfiguration(self.env, name="Global Backlog")
     backlog.ticket_types = [Type.REQUIREMENT]
     backlog.save()
     # Create some tickets and add them to the Backlog
     b = self.bmm.get(name="Global Backlog")
     b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '3000'}))
     b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '1200'}))
     b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '2000'}))
     b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '800'}))
     b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '3000'}))
     # Now test that the ticket are sorted by the defined Key
     ref = 3000
     self.assert_equals(5, len(b), 'Wrong number of tickets in this (%s) Backlog!' % \
                                   len(b))
     # Now load it again, and verify that the order is still ok
     b1 = self.bmm.get(name="Global Backlog")
     self.assert_true(len(b1) > 0, 'There is no ticket associated to this Backlog!')
Beispiel #32
0
    def setUp(self):
        self.super()
        self.tester.login_as(Usernames.admin)

        global_backlog_config = BacklogConfiguration(self.env,
                                                     name='Product Backlog')
        global_backlog_config.backlog_columns = ['total_remaining_time']
        global_backlog_config.save()
        self.assertTrue('task' not in global_backlog_config.ticket_types)

        self.expected_remaining_time = 3
        self.story_id = self.tester.create_new_agilo_ticket(
            Type.USER_STORY, "Story summary")
        self.task_id = self.tester.create_referenced_ticket(
            self.story_id,
            Type.TASK,
            'Task summary',
            remaining_time=self.expected_remaining_time)
        self.task = self.teh.load_ticket(t_id=self.task_id)
Beispiel #33
0
 def test_backlog_shows_right_tickets(self):
     """Tests the Release Backlog shows the Requirements belonging to a 
     specific Milestone"""
     sprint = self.teh.create_sprint("Release Sprint")
     release_backlog = BacklogConfiguration(self.env, name="Release Backlog", type=BacklogType.MILESTONE)
     release_backlog.ticket_types = [Type.REQUIREMENT, Type.USER_STORY]
     release_backlog.save()
     req = self.teh.create_ticket(Type.REQUIREMENT, props={Key.MILESTONE: sprint.milestone})
     # load the real backlog
     release_backlog = self.bmm.get(name="Release Backlog", scope=sprint.milestone)
     self.assert_contains(req, release_backlog)
     self.assert_length(1, release_backlog)
     # Now add 2 stories to the requirement, one planned for the sprint one
     # not, only the one assigned to the sprint should appear in the backlog
     us1 = self.teh.create_ticket(Type.USER_STORY, props={Key.SPRINT: sprint.name})
     us2 = self.teh.create_ticket(Type.USER_STORY)
     self.assert_true(us1 in release_backlog)
     self.assert_not_contains(us2, release_backlog)
     self.assert_length(1 + 1, release_backlog)
Beispiel #34
0
def create_default_backlogs(env):
    """Creates the default Backlog for Product Backlog and Sprint 
    Backlog"""
    # AT: we can now just try to create it, if it is already existing
    # nothing will happen
    notify_user("Creating Product Backlog...", env)
    product_backlog = BacklogConfiguration(env, name=Key.PRODUCT_BACKLOG)
    product_backlog.ticket_types = [Type.REQUIREMENT, Type.USER_STORY]
    product_backlog.save()
    
    notify_user("Creating Sprint Backlog...", env)
    sprint_backlog = BacklogConfiguration(env, name=Key.SPRINT_BACKLOG)
    sprint_backlog.type = BacklogType.SPRINT
    sprint_backlog.ticket_types = [Type.REQUIREMENT, Type.USER_STORY, 
                                   Type.TASK, Type.BUG]
    sprint_backlog.save()
Beispiel #35
0
 def testBacklogWithItemNotAdded(self):
     """Tests the Backlog with Items that have not been explicitly added"""
     backlog = BacklogConfiguration(self.env, name="Global Backlog")
     backlog.ticket_types = [Type.REQUIREMENT]
     backlog.save()
     # Create some tickets and add them to the Backlog
     b = self.bmm.get(name="Global Backlog")
     t1 = self.teh.create_ticket(Type.REQUIREMENT,
                                 props={Key.BUSINESS_VALUE: '3000'})
     t_no = self.teh.create_ticket(Type.USER_STORY,
                                   props={Key.STORY_POINTS: '13'})
     t2 = self.teh.create_ticket(Type.REQUIREMENT,
                                 props={Key.BUSINESS_VALUE: '1200'})
     b1 = self.bmm.get(name="Global Backlog")
     # Test that a belonging ticket is really belonging
     self.assert_contains(t2, b1)
     # Test if the external ticket, has been loaded into the Backlog
     self.assert_contains(t1, b1)
     # Test that the t_no, User Story is also not in the Backlog
     self.assert_not_contains(t_no, b1)
Beispiel #36
0
    def testBacklogPositionPersistence(self):
        """Tests the Backlog position persistence of items, after being saved and reloaded"""
        backlog = BacklogConfiguration(self.env, name="Global Backlog")
        backlog.ticket_types=[Type.REQUIREMENT]
        backlog.save()

        # Create some tickets and add them to the Backlog
        b = self.bmm.get(name="Global Backlog")
        b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '3000'}))
        b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '1200'}))
        b.add(self.teh.create_ticket(Type.REQUIREMENT, props={Key.BUSINESS_VALUE: '2000'}))
        # Now reload the backlog, move the item in pos 2 to 1, save and reload
        b1 = self.bmm.get(name="Global Backlog")
        self.assert_equals(3, len(b1))
        t1200 = b1[1]
        b1.insert(0, t1200)
        # reload the backlgo and verify that the item is in position 0
        b2 = self.bmm.get(name='Global Backlog')
        self.assert_equals(t1200.ticket.id, b2[0].ticket.id)
        self.assert_equals(0, b2[0].pos)
Beispiel #37
0
 def testGlobalBacklogWithStrictOption(self):
     """Tests a global backlog with the Strict option"""
     backlog = BacklogConfiguration(self.env, name="Bug-Backlog")
     backlog.ticket_types=[Type.BUG, Type.TASK]
     backlog.save()
     # Build a hierarchy of Bug tasks
     b1 = self.teh.create_ticket(Type.BUG)
     t1 = self.teh.create_ticket(Type.TASK, 
                                 props={Key.REMAINING_TIME: '3'})
     t2 = self.teh.create_ticket(Type.TASK, 
                                 props={Key.REMAINING_TIME: '7'})
     # Link the Bug only with one task
     self.assert_true(b1.link_to(t1))
     self.assert_equals('', b1[Key.SPRINT])
     # Standard trac fields must not be None (see property change rendering
     # for ticket preview)
     self.assert_equals('', b1[Key.MILESTONE])
     self.assert_equals(Type.BUG, b1[Key.TYPE])
     self.assert_equals('', t1[Key.SPRINT])
     self.assert_equals('', t1[Key.MILESTONE])
     self.assert_equals('', t2[Key.SPRINT])
     self.assert_equals('', t2[Key.MILESTONE])
     
     # Now load the backlog, and check that even with strict
     # a global backlog shows all the tickets
     b = self.bmm.get(name="Bug-Backlog")
     if len(b) != 3:
         print_backlog(b)
         self.fail("Backlog count wrong! %s != 3" % \
                    len(b))
     # Now links also the second task
     self.assert_true(b1.link_to(t2))
     # Now reload the backlog and check if the second task is there too
     self.assert_length(3, b)
     # Now plan the a task for a sprint so that should disappear from the
     # backlog
     s = self.teh.create_sprint("Test")
     t1[Key.SPRINT] = s.name
     self.assert_true(t1.save_changes('Tester', 'Planned...'))
     self.assert_length(2, b)
Beispiel #38
0
 def testRemoveFromBacklogsWhenClosed(self):
     """Test the remove from a backlog when the ticket gets closed and the
     backlog is global"""
     s = self.teh.create_sprint('Test')
     t1 = self.teh.create_ticket(Type.USER_STORY,
                                 props={Key.STORY_POINTS: '8'})
     t2 = self.teh.create_ticket(Type.USER_STORY,
                                 props={
                                     Key.STORY_POINTS: '5',
                                     Key.SPRINT: s.name
                                 })
     b1 = BacklogConfiguration(self.env, name="Backlog")
     b1.ticket_types = [Type.USER_STORY]
     b1.save()
     b1 = self.bmm.get(name="Backlog")
     self.assert_equals(len(b1), 1)
     self.assert_true(t1 in b1)
     self.assert_false(t2 in b1)
     b2 = BacklogConfiguration(self.env,
                               name="Scoped",
                               type=BacklogType.SPRINT)
     b2.ticket_types = [Type.USER_STORY]
     b2.save()
     b2 = self.bmm.get(name="Scoped", scope=s.name)
     self.assert_equals(len(b2), 1)
     self.assert_true(t2 in b2)
     self.assert_false(t1 in b2)
     # Now close the tickets, should go away from the b1 and remain in b2
     t1[Key.STATUS] = t2[Key.STATUS] = Status.CLOSED
     t1.save_changes('tester', 'closed t1 ticket...')
     t2.save_changes('tester', 'closed t2 ticket...')
     self.assert_false(t1 in b1)
     self.assert_false(t2 in b1)
     self.assert_false(t1 in b2)
     self.assert_true(t2 in b2)
     # Now remove directly a BacklogItem
     for bi in b1:
         bi[Key.STATUS] = Status.CLOSED
         bi.save()
         self.assert_false(bi in b1, "Ticket %s still in backlog!!!" % bi)
Beispiel #39
0
    def testGlobalBacklogWithStrictOption(self):
        """Tests a global backlog with the Strict option"""
        backlog = BacklogConfiguration(self.env, name="Bug-Backlog")
        backlog.ticket_types = [Type.BUG, Type.TASK]
        backlog.save()
        # Build a hierarchy of Bug tasks
        b1 = self.teh.create_ticket(Type.BUG)
        t1 = self.teh.create_ticket(Type.TASK, props={Key.REMAINING_TIME: '3'})
        t2 = self.teh.create_ticket(Type.TASK, props={Key.REMAINING_TIME: '7'})
        # Link the Bug only with one task
        self.assert_true(b1.link_to(t1))
        self.assert_equals('', b1[Key.SPRINT])
        # Standard trac fields must not be None (see property change rendering
        # for ticket preview)
        self.assert_equals('', b1[Key.MILESTONE])
        self.assert_equals(Type.BUG, b1[Key.TYPE])
        self.assert_equals('', t1[Key.SPRINT])
        self.assert_equals('', t1[Key.MILESTONE])
        self.assert_equals('', t2[Key.SPRINT])
        self.assert_equals('', t2[Key.MILESTONE])

        # Now load the backlog, and check that even with strict
        # a global backlog shows all the tickets
        b = self.bmm.get(name="Bug-Backlog")
        if len(b) != 3:
            print_backlog(b)
            self.fail("Backlog count wrong! %s != 3" % \
                       len(b))
        # Now links also the second task
        self.assert_true(b1.link_to(t2))
        # Now reload the backlog and check if the second task is there too
        self.assert_length(3, b)
        # Now plan the a task for a sprint so that should disappear from the
        # backlog
        s = self.teh.create_sprint("Test")
        t1[Key.SPRINT] = s.name
        self.assert_true(t1.save_changes('Tester', 'Planned...'))
        self.assert_length(2, b)
Beispiel #40
0
 def testScopedBacklogWithClosedTicket(self):
     """Tests if a scoped backlog loads also closed tickets"""
     
     sprint1 = self.teh.create_sprint("Sprint Scoped")
     sprint1.save()
     # Creates the Backlog bound to a scope (Sprint)
     backlog = BacklogConfiguration(self.env, name="Scoped-Backlog", type=BacklogType.SPRINT)
     backlog.ticket_types = [Type.USER_STORY, Type.TASK]
     backlog.save()
     # Create 1 ticket
     task = self.teh.create_ticket(Type.TASK, 
                                   props={Key.REMAINING_TIME: '12',
                                          Key.SPRINT: sprint1.name})
     # Force reload
     backlog = self.bmm.get(name="Scoped-Backlog", 
                            scope=sprint1.name)
     self.assert_true(task in backlog)
     self.assert_equals(len(backlog), 1)
     task[Key.STATUS] = Status.CLOSED
     task.save_changes('tester', 'Changed Status')
     # Now should still be there even if closed, because the backlog is scoped
     self.assert_true(task in backlog)
     self.assert_equals(len(backlog), 1)
Beispiel #41
0
 def testMoveItemInBacklog(self):
     """Test the movement of an item into the backlog, change the position"""
     backlog = BacklogConfiguration(self.env, name="Global Backlog")
     backlog.ticket_types = [Type.REQUIREMENT]
     backlog.save()
     # Create some tickets and add them to the Backlog
     b = self.bmm.get(name="Global Backlog")
     b.add(
         self.teh.create_ticket(Type.REQUIREMENT,
                                props={Key.BUSINESS_VALUE: '3000'}))
     b.add(
         self.teh.create_ticket(Type.REQUIREMENT,
                                props={Key.BUSINESS_VALUE: '1200'}))
     b.add(
         self.teh.create_ticket(Type.REQUIREMENT,
                                props={Key.BUSINESS_VALUE: '2000'}))
     b.add(
         self.teh.create_ticket(Type.REQUIREMENT,
                                props={Key.BUSINESS_VALUE: '800'}))
     b.add(
         self.teh.create_ticket(Type.REQUIREMENT,
                                props={Key.BUSINESS_VALUE: '3000'}))
     b1 = self.bmm.get(name="Global Backlog")
     t2000 = None
     for b in b1:
         #print "b: %s" % type(b)
         if int(b.ticket[Key.BUSINESS_VALUE]) == 2000:
             t2000 = b
             break
     self.assert_not_none(t2000)
     new_pos = b1.insert(0, t2000)
     self.assert_equals(new_pos, 0)
     # Now try to move a normal ticket and not a BacklogItem
     t2000 = self.teh.load_ticket(t_id=t2000.ticket.id)
     b1.insert(1, t2000)
     self.assert_equals(t2000, b1[1].ticket)
Beispiel #42
0
 def test_backlog_shows_right_tickets(self):
     """Tests the Release Backlog shows the Requirements belonging to a 
     specific Milestone"""
     sprint = self.teh.create_sprint("Release Sprint")
     release_backlog = BacklogConfiguration(self.env,
                                            name="Release Backlog",
                                            type=BacklogType.MILESTONE)
     release_backlog.ticket_types = [Type.REQUIREMENT, Type.USER_STORY]
     release_backlog.save()
     req = self.teh.create_ticket(Type.REQUIREMENT,
                                  props={Key.MILESTONE: sprint.milestone})
     # load the real backlog
     release_backlog = self.bmm.get(name="Release Backlog",
                                    scope=sprint.milestone)
     self.assert_contains(req, release_backlog)
     self.assert_length(1, release_backlog)
     # Now add 2 stories to the requirement, one planned for the sprint one
     # not, only the one assigned to the sprint should appear in the backlog
     us1 = self.teh.create_ticket(Type.USER_STORY,
                                  props={Key.SPRINT: sprint.name})
     us2 = self.teh.create_ticket(Type.USER_STORY)
     self.assert_true(us1 in release_backlog)
     self.assert_not_contains(us2, release_backlog)
     self.assert_length(1 + 1, release_backlog)
Beispiel #43
0
 def testBacklogWithHierarchicalItems(self):
     """Tests the Backlog with multiple hierarchical types"""
     # Create 2 requirements and link 2 stories each
     r1 = self.teh.create_ticket(Type.REQUIREMENT,
                                 props={Key.BUSINESS_VALUE: '2000'})
     self.assert_true(
         r1.link_to(
             self.teh.create_ticket(Type.USER_STORY,
                                    props={Key.STORY_PRIORITY: 'Linear'})))
     self.assert_true(
         r1.link_to(
             self.teh.create_ticket(Type.USER_STORY,
                                    props={Key.STORY_PRIORITY:
                                           'Mandatory'})))
     r2 = self.teh.create_ticket(Type.REQUIREMENT,
                                 props={Key.BUSINESS_VALUE: '3000'})
     self.assert_true(
         r2.link_to(
             self.teh.create_ticket(Type.USER_STORY,
                                    props={Key.STORY_PRIORITY: 'Exciter'})))
     self.assert_true(
         r2.link_to(
             self.teh.create_ticket(Type.USER_STORY,
                                    props={Key.STORY_PRIORITY: 'Linear'})))
     # Now create a Backlog with both type and lets' verify that the tickets are there
     backlog = BacklogConfiguration(self.env, name="Global Backlog")
     backlog.ticket_types = [Type.REQUIREMENT, Type.USER_STORY]
     backlog.save()
     b = self.bmm.get(name="Global Backlog")
     self.assert_equals(6, len(b))
     self.assert_contains(r1, b)
     for at in r1.get_outgoing():
         self.assert_contains(at, b)
     self.assert_contains(r1, b)
     for at in r2.get_outgoing():
         self.assert_contains(at, b)
Beispiel #44
0
    def setUp(self):
        self.super()

        global_backlog_config = BacklogConfiguration(self.env,
                                                     name='Product Backlog')
        global_backlog_config.ticket_types = [
            Type.REQUIREMENT, Type.USER_STORY
        ]
        global_backlog_config.include_planned_items = True
        global_backlog_config.save()

        self.tester.login_as(Usernames.admin)
        self.ids = self.tester.create_sprint_with_small_backlog()
 def setUp(self):
     self.super()
     self.tester.login_as(Usernames.admin)
     global_backlog_config = BacklogConfiguration(self.env, name='Product Backlog')
     global_backlog_config.ticket_types = [Type.REQUIREMENT, Type.USER_STORY, Type.TASK]
     global_backlog_config.save()
Beispiel #46
0
 def _backlog_config(self, name):
     return BacklogConfiguration(self.env, name=name)
Beispiel #47
0
 def _create_release_backlog(self):
     config = BacklogConfiguration(self.env, 'Release Backlog',
                                   BacklogType.MILESTONE, [Type.USER_STORY])
     config.save()
     return config
Beispiel #48
0
 def _sprint_backlog(self, sprint_name=None):
     sprint_backlog_config = BacklogConfiguration(self.env, name='Sprint', type=BacklogType.SPRINT)
     if not sprint_backlog_config.exists:
         sprint_backlog_config.save()
     return Backlog(self.env, name='Sprint', scope=sprint_name)
Beispiel #49
0
 def _global_backlog(self):
     global_backlog_config = BacklogConfiguration(self.env, name='Global')
     if not global_backlog_config.exists:
         global_backlog_config.ticket_types = [Type.REQUIREMENT, Type.USER_STORY]
         global_backlog_config.save()
     return Backlog(self.env, name='Global') 
Beispiel #50
0
 def _milestone_backlog(self, milestone_name=None):
     milestone_backlog_config = BacklogConfiguration(self.env, name='Milestone', type=BacklogType.MILESTONE)
     if not milestone_backlog_config.exists:
         milestone_backlog_config.ticket_types = [Type.REQUIREMENT, Type.USER_STORY]
         milestone_backlog_config.save()
     return Backlog(self.env, name='Milestone', scope=milestone_name)
Beispiel #51
0
 def testBacklogForMultipleSprint(self):
     """Tests a Backlog associated to a Sprint with multiple sprints"""
     # Creates a Milestone
     m = Milestone(self.env)
     m.name = "Milestone 1"
     m.insert()
     # Create 2 Sprints
     sprint1 = self.teh.create_sprint(name="Sprint 1",
                                      start=to_datetime(t=None),
                                      duration=20,
                                      milestone=m.name)
     sprint2 = self.teh.create_sprint(name="Sprint 2",
                                      start=to_datetime(t=None),
                                      duration=20,
                                      milestone=m.name)
     # Create some tickets
     s1 = self.teh.create_ticket(Type.USER_STORY,
                                 props={
                                     Key.STORY_POINTS: '3',
                                     Key.SPRINT: sprint1.name
                                 })
     self.assert_true(
         s1.link_to(
             self.teh.create_ticket(Type.TASK,
                                    props={
                                        Key.REMAINING_TIME: '4',
                                        Key.SPRINT: sprint1.name
                                    })))
     self.assert_true(
         s1.link_to(
             self.teh.create_ticket(Type.TASK,
                                    props={
                                        Key.REMAINING_TIME: '8',
                                        Key.SPRINT: sprint1.name
                                    })))
     self.assert_true(
         s1.link_to(
             self.teh.create_ticket(Type.TASK,
                                    props={Key.REMAINING_TIME: '4'})))
     s2 = self.teh.create_ticket(Type.USER_STORY,
                                 props={
                                     Key.STORY_POINTS: '5',
                                     Key.SPRINT: sprint2.name
                                 })
     self.assert_true(
         s2.link_to(
             self.teh.create_ticket(Type.TASK,
                                    props={
                                        Key.REMAINING_TIME: '2',
                                        Key.SPRINT: sprint2.name
                                    })))
     self.assert_true(
         s2.link_to(
             self.teh.create_ticket(Type.TASK,
                                    props={Key.REMAINING_TIME: '3'})))
     # Creates the Backlog bound to the Sprint
     backlog = BacklogConfiguration(self.env,
                                    name="Sprint-Backlog",
                                    type=BacklogType.SPRINT)
     backlog.ticket_types = [Type.USER_STORY, Type.TASK]
     backlog.save()
     # The Backlog should contains only the items planned for the Sprint, and with parents
     # planned for the Sprint too
     backlog1 = self.bmm.get(name="Sprint-Backlog", scope=sprint1.name)
     self.assert_length(3, backlog1)
     backlog2 = self.bmm.get(name="Sprint-Backlog", scope=sprint2.name)
     self.assert_length(2, backlog2)
Beispiel #52
0
def create_default_backlogs(env):
    """Creates the default Backlog for Product Backlog and Sprint 
    Backlog"""
    # AT: we can now just try to create it, if it is already existing
    # nothing will happen
    notify_user("Creating Product Backlog...", env)
    product_backlog = BacklogConfiguration(env, name=Key.PRODUCT_BACKLOG)
    product_backlog.ticket_types = [Type.REQUIREMENT, Type.USER_STORY]
    product_backlog.save()

    notify_user("Creating Sprint Backlog...", env)
    sprint_backlog = BacklogConfiguration(env, name=Key.SPRINT_BACKLOG)
    sprint_backlog.type = BacklogType.SPRINT
    sprint_backlog.ticket_types = [
        Type.REQUIREMENT, Type.USER_STORY, Type.TASK, Type.BUG
    ]
    sprint_backlog.save()
 def _create_release_backlog(self):
     config = BacklogConfiguration(self.env, 'Release Backlog', BacklogType.MILESTONE, [Type.USER_STORY])
     config.save()
     return config