示例#1
0
 def test_addpartsmodel_success(self):
     """新增配件型号成功"""
     f = GetDataFile_P(addmodel_path)
     lst = f['test_addpartsmodel_success_02']
     self.obb.click_add_button()
     self.oba.select_goodstype(lst[0])
     lst[1] = self.oba.select_partsname(lst[1])
     lst[2] = lst[2] + str(random.randint(0, 10000))
     self.oba.input_partsmodel(lst[2])
     self.oba.input_partsPrice(lst[3])
     self.oba.input_Supplier(lst[4])
     self.oba.input_factory(lst[5])
     self.oba.input_Remarks(lst[6])
     self.oba.select_terminal(lst[7])
     self.oba.upload_picture(path3)
     self.oba.click_keep_button()
     sql = "select a.GOODS_TYPE,a.GOODS_NAME,b.DEVICE_MODEL,(b.UNIT_PRICE/100),b.PROVIDER,b.MANUFACTOR_INFO,b.REMARK,b.FILES" \
           " from T_GOODS_TYPE a join T_GOODS_MODEL b on a.id = b.GOODS_ID where a.goods_name = '%s' and b.DEVICE_MODEL = '%s'" % (lst[1],lst[2])
     res = self.oba.check_database(sql)
     # 断言数据库保存数据是否正确
     for i in range(len(res) - 1):
         if i != 3:
             self.assertEqual(lst[i], res[i])
         else:
             self.assertEqual(lst[i], str(res[i]))
示例#2
0
 def test_modifyterminal(self):
     """修改设备型号页面"""
     f = GetDataFile_P(modifymodel_path)
     lst = f['test_modifyterminal_success_01']
     self.obb.select_goodstype(u'设备')
     self.obb.select_goodsname(u'自动化设备')
     self.obb.click_query_button()
     bu = self.obb.check_buttonstatus()
     if bu == '开':
         self.obb.click_operation_button()
     self.obb.click_modify_button()
     lst[0] = self.obc.select_terminalname(lst[0])
     lst[1] = lst[1] + str(random.randint(10, 10000))
     self.obc.input_termodel(lst[1])
     self.obc.input_terPrice(lst[2])
     self.obc.input_Supplier(lst[3])
     self.obc.input_factory(lst[4])
     self.obc.delete_picture()
     self.obc.upload_picture(path4)
     self.obc.input_Remarks(lst[5])
     self.obc.click_keep_button()
     sql = "select a.GOODS_NAME,b.DEVICE_MODEL,(b.UNIT_PRICE/100),b.PROVIDER,b.MANUFACTOR_INFO,b.REMARK,b.FILES" \
           " from T_GOODS_TYPE a join T_GOODS_MODEL b on a.id = b.GOODS_ID where a.goods_name = '%s' and b.DEVICE_MODEL = '%s'" % (lst[0],lst[1])
     res = self.oba.check_database(sql)
     # 断言数据库保存数据是否正确
     for i in range(len(res) - 1):
         if i != 2:
             self.assertEqual(lst[i], res[i])
         else:
             self.assertEqual(lst[i], str(res[i]))
示例#3
0
 def test_modifysheshi(self):
     """修改设施页面"""
     f = GetDataFile_P(modify_path)
     lst = f['test_modifyfacilities_success_04']
     self.obb.select_goodstype(u'设施')
     self.obb.select_goodsname(u'自动化设施')
     self.obb.click_query_button()
     bu = self.obb.check_buttonstatus()
     if bu == '开':
         self.obb.click_operation_button()
     self.obb.click_modify_button()
     lst[1] = lst[1] + str(random.randint(0, 10000))
     self.obc.input_facilitiesname(lst[1])
     self.obc.input_facilitiesnum(lst[2])
     self.obc.input_facilitiesunitPrice(lst[3])
     self.obc.input_facilitiesunit(lst[4])
     self.obc.input_Supplier(lst[5])
     self.obc.input_factory(lst[6])
     self.obc.input_Remarks(lst[7])
     self.obc.delete_picture()
     self.obc.upload_picture(path1)
     self.oba.click_keep_button()
     sql = "select goods_type,goods_name,CODE,(UNIT_PRICE/100),device_unit,PROVIDER,MANUFACTOR_INFO,REMARK,FILES " \
           "from T_GOODS_TYPE where goods_name = '%s'" % lst[1]
     res = self.oba.check_database(sql)
     # 断言数据库保存数据是否正确
     for i in range(len(res)-1):
         if i != 3:
             self.assertEqual(lst[i], res[i])
         else:
             self.assertEqual(lst[i], str(res[i]))
示例#4
0
 def test_addfacilities_success(self):
     """新增设施成功"""
     f = GetDataFile_P(add_path)
     lst = f['test_addfacilities_success_04']
     self.obb.click_add_button()
     self.oba.select_goodstype(lst[0])
     lst[1] = lst[1]+str(random.randint(0,10000))
     self.oba.input_facilitiesname(lst[1])
     self.oba.input_facilitiesnum(lst[2])
     self.oba.input_facilitiesunitPrice(lst[3])
     self.oba.input_facilitiesunit(lst[4])
     self.oba.input_Supplier(lst[5])
     self.oba.input_factory(lst[6])
     self.oba.input_Remarks(lst[7])
     self.oba.upload_picture(path)
     self.oba.click_keep_button()
     sql = "select goods_type,goods_name,CODE,(UNIT_PRICE/100),device_unit,PROVIDER,MANUFACTOR_INFO,REMARK " \
           "from T_GOODS_TYPE where goods_name = '%s'"%lst[1]
     res = self.oba.check_database(sql)
     #断言数据库保存数据是否正确
     for i in range(len(res)):
         if i !=3:
             self.assertEqual(lst[i], res[i])
         else:
             self.assertEqual(lst[i], str(res[i]))
示例#5
0
 def test_modifyparts(self):
     """修改配件型号页面"""
     f = GetDataFile_P(modifymodel_path)
     lst = f['test_modifyparts_success_02']
     self.obb.select_goodstype(u'配件')
     self.obb.select_goodsname(u'自动化配件')
     self.obb.click_query_button()
     bu = self.obb.check_buttonstatus()
     if bu == '开':
         self.obb.click_operation_button()
     self.obb.click_modify_button()
     lst[0] = self.obc.select_partsname(lst[0])
     lst[1] = lst[1] + str(random.randint(10, 10000))
     self.obc.input_partsmodel(lst[1])
     self.obc.input_partsPrice(lst[2])
     self.obc.input_Supplier(lst[3])
     self.obc.click_del_button()
     self.obc.click_add_button()
     #tern,term为新增的机型设备名称和型号
     tername, termodel = self.obc.select_terminal(lst[6])
     self.obc.delete_picture()
     self.obc.upload_picture(path4)
     self.obc.input_factory(lst[4])
     self.obc.input_Remarks(lst[5])
     self.obc.click_keep_button()
     sql = "select a.GOODS_NAME,b.DEVICE_MODEL,(b.UNIT_PRICE/100),b.PROVIDER,b.MANUFACTOR_INFO,b.REMARK,b.FILES" \
           " from T_GOODS_TYPE a join T_GOODS_MODEL b on a.id = b.GOODS_ID where a.goods_name = '%s' and b.DEVICE_MODEL = '%s'" % (lst[0],lst[1])
     res = self.oba.check_database(sql)
     # 断言数据库保存数据是否正确
     for i in range(len(res) - 1):
         if i != 2:
             self.assertEqual(lst[i], res[i])
         else:
             self.assertEqual(lst[i], str(res[i]))
     # 验证图片是否修改
     # self.assertIn(u'dog', res[-1])
     #对比数据库验证新增可用机型
     sql2 = """select d.GOODS_NAME,c.DEVICE_MODEL from T_MODEL_AVAILABLE a 
     left join T_USER_INFO b on b.user_id = a.create_by left join T_GOODS_MODEL c on a.MODEL_ID = c.id 
     left join T_GOODS_TYPE d on c.GOODS_ID = d.id where a.parts_id = (select id from T_GOODS_MODEL  
     where  DEVICE_MODEL = '%s')""" % lst[1]
     #查询到新增的机型设备名称和型号
     result2 = self.obc.check_database(sql2)
     self.assertIn(tername, result2)
     self.assertIn(termodel, result2)
示例#6
0
 def test_addparts_success(self):
     """新增配件成功"""
     f = GetDataFile_P(add_path)
     lst = f['test_addparts_success_02']
     self.obb.click_add_button()
     self.oba.select_goodstype(lst[0])
     lst[1] = lst[1]+str(random.randint(0,10000))
     self.oba.input_partsname(lst[1])
     self.oba.input_partsunit(lst[2])
     self.oba.select_recycled(lst[3])
     self.oba.input_Remarks(lst[4])
     self.oba.click_keep_button()
     sql = "select goods_type,goods_name,device_unit,IS_RECOVERY,REMARK " \
           "from T_GOODS_TYPE where goods_name = '%s'"%lst[1]
     res = self.oba.check_database(sql)
     #断言数据库保存数据是否正确
     for i in range(len(res)):
         self.assertEqual(lst[i], res[i])
示例#7
0
 def test_addter2_success(self):
     """新增柜员机成功"""
     f = GetDataFile_P(add_path)
     lst = f['test_addter2_success_06']
     self.obb.click_add_button()
     self.oba.select_goodstype(lst[0])
     self.oba.select_terminaltype(lst[1])
     self.oba.input_terunit(lst[3])
     self.oba.select_standard(lst[4])
     self.oba.select_recycled(lst[5])
     self.oba.input_Remarks(lst[6])
     self.oba.click_keep_button()
     sql = "select goods_type,device_type,goods_name,device_unit,IS_STANDARD,IS_RECOVERY,REMARK " \
           "from T_GOODS_TYPE where goods_name = '%s'"%lst[2]
     res = self.oba.check_database(sql)
     #断言数据库保存数据是否正确
     for i in range(len(res)):
         self.assertEqual(lst[i], res[i])
示例#8
0
 def test_modifyparts(self):
     """修改配件页面"""
     f = GetDataFile_P(modify_path)
     lst = f['test_modifyparts_success_02']
     self.obb.select_goodstype(u'配件')
     self.obb.select_goodsname(u'自动化配件')
     self.obb.click_query_button()
     bu = self.obb.check_buttonstatus()
     if bu == '开':
         self.obb.click_operation_button()
     self.obb.click_modify_button()
     lst[1] = lst[1]+str(random.randint(0,10000))
     self.obc.input_partsname(lst[1])
     self.obc.input_partsunit(lst[2])
     self.obc.select_recycled(lst[3])
     self.obc.input_Remarks(lst[4])
     self.obc.click_keep_button()
     sql = "select goods_type,goods_name,device_unit,IS_RECOVERY,REMARK " \
           "from T_GOODS_TYPE where goods_name = '%s'" % lst[1]
     res = self.oba.check_database(sql)
     # 断言数据库保存数据是否正确
     for i in range(len(res)):
         self.assertEqual(lst[i], res[i])