Video description
Welcome to the most comprehensive course on automated software testing with Python. Software testing is an essential skill for any developer, and this course will help you truly understand all types of test automation with Python.
The focus of this course is on testing for the web—we'll be working with REST APIs and web applications, and technologies such as unittest, Postman, and Selenium WebDriver—ranging from operations such as mocking and patching using the unit test library (to reduce dependencies and turn complex tests into simple ones) to looking at all types of testing: simple unit tests to large system tests and even customer acceptance tests.
Throughout the course we work on the Testing Pyramid concept, making sure that we have full coverage of every system component with unit tests. Then we test dependencies using integration tests. Finally, we cover the entire system using system tests. Of course, we also look at what acceptance testing is, how we come up with acceptance tests, and some of the best ways to write acceptance tests for a web application using Behavior-Driven Development and Selenium WebDriver. We also learn about implicit and explicit waits with Selenium WebDriver and Python, a key concept used to speed up the runtime of your acceptance tests. By implementing a Continuous Integration pipeline that runs your tests whenever you make any changes, you'll have much higher project quality so that you don't miss any annoying bugs. We'll look at putting our projects into GitHub and linking with them.
What You Will Learn
- Everything you need to know about automated software testing with Python (and how to enjoy testing, too!)
- Common pitfalls and best practices when writing automated tests
- Write complete system tests using Python and tools such as Postman
- Automate your application testing by setting up a Continuous Integration pipeline using Travis CI
- Browser-based acceptance testing using Behave and Selenium WebDriver
Audience
This course is designed for students who want to test their Python applications in order to build more complete solutions, professionals keen to learn more about automated software testing in their workplace, automated software testers, and software developers
About The Author
Jose Salvatierra Fuentes: Jose Salvatierra has been teaching online for over seven years, and he loves helping students learn to code and master software development. He founded Teclado to bring software development to everyone; his objective is for you to truly understand everything that goes on behind the scenes.
Coding is extremely rewarding. As you learn, things start to click and make sense. You can join the dots of all the things that weren’t quite clear before.
Jose can help you with Python and JavaScript issues, particularly in web and backend development. He is experienced with programming libraries and frameworks such as Flask, React, React Native, and AngularJS. He has worked extensively with UNIX systems, MongoDB, PostgreSQL, and advanced system architecture design.
Table of contents
- Chapter 1 : Welcome
-
Chapter 2 : A Full Python Refresher
- Variables in Python
- String formatting in Python
- Getting user input
- Writing our first Python app
- Lists, tuples, and sets
- Advanced set operations
- Booleans in Python
- If statements
- The "in" keyword in Python
- If statements with the "in" keyword
- Loops in Python
- List comprehensions in Python
- Dictionaries
- Destructuring variables
- Functions in Python
- Function arguments and parameters
- Default parameter values
- Functions returning values
- Lambda functions in Python
- Dictionary comprehensions
- Unpacking arguments
- Unpacking keyword arguments
- Object-Oriented Programming in Python
- Magic methods: __str__ and __repr__
- @classmethod and @staticmethod
- Class inheritance
- Class composition
- Type hinting in Python 3.5+
- Imports in Python
- Relative imports in Python
- Errors in Python
- Custom error classes
- First-class functions
- Simple decorators in Python
- The "at" syntax for decorators
- Decorating functions with parameters
- Decorators with parameters
- Mutability in Python
- Mutable default parameters (and why they're a bad idea)
-
Chapter 3 : Your first automated software test
- Introduction to this section
- Setting up our project
- Writing our first test
- Testing dictionary equivalence
- Writing blog tests and PyCharm run configurations
- The __repr__ method, and intro to TDD
- Integration tests and finishing the blog
- Mocking, patching, and system tests
- Patching the input method and returning values
- Taking our patching further
- The last few patches!
- The TestCase setUp method
- Conclusion of this section
- Chapter 4 : Testing a Flask Endpoint
- Chapter 5 : REST API Testing, Part I
- Chapter 6 : REST API Testing, Part II
-
Chapter 7 : System testing a REST API
- Introduction to this section
- Setting project up and creating User model
- Allowing users to log in
- Writing our User tests
- The setUpClass method in the BaseTest
- Testing user registration
- Finalising user System tests
- Writing Store System tests
- Writing our Item System tests and testing authentication
- Conclusion of this section
-
Chapter 8 : System testing with Postman and Newman
- Introduction to this section
- Introduction to Postman
- Our first Posman tests
- Setting and clearing environment variables in Postman
- Running a test folder in Postman
- Advanced PyCharm run configurations
- Installing Node and Newman
- Multirun in PyCharm—Running app and tests together
- Conclusion of this section
-
Chapter 9 : Continuous Integration with Travis CI
- Introduction to this section
- Installing Git
- What is a Git repository?
- A local Git workflow
- GitHub and remote repositories
- Adding our project to GitHub
- What is Travis CI?
- Adding our repository to Travis
- The Travis config file and running tests
- Adding our test badge to the Readme
- Conclusion of this section
-
Chapter 10 : Acceptance testing and browser automation with Selenium
- Introduction to this section
- What is acceptance testing?
- Introduction to our project
- Our first acceptance test step
- Getting the Chrome webdriver
- Verifying everything works
- Finishing our first test
- Re-using steps with the regular expression matcher
- Our first content test
- Page locators and models
- The blog page
- Using pages in navigation
- Don't over-generalise tests!
- Waits and timeouts with Selenium
- Debugging acceptance tests in PyCharm
- Our final complex scenario
- Filling in forms with Selenium
- Conclusion of this section
Product information
- Title: Automated Software Testing with Python
- Author(s):
- Release date: September 2019
- Publisher(s): Packt Publishing
- ISBN: 9781839214592
You might also like
book
Python Testing with pytest
Test applications, packages, and libraries large and small with pytest, Python's most powerful testing framework. pytest …
book
Python Testing with pytest
Do less work when testing your Python code, but be just as expressive, just as elegant, …
video
Complete Python Scripting for Automation
Over the last few years, Python has gained immense popularity. The demand for the programming language …
video
Selenium Python Automation Testing from Scratch and Frameworks
Python is a popular choice for implementing Artificial Intelligence and web security in any application. This …