Posts

Showing posts with the label software testing

Instruction to Deploy Contract Test between NextJS and NestJS with Pact

Image
Introduction Contract Testing is an integration testing method focused on verifying the interaction between a Consumer (the service user) and a Provider (the service provider). Instead of testing the entire system, Contract Testing ensures that both parties adhere to a shared covenant (contract). Key benefits include: early detection of non-compatible errors between Frontend and Backend, reduction of dependency on complex staging environments and enabling API changes to be made more confidently without breaking the partner's application. Pact is currently the most popular Consumer-Driven Contract Testing tool. It allows the Consumer to define expectations regarding the response from the Provider and then packages these expectations into a JSON file (Pact file). Pact's advantages lie in supporting multiple languages, automatically generating documentation based on test cases and having robust integration capabilities into CI/CD pipelines to ensure the Provider always meets the C...

Guide to Setting Up Playwright E2E Testing in NextJS

Image
Introduction Playwright is a powerful automated testing framework developed by Microsoft, allowing for End-to-End (E2E) testing across modern browsers such as Chromium, Firefox, and WebKit. Key advantages include fast execution speed due to its event-driven architecture, auto-wait capabilities that reduce "flaky" errors, default support for parallel execution, and the Codegen tool which helps generate automated test scripts by recording user interactions. Prerequisites This article is a continuation of my previous posts, so I will not provide the test code files again; please review them to have the source code ready before proceeding. Detail First, if your project does not have Playwright yet, you can set it up quickly as follows; this command will install the necessary packages and create a config file along with demo test files: yarn create playwright Or install the following packages manually: yarn add -D @playwright/test yarn playwright install Update playwright.c...