This short article covers what "mocking" means in web development, how developers achieve this, and how it helps them. We'll also cover some disadvantages of mocking.
10 posts tagged with "Software Testing"
View All TagsWhat a Google Search Can't Tell You About These JS Testing Frameworks
This blog post gives detailed insights into the most prevalent JavaScript E2E (end-to-end) testing frameworks. We break down our article into two main sections:
- Our experience - we tried six different frameworks by writing the same test case on the same web application and provided detailed pros/cons of working with those technologies. All the code examples are available here.
- Deep dive - to help you decide the best framework for your project, we pulled together many different data sources - e.g., the state of JS survey, social networks, GitHub, etc. We evaluate each framework across four categories: feature set, adoption & popularity, DX (developer experience), and maintenance.
The Different Shades of Testing Web Apps: Aiming for Balance
It's 2022, and automation is on the rise. The number of software testing tools, libraries, and platforms available increases daily. What different aspects of web applications should you be testing? Which ones should you automate? And when and how should you employ manual testing?
How to Override an HTTP Response Status Code
During our web development daily activities it's common to poke around the browser to test our applications or replicate weird behaviors, often caused by API calls errors. In this short tutorial you can learn how to override a XHR/Fetch response status code with the tweak browser extension.
How to Block an HTTP Request
Modern browsers have advanced development toolkits allowing developers to inspect and debug their code in detail. This article will go through the options you have to block HTTP requests with modern browsers.
How to Simulate HTTP Request Errors
Errors handling is part of our work as developers. You can try to ignore them at first, but to offer a good user experience, you don't want your website breaking just because one of the API endpoints decided to give up on you. These days we try to find clever workarounds to run our applications with a graceful degradation strategy. We build software to work in an optimal environment while providing certain fallbacks not to break the experience entirely when there's some disturbance in the system (e.g., lousy network condition, CPU lag, etc.).
In this article, we will understand how to maximize productivity when tackling HTTP requests error handling from a front-end development perspective.
5 Tips for Effective Puppeteer Automation
In our "Complete Guide to Test Chrome Extensions with Puppeteer", we've covered all you need to know to get you up to speed on setting up end-to-end testing for a chrome extension. The fact is that many elements of the article can be brought to traditional front-end applications.
To truly deliver to you the complete knowledge we've acquired, we've decided to write this tiny, complementary blog post, where we'll cover ad-hoc topics, let's call it tips & tricks, to help you work with Puppeteer.
Complete Guide to Test Chrome Extensions with Puppeteer
Here's what we cover in this article:
- Motivation to perform e2e testing on browser extensions.
- Why Puppeteer and known limitations.
- A complete example of a functional chrome extension and a sample React application.
- A complete example of a puppeteer + jest set up to run your automation.
All the code referenced in this article can be found in our repo tweak-extension/puppeteer-test-browser-ext.
Simulate Delays in HTTP Requests
There might be a few reasons why we would want to delay an HTTP request:
- You want to test how your UI behaves to a slow response from an upstream service.
- There's a race condition in my code, and I suspect that it happens when the request to A is slower than the request B.
- You want to show off that beautiful loading animation you've been working on all day!
How to Mock API Calls
A Pragmatic Mocking Tool
When I first started my career in the software industry, I began to get familiar with Single-page applications and how they interact with servers, mainly through HTTP requests to retrieve or send data to the end-user. If you're working with the front end, there's a very high chance you found yourself in one (or multiple) of the following scenarios.