当前位置:网站首页>Summary and review of puppeter
Summary and review of puppeter
2022-07-28 04:52:00 【taoli-qiao】
The last blog introduced how to improve UI Layer tests the readability of the code , This blog is puppeteer The last blog in the framework section . First , Meeting review puppeteer Frame features , Next, we will introduce how to choose puppeteer frame , How to build a perfect UI Layer automation script . In order to achieve the goal of this course 2 individual task.
- review puppeteer Frame features
- Use puppeteer How to build a perfect UI Layer automation script
Next , Start the first task Well .
review puppeteer Frame features
I learned from the front puppeteer After the relevant contents of the framework , Let's look back puppeteer Frame features , The one marked with red stars is the outstanding advantage of the framework .

Fully understand the characteristics of a framework 、 advantage , There is the use of selecting the appropriate testing framework for the project . How to choose the right one for the project UI Layer framework ? The latitude on the left in the figure above covers almost all points of the selection frame , When selecting a framework, you only need to judge whether it meets the project requirements at a certain latitude . for example , If the project uses IE Browser to test , and puppeteer Only support Chrome and firefox, Obviously not . Another example , If multiple scenarios of the tested project need to be in multiple tab Switching operation on page , that puppeteer It is appropriate. , contrary , As I said before cypress Don't fit , because cypress Don't support more tab Inter page operation .
The above highlights Puppeteer The advantages of , So is there any limitation in choosing this framework ? Of course. . Official website Puppeeteer Is defined as : Provides a high-level control of the browser API, therefore , Strictly speaking Puppeteer Not specifically for UI Test framework for layer automated testing , It can only be used Puppeteer complete UI Layer automated testing . So if you choose Puppeteer, Writing and debugging test scripts will cost more .
In addition to judging whether the framework meets the basic needs of the project , You also need to consider the cost of using the framework . For example, debugging cost , With puppeteer and cypress As an example ,cypress Debugging is obviously better than puppeteer. Another example ,UI Locating page elements is a relatively large part of the cost of writing layer test scripts , Therefore, when choosing a framework, we also need to consider whether the framework provides rich methods to locate page elements , Just puppeteer and cypress comparison ,cypress Provides more ways to locate page elements api. Use puppeteer Sometimes, when locating page elements, you need to use document object , Script writing costs a little more .
Last , We also need to see the community support of the framework , Try to choose start A relatively high number of frames , Or there is a framework supported by big manufacturers , In this way, when you encounter the framework itself issue Can be solved in time . As reviewed above puppeteer Frame features , Next, let's look at how to use pupeeteer, How to build a perfect UI Layer automation script .
Use puppeteer How to build a perfect UI Layer automation script
Let's first look at writing UI What we expect to achieve in layer automation testing , The listed objectives are as follows
UI Layer automated testing can automatically prepare test data , Automatic execution , Automatic verification , Automatically clean up test data
UI Layer automated testing can automatically switch between multiple environments
UI Layer automated tests can run concurrently , The running time is controlled at X Within minutes , here X It can be determined according to the actual project . Run concurrently , It requires that there is no interdependence before use cases , No execution sequence requirements .
Follow the test pyramid ,UI Layer automation covers the forward process of important scenes .
UI The stability of layer test is good , for example CICD The success rate on the platform reaches 95% above (issue Except for the failure caused ).
UI Layer test code structure is clear 、UI The layer test script itself is clearly layered , Easy to maintain .
UI The function granularity in the layer test code is appropriate , It can reuse , It can also control the size of the function .
If the above goals are achieved , In fact, it has achieved perfection UI The goal of layer automation scripts . How can the above goals be translated into landing scripting strategies ? Look at the following .

thus , This blog is over , This blog introduces the latitude from which you can understand the characteristics of the test framework , Select the test framework suitable for the project according to the characteristics of the framework . in addition , It also introduces how to build a perfect automated script , There is a point to emphasize here , The above strategy is only a general guidance strategy , Each system is very different , Each company's project operation is also different , Based on the general guidance strategy , We also need to consider the actual situation of our project , Continue to optimize .
边栏推荐
- C语言ATM自动取款机系统项目的设计与开发
- Youxuan database participated in the compilation of the Research Report on database development (2022) of the China Academy of communications and communications
- go-zero单体服务使用泛型简化注册Handler路由
- Do you know several assertion methods commonly used by JMeter?
- Strlen introduction, and the difference between sizeof
- [Sylar] framework Chapter 22 auxiliary module
- Use and expansion of fault tolerance and fusing
- CPU and memory usage are too high. How to modify RTSP round robin detection parameters to reduce server consumption?
- Use animatedbuilder to separate components and animation, and realize dynamic reuse
- [每日一氵]上古年代的 Visual Studio2015 安装
猜你喜欢

go-zero单体服务使用泛型简化注册Handler路由

物联网工业串口转WiFi模块 无线路由WiFi模块的选型

Easycvr Video Square snapshot adding device channel offline reason display

Special topic of APP performance design and Optimization - poor implementation affecting performance

Inspire domestic students to learn robot programming education for children

Rendering process, how the code becomes a page (I)

Destructor of member function
![[function document] torch Histc and paddle Histogram and numpy.histogram](/img/ee/ea918f79dc659369fde5394b333226.png)
[function document] torch Histc and paddle Histogram and numpy.histogram
![Geely AI interview question [Hangzhou multi tester] [Hangzhou multi tester _ Wang Sir]](/img/18/27a86595eb3a7d30df359d6b2b8d8c.png)
Geely AI interview question [Hangzhou multi tester] [Hangzhou multi tester _ Wang Sir]

Wang Shuang assembly language detailed learning notes 3: registers (memory access)
随机推荐
After easycvr is connected to the national standard equipment, how to solve the problem that the equipment video cannot be played completely?
Explain initialization list
01 node express system framework construction (express generator)
The difference between alter and confirm, prompt
Redis类型
Strlen introduction, and the difference between sizeof
【sylar】框架篇-Chapter8-定时器模块
Is low code the future of development? On low code platform
Rendering process, how the code becomes a page (2)
【sylar】框架篇-Chapter20-守护进程模块
FPGA: use PWM wave to control LED brightness
App test process and test points
【sylar】框架篇-Chapter6-协程调度模块
Mysql database -- first knowledge database
Analysis of the reason why easycvr service can't be started and tips for dealing with easy disk space filling
could only be written to 0 of the 1 minReplication nodes. There are 0 datanode(s) running and 0 node
Constructor of member function
pytorch打包exe出现WARNING: file already exists but should not: C:\Users\workAI\AppData\Local\Temp\_MEI13
Chuangyuan will join hands with 50+ cloud native enterprises to explore new models to cross the digital divide
gerrit操作-回退掉某个patch_set