The Web App Testing Guidebook
The Web App Testing Guidebook
UI Testing of Real World Websites Using WebdriverIO
About the Book
Over the past decade, website complexity has grown substantially, requiring much more effort when it comes to testing. While test automation is certainly not a recent technique, it has grown in popularity lately due to the increased complexity of the sites we build.
In fact, many organizations have full teams dedicated just to testing their site. Quality Assurance is an important role for any company that wants to take its technology seriously.
However, having humans manually run through test scripts is time-consuming.
By automating tests, we shift the workload from manual labor to speedy CPUs. Without humans and their need to sleep and eat, we can test our sites on-demand, around the clock.
Wouldn't it be ideal to have a test suite so effective that your QA team focused solely on keeping it up-to-date?
Unfortunately, that's not the reality.
I've seen, heard, and have been part of many teams that set out after this ideal, only to realize months later that all the effort has provided them little benefit. Yes, they have test automation in place, but it's constantly breaking and causing endless headaches. It seems they either have tests that run well but don't validate much, or have tests that check for everything but are always reporting false errors.
In 2017 I spent the year recording screencasts covering WebdriverIO, a test automation framework that we'll be learning in this book. While I covered the details of the framework quite well (or so I was told), I was left with nagging questions of "is knowing the tool valuable enough?"
Is knowing how to mix colors and hold a paintbrush enough to be able to paint beautiful art?
Does knowing what the 'addValue' command does in WebdriverIO teach you enough to write tests that are effective?
So I'm rebuilding this content. I want to focus on that second part this time around. Yes, it's important to cover the details of commands and code. More importantly though, you need to see how you can combine all that technology to create a test suite that provides actual value.
In this book, I cover not only what WebdriverIO can do, but also how you'll be using it day-to-day. I've built the examples around real-world scenarios that demonstrate how you would actually set things up. It's not just "what", but also "how to get there".
It takes a little more work on my part, and extra effort on your's to get started, but the payoff is there, I promise.
- 1.1.1 Why Read This Book?
- 1.1.2 Why Use WebdriverIO?
- 1.1.3 Technical Details
1.2 Installation and Configuration
- 1.2.1 Software Requirements
- 1.2.2 Browsers and “Driving” Them
- 1.2.3 Installing WebdriverIO and Basic Usage
- 1.2.4 Upgrading to the WDIO Test Runner
- 1.2.5 Reviewing the Standard WebdriverIO Configuration File
- 1.2.6 Running the Example Test Runner Test
- 1.2.7 Command Line Options (and Logging)
2.0 A ‘Real World’ App
- 2.0.1 Why ‘Real World’?
- 2.0.2 Use the Shared Demo App
- 2.0.3 Run Your Own Server Locally
- 2.0.4 Using a Docker Image (Recommended)
- 2.0.5 Self-install and Run
- 2.0.6 A Final Reminder
2.1 Site Loading and Navigation
- 2.1.1 Avoiding Troubles
- 2.1.2 Let’s Start
- 2.1.3 Writing our First Real Test
- 2.1.4 Elements and Actions
- 2.1.5 Finishing up
- 2.1.6 Adding Assertions
- 2.1.7 Expanding Assertions
- 2.1.8 The WebdriverIO Expect Library
- 2.1.9 Exceeding Expectations
- 2.1.10 Chapter Challenge
2.2 Selectors of Every Shape and Size
- 2.2.1 Selector Mania
- 2.2.2 CSS Selectors
- 2.2.3 XPath
- 2.2.4 Chaining Selectors
- 2.2.5 Custom Data Attributes for Testing
- 2.2.6 Avoiding Poorly Built Selectors
- 2.2.7 Chapter Challenge
2.3 Testing the Login Page
- 2.3.1 Is This Thing Working?
- 2.3.2 Slow It Down
- 2.3.3 Network Throttling
- 2.3.4 Waiting With Waits
- 2.3.5 Waiting With Inverse Waits
- 2.3.6 Chapter Challenge
2.4 Custom Functions, Page Objects, and Actions
- 2.4.1 You’ve Got Me Hooked
- 2.4.2 Getting the Error Text
- 2.4.3 Only One More Thing I Don’t Want to Skip
- 2.4.4 Custom Test Functions
- 2.4.5 Basics of Page Objects
- 2.4.6 Naming Patterns
- 2.4.7 Page Actions
- 2.4.8 Improving Our Login Detection
- 2.4.9: Separating Files
- 2.4.10 Chapter Challenge
2.5 Sharing Common Page Object Functionality
- 2.5.1 Testing the Post Editor
- 2.5.2 Has the Page Loaded Properly?
- 2.5.3 Storing Common Credentials as Test Fixtures
- 2.5.4 Using and Updating the Auth Login Function
- 2.5.5 Abstracting the Page Load
- 2.5.6 Common Page Objects
- 2.5.7 Time to ‘extend’ Our Generic Page
- 2.5.8 The ‘super’ Keyword
- 2.5.9 Implementing Our Generic Page Object
- 2.5.10 Using Our Page Object’s Path in Tests
- 2.5.11 Taking Advantage of NodeJS’s URL Utility
- 2.5.12 Finishing the URL Implementation
- 2.5.13 Chapter Challenge
2.6 Testing Complex Inputs
- 2.6.1 Testing the Publish Action
- 2.6.2 Key Commands
- 2.6.3 Submitting and Validating the Result
- 2.6.4 Form Submission Functions
- 2.6.5 ChanceJS to Create Data
- 2.6.6 Checking Page Data
- 2.6.7 Testing Multiple Tags
- 2.6.8 Checking Alerts When Leaving With Unsaved Changes
- 2.6.9 A Not-So-Random Chance
- 2.6.10 Global Chance via WebdriverIO Configuration Hooks
- 2.6.11 Chapter Challenge
2.7 Managing User Sessions
- 2.7.1 Thinking Through a New Type of Test
- 2.7.2 Checking Those Feeds
- 2.7.3 Session Management
- 2.7.4 Executing Arbitrary Scripts in the Browser
- 2.7.5 Speeding up the login via APIs
- 2.7.6 Global Custom Commands
- 2.7.7 Chapter Challenge
2.8 Creating Page Components
- 2.8.1 Checking the Active Tab
- 2.8.2 Switching Tabs
- 2.8.3 Dynamic Content Testing
- 2.8.4 Waiting to Load
- 2.8.5 Custom Page Components
- 2.8.6 The Feed Page Component
- 2.8.7 Testing Feeds
- 2.8.8 Testing Feed Content
- 2.8.9 Validating Multiple Properties Easier
- 2.8.10 Chapter Challenge
2.9 Generating Data for Testing via APIs
- 2.9.1 The ‘Tag’ Page
- 2.9.2 Creating a New Article/Tag via the API
- 2.9.3 Writing Our Tag Page Test
- 2.9.4 Cleaning Up Our Mess
- 2.9.5 Exercises
3.0 Chapter Challenge Code Solutions
- Chapter 2.1: Assertions
- Chapter 2.2: Selectors
- Chapter 2.3: Waiting Another Way
- Chapter 2.4: Registration Tests
- Chapter 2.5: More Sharing
- Chapter 2.6: Validating ‘Edit Article’ Functionality
- Chapter 2.7: Move ‘loginViaApi’ Command to the Auth Page Object
- Chapter 2.8: Validating the “Popular Tags” Block
- Chapter 2.9: Public User Profile Page Tests
- 3.1 Final Thoughts
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
C++ Best PracticesJason Turner
Level up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
OpenIntro StatisticsDavid Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntro
A complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
Functional Design and ArchitectureAlexander Granin
Software Design in Functional Programming, Design Patterns and Practices, Methodologies and Application Architectures. How to build real software in Haskell with less efforts and low risks. The first complete source of knowledge.
R Programming for Data ScienceRoger D. Peng
This book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
C++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
I am a Software Engineer and I am in ChargeAlexis Monville and Michael Doyle
I am a Software Engineer and I am in Charge is a real-world, practical book that helps you increase your impact and satisfaction at work no matter who you work with.
In the book, we will follow Sandrine, a fictional character who learns to think in a new way enabling her to take a different course of action.
Atomic KotlinBruce Eckel and Svetlana Isakova
For both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
Invest In Digital Health - The Medical Futurist's GuideDr. Bertalan Mesko
Artificial Intelligence and Digital Health are booming. In this book, we explain why now it's a good time to invest in Digital Health and give recommendations on where to invest by looking at the top 24 technological trends we find the most promising.
The Hundred-Page Machine Learning BookAndriy Burkov
Everything you really need to know in Machine Learning in a hundred pages.
Mastering STM32Carmine Noviello
With more than 600 microcontrollers, STM32 is probably the most complete ARM Cortex-M platform on the market. This book aims to be the first guide around that introduces the reader to this exciting MCU portfolio from ST Microelectronics and its official CubeHAL.
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before...
CCIE Service Provider Ultimate Study Bundle
2 BooksPiotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification...
The Future of Digital Health
6 BooksWe put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy and how technology giants such as Amazon or Google want to conquer...
Cisco CCNA 200-301 Complet
4 BooksCe lot comprend les quatre volumes du guide préparation à l'examen de certification Cisco CCNA 200-301.
CCDE Practical Studies (All labs)
3 BooksCCDE lab
"The C++ Standard Library" and "Concurrency with Modern C++"
2 BooksGet my books "The C++ Standard Library" and "Concurrency with Modern C++" in a bundle. The first book gives you the details you should know about the C++ standard library; the second one dives deeper into concurrency with modern C++. In sum, you get more than 600 pages full of modern C++ and about 250 source files presenting the standard library...
Modern Management Made Easy
3 BooksRead all three Modern Management Made Easy books. Learn to manage yourself, lead and serve others, and lead the organization.
Linux Administration Complet
4 BooksCe lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité...
Programming with Ease
3 BooksAlle drei Bände der Serie Programming with Ease in einem Paket. Darin findest du alles, was ich dir zu den wichtigsten Phasen der Softwareentwicklung im Hinblick auf Clean Code Development für langfristig hohe Produktivität sagen kann.Im Band Slicing findest du die Anforderungsanalyse im Rahmen eines iterativ-inkrementellen Vorgehensmodells aus...
2 BooksUnveil the power of Ansible and Vagrant with this bundle at a special price. You'll have everything you need to get started with Vagrant - learn the basics and how to create your virtual development environments, using Ansible as provisioner! About Vagrant Cookbook Vagrant Cookbook is a complete guide to get started with Vagrant and create your...