New Book Launched----Pytest Enterprise Application Practical New Book Launched

[Original Link] New Book Launched----Pytest Enterprise Application Practical New Book Launched

"Pytest Enterprise Application Combat"

Jingdong book link

Dangdang book link

Tmall book link

About the Author

The author of this book graduated from Harbin Institute of Technology with a master's degree. He has successively worked for ZTE and Huawei, and now works for the Nanjing Software Technology Research Institute of China Science and Technology. Automated testing and CICD pipeline design and development work, has rich practical experience in the field of DevOps.

brief introduction

Pytest is a very extensive application automation testing framework based on the Python language. "Pytest Enterprise Application Practice" first explains the use of the Pytest framework layer by layer from the perspective of actual combat, and then explains how to use it from the perspective of actual combat at the enterprise level. Pytest automates the testing of the enterprise testing framework, combined with Jenkins and Allure tools, to demonstrate how it is applied in the enterprise.
  Chapter 1 introduces the running environment and Pytest quick experience, Chapter 2 introduces the structure of Pytest test scripts, the default naming rules of test scripts and script execution, Chapter 3 introduces the use of assertions, and Chapter 4 introduces the use of tags , Chapter 5 introduces in detail various commonly used execution strategies of automation scripts, Chapters 6-8 introduces the basic and advanced applications of fixtures and common fixture usage methods, Chapter 9 introduces parameterization and data-driven usage methods , Chapter 10 introduces alarms, Chapter 11 introduces the rich log and printing functions in Pytest, Chapter 12 introduces Allure test reports, Chapter 13 introduces how to design and encapsulate automated test frameworks from a design perspective, and Pytest, Allure and The integration of Jenkins, Chapter 14 introduces commonly used third-party plug-ins, and Chapter 15 explains the source code analysis of Pluggy, the core of Pytest.
  "Pytest Enterprise Application Practice" can be used not only as a reference book for automated testers and test developers, but also as a training material related to Pytest technology.

Table of contents

Chapter 1 Overview of Pytest
1.1 Introduction to Pytest
1.1.1 Features of Pytest
1.1.2 Development history of Pytest
1.1.3 Why choose Pytest
1.2 Development environment installation
1.2.1 Python installation
1 .2.2 Simultaneously install multiple Python versions
1.2.3 Completely uninstall Python
1.2.4 Download and install Pycharm
1.3 Application of virtual environment management tool Pipenv
1.3.1 Install Pipenv
1.3.2 Pipenv How to use the tool
1.3.3 Configure Python interpreter
1.4 Pytest quick experience
1.4.1 Pytest installation and upgrade
1.4.2 Create and execute the first test script
1.4.3 The default of Pytest command Behavior
1.4.4 Make assertions about exceptions generated
1.4.5 Write test scripts in classes
1.4.6 Test script requests, create a temporary directory

Chapter 2 Pytest script rules, composition and operation
2.1 Pytest script rules
2.1.1 Test script file naming rules
2.1.2 Test class naming rules for test functions
2.1.3 Constraints of test script directories
2.1.4 Custom test file name, test class, test function naming rules
2.2 Composition of Pytest script
2.2.1 Introduction to automation script composition
2.2.2 Setup and teardown of each level in the test class
2. 2.3 The setup and teardown of each level in the test file
2.2.4 The setup and teardown of each level when the test function in the test file and the test method in the class are mixed
2.2.5 The setup and teardown of each level in automation practice 2.3 The operation of
Pytest script
2.3.1 Specify the directory or file
2.3.2 Specify the test function or test method
2.3.3 Use the -k parameter to fuzzy match and match the file class name and function name Select
2.3.4 Use-ignore parameter to select use case, ignore execution
2.3.5 Use-ignore-glob parameter supports regular selection use case ignore
2.3.6 Use-deselect parameter to select use case does not execute, and display Number of unexecuted
2.3.7 Repeated execution of use cases by repeatedly specifying the file path
2.3.8 Pass --collect-only parameter does not execute the script but counts the total number of scripts
2.3.9 Passes Pytest. ini sets the default search directory for use cases
2.3.10 Right-click to execute the current file in the IDE Use Case
2.4 Pytest Script Loading Principle
2.4.1 Prepend Mode
2.4.2 Append Mode
2.4.3 Problems Existing in Prepend and Append Mode
2. 4.4 importlib mode

Chapter 3 Assert assertion
3.1 Use Assert assertion
3.1.1 All numerical assertions that are False in Python fail
3.1.2 Python logical expression all fail assertions that are False
3.2 Custom assertion error message
3. 3. Asserting the captured exception
3.3.1 Asserting the exception type:
3.3.2 Asserting the captured exception information
3.3.3 Simultaneously asserting the captured exception type and exception information
3.3. 4 Assert on the exceptions that may be generated by a function
3.4 Rewrite the error message of the Assert statement
3.4.1 The default error message
3.4.2 Rewrite the error message of the assertion that judges whether it is equal
3.4.3 Repeat Write common judgment logic error messages
...
Chapter 4 Usage of mark tags
Chapter 5 Execution strategy of Pytest test cases
Chapter 6 Basic application of fixtures
Chapter 7 Advanced applications of fixtures
Chapter 8 Common applications of built-in fixtures
Chapter 9 Parameterize parameterization and data drive
Chapter 10 Alarm
Chapter 11 Log and console output management
Chapter 12 Allure test report
Chapter 13 Continuous integration with jenkins
Chapter 14 Other commonly used use case plug-ins
Chapter 15 Interpretation of the source code of Pluggy, the core of Pytest

preamble

At present, software automation testing is occupying an increasingly important position in the entire IT industry or in the field of software testing. At present, the entire IT industry is advocating cost reduction and efficiency enhancement, and automated testing is a very important aspect of cost reduction and efficiency enhancement. means. In addition, from the perspective of personal growth, test development will be the career development trend of future testers, and automated testing is the easiest direction for test development. So if you want to do a good job in automated testing, you need to be very familiar with at least one automated testing framework. Among many automated testing frameworks, Pytest can be said to be the leader. From the perspective of actual combat, this book introduces in detail how to use the Pytest automated testing framework, and at the same time incorporates some practical application experience in enterprises.
  This book is divided into 15 chapters. The main content of Chapter 1 is to quickly experience Pytest. Chapters 2 to 11 let readers understand Pytest step by step. Chapters 12 to 14 introduce Pytest from the perspective of designing an automated testing framework. The source code perspective introduces the core principles of the Pytest automated testing framework.
  In order to better meet the needs of technical readers, this book does not introduce too much theory, but uses example demonstrations to learn and summarize the usage of Pytest together with readers, so that readers can achieve better learning results. In addition, this book can also be used as a reference book. The titles of each chapter in the book are named in the way of solving practical problems, so that readers can quickly locate the chapters they like or need to read.
  The characteristics of this book are as follows:
  (1) Based on actual combat, minimize the theoretical analysis of too much text, show the actual combat code, that is, summarize the usage method of Pytest from actual combat, and stimulate readers to analyze and solve problems in depth by introducing practical problems interest of.
  (2) The chapters are arranged step by step. Let readers quickly experience Pytest first, then gradually introduce the characteristics and usage methods of various aspects of Pytest, and then introduce how to combine Pytest with other tools in enterprise-level actual combat, so as to design an automated test team. The actual executable and landing automated testing framework is needed, and finally the core source code of Pytest is explained in detail, thus meeting the needs of some advanced learning readers.
  (3) This book introduces the characteristics and usage methods of various aspects of Pytest, including explanations of basic content and some advanced content, so that readers can not only quickly grasp the basic content of Pytest, but also quickly understand the basic content of Pytest. The sense of accomplishment brought by learning Pytest.
  (4) Set up a large number of code examples, allowing readers to summarize and study the usage of Pytest through actual combat, which is also the best way to learn technology.

Guess you like

Origin blog.csdn.net/redrose2100/article/details/132372341