From 75a02d813f4712079dfa2bc176a90c97a068b593 Mon Sep 17 00:00:00 2001 From: redjie Date: Thu, 27 Oct 2022 15:08:16 +0800 Subject: [PATCH] =?UTF-8?q?snapshot=5Fdisplay=E6=94=B9=E5=8F=98=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=A0=BC=E5=BC=8Fpng->jpeg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: redjie Change-Id: Iaa6021bdc65b111081e2bdad70ef08a8be4c1705 --- .../testcases/DistributedTest.py | 30 +++++++++---------- screenshot32/resource/capturescreentest.py | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/screenshot32/DistributedTest/testcases/DistributedTest.py b/screenshot32/DistributedTest/testcases/DistributedTest.py index 920df19..6de3591 100644 --- a/screenshot32/DistributedTest/testcases/DistributedTest.py +++ b/screenshot32/DistributedTest/testcases/DistributedTest.py @@ -39,26 +39,26 @@ class DistributedTest(TestCase): # 授权 CommonOH.click(self.Phone1, 500, 706) CommonOH.click(self.Phone1, 500, 706) - CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step1.png") - CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step1.png testcases\\distributedcalc_step1.png") + CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step1.jpeg") + CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step1.jpeg testcases\\distributedcalc_step1.jpeg") CommonOH.click(self.Phone1, 610, 110) time.sleep(2) CommonOH.click(self.Phone1, 380, 1150) CommonOH.click(self.Phone1, 610, 110) time.sleep(2) - CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step2.png") - CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step2.png testcases\\distributedcalc_step2.png") + CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step2.jpeg") + CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step2.jpeg testcases\\distributedcalc_step2.jpeg") CommonOH.click(self.Phone1, 580, 1090) time.sleep(2) - CommonOH.hdc_std(self.Phone2, "shell snapshot_display -f /data/distributedcalc_step3.png") - CommonOH.hdc_std(self.Phone2, "file recv /data/distributedcalc_step3.png testcases\\distributedcalc_step3.png") + CommonOH.hdc_std(self.Phone2, "shell snapshot_display -f /data/distributedcalc_step3.jpeg") + CommonOH.hdc_std(self.Phone2, "file recv /data/distributedcalc_step3.jpeg testcases\\distributedcalc_step3.jpeg") #确定 CommonOH.click(self.Phone2, 520, 520) CommonOH.click(self.Phone2, 520, 520) - CommonOH.hdc_std(self.Phone2, "shell snapshot_display -f /data/distributedcalc_step4.png") - CommonOH.hdc_std(self.Phone2, "file recv /data/distributedcalc_step4.png testcases\\distributedcalc_step4.png") + CommonOH.hdc_std(self.Phone2, "shell snapshot_display -f /data/distributedcalc_step4.jpeg") + CommonOH.hdc_std(self.Phone2, "file recv /data/distributedcalc_step4.jpeg testcases\\distributedcalc_step4.jpeg") time.sleep(2) - code = Orc("testcases\\distributedcalc_step4.png") + code = Orc("testcases\\distributedcalc_step4.jpeg") self.code = re.findall("[0-9]{6}", code)[0] #输pin码 CommonOH.click(self.Phone1, 340, 530) @@ -75,10 +75,10 @@ class DistributedTest(TestCase): CommonOH.click(self.Phone1, 46 + j * 70, 778) time.sleep(1) CommonOH.click(self.Phone1, 60, 1145) - CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step5.png") + CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step5.jpeg") # 确定 CommonOH.click(self.Phone1, 500, 600) - CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step5.png testcases\\distributedcalc_step5.png") + CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step5.jpeg testcases\\distributedcalc_step5.jpeg") def sub_distributed_smoke_testcase_0300(self): # 切入后台,结束进程 @@ -90,8 +90,8 @@ class DistributedTest(TestCase): # 拉起远端设备 CommonOH.click(self.Phone1, 610, 110) time.sleep(3) - CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step6.png") - CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step6.png testcases\\distributedcalc_step6.png") + CommonOH.hdc_std(self.Phone1, "shell snapshot_display -f /data/distributedcalc_step6.jpeg") + CommonOH.hdc_std(self.Phone1, "file recv /data/distributedcalc_step6.jpeg testcases\\distributedcalc_step6.jpeg") CommonOH.click(self.Phone1, 580, 1090) CommonOH.click(self.Phone1, 580, 1090) # 设备二授权 @@ -99,8 +99,8 @@ class DistributedTest(TestCase): CommonOH.click(self.Phone2, 500, 706) CommonOH.click(self.Phone2, 500, 706) # 校验远端计算器是否被拉起 - CommonOH.hdc_std(self.Phone2, "shell snapshot_display -f /data/distributedcalc_step7.png") - CommonOH.hdc_std(self.Phone2, "file recv /data/distributedcalc_step7.png testcases\\distributedcalc_step7.png") + CommonOH.hdc_std(self.Phone2, "shell snapshot_display -f /data/distributedcalc_step7.jpeg") + CommonOH.hdc_std(self.Phone2, "file recv /data/distributedcalc_step7.jpeg testcases\\distributedcalc_step7.jpeg") CommonOH.hdc_std(self.Phone2, 'shell "aa dump -a | grep distributedcalc > /data/report.txt"') CommonOH.hdc_std(self.Phone2, "file recv /data/report.txt testcases\\report.txt") time.sleep(1) diff --git a/screenshot32/resource/capturescreentest.py b/screenshot32/resource/capturescreentest.py index 5f9d72c..1994e2f 100644 --- a/screenshot32/resource/capturescreentest.py +++ b/screenshot32/resource/capturescreentest.py @@ -169,7 +169,7 @@ def sandbox_check(process): def is_image_file(filename): - IMG_EXTENSIONS = ['.png', '.PNG'] + IMG_EXTENSIONS = ['.png', '.PNG', 'jpeg'] return any(filename.endswith(extension) for extension in IMG_EXTENSIONS) def picture_save(pic_path): -- Gitee