FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
How I stopped declaring login in each of my 5k tests
How-ToMachine Learning

How I stopped declaring login in each of my 5k tests

via Dev.toMarcelo C.1mo ago

Have you ever encountered a testing codebase that many portions are repeated over and over? We all have! Of course, I could be talking about DRY princples (Don't Repeat Yourself), but lets keep that aside for now and focus on a Cypress trick up it's sleeve that can go unnoticed for many senior devs: the global hooks. And what do I mean by "global" hooks? They're called like that because you only declare them once and they're applied to all your tests instantly. So let's get to the grain here: when installing Cypress it already comes with a file at created at cypress/support/e2e.<ts|js> level. This is usually where you declare some important commands imports that your E2E testing will need to access and run properly. But it's also responsible for adding let's say before , beforeEach , or after , afterEach hooks that will be applied by all your tests. This can be responsible for login hooks, clean-ups to the database after the tests run, screenshots resolutions configuration -- a million

Continue reading on Dev.to

Opens in a new tab

Read Full Article
24 views

Related Articles

The Boring Skills That Make Developers Unstoppable in 2026
How-To

The Boring Skills That Make Developers Unstoppable in 2026

Medium Programming • 16h ago

I Installed This VS Code Extension… and My Code Got Instantly Better
How-To

I Installed This VS Code Extension… and My Code Got Instantly Better

Medium Programming • 18h ago

The Age of Personalized Software
How-To

The Age of Personalized Software

Medium Programming • 20h ago

Automating Checkout Add-On Recommendations in WordPress for WooCommerce
How-To

Automating Checkout Add-On Recommendations in WordPress for WooCommerce

Dev.to • 20h ago

How-To

Start Here: Learning to develop your own way with SCSIC

Medium Programming • 1d ago

Discover More Articles