Booking options
£94.99
£94.99
On-Demand course
5 hours 49 minutes
All levels
Leverage pytest's fast, scalable, and professional-grade framework design to build and run automated test suites like a pro
Python is one of the most popular programming languages in the world, with its demand increasing by the minute. Pytest - one of the most actively maintained testing frameworks in the industry - provides an incredible set of tools for faster, less stressful testing. In this course, you'll learn how to eliminate boilerplate setup and teardown code, run multiple tests simultaneously, and track your test run history to identify slow or problematic tests.
Beginning with a brief introduction and a step-by-step setup of pytest, this course will walk you through each session. You'll discover what makes a good framework, and, more importantly, what makes a bad one. As you advance, you'll learn how to use test searching to avoid cumbersome test suites, and how fixtures can eliminate up to 80% of code in case of code bloat. This interactive course is also equipped with information-rich videos to help you grasp the concepts with ease.
By the end of this course, you'll be ready to build high-performance, well-organized, scalable test frameworks on the professional level. All codes and supporting files are available at-
https://github.com/PacktPublishing/Elegant-Automation-Frameworks-with-Python-and-Pytest
Delve into one of the most in-demand fields in today s tech market - automated testing
Build high-performance automated test suites with actionable reporting
Discover how to eliminate boilerplate setup and teardown code
Find out how to run multiple tests simultaneously
Get to grips with tracking the history of your test runs
This course is for anyone looking to build or improve an automated testing framework.
Complete with code samples and information-rich videos, this course will help you understand the concepts easily.
Become proficient in automated testing using pytest * Create a well-organized, scalable test framework on a professional level * Find out how fixtures can eliminate up to 80% of code in a bloated codebase
https://github.com/packtpublishing/elegant-automation-frameworks-with-python-and-pytest
Brandon Blair is a Software Engineer who designs fast, scalable, and maintainable frameworks for automated testing in the UI (browser), backend/API, and mobile testing domains. He is passionate about delivering critical insights to teams at short notice by giving them powerful automation tools and enjoys teaching strong foundational concepts to others, along with focusing on problem-solving.
1. Introduction
1. Introduction This lecture introduces the course. |
2. Setting Up Your Environment
1. Setup Python 3 (Windows) Let's set up Python 3 on your Windows machine, and ensure we're working with the same tools, so you don't run into unnecessary hardship. |
2. Setting up Your Virtual Environment (Windows) In order to avoid problems, it's best when we are working with the same tools. |
3. Setting up Python 3 and the Virtual Environment (Mac OS / Linux) For those of you working on Mac OS or linux, we go over setting up Python 3 and your virtual environment. |
3. The Pytest Framework
1. Getting started with Pytest In this session we will set up a simple framework around some dummy tests and explain the pytest.ini file. |
2. Test Searching In this session we will discuss why test searching is so amazing, and why you should never run a test case file ever again. |
3. Save Time and Code with Test Fixtures Fixtures are one of the most powerful tools Pytest offers. |
4. Reporting Test Results and Tracking Test History In this video, the author demonstrates a quick reporting recipe using the open source Continuous Integration tool "Jenkins", since many students may work on teams that use Jenkins. The concept is transferable to many other tools that read XML test reports. |
5. Customizing Test Runs with the Command Line and Configuration Files We will learn how to pass data into your test run using the command line and write a self-building configuration file that allows testing in different environments without changing any code. |
6. Handling Skips and Expected Failures How do we skip tests without forgetting we ever wrote them? How do we handle tests that are expected to fail? We cover both solutions in today's lecture |
7. Cross-Browser and Data-driven testing with parametrize In this lecture we learn a recipe for testing multiple browsers without writing additional tests, and how to perform Data-driven testing using the contents of a JSON file. |
8. Fast Testing with Pytest-xdist, and Parallel vs Concurrent Learn the difference between parallelism and concurrency, and how we can leverage parallel testing to slash run-times on our test suites. |
4. Writing Great Tests
1. Writing Unit Tests (White Box Testing) We will learn how to write valuable, well-scoped unit tests to expose bugs before we push our changes to the repository. |
2. Running Unit Tests with Tox To set up our unit tests for primetime, it's important to separate our testing harness and cases from the library we are testing. We will use a tool called Tox to make this process fast, fluid, and repeatable. |
3. Writing Functional Tests (Black/Grey Box Testing) When testing something from the "outside", it's important that we structure our tests and framework so that our intent is clear, and so that the tests are maintainable by other people. |