UI testing with puppeteer implement end-to-end testing and browser automation using javascript and node.js

Explore Google's open source web automation library Puppeteer to perform tasks such as end-to-end testing, performance monitoring, and task automation with ease. Using real-world use cases, this book will help you learn the capabilities and best practices of Puppeteer to take your automation co...

Descripción completa

Detalles Bibliográficos
Otros Autores: Kondratiuk, Dario, author (author)
Formato: Libro electrónico
Idioma:Inglés
Publicado: Birmingham, England ; Mumbai : Packt Publishing [2021]
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009631735406719
Tabla de Contenidos:
  • Cover
  • Title page
  • Copyright and Credits
  • Dedicated
  • Contributors
  • Table of Contents
  • Preface
  • Chapter 1: Getting started with Puppeteer
  • What is browser automation?
  • Selenium and Puppeteer
  • Introducing Headless browsers
  • Available headless browsers
  • The Chromium DevTools Protocol
  • Introducing Puppeteer
  • The Puppeteer object model
  • Puppeteer use cases
  • Task Automation
  • Web Scraping
  • Content generation
  • End-to-end testing
  • Setting up the environment
  • Node.js
  • Visual Studio Code
  • Our first Puppeteer code
  • Installing Puppeteer
  • Hello world in Puppeteer
  • Asynchronous programming in JavaScript
  • Promise.all
  • Promise.race
  • Fulfilling our own promises
  • Summary
  • Chapter 2: Automated Testing and Test runners
  • Technical requirements
  • Introduction to Automated Testing
  • Unit tests
  • Service tests
  • End-to-end tests
  • Test runner features
  • Available test runners
  • Creating our first test project
  • Organizing our code
  • Introducing the Page Object Model
  • Summary
  • Chapter 3: Navigating through a website
  • Technical requirements
  • Introducing the tests sites for this chapter
  • Creating a Puppeteer browser
  • Using the Puppeteer.launch function
  • Headless
  • The user data directory
  • Executable Path
  • Default Viewport
  • Product
  • Browser Arguments
  • Mobile options
  • Options in practice
  • Navigating through a site
  • Timeouts
  • waitUntil
  • Referrer
  • Using the response object
  • Getting the response URL
  • Getting the response status code
  • Introduction to continuous integration
  • Summary
  • Chapter 4: Interacting with a page
  • Technical requirements
  • Introduction to HTML, the DOM, and CSS
  • HTML
  • The DOM
  • CSS Selectors
  • Finding elements
  • Finding elements using XPath
  • Interacting with Elements
  • Typing on input elements
  • Clicking on elements.
  • Selecting options in drop-down lists
  • Keyboard and Mouse emulation
  • Debugging tests with Visual Studio Code
  • Summary
  • Chapter 5: Waiting for elements and network calls
  • Technical requirements
  • Waiting for the page to load
  • Waiting for elements
  • Await a wait function
  • Waiting for network calls
  • Arrange, Act, Await
  • Fire and forget
  • Promise.all
  • Waiting for page events
  • The close event
  • The popup event
  • Target created event
  • The console event
  • The dialog event
  • The headless recorder
  • Summary
  • Chapter 6: Executing and Injecting JavaScript
  • Technical requirements
  • Executing JavaScript code
  • Variable scopes in JavaScript
  • Manipulating handles with JavaScript code
  • Getting information from the elements
  • Acting on elements
  • Enforcing server rules
  • Finding elements using JavaScript
  • Waiting for functions
  • Exposing local functions
  • Running our checks with Checkly
  • Summary
  • Chapter 7: Generating Content with Puppeteer
  • Technical requirements
  • Taking screenshots
  • Using screenshots for regression tests
  • Generate PDF files
  • Creating HTML content
  • Summary
  • Chapter 8: Environments emulation
  • Technical requirements
  • Understanding the browser's market share
  • The browser's popularity over the years
  • Operative Systems market share
  • Screen resolution distribution
  • Emulating mobile devices
  • The Viewport
  • Pixel ratio
  • The touchscreen
  • The user agent
  • Emulating mobile devices with Puppeteer
  • Emulating network conditions
  • Emulating localization
  • Emulating geolocation
  • Emulating time zones
  • Emulating languages
  • Other emulations
  • Summary
  • Chapter 9: Scraping tools
  • Technical requirements
  • Introduction to web scraping
  • Does the site allow scrapers?
  • Creating scrapers
  • Running scrapers in parallel
  • How to avoid being detected as a bot.
  • Dealing with authorization
  • Summary
  • Chapter 10: Evaluating and Improving the Performance of a Website
  • Technical requirements
  • The Issue of Performance
  • Getting started with Google Lighthouse
  • As part of Chrome DevTools
  • Using PageSpeed Insights
  • Using the command line
  • Using the node module
  • The performance category
  • Using Lighthouse for testing
  • Tracing Pages
  • Analyzing code coverage
  • Summary
  • Why subscribe?
  • About Packt
  • Other Books You May Enjoy
  • Index.