def test_uploadnum_case(self):
     '''图片上传控件上传数量'''
     comp = FileUploadPage(self.driver)
     name = '图片上传控件上传数量'
     compname = '图片上传控件_最大上传数量'
     comp.scroll_to_pic_upload_btn(compname)
     comp.hide_activity_box()  #隐藏操作按钮栏
     file_path = comp.get_file_path("大于50KB.jpg")
     file_path2 = comp.get_file_path("小于50KB.jpg")
     attr = comp.getcompatrr(compname, 'limitnumber')
     self.assertEqual('1', attr, msg=name + '检验不通过')
     comp.picture_upload(compname, file_path2)  #上传图片
     comp.click_pictureupload_btn(compname)
     text = comp.adjustalertexistence()
     self.assertEqual("文件上传超出数量限制。", text, msg=name + '检验不通过')
Example #2
0
 def test_recalculation_case(self):
     '''文件上传控件刷新重计算'''
     comp = FileUploadPage(self.driver)
     name = '文件上传控件重计算'
     compname = '文件上传_重计算'
     compname2 = '文件上传_刷新'
     comp.scroll_to_file_upload_btn(compname2)
     comp.hide_activity_box()
     file_path = comp.get_file_path("大于100kb.doc")  #返回大于100kb.doc的路径
     bool1 = comp.check_existence(compname)  #判断文件上传控件是否存在
     self.assertTrue(bool1, msg=name + '检验不通过')
     comp.wait_loading_hide()
     comp.file_upload(compname2, file_path)
     comp.wait_refresh_loading_back_show_then_hide()
     bool2 = comp.upload_btn_is_invisibility(compname)
     self.assertTrue(bool2, msg=name + '检验不通过')
Example #3
0
 def test_sort_case(self):
     '''文件上传控件排序'''
     comp = FileUploadPage(self.driver)
     name = '文件上传_文件排序'
     compname = '文件上传_文件排序'
     file_path = comp.get_file_path("大于100kb.doc")
     file_path2 = comp.get_file_path("小于100KB.txt")
     comp.scroll_to_file_upload_btn(compname)
     comp.hide_activity_box()
     comp.wait_loading_hide()
     comp.file_upload(compname, file_path)  #上传文件大于100kb.doc
     #time.sleep(0.5)
     comp.wait_loading_hide()
     comp.file_upload(compname, file_path2)
     #time.sleep(0.5)
     text = comp.get_first_item_text(compname)  #上传控件的第一个上传文件的text
     self.assertIn('大于100kb.doc', text, msg=name + '检验不通过')
     comp.click_fiest_item_down(compname)
     #time.sleep(0.5)
     text1 = comp.get_first_item_text(compname)  #上传控件的第一个上传文件的text
     self.assertIn('小于100KB.txt', text1, msg=name + '检验不通过')