test_DepartmentMember.py 774 Bytes
from atdd.PcPost import PcPost
from tests.Staff_Management.Organization.public_org import PulbicOrg
import random

# 点击组织,跳转至人员列表页面,即查询该组织下的人员情况
class DepartmentMember(PcPost):

    interfaceUrl = "/contact/Apicp/User/DepartmentMember"

    def setUp(self):
        self.do_login(self.host, self.mobile, self.psw, self.domain)

    def test_departmentMember(self):
        top_Id = PulbicOrg().get_top_org()
        dpId_all = PulbicOrg().get_all_dpId(top_Id)  # 所有部门的dpId
        x = random.randint(0, len(dpId_all) - 1)  # 在所有部门中随机取一个部门
        data = {
            "department_id[0]": dpId_all[x]
        }
        result = self.PcPost(self.interfaceUrl,data)
        print(result)