Member-only story

How to launch Cypress test with Chrome Incognito Mode?

Manzeel Uprety
2 min readNov 9, 2024

--

Running tests in incognito mode can be incredibly useful for keeping your testing environment clean and predictable. In this guide, we’ll cover why you might want to run Cypress tests in incognito, the advantages of doing so, and the potential pitfalls of testing in a normal browser window.

Why Launch Cypress in Incognito Mode?

When you run tests in a regular browser session, data from previous sessions — like cookies, history, and cache — can affect the results. Incognito mode, on the other hand, starts fresh each time, which means you can avoid interference from any stored data and focus on testing the actual functionality.

Read this article directly on my site

Advantages of Testing in Incognito Mode

  1. Data Isolation: Incognito mode prevents cached data, cookies, and login sessions from impacting test results. This is especially helpful when testing login flows or session management, where residual data can interfere.
  2. Consistent Results: Running tests in incognito mode helps you avoid issues caused by leftover data, resulting in more reliable and consistent test results.
  3. Efficient Debugging: With incognito, you don’t need to clear cache or cookies…

--

--

Manzeel Uprety
Manzeel Uprety

No responses yet