DEV Community

Cover image for Automate One Time Password (OTP) using Cypress
Dilpreet Johal
Dilpreet Johal

Posted on

4

Automate One Time Password (OTP) using Cypress

Automating One Time Password (OTP) is always a bit challenging as you need to work with a third-party service to send/receive messages. Let's take a look at how we can do that using Cypress ...

βš™οΈ Dependencies

  • Cypress: browser automation framework (can be replaced with any other JS browser automation framework)
  • Receive SMS: to generate a temporary phone number and receive SMS. Note: this can easily be replaced with a paid service such as Twilio, SMSArc, etc..
  • GitHub: example site to test OTP on

In this video, we will cover step-by-step how to automate OTP using Cypress:

πŸ‘©πŸ»β€πŸ’» Access the source code here.


To learn more about Cypress, check out my free Cypress tutorial series here -

https://www.youtube.com/watch?v=krpKuSqQ0XM&list=PL6AdzyjjD5HAr_Jq1hwpFUIO49uyBZ9ma


πŸ‘©πŸ»β€πŸ’» It's time to advance your career by joining the SDET-U Academy today πŸ‘‡πŸ»
Join Academy

πŸ“§ Subscribe to my mailing list to get access to more content like this as well as be part of amazing free giveaways.

πŸ‘ You can follow my content here as well -

...

Thanks for reading!

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (1)

Collapse
 
dancortazio profile image
Dan Cortazio β€’ β€’ Edited

This SMS tool doesn't have many phones, and most don't work. I found this one with 4000+ free temp numbers, and there is API access for premium numbers.

maybe you want to change your post?

Playwright CLI Flags Tutorial

5 Playwright CLI Flags That Will Transform Your Testing Workflow

  • --last-failed: Zero in on just the tests that failed in your previous run
  • --only-changed: Test only the spec files you've modified in git
  • --repeat-each: Run tests multiple times to catch flaky behavior before it reaches production
  • --forbid-only: Prevent accidental test.only commits from breaking your CI pipeline
  • --ui --headed --workers 1: Debug visually with browser windows and sequential test execution

Learn how these powerful command-line options can save you time, strengthen your test suite, and streamline your Playwright testing experience. Practical examples included!

Watch Video πŸ“ΉοΈ

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay