def test_06_out_of_date_workers(self):
     # 对过期的工人发起合同
     ws_driver = get_ws_driver(self.ws_url)
     sid = login(ws_driver, self.username, self.password)
     workers_name = get_save_mobile_number()
     user = login(ws_driver, workers_name, self.password)
     workflow_process_create(ws_driver, sid['data']['sid'],
                             user['data']['user_id'], 0)
     web_login(self.browser, self.username1, self.password)
     verify_worker_exists(self.browser, user['data']['realname'])
 def test_01_new_payroll(self):
     money = random.randint(20, 1000)
     web_workman_register(self.driver, self.mobile, self.code, self.password)
     # 实名认证
     verify_real_name(self.driver, self.people_name, self.identity, self.file_path, self.file_path)
     logout(self.driver)
     # 劳务经理登陆
     sid = login(self.ws_driver, self.username, self.password)
     workflow_process_create(self.ws_driver, sid['data']['sid'],
                             login(self.ws_driver, self.mobile, self.password)['data']['user_id'])
     web_login(self.driver, self.username, self.password)
     new_payroll(self.driver, self.payroll_name, money)
Beispiel #3
0
 def test_add_face_worker(self):
     pwd = 123456
     sid = login(self.ws_driver, self.username, pwd)
     i = 0
     while True:
         identity_number = getDistrictCode()
         name = get_people_name()
         sex_str = "男女"
         sex = random.choice(sex_str)
         birthday = get_pass_dates(random.randint(7500, 25550))
         overdue = '2008/08/15-2020/08/15'
         mobile = get_phone_number()
         print(mobile)
         characteristic_value = random_face_eigenvalues()
         user = quick_register(self.ws_driver, sid['data']['sid'],
                               identity_number, name, sex, birthday,
                               overdue, self.file_path, self.file_path,
                               mobile, characteristic_value)
         workflow_process_create(self.ws_driver, sid['data']['sid'],
                                 user['data']['user_id'])
         i += 1
         if i > self.number:
             break
         else:
             pass
    def test_01_workman_contract_time(self):

        # 工人注册
        web_workman_register(self.browser, self.mobile, self.code,
                             self.password)
        save_mobile_number(self.mobile)
        # 实名认证

        verify_real_name(self.browser, self.people_name, self.identity,
                         self.file_path, self.file_path)
        logout(self.browser)
        # 劳务经理登陆
        ws_driver = get_ws_driver(self.ws_url)
        sid = login(ws_driver, self.username, self.password)
        workflow_process_create(
            ws_driver, sid['data']['sid'],
            login(ws_driver, self.mobile, self.password)['data']['user_id'])
 def test_05_terminating_contract(self):
     # 合同终止
     web_login(self.browser, self.username, self.password)
     workers_name = get_save_mobile_number()
     ws_driver = get_ws_driver(self.ws_url)
     termination_of_the_contract(
         self.browser,
         login(ws_driver, workers_name, self.password)['data']['realname'])
 def test_03_modify_comments(self):
     # 修改评价
     web_login(self.browser, self.username, self.password)
     workers_mobile = get_save_mobile_number()
     ws_driver = get_ws_driver(self.ws_url)
     evaluation_of_worker(
         self.browser,
         login(ws_driver, workers_mobile,
               self.password)['data']['realname'], '修改评价')
 def test_02_evaluation_worker(self):
     # 评价工人
     web_login(self.browser, self.username, self.password)
     workers_mobile = get_save_mobile_number()
     ws_driver = get_ws_driver(self.ws_url)
     evaluation_of_worker(
         self.browser,
         login(ws_driver, workers_mobile,
               self.password)['data']['realname'])
Beispiel #8
0
 def test_upload_file(self):
     while True:
         mobile = get_phone_number()
         sid = login(self.ws_driver,
                     worker_register(self.ws_driver, mobile))
         p1 = Process(target=upload_file, args=('back', sid))
         p2 = Process(target=upload_file, args=('face', sid))
         p1.start()
         p2.start()
         p1.join()
         p2.join()
         self.i += 1
         if self.i > self.number:
             break
def employee_operation_the_all_workflow(driver, ws_driver, position):
    """

    :param ws_driver:
    :param driver:
    :param position: 1 项目经理 2 劳务经理
    :return:
    """
    conf = ConfigParser()
    path = setting_path()
    conf.read(path)
    pwd = 123456
    if position == 1:
        username = conf.get('projectManager', 'taohui')
        web_login(driver, username, pwd)
        login(ws_driver, username, pwd)
    elif position == 2:
        username = conf.get('labor', 'Wuhuigang')
        web_login(driver, username, pwd)
        login(ws_driver, username, pwd)
    else:
        print('请输入整数(1 :项目经理 2: 劳务经理)')
    operation_the_all_workflow(driver)
Beispiel #10
0
 def test_02_EmployeeRegistration(self):
     # 通过企业运维sid 获取所有的公司名称
     sid = login(self.ws_driver, self.username, self.password)
     all_company_info = company_list(self.ws_driver, sid['data']['sid'])
     all_company_name = []
     h = 0
     for i in all_company_info['data']['company']:
         print(i)
         all_company_name.insert(h, i["name"])
         h += 1
     company_name = all_company_name[random.randint(0, len(all_company_name)-1)]
     web_employee_registration(self.browser, self.people_name, self.mobile, self.password, company_name)
     # 实名认证
     verify_real_name(self.browser, self.people_name, self.identity, self.file_path, self.file_path)
     logout(self.browser)
Beispiel #11
0
 def test_employee_register(self):
     sid = login(self.operation)
     new_company_id = company_add(sid)
     t = time.time()
     while True:
         p1 = Process(target=employee_register, args=(new_company_id, ))
         p2 = Process(target=employee_register, args=(new_company_id, ))
         p3 = Process(target=employee_register, args=(new_company_id, ))
         p4 = Process(target=employee_register, args=(new_company_id, ))
         p1.start()
         p2.start()
         p3.start()
         p4.start()
         p1.join()
         p2.join()
         p3.join()
         p4.join()
         self.i += 1
         if self.i > self.number:
             break
     print(time.time() - t)