Код и примеры для занятия по тестированию API
- Argraprse, аргументы в pytest
- requests
- Параметризация фикстур
- Тестирование API
Application programming interface (API) is a set of subroutine definitions, communication protocols, and tools for building software. In general terms, it is a set of clearly defined methods of communication among various components. A good API makes it easier to develop a computer program by providing all the building blocks, which are then put together by the programmer.
Representational State Transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services. Web services that conform to the REST architectural style, called RESTful Web services (RWS), provide interoperability between computer systems on the Internet. RESTful Web services allow the requesting systems to access and manipulate textual representations of Web resources by using a uniform and predefined set of stateless operations. Other kinds of Web services, such as SOAP Web services, expose their own arbitrary sets of operations.
Стандарт: https://www.w3.org/TR/soap12/
https://api.spacexdata.com/ - SpaceX
https://jsonplaceholder.typicode.com/ - Тестовое API
https://rapidapi.com/ - Библиотека разных API
https://www.cbr-xml-daily.ru/ - API Центробанка
-
Всегда 200, коды ошибок и ответов внутри ответа (Поддержка GET, POST)
-
Могут быть различные коды ответов (PUT, PATCH, DELETE ... )
Хорошее описание http://qaru.site/questions/112998/what-is-the-difference-between-put-post-and-patch