class TestAddmember(): def setup(self): self.main = MainPage() def teardown(self): self.main.driver.quit() @allure.feature("添加成员") @pytest.mark.parametrize("username, acctid, phone", get_datas()[0], ids=get_datas()[1]) def test_addmember(self, username, acctid, phone): namelist = self.main.go_to_addmember_page().addmember(username, acctid, phone).save_member().get_contact_list() assert username in namelist @allure.feature("添加成员失败") @pytest.mark.parametrize("username, acctid, phone", get_datas()[2], ids=get_datas()[3]) def test_addmember_fail(self, username, acctid, phone): namelist = self.main.go_to_addmember_page().addmember(username, acctid, phone).cancel_member().get_contact_list() assert username not in namelist @allure.feature("通讯录添加成员") @pytest.mark.parametrize("username, acctid, phone", get_datas()[0], ids=get_datas()[1]) def test_contact_addmember(self, username, acctid, phone): namelist = self.main.go_to_contact_page().go_to_addmember_page().addmember(username, acctid, phone).save_member().get_contact_list() assert username in namelist
class TestAddDepartment(): def setup(self): self.main = MainPage() def teardown(self): self.main.driver.quit() @allure.feature("确认添加部门") @pytest.mark.parametrize("departmentname", get_datas()[0], ids=get_datas()[1]) def test_adddepartment(self, departmentname): departmentlist = self.main.go_to_contact_page( ).go_to_adddepartment_page().adddepartment( departmentname).save_department().get_department_list() assert departmentname in departmentlist @allure.feature("取消添加部门") @pytest.mark.parametrize("departmentname", get_datas()[2], ids=get_datas()[3]) def test_adddepartment_cancel(self, departmentname): departmentlist = self.main.go_to_contact_page( ).go_to_adddepartment_page().adddepartment( departmentname).cancel_department().get_department_list() assert departmentname not in departmentlist
def test_add_member(self): self.main = MainPage() # 1.点击添加成员,跳转到添加成员页 # 2。填写成员信息 # 3。点击保存 # 4。断言是否添加成功 assert "王翠敏" not in self.main.goto_add_member().add_member().get_member()
class TestAddMember: def test_add_member(self): self.main = MainPage() # 1.点击添加成员,跳转到添加成员页 # 2。填写成员信息 # 3。点击保存 # 4。断言是否添加成功 assert "王翠敏" not in self.main.goto_add_member().add_member().get_member() def teardown(self): self.main.quit()
class Test_ImportMember(): def test_importmember(self): filepath="/Users/ouyanxia/PycharmProjects/Lagou2QiProject/test_wework/member/tongxunlu.xlsx" filename="tongxunlu.xlsx" self.main = MainPage() newmember=self.main.goto_import_contact().import_member(filepath,filename).get_member() assert "李一" in newmember
class TestDeleteMember: def setup(self): self.main = MainPage() def test_delete_member(self): # 1点击通讯录,跳转通讯录 2、找到姓名对应的单选框勾选 3、点击删除 4、点击确认 5、验证是否删除 assert len( self.main.goto_contact().delete_all_member().get_member()) == 1
class TestAddMember: def setup(self): self.main = MainPage() def test_add_member(self): # 1.点击添加成员,跳转添加成员页面2.填写成员信息3.点击保存4.进行校验 assert "钱钱" in self.main.goto_add_member().add_member().get_member() def test_add_member_fail(self): # 1.点击添加成员,跳转添加成员页面2.填写成员信息3.点击保存点击取消4.进行校验 assert "钱钱1" not in self.main.goto_add_member().add_member_fail( ).get_member() def test_add_member_by_file(self): # 1、点击导入通讯录,跳转至通讯录页面2、点击上传文件,并上传data中的模版、点击导入,点击完成,跳转到成员页面5、进行校验 assert "张三(示例)" in self.main.goto_import_contact().upload_file( ).get_member() def teardown(self): self.main.quit()
def test_del_member(self): del_name = "李五" self.main = MainPage() assert del_name not in self.main.goto_contact().del_member(del_name)
def setup(self): self.main = MainPage()