Automated Software Testing with Python

Video description

Learn about automated software testing with Python, BDD, Selenium WebDriver, and Postman, focusing on web applications

About This Video

  • Learn automated software testing with Python
  • Learn to write complete system tests using Python and tools such as Postman

In Detail

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.

Publisher resources

Download Example Code

Table of contents

  1. Chapter 1 : Welcome
    1. Welcome to the course 00:01:34
  2. Chapter 2 : A Full Python Refresher
    1. Variables in Python 00:08:26
    2. String formatting in Python 00:06:26
    3. Getting user input 00:05:17
    4. Writing our first Python app 00:03:19
    5. Lists, tuples, and sets 00:06:31
    6. Advanced set operations 00:04:39
    7. Booleans in Python 00:05:00
    8. If statements 00:08:17
    9. The "in" keyword in Python 00:02:02
    10. If statements with the "in" keyword 00:08:18
    11. Loops in Python 00:11:07
    12. List comprehensions in Python 00:07:24
    13. Dictionaries 00:08:31
    14. Destructuring variables 00:08:29
    15. Functions in Python 00:10:42
    16. Function arguments and parameters 00:07:41
    17. Default parameter values 00:03:55
    18. Functions returning values 00:07:20
    19. Lambda functions in Python 00:07:53
    20. Dictionary comprehensions 00:04:01
    21. Unpacking arguments 00:10:24
    22. Unpacking keyword arguments 00:08:44
    23. Object-Oriented Programming in Python 00:15:46
    24. Magic methods: __str__ and __repr__ 00:06:26
    25. @classmethod and @staticmethod 00:14:04
    26. Class inheritance 00:08:32
    27. Class composition 00:06:08
    28. Type hinting in Python 3.5+ 00:05:09
    29. Imports in Python 00:09:34
    30. Relative imports in Python 00:08:53
    31. Errors in Python 00:12:48
    32. Custom error classes 00:05:05
    33. First-class functions 00:07:48
    34. Simple decorators in Python 00:07:13
    35. The "at" syntax for decorators 00:03:33
    36. Decorating functions with parameters 00:02:24
    37. Decorators with parameters 00:04:50
    38. Mutability in Python 00:06:04
    39. Mutable default parameters (and why they're a bad idea) 00:04:28
  3. Chapter 3 : Your first automated software test
    1. Introduction to this section 00:00:25
    2. Setting up our project 00:06:42
    3. Writing our first test 00:11:10
    4. Testing dictionary equivalence 00:05:26
    5. Writing blog tests and PyCharm run configurations 00:06:43
    6. The __repr__ method, and intro to TDD 00:08:49
    7. Integration tests and finishing the blog 00:11:58
    8. Mocking, patching, and system tests 00:16:37
    9. Patching the input method and returning values 00:07:21
    10. Taking our patching further 00:16:03
    11. The last few patches! 00:07:07
    12. The TestCase setUp method 00:04:36
    13. Conclusion of this section 00:00:28
  4. Chapter 4 : Testing a Flask Endpoint
    1. Introduction to this section 00:00:27
    2. Setting our project up 00:04:39
    3. Creating our Flask app 00:06:51
    4. Our first System test 00:09:56
    5. Refactoring our System Tests 00:06:32
    6. Conclusion of this section 00:00:33
  5. Chapter 5 : REST API Testing, Part I
    1. Introduction to this section 00:00:36
    2. A look at a REST API with Flask 00:17:55
    3. Unit testing a REST API 00:08:15
    4. Setting up our generic BaseTest 00:09:37
    5. Integration testing a REST API 00:06:47
    6. Conclusion of this section 00:00:25
  6. Chapter 6 : REST API Testing, Part II
    1. Introduction to this section 00:00:21
    2. Setting up our project 00:08:45
    3. Testing foreign key constraints with Python 00:05:25
    4. Unit testing models and SQLAlchemy mappers 00:11:03
    5. Finishing our Store tests 00:11:38
    6. Conclusion of this section 00:00:24
  7. Chapter 7 : System testing a REST API
    1. Introduction to this section 00:00:29
    2. Setting project up and creating User model 00:03:58
    3. Allowing users to log in 00:04:10
    4. Writing our User tests 00:04:14
    5. The setUpClass method in the BaseTest 00:04:59
    6. Testing user registration 00:06:42
    7. Finalising user System tests 00:07:32
    8. Writing Store System tests 00:13:35
    9. Writing our Item System tests and testing authentication 00:22:36
    10. Conclusion of this section 00:00:27
  8. Chapter 8 : System testing with Postman and Newman
    1. Introduction to this section 00:00:41
    2. Introduction to Postman 00:09:02
    3. Our first Posman tests 00:05:51
    4. Setting and clearing environment variables in Postman 00:07:04
    5. Running a test folder in Postman 00:07:53
    6. Advanced PyCharm run configurations 00:06:08
    7. Installing Node and Newman 00:04:43
    8. Multirun in PyCharm—Running app and tests together 00:03:01
    9. Conclusion of this section 00:00:36
  9. Chapter 9 : Continuous Integration with Travis CI
    1. Introduction to this section 00:00:38
    2. Installing Git 00:04:12
    3. What is a Git repository? 00:05:28
    4. A local Git workflow 00:04:31
    5. GitHub and remote repositories 00:05:18
    6. Adding our project to GitHub 00:04:51
    7. What is Travis CI? 00:02:29
    8. Adding our repository to Travis 00:01:39
    9. The Travis config file and running tests 00:10:34
    10. Adding our test badge to the Readme 00:02:48
    11. Conclusion of this section 00:00:38
  10. Chapter 10 : Acceptance testing and browser automation with Selenium
    1. Introduction to this section 00:00:40
    2. What is acceptance testing? 00:05:08
    3. Introduction to our project 00:03:10
    4. Our first acceptance test step 00:10:47
    5. Getting the Chrome webdriver 00:03:38
    6. Verifying everything works 00:05:45
    7. Finishing our first test 00:14:51
    8. Re-using steps with the regular expression matcher 00:04:00
    9. Our first content test 00:09:18
    10. Page locators and models 00:18:36
    11. The blog page 00:07:30
    12. Using pages in navigation 00:06:45
    13. Don't over-generalise tests! 00:02:26
    14. Waits and timeouts with Selenium 00:07:33
    15. Debugging acceptance tests in PyCharm 00:03:32
    16. Our final complex scenario 00:02:46
    17. Filling in forms with Selenium 00:13:01
    18. Conclusion of this section 00:00:42

Product information

  • Title: Automated Software Testing with Python
  • Author(s): Jose Salvatierra
  • Release date: September 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781839214592