def test_repeatSelectExistingTasks_succeed_run11(self): '''选择已有任务,重新选择后,验证是否成功''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.clickManualDetectButton() sleep(2) me.clickChooseBtn() me.clickDropDownBtn() me.clickOldTaskchoise() me.clickConfirmTaskBtn() me.clickRechoiseBtn() try: self.assertTrue(me.isRechoiseClickable(), "-----重新选择不可点击------") me.clickDropDownBtn() rechoise_name = me.clickSecendOldTaskchoise() me.clickConfirmTaskBtn() confirm_name = me.getCreatTaskName() self.assertEqual(rechoise_name, confirm_name, "-----重新选择已有任务失败-----") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "repeatSelectExistingTasks_succeed.jpg") sleep(3)
def test_creatNewTask_isnull_run04(self): '''新建任务,任务名称为空''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.clickManualDetectButton() me.clickConfirmTaskBtn() try: self.assertTrue(me.isCreatAlertExist(), "-----没有错误提示-----") is_null_alert = me.getCreatTaskALert() self.assertEqual(is_null_alert, "任务名不能为空", "-------任务名称为空未提示--------") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "creatNewTask_isnull.jpg") sleep(3)
def test_creatNewTask_succeed_run01(self): '''新建任务成功''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.clickManualDetectButton() task_name = me.getDifferName() me.inputCreatTaskBox(task_name) me.clickConfirmTaskBtn() confirm_name = me.getCreatTaskName() try: self.assertEqual(task_name, confirm_name, "-----新建任务失败-----") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "creatNewTask_succeeful.jpg") sleep(3)
def test_creatNewTask_overlong_run05(self): '''新建任务,任务名称过长''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.clickManualDetectButton() task_name = me.getOverLongName() me.inputCreatTaskBox(task_name) me.clickConfirmTaskBtn() try: self.assertTrue(me.isCreatAlertExist(), "-----没有错误提示-----") over_long_alert = me.getCreatTaskALert() self.assertEqual(over_long_alert, "任务名不能超过16位", "-------任务名称过长未提示-------") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "creatNewTask_overlong.jpg") sleep(3)
def test_creatNewTask_sameName_run03(self): '''新建任务,任务名称重复''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.clickManualDetectButton() old_name = me.getSameName() me.inputCreatTaskBox(old_name) me.clickConfirmTaskBtn() try: self.assertTrue(me.isCreatAlertExist(), "-----没有错误提示-----") same_name_alert = me.getCreatTaskALert() self.assertEqual(same_name_alert, "您已创建过该任务;请重新创建或在已有任务中选择", "-----名称重复未提示-----") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "creatNewTask_sameName.jpg") sleep(3)
def test_selectExistingTasks_succeed_run02(self): '''选择已有任务成功''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.clickManualDetectButton() sleep(5) me.clickChooseBtn() me.clickDropDownBtn() old_name = me.clickOldTaskchoise() me.clickConfirmTaskBtn() confirm_name = me.getCreatTaskName() try: self.assertEqual(old_name, confirm_name, "-----选择已有任务失败-----") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "selectExistingTasks_succeed.jpg") sleep(3)
def test_selectExistingTasks_isnull_run07(self): '''不选择已有任务,直接点击''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.clickManualDetectButton() sleep(2) me.clickChooseBtn() me.clickConfirmTaskBtn() try: self.assertTrue(me.isOldAlertExist, "-----没有错误提示-----") is_null_alert = me.getOldTaskAlert() self.assertEqual(is_null_alert, "没有您输入的已有任务", "-------选择已有任务失败-------") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "selectExistingTasks_isnull.jpg") sleep(3)
def test_modifyCreatNewTask_isnull_run10(self): '''新建任务后,修改任务名称名为空的提示验证''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.clickManualDetectButton() task_name = me.getDifferName() me.inputCreatTaskBox(task_name) me.clickConfirmTaskBtn() me.clickModifyBtn() me.inputCreatTaskBox("") me.clickConfirmTaskBtn() same_name_alert = me.getCreatTaskALert() try: self.assertEqual(same_name_alert, "任务名不能为空", "-----任务名称为空未提示-----") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "modifyCreatNewTask_isnull.jpg") sleep(3)
def test_modifyCreatNewTask_samename_run09(self): '''新建任务后,修改任务名称名称重复的提示验证''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.clickManualDetectButton() task_name = me.getDifferName() me.inputCreatTaskBox(task_name) me.clickConfirmTaskBtn() me.clickModifyBtn() me.inputCreatTaskBox(task_name) me.clickConfirmTaskBtn() same_name_alert = me.getCreatTaskALert() try: self.assertEqual(same_name_alert, "您已创建过该任务;请重新创建或在已有任务中选择", "-----任务名称重复未提示-----") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "modifyCreatNewTask_samename.jpg") sleep(3)
def test_modifyCreatNewTask_succeed_run08(self): '''新建任务后,对任务名称进行修改''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.clickManualDetectButton() task_name = me.getDifferName() me.inputCreatTaskBox(task_name) me.clickConfirmTaskBtn() me.clickModifyBtn() modify_name = me.getDifferName() me.inputCreatTaskBox(modify_name) me.clickConfirmTaskBtn() confirm_name = me.getCreatTaskName() try: self.assertEqual(modify_name, confirm_name, "------修改任务名称失败--------") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "modifyCreatNewTask_succeed.jpg") sleep(3)