Commit 6f9be715ae9aadab8be612c1865da3e25b7252a8

Authored by 季培红
1 parent 57515b13

org

tests/Staff_Management/Organization/public_org.py
1 1  
2 2 from atdd.PcPost import PcPost
  3 +import random
3 4  
4 5 class PulbicOrg(PcPost):
5 6 url_ListChildren = "/Contact/Apicp/Department/ListChildren"
... ... @@ -38,8 +39,9 @@ class PulbicOrg(PcPost):
38 39 user_total = result['result']['list'][0]['user_total']
39 40 return user_total
40 41  
41   -
42   -
43   -
44   -
45   -
  42 + # 随机取一个部门,返回部门ID
  43 + def get_random_dptId(self):
  44 + top_Id = self.get_top_org()
  45 + dpId_all = self.get_all_dpId(top_Id) # 所有部门的dpId
  46 + x = random.randint(0, len(dpId_all) - 1) # 在所有部门中随机取一个部门
  47 + return dpId_all[x]
46 48 \ No newline at end of file
... ...
tests/Staff_Management/Organization/test_changeOrder.py 0 → 100644
  1 +from atdd.PcPost import PcPost
  2 +from tests.Staff_Management.Organization.public_org import PulbicOrg
  3 +
  4 +class ChangeOrder(PcPost):
  5 +
  6 + interfaceUrl = "/Contact/Apicp/Department/ChangeOrder"
  7 +
  8 + def setUp(self):
  9 + self.do_login(self.host, self.mobile, self.psw, self.domain)
  10 +
  11 + def test_changeOrder(self):
  12 + # 随机取一个部门
  13 + dptId = PulbicOrg().get_random_dptId()
  14 + data = {
  15 + "department_id": dptId,
  16 + "order":12
  17 + }
  18 + result = self.PcPost(self.interfaceUrl,data)
  19 + print(result)
  20 + return result
  21 +
... ...
tests/Staff_Management/Organization/test_DepartmentMember.py renamed to tests/Staff_Management/Organization/test_departmentMember.py
1 1 from atdd.PcPost import PcPost
2 2 from tests.Staff_Management.Organization.public_org import PulbicOrg
3   -import random
  3 +
4 4  
5 5 # 点击组织,跳转至人员列表页面,即查询该组织下的人员情况
6 6 class DepartmentMember(PcPost):
... ... @@ -11,11 +11,10 @@ class DepartmentMember(PcPost):
11 11 self.do_login(self.host, self.mobile, self.psw, self.domain)
12 12  
13 13 def test_departmentMember(self):
14   - top_Id = PulbicOrg().get_top_org()
15   - dpId_all = PulbicOrg().get_all_dpId(top_Id) # 所有部门的dpId
16   - x = random.randint(0, len(dpId_all) - 1) # 在所有部门中随机取一个部门
  14 + # 随机取一个部门ID
  15 + dptId = PulbicOrg().get_random_dptId()
17 16 data = {
18   - "department_id[0]": dpId_all[x]
  17 + "department_id[0]": dptId
19 18 }
20 19 result = self.PcPost(self.interfaceUrl,data)
21 20 print(result)
22 21 \ No newline at end of file
... ...
tests/Staff_Management/Organization/test_search_org.py
... ... @@ -14,7 +14,7 @@ class SearchOrg(PcPost):
14 14 # 搜索存在的组织
15 15 def test_search_org(self):
16 16 data = {
17   - "keyword": 123
  17 + "keyword": '小仙女'
18 18 }
19 19 result = self.PcPost(self.interfaceUrl,data)
20 20 print(result)
... ...
tests/Staff_Management/Organization/tets_edit_org.py 0 → 100644
  1 +from atdd.PcPost import PcPost
  2 +from tests.Staff_Management.Organization.public_org import PulbicOrg
  3 +
  4 +
  5 +# 编辑组织
  6 +class EditOrg(PcPost):
  7 +
  8 + interfaceUrl = "/contact/Apicp/Department/EditQuery"
  9 +
  10 + def setUp(self):
  11 + self.do_login(self.host, self.mobile, self.psw, self.domain)
  12 +
  13 + def test_edit_query(self):
  14 + # 随机取一个部门ID
  15 + dptId = PulbicOrg().get_random_dptId()
  16 +
  17 + data = {
  18 + "department_id": dptId
  19 + }
  20 + result = self.PcPost(self.interfaceUrl,data)
  21 + print(result)
  22 + return result
  23 +
... ...