CN112286745B - Automatic testing method for cloud printer - Google Patents

Automatic testing method for cloud printer Download PDF

Info

Publication number
CN112286745B
CN112286745B CN202011161809.4A CN202011161809A CN112286745B CN 112286745 B CN112286745 B CN 112286745B CN 202011161809 A CN202011161809 A CN 202011161809A CN 112286745 B CN112286745 B CN 112286745B
Authority
CN
China
Prior art keywords
cloud printer
printer
cloud
test
serial port
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011161809.4A
Other languages
Chinese (zh)
Other versions
CN112286745A (en
Inventor
张晓龙
余凯
何奇辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Sunmi Technology Group Co Ltd
Shenzhen Michelangelo Technology Co Ltd
Original Assignee
Shanghai Sunmi Technology Group Co Ltd
Shenzhen Michelangelo Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Sunmi Technology Group Co Ltd, Shenzhen Michelangelo Technology Co Ltd filed Critical Shanghai Sunmi Technology Group Co Ltd
Priority to CN202011161809.4A priority Critical patent/CN112286745B/en
Publication of CN112286745A publication Critical patent/CN112286745A/en
Application granted granted Critical
Publication of CN112286745B publication Critical patent/CN112286745B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2268Logging of test results

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)

Abstract

本发明公开了一种云打印机自动化测试装置,包括:云打印机、与所述云打印机通过打印纸连接的卷筒、与所述卷筒连接的马达以及用于控制所述马达的继电器;所述打印纸的正上方设置有带有拾音麦克风的AI摄像头,所述云打印机与所述继电器通过串口线连接上位机(电脑),所述上位机通过串口线连接移动设备端(装有与云打印机配套的APP);所述云打印机端受上位机端发送的MQTT指令及移动设备端APP发送的指令控制,用于打印及播报相关内容,并通过串口线将实时本地日志传输回所述上位机。根据本发明,能够在无人条件下批量完成从指令下发到响应结果判定的自动化测试,以及测试报告的自动生成,能够实现短时间内批量部署云打印机测试的客观需求。

Figure 202011161809

The invention discloses a cloud printer automatic testing device, comprising: a cloud printer, a reel connected to the cloud printer through printing paper, a motor connected to the reel, and a relay for controlling the motor; Just above the printing paper is provided with an AI camera with a pickup microphone, and the cloud printer and the relay are connected to an upper computer (computer) through a serial line, and the upper computer is connected to a mobile device end (equipped with a cloud connection) through a serial line. printer supporting APP); the cloud printer end is controlled by the MQTT command sent by the upper computer end and the command sent by the mobile device end APP, and is used for printing and broadcasting relevant content, and transmits the real-time local log back to the upper position through the serial port line machine. According to the present invention, automated testing from command issuance to response result determination and automatic generation of test reports can be completed in batches under unmanned conditions, and the objective requirement of batch deployment of cloud printer testing in a short period of time can be realized.

Figure 202011161809

Description

一种云打印机自动化测试方法A cloud printer automated testing method

技术领域technical field

本发明涉及云打印的技术领域,特别涉及一种云打印机自动化测试方法。The present invention relates to the technical field of cloud printing, in particular to an automated testing method for cloud printers.

背景技术Background technique

物联网及云打印技术的兴起使得云打印机得到越来越多人的关注,由于其不依赖于外接存储设备且打印记录方便管理等优点,云打印机近年来被广泛应用于校园打印、外卖打印等现实场景。区别于传统打印机,云打印机连入的是更广泛意义的互联网,能实现与更多更大范围通讯设备进行实时通信,其通信方式也与传统打印机不尽相同。云打印机在连入网络后一般以MQTT为基础与上游服务器进行通信,执行服务器下发的指令。同时,云打印机一般也具有与之配套使用的APP,用于网络配置和打印参数设置。The rise of the Internet of Things and cloud printing technology has brought more and more people's attention to cloud printers. Due to its advantages of not relying on external storage devices and convenient management of printing records, cloud printers have been widely used in campus printing and takeaway printing in recent years. realistic scene. Different from traditional printers, cloud printers are connected to the Internet in a broader sense, which can realize real-time communication with more and larger communication devices, and their communication methods are also different from traditional printers. After the cloud printer is connected to the network, it usually communicates with the upstream server based on MQTT, and executes the instructions issued by the server. At the same time, cloud printers generally have a supporting APP for network configuration and printing parameter settings.

对于云打印机的测试,目前业内较多采用的是全手动或半自动的测试方法,即通过人工/自动化脚本点击APP或是下发MQTT指令,用肉眼观察云打印机响应结果来进行测试。For the testing of cloud printers, the industry currently mostly adopts fully manual or semi-automatic testing methods, that is, through manual/automated scripts to click on the APP or issue MQTT commands, and observe the response results of the cloud printer with the naked eye for testing.

云打印机的测试方法目前尚未形成成熟体系,现有测试手段在指令下发环节一部分可通过手动/自动化脚本实现,然而端到端测试环节中最后的识别/判定环节大多还是依赖于人工手动参与。因此即使接口测试功能部分实现了自动化测试,但受限于结果的判断环节,接口测试与端到端测试无法整合,总体来说云打印机的测试依然处于一种全手动或半自动化测试的阶段。当版本快速迭代及测试项较繁杂时,人工测试结果效率较低,且容易出现漏测、误测等情况,对最终测试结果造成隐患。另一方面,端到端人工测试的存在,使得测试人员无法在短时间内进行系统性批量测试,而且测试结果的统计分析也十分依赖于后期人力投入。The testing method of cloud printers has not yet formed a mature system. Existing testing methods can be realized through manual/automated scripts in part of the instruction issuing link. However, most of the final identification/judgment links in the end-to-end testing link still rely on manual participation. Therefore, even if the interface test function partially realizes the automated test, the interface test and the end-to-end test cannot be integrated due to the limitation of the judgment of the result. Generally speaking, the test of the cloud printer is still in a fully manual or semi-automatic test stage. When the version is iterated quickly and the test items are complicated, the efficiency of manual test results is low, and it is prone to missed tests and false tests, which will cause hidden dangers to the final test results. On the other hand, the existence of end-to-end manual testing makes it impossible for testers to conduct systematic batch testing in a short period of time, and the statistical analysis of test results is also very dependent on later manpower input.

发明内容Contents of the invention

针对现有技术中存在的不足之处,本发明的目的是提供一种云打印机自动化测试方法,能够在无人条件下批量完成从指令下发到响应结果判定的自动化测试,以及测试报告的自动生成,能够实现短时间内批量部署云打印机测试的客观需求。为了实现根据本发明的上述目的和其他优点,提供了一种云打印机自动化测试装置,包括:Aiming at the deficiencies in the prior art, the purpose of the present invention is to provide an automated testing method for cloud printers, which can complete automated testing in batches from issuing instructions to determining response results, as well as automatic testing of test reports under unmanned conditions. Generated to meet the objective requirements of batch deployment of cloud printer testing in a short period of time. In order to achieve the above object and other advantages according to the present invention, a cloud printer automated testing device is provided, including:

云打印机、与所述云打印机通过打印纸连接的卷筒、与所述卷筒连接的马达以及用于控制所述马达的继电器;a cloud printer, a reel connected to the cloud printer through printing paper, a motor connected to the reel, and a relay for controlling the motor;

所述打印纸的正上方设置有带有拾音麦克风的AI摄像头,所述云打印机与所述继电器通过串口线连接有上位机,所述上位机通过串口线连接移动设备端;An AI camera with a pickup microphone is arranged directly above the printing paper, and the cloud printer and the relay are connected to a host computer through a serial port line, and the host computer is connected to a mobile device end through a serial port line;

所述云打印机端受上位机端发送的MQTT指令及移动设备端APP发送的指令控制,用于打印及播报相关内容,并通过串口线将实时本地日志传输回所述上位机;The cloud printer is controlled by the MQTT command sent by the host computer and the command sent by the mobile device APP, and is used to print and broadcast relevant content, and transmit the real-time local log back to the host computer through the serial port line;

所述移动设备端受上位机端控制,完成移动设备端上点击、滑动、信息输入相关的指令操作,且所述移动设备端下发的命令信息通过蓝牙或网络的方式传达至所述云打印机;The mobile device is controlled by the host computer to complete command operations related to clicking, sliding, and information input on the mobile device, and the command information issued by the mobile device is transmitted to the cloud printer through Bluetooth or the network ;

所述继电器受上位机端指令控制,用于将带动卷筒使得打印纸始终保持紧绷平整;The relay is controlled by the command of the upper computer, and is used to drive the reel so that the printing paper is always kept tight and flat;

所述AI摄像头受上位机端指令控制,用于在特定的时间节点拍摄云打印机打印成品的照片及录制其语音播报内容,相关的图片及音频文件通过网络传回上位机端。The AI camera is controlled by the command of the host computer, and is used to take pictures of the finished product printed by the cloud printer and record its voice broadcast content at a specific time node, and the relevant pictures and audio files are sent back to the host computer through the network.

一种云打印机自动化测试方法,其特征在于,包括以下步骤:A cloud printer automated testing method, characterized in that it comprises the following steps:

S1、将所述云打印机置于平整的台面,使得打印机的出纸方向与平台相平行,打印纸上方适当位置安装一个带拾音麦克风的AI摄像头,用于拍摄打印成品照片及录制云打印机的语音播报音频,将移动设备、继电器和云打印机通过串口数据线与上位机相连接,各个部件摆放位置在后续测试过程中保持不变;S1. Place the cloud printer on a flat table so that the paper output direction of the printer is parallel to the platform, and install an AI camera with a pickup microphone at an appropriate position above the printing paper to take photos of the printed product and record the cloud printer. Voice broadcast audio, connect the mobile device, relay and cloud printer to the host computer through the serial port data cable, and the placement of each component remains unchanged during the subsequent test process;

S2、人工点击操作移动设备端或下发MQTT指令使云打印机进行指定功能的打印播报作业,并进行采集正确的云打印机响应数据作为后续结果评判的标准;S2. Manually click to operate the mobile device or issue an MQTT command to enable the cloud printer to print and broadcast the specified function, and collect the correct response data of the cloud printer as the standard for subsequent result evaluation;

S3、针对该指定功能编写测试脚本,脚本内容包含指令下发和结果评判两部分,进行单元测试;S3. Write a test script for the specified function, and the script content includes two parts: instruction issuing and result evaluation, and unit testing is carried out;

S4、若尚未完成各待测基本功能点的单元测试,则重复步骤S2,S3,针对其他待测功能编写测试脚本进行单元测试;S4. If the unit test of each basic function point to be tested has not been completed, repeat steps S2 and S3 to write test scripts for other functions to be tested for unit testing;

S5、在各待测基本功能点的单元测试工作全部完成后,可将脚本置于统一的测试框架下进行集成;S5. After the unit testing of each basic function point to be tested is completed, the script can be placed under a unified testing framework for integration;

S6、待测试代码集成完毕上传至Jenkins平台,并对云服务端的Jenkins工具发起构建,设置接收测试报告的邮箱地址,进行集成测试;S6. The code to be tested is integrated and uploaded to the Jenkins platform, and initiates the construction of the Jenkins tool on the cloud server, sets the email address for receiving the test report, and performs the integration test;

S7、集成测试结束云端将自动生成一份测试报告并发送至预设邮箱,通过邮件可查询测试结果,测试结束。S7. After the integration test is over, the cloud will automatically generate a test report and send it to the preset mailbox. The test result can be queried through the email, and the test is over.

优选的,所述步骤S2包括:Preferably, said step S2 includes:

S21、AI摄像头拍摄云打印机的打印内容成品照片;S21, the AI camera shoots the finished photo of the printed content of the cloud printer;

S22、AI摄像头的拾音麦克风录制云打印机进行语音播报时的播报音频;S22. The audio pickup microphone of the AI camera records the broadcast audio when the cloud printer performs voice broadcast;

S23、记录此时云打印机输出的串口信息。S23. Record the serial port information output by the cloud printer at this time.

优选的,所述步骤S3中的指令下发部分的脚本包括:Preferably, the script of the instruction issuing part in the step S3 includes:

1)MQTT消息接收/下发脚本:连接MQTT客户端,订阅与云打印机相对应的sub/pub信息,并在脚本中通过sub渠道向云打印机下发MQTT指令,通过pub渠道接收云打印机上报的MQTT信息;1) MQTT message receiving/delivering script: connect to the MQTT client, subscribe to the sub/pub information corresponding to the cloud printer, and send MQTT commands to the cloud printer through the sub channel in the script, and receive the information reported by the cloud printer through the pub channel MQTT information;

2)iOS/Android自动化脚本:控制iOS/Android设备在与云打印机相配套的app端完成点击、滑动、信息输入操作,模拟用户的实际使用过程而无需用户手动操作。在测试过程中,设备与上位机通过数据线相连,iOS/Android设备可通过用Airtest或Appium测试工具代替人工完成点击、滑动、信息输入操作,实现指令的下发;2) iOS/Android automation script: control iOS/Android devices to complete click, slide, and information input operations on the app side that is compatible with the cloud printer, simulating the actual use process of the user without manual operation by the user. During the test process, the device is connected to the host computer through a data cable, and the iOS/Android device can issue instructions by using Airtest or Appium test tools instead of manually completing clicks, slides, and information input operations;

3)继电器控制脚本:上位机通过串口向继电器发送控制指令,当打印机有打印动作时,上位机通过串口向继电器发送控制指令,打开继电器开关使得马达开始转动,保持打印纸始终保持紧绷平整,当打印机无打印动作时,关闭继电器开关使马达停止工作。3) Relay control script: The host computer sends control commands to the relay through the serial port. When the printer is printing, the host computer sends control commands to the relay through the serial port, and the relay switch is turned on to make the motor start to rotate, keeping the printing paper tight and flat. When the printer does not print, turn off the relay switch to stop the motor.

优选的,所述步骤S2中的结果评判部分的脚本主要包括串口读取识别和图片/语音对比两个部分,所述串口读取识别脚本包括读取并识别云打印机输出的串口信息,包括云打印机的状态、动作及其与上游服务器端的信息交互记录,匹配云打印机执行的特定功能或动作时的串口关键语句信息。测试时,若云打印机串口中输出的信息中含有步骤S2中所得到的串口基准信息,则串口信息测试部分通过。Preferably, the script of the result evaluation part in the step S2 mainly includes two parts: serial port reading identification and picture/voice comparison, and the serial port reading identification script includes reading and identifying the serial port information output by the cloud printer, including cloud The printer's state, action and its information interaction record with the upstream server, and the key statement information of the serial port when matching the specific function or action performed by the cloud printer. During the test, if the information output from the serial port of the cloud printer contains the serial port reference information obtained in step S2, the serial port information test part passes.

优选的,所述图片/语音对比脚本包括调用AI摄像头识别拍摄打印成品的照片与步骤S2数据采集得到的基准照片进行对比,包括照片文字内容,格式及打印浓度;调用AI摄像头的拾音麦克风对打印机的播报内容进行录制,将所得音频文件与前期数据采集得到的基准音频进行对比,包括语音内容、语速、语调。Preferably, the picture/voice comparison script includes calling the AI camera to identify the photo of the printed product and comparing it with the reference photo obtained by the data collection in step S2, including the photo text content, format and print density; Record the broadcast content of the printer, and compare the obtained audio file with the reference audio obtained from the previous data collection, including voice content, speech speed, and intonation.

本发明与现有技术相比,其有益效果是:The present invention compares with prior art, and its beneficial effect is:

(1)借助AI摄像头的图像/语音识别功能及串口的读取来替代人工进行云打印机响应结果准确性的判断,同时Jenkins平台的加入也使得短时间内大量部署云打印机的测试工作成为现实。(1) Use the image/voice recognition function of the AI camera and the reading of the serial port to replace the manual judgment of the accuracy of the response results of the cloud printer. At the same time, the addition of the Jenkins platform also makes the test work of deploying a large number of cloud printers in a short period of time a reality.

(2)本发明在测试脚本中集成了云打印机测试流程中的指令下发和识别/判定环节,为接口测试和端到端测试的整合提供了必要条件,能够在无人条件下批量完成从指令下发到响应结果判定的自动化测试,以及测试报告的自动生成。相较于传统测试手段本发明能够解决端到端测试过程中结果判断必须人工参与的业务痛点,能更好地应对快速迭代的批量测试场景,在长周期测试中节约大量人力,提高测试效率。(2) The present invention integrates the instruction issuing and identification/judgment links in the cloud printer test process in the test script, which provides the necessary conditions for the integration of interface testing and end-to-end testing, and can complete batches from Instructions are issued to the automated test of the response result judgment, and the automatic generation of the test report. Compared with traditional testing methods, the present invention can solve the business pain point that human participation is necessary for result judgment in the end-to-end testing process, and can better cope with fast iterative batch testing scenarios, save a lot of manpower in long-term testing, and improve testing efficiency.

附图说明Description of drawings

图1为根据本发明的云打印机自动化测试方法的具体流程的流程框图;Fig. 1 is a flow chart of the specific process of the cloud printer automated testing method according to the present invention;

图2为根据本发明的云打印机自动化测试方法的基本测试流程框图。Fig. 2 is a block diagram of the basic test flow of the cloud printer automated test method according to the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

参照图1-2,一种云打印机自动化测试装置,包括:云打印机、与所述云打印机通过打印纸连接的卷筒、与所述卷筒连接的马达以及用于控制所述马达的继电器;Referring to Figures 1-2, an automated testing device for a cloud printer includes: a cloud printer, a reel connected to the cloud printer through printing paper, a motor connected to the reel, and a relay for controlling the motor;

所述打印纸的正上方设置有带有拾音麦克风的AI摄像头,所述云打印机与所述继电器通过串口线连接有上位机,所述上位机通过串口线连接有移动设备端;An AI camera with a pickup microphone is arranged directly above the printing paper, and the cloud printer and the relay are connected to a host computer through a serial port line, and the host computer is connected to a mobile device terminal through a serial port line;

所述云打印机端受上位机电脑端发送的MQTT指令及移动设备端APP发送的指令控制,用于打印及播报相关内容,并通过串口线将实时本地日志传输回所述上位机;The cloud printer end is controlled by the MQTT command sent by the computer terminal of the host computer and the command sent by the APP of the mobile device, and is used for printing and broadcasting related content, and transmits the real-time local log back to the host computer through a serial port line;

所述移动设备端受上位机端控制,完成移动设备上点击、滑动、信息输入相关的指令操作,且所述移动设备端下发的命令信息通过蓝牙或网络的方式传达至所述云打印机;The mobile device is controlled by the host computer to complete the command operations related to clicking, sliding, and information input on the mobile device, and the command information issued by the mobile device is transmitted to the cloud printer through Bluetooth or the network;

所述继电器受上位机端指令控制,用于将带动卷筒使得打印纸始终保持紧绷平整;The relay is controlled by the command of the upper computer, and is used to drive the reel so that the printing paper is always kept tight and flat;

所述AI摄像头受上位机电脑端指令控制,用于在特定的时间节点拍摄云打印机打印成品的照片及录制语音播报内容,相关的图片及音频文件通过网络传回上位机电脑端。The AI camera is controlled by instructions from the host computer, and is used to take pictures of the finished product printed by the cloud printer and record voice broadcast content at a specific time node, and the relevant pictures and audio files are sent back to the host computer through the network.

进一步的,一种云打印机自动化测试方法,其特征在于,包括以下步骤:Further, a cloud printer automated testing method is characterized in that it comprises the following steps:

S1、将所述云打印机置于平整的台面,使得打印机的出纸方向与平台相平行,打印纸上方适当位置安装一个带拾音麦克风的AI摄像头,用于拍摄打印成品照片及录制云打印机的语音播报音频,将移动设备、继电器和云打印机通过串口数据线与上位机相连接,各个部件摆放位置在后续测试过程中保持不变;S1. Place the cloud printer on a flat table so that the paper output direction of the printer is parallel to the platform, and install an AI camera with a pickup microphone at an appropriate position above the printing paper to take photos of the printed product and record the cloud printer. Voice broadcast audio, connect the mobile device, relay and cloud printer to the host computer through the serial port data cable, and the placement of each component remains unchanged during the subsequent test process;

S2、人工点击操作APP或下发MQTT指令使云打印机进行指定功能的打印播报作业,并进行采集正确的云打印机响应数据作为后续结果评判的标准;S2. Manually click to operate the APP or issue an MQTT command to enable the cloud printer to print and broadcast the specified function, and collect the correct response data of the cloud printer as the standard for subsequent result evaluation;

S3、针对该指定功能编写测试脚本,脚本内容包含指令下发和结果评判两部分,进行单元测试;S3. Write a test script for the specified function, and the script content includes two parts: instruction issuing and result evaluation, and unit testing is carried out;

S4、若尚未完成各待测基本功能点的单元测试,则重复步骤S2,S3,针对其他待测功能编写测试脚本进行单元测试;S4. If the unit test of each basic function point to be tested has not been completed, repeat steps S2 and S3 to write test scripts for other functions to be tested for unit testing;

S5、在各待测基本功能点的单元测试工作全部完成后,可将脚本置于统一的测试框架下进行集成;S5. After the unit testing of each basic function point to be tested is completed, the script can be placed under a unified testing framework for integration;

S6、待测试代码集成完毕上传至Jenkins平台,并对云服务端的Jenkins工具发起构建,设置接收测试报告的邮箱地址,进行集成测试;S6. The code to be tested is integrated and uploaded to the Jenkins platform, and initiates the construction of the Jenkins tool on the cloud server, sets the email address for receiving the test report, and performs the integration test;

S7、集成测试结束云端将自动生成一份测试报告并发送至预设邮箱,通过邮件可查询测试结果,测试结束。S7. After the integration test is over, the cloud will automatically generate a test report and send it to the preset mailbox. The test result can be queried through the email, and the test is over.

进一步的,所述步骤S2包括:Further, the step S2 includes:

S21、AI摄像头拍摄云打印机的打印内容成品照片;S21, the AI camera shoots the finished photo of the printed content of the cloud printer;

S22、AI摄像头的拾音麦克风录制云打印机进行语音播报时的播报音频;S22. The audio pickup microphone of the AI camera records the broadcast audio when the cloud printer performs voice broadcast;

S23、记录此时云打印机输出的串口信息。这些照片、音频及串口信息将作为后续测试结果评判的标准。S23. Record the serial port information output by the cloud printer at this time. These photos, audio and serial port information will be used as the criteria for judging the follow-up test results.

进一步的,所述步骤S3中的指令下发部分的脚本包括:Further, the script of the instruction issuing part in the step S3 includes:

1)MQTT消息接收/下发脚本:连接MQTT客户端,订阅与云打印机相对应的sub/pub信息,并在脚本中通过sub渠道向云打印机下发MQTT指令,通过pub渠道接收云打印机上报的MQTT信息;1) MQTT message receiving/delivering script: connect to the MQTT client, subscribe to the sub/pub information corresponding to the cloud printer, and send MQTT commands to the cloud printer through the sub channel in the script, and receive the information reported by the cloud printer through the pub channel MQTT information;

2)iOS/Android自动化脚本:控制iOS/Android设备在与云打印机相配套的app端完成点击、滑动、信息输入操作,模拟用户的实际使用过程而无需用户手动操作。在测试过程中,设备与上位机通过数据线相连,iOS/Android设备可通过用Airtest或Appium测试工具代替人工完成点击、滑动、信息输入操作,实现指令的下发;2) iOS/Android automation script: control iOS/Android devices to complete click, slide, and information input operations on the app side that is compatible with the cloud printer, simulating the actual use process of the user without manual operation by the user. During the test process, the device is connected to the host computer through a data cable, and the iOS/Android device can issue instructions by using Airtest or Appium test tools instead of manually completing clicks, slides, and information input operations;

3)继电器控制脚本:上位机通过串口向继电器发送控制指令,当打印机有打印动作时,上位机通过串口向继电器发送控制指令,打开继电器开关使得马达开始转动,保持打印纸始终保持紧绷平整,当打印机无打印动作时,关闭继电器开关使马达停止工作。3) Relay control script: The host computer sends control commands to the relay through the serial port. When the printer is printing, the host computer sends control commands to the relay through the serial port, and the relay switch is turned on to make the motor start to rotate, keeping the printing paper tight and flat. When the printer does not print, turn off the relay switch to stop the motor.

进一步的,所述步骤S2中的结果评判部分的脚本主要包括串口读取识别和图片/语音对比两个部分,所述串口读取识别脚本包括读取并识别云打印机输入的串口信息,包括云打印机的状态、动作及其与上游服务器端的信息交互记录,匹配云打印机执行的特定功能或动作时的串口关键语句信息。测试时,若云打印机串口中输出的信息中含有步骤S2中所得到的串口基准信息,则串口信息测试部分通过。Further, the script of the result evaluation part in the step S2 mainly includes two parts: serial port reading identification and picture/voice comparison, and the serial port reading identification script includes reading and identifying the serial port information input by the cloud printer, including cloud The printer's state, action and its information interaction record with the upstream server, and the key statement information of the serial port when matching the specific function or action performed by the cloud printer. During the test, if the information output from the serial port of the cloud printer contains the serial port reference information obtained in step S2, the serial port information test part passes.

进一步的,所述图片/语音对比脚本包括调用AI摄像头拍摄打印成品的照片与步骤S2数据采集得到的基准照片进行对比,包括照片文字内容,格式及打印浓度;调用AI摄像头的拾音麦克风对打印机的播报内容进行录制,将所得音频文件与前期数据采集得到的基准音频进行对比,包括语音内容、语速、语调。理论上,测试过程中当云打印机反应正常时,其打印成品与语音播报音频应与步骤S2中所得的图片、音频基准内容保持一致,然而考虑到现实测试中环境因素的干扰,当两者对比相似度超过95%时即可判断打印机的打印效果及语音播报测试通过。Further, the picture/voice comparison script includes calling the AI camera to take the photo of the printed product and comparing it with the reference photo obtained by the data collection in step S2, including the photo text content, format and printing density; Record the content of the broadcast, and compare the obtained audio file with the benchmark audio obtained from the previous data collection, including the voice content, speech rate, and intonation. Theoretically, when the cloud printer responds normally during the test, its printed product and voice broadcast audio should be consistent with the picture and audio reference content obtained in step S2. However, considering the interference of environmental factors in the actual test, when the two are compared When the similarity exceeds 95%, it can be judged that the printing effect of the printer and the voice broadcast test have passed.

在搭建好相关测试环境后,即可进行测试工作。测试过程中保持各测试部件的位置基本不变,测试结束后预设邮箱中将会收到一份内容为云打印机测试结果的邮件。基本测试步骤包括:After setting up the relevant test environment, the test work can be carried out. Keep the position of each test component basically unchanged during the test. After the test is over, an email containing the test result of the cloud printer will be received in the preset mailbox. Basic test steps include:

1)对测试设备进行连接,并且进行启动;1) Connect the test equipment and start it;

2)进行基准结果获取;2) Obtain benchmark results;

3)编写测试脚本;3) Write test scripts;

4)进行判断是否覆盖所有待测功能点,如果没有覆盖所有功能点,则返回步骤S2;4) Judging whether all function points to be tested are covered, if not all function points are covered, then return to step S2;

5)当覆盖所有待测功能点,则进行脚本集成;5) When all the function points to be tested are covered, script integration is performed;

6)进行Jenkins平台集成测试;6) Conduct Jenkins platform integration test;

7)获取测试结果。7) Get test results.

这里说明的设备数量和处理规模是用来简化本发明的说明的,对本发明的应用、修改和变化对本领域的技术人员来说是显而易见的。尽管本发明的实施方案已公开如上,但其并不仅限于说明书和实施方式中所列运用,它完全可以被适用于各种适合本发明的领域,对于熟悉本领域的人员而言,可容易地实现另外的修改,因此在不背离权利要求及等同范围所限定的一般概念下,本发明并不限于特定的细节和这里示出与描述的图例。The number of devices and processing scale described here are used to simplify the description of the present invention, and the application, modification and variation of the present invention will be obvious to those skilled in the art. Although the embodiment of the present invention has been disclosed as above, it is not limited to the use listed in the specification and implementation, it can be applied to various fields suitable for the present invention, and it can be easily understood by those skilled in the art Further modifications can be effected, so the invention is not limited to the specific details and examples shown and described herein without departing from the general concept defined by the claims and their equivalents.

Claims (2)

1. An automatic testing method for a cloud printer is characterized by comprising the following devices:
the printing device comprises a cloud printer, a winding drum connected with the cloud printer through printing paper, a motor connected with the winding drum and a relay used for controlling the motor;
an AI camera with a pickup microphone is arranged right above the printing paper, the cloud printer and the relay are connected with an upper computer through a serial port line, and the upper computer is connected with a mobile equipment end through the serial port line;
the cloud printer end is controlled by an MQTT instruction sent by the upper computer end and an instruction sent by the mobile equipment end, is used for printing and broadcasting related contents, and transmits real-time local logs back to the upper computer through a serial port line;
the mobile equipment end is controlled by the upper computer end to complete instruction operations related to clicking, sliding and information input on the mobile equipment, and command information issued by the mobile equipment is transmitted to the cloud printer in a Bluetooth or network mode;
the relay is controlled by an instruction from the upper computer end and is used for driving the winding drum to enable the printing paper to be always kept tight and flat;
the AI camera is controlled by the instruction of the upper computer end and is used for shooting the photos of the finished products printed by the cloud printer and recording the voice broadcast content of the finished products at a specific time node, the related pictures and audio files are transmitted back to the upper computer end through the network,
the method also comprises the following implementation steps:
s1, placing the cloud printer on a flat table top, enabling the paper outlet direction of the printer to be parallel to the table top, installing an AI camera with a pickup microphone at a proper position above printing paper, and being used for shooting a printed finished photo and recording voice broadcast audio of the cloud printer, connecting a mobile device, a relay and the cloud printer with an upper computer through serial port data lines, wherein the placement positions of all components are kept unchanged in a subsequent testing process;
s2, issuing an MQTT instruction by the cloud end to enable the cloud printer to perform printing and broadcasting operation with a specified function, and collecting correct cloud printer response data as a standard for subsequent result judgment;
s3, compiling a test script aiming at the specified function, wherein the script content comprises two parts of instruction issuing and result judging, and carrying out unit test;
s4, if the unit test of each basic function point to be tested is not finished, repeating the steps S2 and S3, and compiling a test script for the other functions to be tested to perform the unit test;
s5, after the unit test work of each basic function point to be tested is completed, the script can be integrated under a uniform test frame;
s6, after the integration of the codes to be tested is finished, uploading the codes to a Jenkins platform, initiating construction of a Jenkins tool of a cloud server, setting a mailbox address for receiving a test report, and carrying out integration test;
s7, automatically generating a test report by the integration test ending cloud end and sending the test report to a preset mailbox, inquiring a test result through a mail, and ending the test;
the script of the instruction issuing part in the step S3 includes:
1) MQTT message receiving/issuing script: connecting an MQTT client, subscribing sub/pub information corresponding to the cloud printer, issuing an MQTT instruction to the cloud printer through a sub channel in the script, and receiving the MQTT information reported by the cloud printer through a pub channel;
2) iOS/Android automation script: the method comprises the steps that the iOS/Android device is controlled to complete clicking, sliding and information input operations at an app end matched with a cloud printer, the actual using process of a user is simulated without manual operation of the user, in the testing process, the device is connected with an upper computer through a data line, and the iOS/Android device can complete clicking, sliding and information input operations through an Airtest or an Apdium testing tool instead of manual work, so that instructions are issued;
3) A relay control script: the upper computer sends a control instruction to the relay through the serial port, when the printer has printing action, the upper computer sends the control instruction to the relay through the serial port, the relay switch is turned on to enable the motor to start rotating, printing paper is kept to be always kept tight and flat, and when the printer has no printing action, the relay switch is turned off to enable the motor to stop working;
the script of the result judging part in the step S3 comprises a serial port reading identification part and a picture/voice comparison part, the serial port reading identification script comprises serial port information which is read and output by a cloud printer, the serial port information comprises the state and the action of the cloud printer and information interaction records of the state and the action of the cloud printer and an upstream server end, the serial port key statement information is matched with a specific function or serial port key statement information during the action executed by the cloud printer, and when the test is carried out, if the serial port reference information obtained in the step S2 is contained in the information output by the serial port of the cloud printer, the serial port information test part passes;
the picture/voice comparison script comprises a step of calling an AI camera to identify and shoot a picture of a printed finished product and a reference picture acquired by data acquisition in the step S2 for comparison, wherein the reference picture comprises the text content, the format and the printing concentration of the picture; and calling a pickup microphone of the AI camera to record the broadcast content of the printer, and comparing the obtained audio file with the reference audio obtained by the data acquisition in the step S2, wherein the reference audio comprises voice content, speed and intonation.
2. The automatic testing method for the cloud printer according to claim 1, wherein the step S2 comprises:
s21, shooting a finished print content photo of the cloud printer by the AI camera;
s22, recording broadcast audio when the cloud printer carries out voice broadcast by using a pickup microphone of the AI camera;
and S23, recording serial port information output by the cloud printer at the moment.
CN202011161809.4A 2020-10-27 2020-10-27 Automatic testing method for cloud printer Active CN112286745B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011161809.4A CN112286745B (en) 2020-10-27 2020-10-27 Automatic testing method for cloud printer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011161809.4A CN112286745B (en) 2020-10-27 2020-10-27 Automatic testing method for cloud printer

Publications (2)

Publication Number Publication Date
CN112286745A CN112286745A (en) 2021-01-29
CN112286745B true CN112286745B (en) 2022-11-15

Family

ID=74373555

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011161809.4A Active CN112286745B (en) 2020-10-27 2020-10-27 Automatic testing method for cloud printer

Country Status (1)

Country Link
CN (1) CN112286745B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113253952A (en) * 2021-04-29 2021-08-13 先进操作系统创新中心(天津)有限公司 Linux operating system-based printer batch automatic adaptation system and adaptation method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006137050A (en) * 2004-11-11 2006-06-01 Seiko Epson Corp Printing system, printing control apparatus, printer driver, printing apparatus, and connection confirmation method
CN111212143A (en) * 2020-01-06 2020-05-29 杭州涂鸦信息技术有限公司 Automatic testing method and system, readable storage medium and computer equipment

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0997144A (en) * 1995-09-29 1997-04-08 Fujitsu Ltd Printer test method
US6106094A (en) * 1996-01-30 2000-08-22 Neopt Corporation Printer apparatus and printed matter inspecting apparatus
JP4055385B2 (en) * 2001-10-11 2008-03-05 富士ゼロックス株式会社 Image inspection device
JP3899910B2 (en) * 2001-11-28 2007-03-28 富士ゼロックス株式会社 Printing system, server, and printing control method
US7545528B2 (en) * 2003-03-31 2009-06-09 Seiko Epson Corporation Print system and print system control method
JP2015197846A (en) * 2014-04-02 2015-11-09 キヤノン株式会社 Printing apparatus monitoring system, control method therefor, and program
US9582225B2 (en) * 2015-03-27 2017-02-28 Kyocera Document Solutions Inc. Document solution management platform in a decentralized environment
US10545844B2 (en) * 2017-09-29 2020-01-28 Ricoh Company, Ltd. Print verification system that reports defective printheads
KR20190136832A (en) * 2018-05-31 2019-12-10 휴렛-팩커드 디벨롭먼트 컴퍼니, 엘.피. Converting voice command into text code blcoks that support printing services
US10528299B1 (en) * 2019-01-30 2020-01-07 Kyocera Document Solutions, Inc. Snapping an image and notifying a user to pick-up a printed document
CN110058824A (en) * 2019-04-18 2019-07-26 江苏曲速教育科技有限公司 Trace of going over examination papers print system and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006137050A (en) * 2004-11-11 2006-06-01 Seiko Epson Corp Printing system, printing control apparatus, printer driver, printing apparatus, and connection confirmation method
CN111212143A (en) * 2020-01-06 2020-05-29 杭州涂鸦信息技术有限公司 Automatic testing method and system, readable storage medium and computer equipment

Also Published As

Publication number Publication date
CN112286745A (en) 2021-01-29

Similar Documents

Publication Publication Date Title
CN103744784B (en) Mobile phone application automated testing method and system
CN112740576B (en) Optical fiber network intelligent maintenance system
CN112783708B (en) DTU hardware testing method, terminal and computer-readable storage medium
CN102420712A (en) Test method and test equipment
CN112783793B (en) Automatic interface test system and method
CN109413678A (en) A kind of Wi-Fi module automatic test approach and test macro
CN106230946A (en) A kind of being uploaded by Quick Response Code scanning realizes the method that file transmits
CN106682910B (en) An information processing method, system and related equipment
CN101453373A (en) Near-end maintenance method, system and equipment for device
CN112286745B (en) Automatic testing method for cloud printer
CN112161984A (en) Wine positioning method, wine information management method, device, equipment and storage medium
CN115905430A (en) Multi-label management and control method, device, terminal and medium based on MES system
CN111817916B (en) Test method, device, device and storage medium based on mobile terminal cluster
CN106452965B (en) A kind of method of automatic verifying network interface card NCSI stability
CN101409655A (en) Message-driven automation test system and implementing method
CN115827435A (en) Front-end performance testing method, electronic device and computer-readable storage medium
CN115221379A (en) Device binding method, system and application
CN114896148A (en) Terminal application automatic testing device, system, method, equipment and storage medium based on image recognition capability
CN113923443A (en) Network video recorder testing method and device and computer readable storage medium
CN111025916B (en) Household appliance detection control method and system
CN111343559A (en) Automatic testing system and method for Bluetooth audio product
CN112863084B (en) Intelligent sales terminal, and testing method, device and system of intelligent sales terminal
CN113742553B (en) Data processing method and device
CN201698490U (en) A standardized operation control system based on handheld mobile data terminal
CN109788066A (en) A kind of material tests test process record system and method based on image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant