Example #1
0
    def __init__(self):
        """
        Constructor class for new model.
        """
        self.board = TaskBoard('Stories Board')
        self.project = Project('DataSwitch Core')
        self.backlog = Backlog()

        return
Example #2
0
 def test_edit_project_name(self):
     my_project = Project()
     dash_page = AuthPage().auth()
     add_project_page = dash_page.click_add_project()
     add_project_page.set_name(my_project.name)
     add_project_page.set_announcement(my_project.announcement)
     add_project_page.select_show_announcement(my_project.show_announcement)
     add_project_page.select_project_view(my_project.view)
     projects_page = add_project_page.click_add_project()
     edit_page = projects_page.click_project_name(my_project.name)
     my_project.name = Project().name
     edit_page.set_name(my_project.name)
     projects_page = edit_page.click_add_project()
     projects_page.assert_name_is_exist_in_list(my_project.name)
 def __build_project_list(self, proj_list, projects):
     for project in projects:
         tmpData = project.to_dict()
         tmpData['owner'] = self._userModel.get_user_info_by_uid(
             tmpData['owner'])[0]
         proj_dic = Project.from_dict(tmpData).to_dict()
         proj_dic.update({'id': project.id})
         proj_list.append(proj_dic)
Example #4
0
 def test_add_new_project_from_dashboard(self):
     my_project = Project()
     dash_page = AuthPage().auth()
     admin_page = dash_page.click_by_admin_item()
     add_project_page = admin_page.click_add_project()
     add_project_page.set_name(my_project.name)
     add_project_page.set_announcement(my_project.announcement)
     add_project_page.select_show_announcement(my_project.show_announcement)
     add_project_page.select_project_view(my_project.view)
     projects_page = add_project_page.click_add_project()
     projects_page.assert_name_is_exist_in_list(my_project.name)
Example #5
0
 def test_delete_cancel(self):
     my_project = Project()
     dash_page = AuthPage().auth()
     add_project_page = dash_page.click_add_project()
     add_project_page.set_name(my_project.name)
     add_project_page.set_announcement(my_project.announcement)
     add_project_page.select_show_announcement(my_project.show_announcement)
     add_project_page.select_project_view(my_project.view)
     projects_page = add_project_page.click_add_project()
     delete_modal_window = projects_page.click_project_delete_icon(
         my_project.name)
     delete_modal_window.select_confirm_project(True)
     delete_modal_window.click_cancel()
     projects_page.assert_name_is_exist_in_list(my_project.name)
Example #6
0
 def test_case_title(self, title):
     my_project = Project()
     dash_page = AuthPage().auth()
     add_project_page = dash_page.click_add_project()
     add_project_page.set_name(my_project.name)
     add_project_page.select_project_view(my_project.view)
     projects_page = add_project_page.click_add_project()
     dash_page = projects_page.click_by_dashboard_item()
     project_page = dash_page.click_by_project_title(my_project.name)
     testcases_subpage = project_page.click_by_project_menu_item(
         'Test Cases')
     add_testcase_subpage = testcases_subpage.click_add_case()
     add_testcase_subpage.set_title(title)
     show_testcase_subpage = add_testcase_subpage.click_add_case()
     show_testcase_subpage.assert_title_is_correct(title)
Example #7
0
 def test_add_new_project_from_admin_page(self):
     my_project = Project(view='suite_mode_single_baseline')
     dash_page = AuthPage().auth()
     add_project_page = dash_page.click_add_project()
     add_project_page.set_name(my_project.name)
     add_project_page.set_announcement(my_project.announcement)
     add_project_page.select_show_announcement(my_project.show_announcement)
     add_project_page.select_project_view(my_project.view)
     projects_page = add_project_page.click_add_project()
     projects_page.assert_name_is_exist_in_list(my_project.name)
     delete_modal_window = projects_page.click_project_delete_icon(
         my_project.name)
     delete_modal_window.select_confirm_project(True)
     delete_modal_window.click_delete()
     projects_page.assert_name_is_not_exist_in_list(my_project.name)
    def add_project(self, name):
        if self.__is_project_name_used(name):
            return None, status_code.BAD_REQUEST

        project = Project(name=name,
                          owner=self._uid,
                          updated=firestore.SERVER_TIMESTAMP)
        project_dict = {
            'name': project.name,
            'owner': project.owner,
            'collaborator': project.collaborator,
            'repositories': project.repositories,
            'updated': project.updated
        }

        self._db.collection('projects').document().set(project_dict)
        return None, status_code.OK
Example #9
0
 def test_add_new_section_and_case(self):
     my_project = Project()
     dash_page = AuthPage().auth()
     add_project_page = dash_page.click_add_project()
     add_project_page.set_name(my_project.name)
     add_project_page.set_announcement(my_project.announcement)
     add_project_page.select_show_announcement(my_project.show_announcement)
     add_project_page.select_project_view(my_project.view)
     projects_page = add_project_page.click_add_project()
     dash_page = projects_page.click_by_dashboard_item()
     project_page = dash_page.click_by_project_title(my_project.name)
     testcases_subpage = project_page.click_by_project_menu_item(
         'Test Cases')
     add_testcase_subpage = testcases_subpage.click_add_case()
     my_case = Case('text_test_case')
     add_testcase_subpage.set_title(my_case.title)
     add_testcase_subpage.set_preconditions(my_case.preconditions)
     add_testcase_subpage.set_steps(my_case.steps)
     add_testcase_subpage.set_results(my_case.result)
     show_testcase_subpage = add_testcase_subpage.click_add_case()
     show_testcase_subpage.assert_title_is_correct(my_case.title)
Example #10
0
class Model(object):
    def __init__(self):
        """
        Constructor class for new model.
        """
        self.board = TaskBoard('Stories Board')
        self.project = Project('DataSwitch Core')
        self.backlog = Backlog()

        return

    def run(self):
        """
        Controls the main model run. Initialises model and patient arrival and
        audit processes. Instigates the run. At end of run calls for an audit
        summary and bed occupancy plot
        """

        """
        EMPLOYEES REGISTER TO THE PROJECT

        Adding 2 QAs with best experience on the project
        """
        self.project.qas_register(
            count=2, experience=10, available_working_hours=10, board=self.board
        )

        """
        Adding 1 release master (for our project we have release master as QA)
        """
        self.project.qas_register(
            count=1,
            experience=7,
            available_working_hours=10,
            board=self.board,
            release_master=True,
        )
        """
        Adding 1 middle QA on the project
        """
        self.project.qas_register(
            count=1, experience=4, available_working_hours=8, board=self.board
        )

        """
        Adding 1 new QA to the project
        """
        self.project.po_register(count=5, frequency=1, board=self.backlog)

        """
        Adding 1 crazy developer
        """
        self.project.dev_register(
            count=1,
            experience=10,
            available_working_hours=15,
            components=['CM'],
            board=self.board,
            backlog=self.backlog,
        )
        """
        Adding 2 UI developers with middle experience
        """
        self.project.dev_register(
            count=2,
            experience=7,
            available_working_hours=8,
            components=['UI'],
            board=self.board,
            backlog=self.backlog,
        )

        """
        Adding 1 UI developer with best experience
        """
        self.project.dev_register(
            count=1,
            experience=10,
            available_working_hours=10,
            components=['UI'],
            board=self.board,
            backlog=self.backlog,
        )

        """
        Adding 2 cross-component developers with best experience
        """
        self.project.dev_register(
            count=2,
            experience=10,
            available_working_hours=8,
            components=['CM', 'ASE'],
            board=self.board,
            backlog=self.backlog,
        )

        """
        Adding 2 single-component developers
        """
        self.project.dev_register(
            count=2,
            experience=7,
            available_working_hours=8,
            components=['CM'],
            board=self.board,
            backlog=self.backlog,
        )

        """
        Adding 2 single component developers with best experience
        """
        self.project.dev_register(
            count=2,
            experience=10,
            available_working_hours=8,
            components=['ASE'],
            board=self.board,
            backlog=self.backlog,
        )

        """
        Adding 1 single component developer
        """
        self.project.dev_register(
            count=1,
            experience=7,
            available_working_hours=8,
            components=['ASE'],
            board=self.board,
            backlog=self.backlog,
        )

        """
        Register processES that will be run into our simulation model
        """
        g.env.process(self.increase_growth_backlog())
        g.env.process(self.development())
        g.env.process(self.testing())
        g.env.process(self.uat())
        g.env.process(self.time())
        # g.env.process(self.release())

        """
        Run simulation model.
        until parameter = estimated hours for our model. 
        
        Here we have 1 working month (8 hours * 5 days on the week * 4 weeks)
        """
        g.env.run(until=8 * 5 * 4)

        """
        After our simulation is ended we need to know some performance metrics.
        For an example we would like to know how much tickets was created/selected from backlog
        """
        print(self.board.board)
        print(f"Spent {g.env.now} hours")
        print(
            f'Backlog. Size is \t\t{self.backlog.tickets.__len__()} tickets\n'
            f"Backlog. Created \t\t{g.stat_backlog['created']['total']} tickets\n"
        )

        return

    """
    Here and above we would like to describe our simualtion's processes on the project.
    
    For an example we have:
    1. Testing (QA accountable for this process)
    2. UAT (QA accountable for this process too). Re-checking on staging environment (not optimal process, yeah)
    3. Release (We have the Release Manager that also is QA).
    4. Increasing Growth Backlog (our product owner is accountable for this process)
    5. Development (our developers are accountable for this process)
    6. Time (is a static method that should allow us to know - What is day of the week today? 
        It needs for Release Manager for releases (we would like to release each Monday and Thursday)  
    """

    def testing(self):
        while True:
            for qa in self.project.qas:
                g.env.process(qa.testing())
            yield g.env.timeout(1000000)
        return

    def uat(self):
        while True:
            for qa in self.project.qas:
                g.env.process(qa.uat())
            yield g.env.timeout(1000000)
        return

    def release(self):
        while True:
            release_master = self.project.qas[0]
            g.env.process(release_master.release())
            yield g.env.timeout(1000000)
        return

    def increase_growth_backlog(self):
        while True:
            for po in self.project.pos:
                g.env.process(po.increase_growth_backlog())
            yield g.env.timeout(1000000)
        return

    def development(self):
        while True:
            for dev in self.project.devs:
                g.env.process(dev.development())
            yield g.env.timeout(1000000)

    @staticmethod
    def time():
        while True:
            yield g.env.timeout(24)
            print(f"Day of the week is {g.dow}\n\n")
            g.dow += 1
            if g.dow == 6:
                g.dow = 1
        return