Exemplo n.º 1
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 setUp(self):
     # 实例化一个火狐配置文件
     fp = browse_driver.FirefoxProfile()
     # 设置各项参数,参数可以通过在浏览器地址栏中输入about:config查看。
     # 设置成0代表下载到桌面,1代表浏览器默认下载路径;设置成2则可以保存到指定目录
     fp.set_preference("browser.download.folderList", 2)
     # 是否显示开始,(个人实验,不管设成True还是False,都不显示开始,直接下载)
     fp.set_preference("browser.download.manager.showWhenStarting", False)
     # 下载到指定目录
     fp.set_preference("browser.download.dir", test_report_path())  # 路径名称文件夹设置成英文,不然不能下载到指定目录
     # 不询问下载路径;后面的参数为要下载页面的Content-type的值
     fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/vnd.ms-excel")
     config = ConfigParser()
     config.read(setting_path())
     self.file_path = r'C:\Users\%s\Desktop\UIAutotest\Page\file\1.jpg' % (str(getpass.getuser()))
     self.driver = browse_driver.Firefox(firefox_profile=fp)
     self.driver.maximize_window()
     self.driver.get(config.get('testUrl', 'url'))
     self.username = config.get('labor', 'Wuhuigang')
     self.password = config.get('operation', 'password')
     ws_url = config.get('testUrl', 'ws_test_url')
     ws = create_connection("ws://%s/wsapi" % ws_url)
     self.ws_driver = BuilderBaseFunc(ws, ws_url)
     self.payroll_name = get_people_name()
     self.mobile = get_mobile()
     self.code = '11111'
     self.people_name = get_people_name()
     # 随机身份证
     self.identity = getDistrictCode()
 def setUpClass(cls):
     config = ConfigParser()
     cls.path = setting_path()
     cls.file_path = r'C:\Users\%s\Desktop\UIAutotest\Page\file\1.jpg' % (str(getpass.getuser()))
     config.read(cls.path)
     url = config.get('testUrl', 'url')
     cls.password = config.get('operation', 'password')
     # 随机姓名
     cls.people_name = get_people_name()
     # 随机身份证
     cls.identity = getDistrictCode()
     cls.browser = browse_driver.Firefox()
     cls.browser.maximize_window()
     cls.browser.get(url)
     cls.mobile = get_mobile()
     cls.code = 11111
     web_workman_register(cls.browser, cls.mobile, cls.code, cls.password)
Exemplo n.º 4
0
 def setUp(self):
     config = ConfigParser()
     self.path = setting_path()
     self.file_path = r'C:\Users\%s\Desktop\UIAutotest\Page\file\1.jpg' % (str(getpass.getuser()))
     config.read(self.path)
     url = config.get('testUrl', 'url')
     self.password = config.get('operation', 'password')
     # 随机姓名
     self.people_name = getPeopleName()
     # 随机身份证
     self.identity = getDistrictCode()
     self.browser = browse_driver.Firefox()
     self.browser.maximize_window()
     self.browser.get(url)
     self.mobile = get_mobile()
     self.new_password = 654321
     self.code = 11111
     self.get_new_mobile = get_mobile()
Exemplo n.º 5
0
 def setUp(self):
     config = ConfigParser()
     self.path = setting_path()
     self.file_path = r'C:\Users\%s\Desktop\UIAutotest\Page\file\1.jpg' % (str(getpass.getuser()))
     config.read(self.path)
     url = config.get('testUrl', 'url')
     self.username = config.get('labor', 'Wuhuigang')
     self.username1 = config.get('projectManager', 'taohui')
     self.password = config.get('operation', 'password')
     # 随机姓名
     self.people_name = getPeopleName()
     # 随机身份证
     # 工件名称
     self.artifact = self.people_name + '的工件'
     self.identity = getDistrictCode()
     self.browser = browse_driver.Firefox()
     self.browser.maximize_window()
     self.browser.get(url)
     self.mobile = get_mobile()
     self.new_password = 654321
     self.code = 11111
 def setUp(self):
     config = ConfigParser()
     self.path = setting_path()
     self.file_path = file_path('1')
     config.read(self.path)
     url = config.get('testUrl', 'url')
     self.ws_url = config.get('testUrl', 'ws_test_url')
     self.username = config.get('labor', 'Wuhuigang')
     self.username1 = config.get('operation', 'username')
     self.password = config.get('operation', 'password')
     # 随机姓名
     self.people_name = get_people_name()
     # 随机身份证
     # 工件名称
     self.artifact = self.people_name + '的工件'
     self.identity = getDistrictCode()
     self.browser = browse_driver.Firefox()
     self.browser.maximize_window()
     self.browser.get(url)
     self.mobile = get_mobile()
     self.new_password = 654321
     self.code = 11111
Exemplo n.º 7
0
 def setUp(self):
     config = ConfigParser()
     self.path = setting_path()
     self.file_path = file_path('1')
     config.read(self.path)
     url = config.get('testUrl', 'url')
     ws_url = config.get('testUrl', 'ws_test_url')
     ws = create_connection("ws://%s/wsapi" % ws_url)
     self.ws_driver = BuilderBaseFunc(ws, ws_url)
     self.username = config.get('operation', 'username')
     self.password = config.get('operation', 'password')
     # 随机姓名
     self.people_name = get_people_name()
     # 随机身份证
     self.identity = getDistrictCode()
     self.browser = browse_driver.Firefox()
     self.browser.maximize_window()
     self.browser.get(url)
     self.mobile = get_mobile()
     self.new_password = 654321
     self.code = 11111
     self.get_new_mobile = get_mobile()