def test_c5837_delete_plan_entry(self): self.add_configs() suite = Suite(name="Test Suite") suite = self.client.add_suite(suite, self.project.id) section = Section(name="Test Section", suite_id=suite.id) section = self.client.add_section(section, self.project.id) plan = Plan(name="Test Plan") plan = self.client.add_plan(plan, self.project.id) config_id = self.config_ids[0] plan_entry = PlanEntry( suite_id=suite.id, include_all=True, config_ids=[config_id], runs=[dict(config_ids=[config_id], include_all=True)], name="Windows", ) plan_entry_added = self.client.add_plan_entry(plan.id, plan_entry) plan = self.client.get_plan(plan.id) assert len(plan.entries) == 1 assert plan.entries[0]["id"] == plan_entry_added.id self.client.delete_plan_entry(plan.id, plan_entry_added.id) updated_plan = self.client.get_plan(plan.id) assert len(updated_plan.entries) == 0
def test_c5836_update_plan_entry(self): self.add_configs() suite = Suite(name="Test Suite") suite = self.client.add_suite(suite, self.project.id) section = Section(name="Test Section", suite_id=suite.id) section = self.client.add_section(section, self.project.id) plan = Plan(name="Test Plan") plan = self.client.add_plan(plan, self.project.id) cases = [] for title in ["Case 1", "Case 2", "Case 3"]: case = Case(title=title, type_id=7, priority_id=2, estimate="10m") case = self.client.add_case(case, section.id) cases.append(case)
def prepare_test_case(cls): # Add Config Groups and Configs cls.add_configs() # add test Suite suite = Suite(name="Test Suite") cls.suite = cls.client.add_suite(suite, cls.project.id) # add Section section = Section(name="Test Section", suite_id=cls.suite.id) section_created = cls.client.add_section(section, cls.project.id) cls.section = section_created # add test case case = Case(title="Test Case") cls.case = cls.client.add_case(case, section_created.id) # add Test Plan plan = Plan(name="Test Plan") cls.plan = cls.client.add_plan(plan, cls.project.id)
def test_c4047_add_plan_entry(self): self.add_configs() suite = Suite(name="Test Suite") suite = self.client.add_suite(suite, self.project.id) section = Section(name="Test Section", suite_id=suite.id) section = self.client.add_section(section, self.project.id) plan = Plan(name="Test Plan") plan = self.client.add_plan(plan, self.project.id) config_ids = self.config_ids[:2] def make_run(id): return dict(config_ids=[id], include_all=True) plan_entry = PlanEntry( suite_id=suite.id, include_all=True, config_ids=[self.config_ids[0], self.config_ids[1]], runs=[make_run(id) for id in config_ids], name="Windows", ) plan_entry_added = self.client.add_plan_entry(plan.id, plan_entry) assert plan_entry_added.suite_id == plan_entry.suite_id assert plan_entry_added.name == plan_entry.name assert len(plan_entry_added.runs) == 2 # The order the runs come back in is not the same order as we sent # them, so we just check they're both included for run in plan_entry_added.runs: config_ids = run['config_ids'] assert len(config_ids) == 1 config_id = config_ids[0] assert config_id in config_ids config_ids.remove(config_id) assert run['include_all'] assert not run['is_completed'] assert run['plan_id'] == plan.id assert len(config_ids) == 0
def update_suite(self, suite): response = self.client.send_post(f'update_suite/{suite.id}', suite) return Suite(**response)
def get_suites(self, project_id): response = self.client.send_get(f'get_suites/{project_id}') return [Suite(**args) for args in response]
def get_suite(self, suite_id): response = self.client.send_get(f'get_suite/{suite_id}') return Suite(**response)
def add_suite(self, suite, project_id): response = self.client.send_post('add_suite/{}'.format(project_id), suite) return Suite(**response)