예제 #1
0
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
예제 #2
0
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