Ejemplo n.º 1
0
 def test_edit_account_sex(self, drivers):
     '''修改性别'''
     account = AccountPage(drivers)
     AccountGender = operation_mysql().search_one(
         "SELECT * FROM user WHERE username='******'")['gender']
     account.switch_to_iframe()
     account.click_select_sex()
     account.click_save()
     account.swtich_to_default()
     account.click_confirm()
     account.click_confirm()
     newAccountGender = operation_mysql().search_one(
         "SELECT * FROM user WHERE username='******'")['gender']
     assert AccountGender != newAccountGender
Ejemplo n.º 2
0
 def test_edit_firm(self, drivers, add_testfirm, delete_testfirm):
     '''修改厂商名称、地址'''
     firm = FirmPage(drivers)
     firm.switch_to_iframe()
     firm.click_row()
     firm.click_edit()
     firm.input_firm_name("修改测试厂商1")
     firm.input_firm_address("修改测试厂商地址1")
     firm.click_save()
     firm.swtich_to_default()
     firm.click_confirm()
     firm.click_confirm()
     firm_edit_name = operation_mysql().search_one(
         sql="SELECT * FROM firm WHERE flag=0 ORDER BY created DESC LIMIT 0,1"
     )['name']
     assert firm_edit_name == '修改测试厂商1'
Ejemplo n.º 3
0
 def test_del_firm(self, drivers, add_testfirm):
     '''删除厂商'''
     firm = FirmPage(drivers)
     firm.switch_to_iframe()
     firm.click_row()
     firm.click_del()
     firm.swtich_to_default()
     firm.click_cancel()
     firm.switch_to_iframe()
     firm.click_row()
     firm.click_del()
     firm.swtich_to_default()
     firm.click_confirm()
     firm.click_confirm()
     firm_number = operation_mysql().search_all(
         sql="SELECT * FROM firm WHERE flag=0")[0]
     assert firm_number == 5
Ejemplo n.º 4
0
 def test_add_firm(self, drivers, add_firm_name, add_firm_code,
                   add_firm_address, delete_testfirm):
     '''新增厂商正常,厂商名称支持特殊字符、中文、英文、数字'''
     firm = FirmPage(drivers)
     firm.switch_to_iframe()
     firm.click_add()
     firm.input_firm_name(add_firm_name)
     firm.input_firm_address(add_firm_address)
     firm.input_firm_code(add_firm_code)
     firm.click_save()
     firm.swtich_to_default()
     firm.click_confirm()
     firm.click_confirm()
     new_firm_name = operation_mysql().search_one(
         "SELECT * FROM firm WHERE flag=0 ORDER BY created DESC LIMIT 0,1"
     )["name"]
     assert add_firm_name == new_firm_name
Ejemplo n.º 5
0
 def test_edit_account_email(self, drivers):
     '''修改邮箱'''
     account = AccountPage(drivers)
     account.switch_to_iframe()
     user_email = "105560" + str(random.randint(100, 9999)) + "@163.com"
     account.input_account_email(user_email)
     account.click_save()
     account.swtich_to_default()
     account.click_cancel()
     account.switch_to_iframe()
     account.input_account_email(user_email)
     account.click_save()
     account.swtich_to_default()
     account.click_confirm()
     account.click_confirm()
     newAccountemail = operation_mysql().search_one(
         "SELECT * FROM user WHERE username='******'")['email']
     assert newAccountemail == user_email
Ejemplo n.º 6
0
 def test_edit_account_phone(self, drivers):
     '''修改联系电话'''
     account = AccountPage(drivers)
     account.switch_to_iframe()
     user_phone = 13000000000 + random.randint(1000, 9999)
     account.input_account_phone(user_phone)
     account.click_save()
     account.swtich_to_default()
     account.click_cancel()
     account.switch_to_iframe()
     account.input_account_phone(user_phone)
     account.click_save()
     account.swtich_to_default()
     account.click_confirm()
     account.click_confirm()
     newAccountPhone = operation_mysql().search_one(
         "SELECT * FROM user WHERE username='******'")['phone']
     assert newAccountPhone == str(user_phone)
Ejemplo n.º 7
0
 def test_edit_account_nickname(self, drivers):
     '''修改昵称'''
     account = AccountPage(drivers)
     account.switch_to_iframe()
     NickName = "测试昵称" + str(random.randint(1, 100))
     account.input_account_nickname(NickName)
     account.click_save()
     account.swtich_to_default()
     account.click_cancel()
     account.switch_to_iframe()
     account.input_account_nickname(NickName)
     account.click_save()
     account.swtich_to_default()
     account.click_confirm()
     account.click_confirm()
     newAccountNickName = operation_mysql().search_one(
         "SELECT * FROM user WHERE username='******'")['nickname']
     assert newAccountNickName == NickName
Ejemplo n.º 8
0
 def test_edit_account_url(self, drivers):
     '''修改邮箱'''
     account = AccountPage(drivers)
     account.switch_to_iframe()
     user_url = "http://www.domi100.com/api" + str(random.randint(
         100, 9999))
     account.input_account_url(user_url)
     account.click_save()
     account.swtich_to_default()
     account.click_cancel()
     account.switch_to_iframe()
     account.input_account_url(user_url)
     account.click_save()
     account.swtich_to_default()
     account.click_confirm()
     account.click_confirm()
     newAccounturl = operation_mysql().search_one(
         "SELECT * FROM user WHERE username='******'")['cbUrl']
     assert newAccounturl == user_url