Challenge: Writing Cypress Commands

Challenge your learning on the cypress commands by modifying the signup command.

Problem statement

It’s possible to set default function parameters in JavaScript and TypeScript. This allows us to avoid writing some of the code in our Cypress signup command, such as the following:

var username = username || 'user';

Try updating the Cypress command to see if you can leverage default function parameters.

(See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters)

Get hands-on with 1200+ tech skills courses.