Automated Software Testing with Python

Automated Software Testing with Python

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 142 lectures (13h 31m) | 2.53 GB

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

Welcome to the most comprehensive course on Automated Software Testing with Python on Udemy.

Testing automation doesn’t have to be painful. Software testing is an essential skill for any developer, and I’m here to help you truly understand all types of test automation with Python.

I’m Jose, a software engineer and founder of Teclado. 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.

Fear not though, after going through this course, you’ll be able to take your new testing knowledge and apply it to any project, even non-web projects!

What will you work with?

This course is jam-packed with all the latest technologies for you to use professionally and in personal projects:

  • The unittest library, Python’s standard automated software testing library;
  • Mocking and patching, two essential tools to reduce dependencies when testing;
  • unit, integration, system, and acceptance testing—all types of testing to have you fully covered;
  • Postman for easy collaboration and testing while developing;
  • Selenium WebDriver for automated browser tests;
  • Git and Travis for continuous integration of your project.

Fundamental Software Testing Skills

We will cover every fundamental software testing skill that you need to know in order to get a job testing or to apply these skills in your existing projects.

From things like mocking and patching using the unittest library, which reduce dependencies and turn complex tests to simple ones; to looking at all types of testing: simple unit tests to large system tests and even customer acceptance tests.

The Testing Pyramid

The Testing Pyramid says you should have a lot of unit tests, slightly fewer integration tests, even fewer system tests, and as few acceptance tests as possible.

Throughout the course we work on this concept, making sure that we have full coverage of every component of our system with unit tests. Then we test the dependencies using integration tests. Finally, we cover the entire system and its assumptions using system tests. Of course, we’ll 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.

Automated Browser Testing with Selenium WebDriver

Selenium WebDriver is extremely powerful, particularly when coupled with the efficient and tried-and-tested approach recommended in this course. We’ll design our acceptance tests professionally—just the way you’d do at a software testing job. We’ll use page models, locators, and step definitions to structure the automated tests in a reusable way. The customers will be able to come up with acceptance tests that you can easily translate to code.

We’ll also learn about implicit and explicit waits with Selenium WebDriver and Python, a key concept to speed up the runtime of your acceptance tests.

Continuous Integration

We also cover how you can take automated testing much further in your projects.

By implementing a Continuous Integration pipeline that runs your tests whenever you make any changes, you’ll have much higher quality in your projects and not let any pesky bugs pass you by. We’ll look at putting our projects in GitHub and liking the CI pipeline with them.

I’m really excited to guide you through this course!

What you’ll 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
  • How to write complete system tests using Python and tools like Postman
  • Automate your application testing by setting up a continuous integration pipeline using Travis CI
  • Browser-based acceptance testing using Behave and Selenium WebDriver
Table of Contents

Welcome!
1 How to take this course
2 A self-assessment
3 Installing Python and PyCharm on Windows
4 Installing Python and PyCharm on OS X

A Full Python Refresher
5 Introduction to this section
6 Access the code for this section here
7 Variables in Python
8 Solution to coding exercise Variables
9 String formatting in Python
10 Getting user input
11 Writing our first Python app
12 Lists, tuples, and sets
13 Advanced set operations
14 Solution to coding exercise lists, tuples, sets
15 Booleans in Python
16 If statements
17 The ‘in’ keyword in Python
18 If statements with the ‘in’ keyword
19 Loops in Python
20 Solution to coding exercise flow control
21 List comprehensions in Python
22 Dictionaries
23 Destructuring variables
24 Functions in Python
25 Function arguments and parameters
26 Default parameter values
27 Functions returning values
28 Solution to coding exercise Functions
29 Lambda functions in Python
30 Dictionary comprehensions
31 Solution to coding exercise dictionaries
32 Unpacking arguments
33 Unpacking keyword arguments
34 Object-Oriented Programming in Python
35 Magic methods str and repr
36 Solution to coding exercise classes and objects
37 @classmethod and @staticmethod
38 Solution to coding exercise @classmethod and @staticmethod
39 Class inheritance
40 Class composition
41 Type hinting in Python 3.5+
42 Imports in Python
43 Relative imports in Python
44 Errors in Python
45 Custom error classes
46 First-class functions
47 Simple decorators in Python
48 The ‘at’ syntax for decorators
49 Decorating functions with parameters
50 Decorators with parameters
51 Mutability in Python
52 Mutable default parameters (and why they’re a bad idea)
53 Conclusion of this section

Your first automated software test
54 Introduction to this section
55 Access the code for this section here
56 Setting up our project
57 Writing our first test
58 Testing dictionary equivalence
59 Writing blog tests and PyCharm run configurations
60 The repr method, and intro to TDD
61 Integration tests and finishing the blog
62 Mocking, patching, and system tests
63 Patching the input method and returning values
64 Taking our patching further
65 The last few patches!
66 The TestCase setUp method
67 Conclusion of this section

Testing a Flask Endpoint
68 Introduction to this section
69 Access the code for this section here
70 Setting our project up
71 Creating our Flask app
72 Our first System test
73 Refactoring our System Tests
74 Conclusion of this section

REST API Testing, Part I
75 Introduction to this section
76 Access the code for this section here
77 A look at a REST API with Flask
78 Unit testing a REST API
79 Setting up our generic BaseTest
80 Integration testing a REST API
81 Conclusion of this section

REST API Testing, Part II
82 Introduction to this section
83 Access the code for this section here
84 Setting up our project
85 Testing foreign key constraints with Python
86 Unit testing models and SQLAlchemy mappers
87 Finishing our Store tests
88 Conclusion of this section

System testing a REST API
89 Introduction to this section
90 Access the code for this section here
91 Setting project up and creating User model
92 Change to the next lecture’s code
93 Allowing users to log in
94 Writing our User tests
95 The setUpClass method in the BaseTest
96 Testing user registration
97 Finalising user System tests
98 Writing Store System tests
99 Writing our Item System tests and testing authentication
100 Conclusion of this section

System testing with Postman and Newman
101 Introduction to this section
102 Access the code and Postman files here
103 Introduction to Postman
104 Our first Posman tests
105 Setting and clearing environment variables in Postman
106 Running a test folder in Postman
107 Advanced PyCharm run configurations
108 Installing Node and Newman
109 Multirun in PyCharm—Running app and tests together
110 Conclusion of this section

Continuous Integration with Travis CI
111 Introduction to this section
112 The code for this section
113 Installing Git
114 What is a Git repository
115 A local Git workflow
116 GitHub and remote repositories
117 Adding our project to GitHub
118 What is Travis CI
119 Adding our repository to Travis
120 The Travis config file and running tests
121 Adding our test badge to the Readme
122 Conclusion of this section

Acceptance testing and browser automation with Selenium
123 Introduction to this section
124 What is acceptance testing
125 Introduction to our project
126 Our first acceptance test step
127 Getting the Chrome webdriver
128 Verifying everything works
129 Finishing our first test
130 Re-using steps with the regular expression matcher
131 Our first content test
132 Page locators and models
133 The blog page
134 Using pages in navigation
135 Don’t over-generalise tests!
136 Waits and timeouts with Selenium
137 Debugging acceptance tests in PyCharm
138 Our final complex scenario
139 Filling in forms with Selenium
140 Access the final code of this section here
141 Conclusion of this section

Bonus Material
142 Bonus lecture other courses and next steps

Homepage