test_Invitation_authority.py 1.34 KB
import random

from AdminSettings.Job_setting.test_jobSetting import JobSetting
from AdminSettings.Role_setting.test_roleSetting import RoleSetting
from atdd.PcPost import PcPost


class InvitationAuth(PcPost):

    interfaceUrl = "/Public/Apicp/ChooseMem/ConfirmChoose"

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

    # 选择成员
    def test_invitationauth_mem(self):
        data = {
            "_identifier": "yuanquan",
            "memArray[0][memID]": self.jipeihong_uid
        }
        result = self.PcPost(self.interfaceUrl,data)
        print(result)
        return result

    # 选择岗位
    def test_invitationauth_job(self):
        jobIdList = JobSetting().get_all_jobId()
        x = random.randint(0,len(jobIdList)-1)
        data = {
            "_identifier": "yuanquan",
            "jobArray[0][jobID]": jobIdList[x]
        }
        result = self.PcPost(self.interfaceUrl,data)
        print(result)
        return result

    # 选择角色
    def test_invitationauth_role(self):
        roleIdList = RoleSetting().get_all_roleId()
        x = random.randint(0,len(roleIdList)-1)
        data = {
            "_identifier": "yuanquan",
            "roleArray[0][roleID]": roleIdList[x]
        }
        result = self.PcPost(self.interfaceUrl,data)
        print(result)
        return result