Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
206 views
by Master (1.2k points)
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?

1 Answer

0 like 0 dislike
by Master (1.2k points)

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


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...