Pytest simple example introduction

tags: Interface automation test  python

Reference: http://www.python3.vip/tut/auto/pytest/01/

For the webui automation of the above article, the corresponding login_api interface automation is written:
The calling method of the interface:

The pytest.mark.parametrize decorator can be used to parameterize test cases

Generate html report:
python -m pytest --html=report/add_demo.html Generate report

Use alluer to generate reports:
python -m pytest --alluredir=report Generate report data
allure generate allure-report render report page

Intelligent Recommendation

Introduction and simple example of Dubbox

Dubbo is an open source distributed service framework from Alibaba. Dangdang has implemented some new functions for Dubbo according to its own needs, including REST-style remote calls, Kryo/FST serial...

RabbitMQ introduction and simple example (on)

Compared with ActiveMQ, RabbitMQ is more professional, more flexible, large enterprises, large-scale applications with high requirements. Unlike ActiveMQ, it is written in Erlang language, so if you w...

SpringMVC Introduction and Simple Example

Springmvc Introduction 1. Springmvc Introduction 1.1, what is SpringMVC? 1.2, SpringMVC design mode? 1.3. Springmvc advantages 2. Springmvc example 2.1. Create engineering 2.2. Configure web.xml file ...

SpringCloud Simple Introduction Example

SpringCloud of the micro -service framework is the most popular. With SpringBoot, it is easy to get started quickly. Spring Cloud has many components, such as registration center Eureka, load balancin...

[Python+Pytest] Simple Pytest example, it feels better than unittest, and compatible with unittest code

Remember, py files, class names, and test case names must all begin with "test_". The test results are as follows:...

More Recommendation

Pytest (1): Introduction to the use of pytest

1. Installation and introduction of pytest pytest can be used to implement automated interface testing and automated UI testing; Two, pytest usage rules If no command line parameters are specified, th...

Scrapy simple introduction and example explanation

Scrapy simple introduction and example explanation   load: Scrapy is an application framework written to crawl website data and extract structural data. It can be used in a series of programs suc...

JMX introduction and simple entry example

[color=red][b]What is JMX? [/b][/color] In a web page, this is the case: "JMX (Java Management Extensions) is a framework for implanting management functions for applications. JMX is a standard s...

STL introduction of priority_queue with simple example

priority_queue priority queue, which is the bottom of the stack to achieve. In the priority queue, the current head of the queue elements must be the highest priority queue that one. In the priority q...

Simple introduction to dubbo (helloworld example)

Dubbo currently supports three methods: 1.multicast;  2.zookeeper;  3.redis  The demo below uses the multicast method. Provider project structure:   Consumer project structure: Ser...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top