power_settings_new

How do I make any input as an optional in feature file?

by (1.1k points)
asked
0 votes
30 views
Say I have a step,

When I am at (.*) (today | tomorrow) at restaurant

Here, today or tomorrow is an optional.

So, how do I mark today or tomorrow as an optional?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

answered by (1.1k points)
0 votes

I could implement this by adding ?: to the option that is not required.

e.g.

in your step defination file, you can write as below

When I am at (.*) (?:today | tomorrow) at restaurant

add
...