Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
UI Testing with Puppeteer

You're reading from   UI Testing with Puppeteer Implement end-to-end testing and browser automation using JavaScript and Node.js

Arrow left icon
Product type Paperback
Published in Mar 2021
Publisher Packt
ISBN-13 9781800206786
Length 316 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Dario Kondratiuk Dario Kondratiuk
Author Profile Icon Dario Kondratiuk
Dario Kondratiuk
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Chapter 1: Getting started with Puppeteer 2. Chapter 2: Automated Testing and Test runners FREE CHAPTER 3. Chapter 3: Navigating through a website 4. Chapter 4: Interacting with a page 5. Chapter 5: Waiting for elements and network calls 6. Chapter 6: Executing and Injecting JavaScript 7. Chapter 7: Generating Content with Puppeteer 8. Chapter 8: Environments emulation 9. Chapter 9: Scraping tools 10. Chapter 10: Evaluating and Improving the Performance of a Website 11. Other Books You May Enjoy

What this book covers

Chapter 1, Getting started with Puppeteer, lays the foundation for the book. It will help you get started with Puppeteer by introducing you to the tool and getting you acquainted with the essentials. You will also learn how to write async code in JavaScript.

Chapter 2, Automated Testing and Test runners, covers end-to-end testing fundamentals and the difference between different types of tests. In the latter part of the chapter, we will cover creating and organizing a test project and getting started with test runners.

Chapter 3, Navigating through a website, sees you start coding your tests. You will learn how to launch a browser, navigate to a page, and make some assertions. Then, you will see how to publish your tests to the cloud to be tested.

Chapter 4, Interacting with a page, is all about interaction. Once you get to a page, how do you test it? How do you simulate user interaction? This chapter takes you through the most common ways of interacting with a page. This chapter also covers some basic HTML concepts, so you can take advantage of all the tools Puppeteer provides.

Chapter 5, Waiting for elements and network calls, teaches you how to wait for the different scenarios on the page you are testing—waiting for the page to load and be ready, waiting for a button to be enabled, waiting for an Ajax call to be completed, and so on. This chapter covers all the tools that Puppeteer offers to handle these scenarios.

Chapter 6, Executing and Injecting JavaScript, shows you one of the best features of Puppeteer: injecting JavaScript code easily. In this chapter, we will leave the end-to-end testing world for a moment and dive into web automation using a general-purpose tool.

Chapter 7, Generating Content with Puppeteer, expands on the usage of Puppeteer and shows you how we can create content using Puppeteer. We'll start by learning how screenshots are created and how they can be used for regression tests. Then, we will cover PDF generation, and finally, we will learn how to create pages on the fly.

Chapter 8, Environments emulation, explains all the tools Puppeteer provides to emulate different scenarios. It will show you how to emulate mobile devices, different screen resolutions, various network speeds, geolocation, and even things such as vision deficiency.

Chapter 9, Scraping tools, demystifies web scraping, showing you how it can be used to your advantage. You will learn how to create scrapers and run tasks in parallel using Puppeteer Cluster.

Chapter 10, Evaluating and Improving the Performance of a Website, shows you how Puppeteer can help developers to evaluate and improve the performance of their sites. We will learn how to extract and analyze all the performance metrics you can see on the Developer Tools. This chapter also has a great introduction to Google Lighthouse and how to automate its reports and integrate them into your tests.

I also want this book to fill your toolbox with more tools besides Puppeteer. During the course of this book, you will learn about other tools, such as GitHub Actions, Visual Studio Code, Checkly and its Puppeteer recorder, and many others.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image