def test_start(self): xls_road = manage_case_road().get_road() # 获取回归用例文件路径 xls = excel(xls_road) words = xls.getCellValue(7, 2) desire_words = xls.getCellValue(7, 3) print("西班牙语自动纠错测试开始") try: util.keyboard_show(self) time.sleep(1) self.driver.keyevent(123) # 光标移动到末尾 for i in range(len(words) + 1): # 根据输入内容单元格点击对应按键 word = words[i - 1:i] print(word) util.input_by_tag(word, self) samsung6_inputkey.space(self, 0) # 点击空格上屏 message = util.gettext(self) xls.setCellValue(7, 5, message) # 实际上屏内容 if len(message) <= 0: xls.setCellValue(7, 4, "输入框内容为空,测试结果错误") # 保存测试结论 time.sleep(1) elif message == desire_words: # 将输入框内容message转换成小写字母和tag对比 xls.setCellValue(7, 4, "上屏成功,自动纠错成功") # 保存测试结论 time.sleep(1) elif len(message) > 1 and message != desire_words: xls.setCellValue(7, 4, "上屏成功,自动纠错错误") # 保存测试结论 time.sleep(1) xls.saveData(xls_road) # 保存xlsx文档 time.sleep(1) except OSError: pass finally: util.cleartext(self) self.driver.keyevent(4) print("西班牙语自动纠错测试结束")
def test_start(self): xls_road = manage_case_road().get_road() # 获取回归用例文件路径 xls = excel(xls_road) words = xls.getCellValue(9, 2) desire_words = xls.getCellValue(9, 3) print("西班牙语滑行输入测试开始") try: util.keyboard_show(self) self.driver.keyevent(123) # 光标移动到末尾 time.sleep(1) self.driver.swipe(507, 1113, 604, 890, 700) # 滑行输入 no samsung6_inputkey.space(self, 0) time.sleep(1) message = util.gettext(self) xls.setCellValue(8, 5, message) # 实际上屏内容 if len(message) <= 0: xls.setCellValue(8, 4, "输入框内容为空,测试结果错误") # 保存测试结论 time.sleep(1) elif message == desire_words: # 将输入框内容message转换成小写字母和tag对比 xls.setCellValue(8, 4, "滑动输入上屏成功,内容正确") # 保存测试结论 time.sleep(1) elif len(message) > 0 and message != desire_words: xls.setCellValue(8, 4, "滑动输入上屏成功,内容错误") # 保存测试结论 time.sleep(1) xls.saveData(xls_road) time.sleep(1) except OSError: pass finally: util.cleartext(self) self.driver.keyevent(4) print("西班牙语滑行输入测试结束")
def test_start(self): xls_road = manage_case_road().get_road() # 获取回归用例文件路径 xls = excel(xls_road) words = xls.getCellValue(4, 2) # 获取英语纠错点击按键内容 try: util.keyboard_show(self) time.sleep(1) print(words) print("英语长按上屏测试开始") time.sleep(1) # 根据输入内容单元格点击对应按键 for i in range(len(words) + 1): word = words[i - 1:i] print(word) util.input_by_tag(word, self) samsung6_inputkey.longpress_sugg(self, 1200) samsung6_inputkey.longpress_sugg_input(self, 0) time.sleep(1) message = util.gettext(self) xls.setCellValue(4, 5, message) # 实际上屏内容 if len(message) <= 0: xls.setCellValue(4, 4, "输入框内容为空,测试结果错误") time.sleep(1) elif message is not None: # 将输入框内容message转换成小写字母和tag对比 xls.setCellValue(4, 4, "输入内容不为空,上屏成功") time.sleep(1) xls.saveData(xls_road) time.sleep(1) except OSError: pass finally: util.cleartext(self) self.driver.keyevent(4) print("英语长按候选词栏上屏测试结束")
def test_start(self): xls_road = manage_case_road().get_road() # 获取回归用例文件路径 xls = excel(xls_road) words = xls.getCellValue(2, 2) desire_words = xls.getCellValue(2, 3) print(words) print("英语点击上屏测试开始") try: util.keyboard_show(self) time.sleep(1) for i in range(len(words) + 1): # 根据输入内容单元格点击对应按键 word = words[i - 1:i] print(word) util.input_by_tag(word, self) time.sleep(1) samsung6_inputkey.click_mid_sugg(self, 0) message = util.gettext(self) xls.setCellValue(2, 5, message) # 保存实际上屏内容 if len(message) <= 0: xls.setCellValue(2, 4, "输入框内容为空,测试结果错误") # 保存测试结论 time.sleep(1) elif message == desire_words: # 将输入框内容message转换成小写字母和tag对比 xls.setCellValue(2, 4, "上屏成功,输入内容正确") time.sleep(1) elif len(message) > 0 and message != desire_words: xls.setCellValue(2, 4, "上屏成功,输入内容错误") time.sleep(1) xls.saveData(xls_road) time.sleep(1) except OSError: pass finally: util.cleartext(self) self.driver.keyevent(4) print("英语点击上屏测试结束")
def test_start(self): xls_road = manage_case_road().get_road() # 获取回归用例文件路径 xls = excel(xls_road) words = xls.getCellValue(3, 2) # 获取英语纠错点击按键内容 desire_words = xls.getCellValue(3, 3) # 获取预期上屏内容 try: util.keyboard_show(self) time.sleep(1) print(words) print("英语自动纠错测试开始") time.sleep(1) # 根据输入内容单元格点击对应按键 for i in range(len(words) + 1): word = words[i - 1:i] print(word) util.input_by_tag(word, self) time.sleep(1) samsung6_inputkey.space(self, 0) # 上屏 copy message = util.gettext(self) xls.setCellValue(3, 5, message) # 保存实际上屏内容 if len(message) <= 0: xls.setCellValue(3, 4, "输入框内容为空,测试结果错误") time.sleep(1) elif message == desire_words: # 将输入框内容message转换成小写字母和tag对比 xls.setCellValue(3, 4, "自动纠错成功,上屏成功") time.sleep(1) elif len(message) > 1 and message != desire_words: xls.setCellValue(3, 4, "自动纠错错误,上屏成功") time.sleep(1) xls.saveData(xls_road) time.sleep(1) except OSError: pass finally: util.cleartext(self) self.driver.keyevent(4) print("英语自动纠错测试结束")